Skip to content

Commit bd44bdf

Browse files
committed
build(deps): Raise OpenEXR minimum from 2.3 to 2.4
This will not be backported to the release branch, it's only for OIIO 2.5 and later. Signed-off-by: Larry Gritz <[email protected]>
1 parent 81cb1a4 commit bd44bdf

File tree

8 files changed

+39
-249
lines changed

8 files changed

+39
-249
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,13 @@ jobs:
3030
fail-fast: false
3131
matrix:
3232
include:
33-
- desc: gcc6/C++14 py2.7 boost1.66 exr2.3 ocio1.1
33+
- desc: gcc6/C++14 py2.7 boost1.66 exr2.4 ocio1.1
3434
nametag: linux-vfx2019
3535
os: ubuntu-latest
3636
container: aswf/ci-osl:2019
3737
vfxyear: 2019
3838
cxx_std: 14
39+
openexr_ver: v2.4.3
3940
python_ver: 2.7
4041
simd: sse4.2
4142
fmt_ver: 6.1.2
@@ -148,7 +149,7 @@ jobs:
148149
simd: "avx2,f16c"
149150
fmt_ver: 9.1.0
150151
pybind11_ver: v2.10.0
151-
- desc: oldest/hobbled gcc6.3/C++14 py2.7 boost-1.66 exr-2.3 no-sse no-ocio
152+
- desc: oldest/hobbled gcc6.3/C++14 py2.7 boost-1.66 exr-2.4 no-sse no-ocio
152153
# Oldest versions of the dependencies that we can muster, and various
153154
# things disabled (no SSE, OCIO, or OpenCV, don't embed plugins).
154155
nametag: linux-oldest
@@ -157,13 +158,13 @@ jobs:
157158
vfxyear: 2019
158159
cxx_std: 14
159160
fmt_ver: 6.1.2
160-
openexr_ver: v2.3.0
161+
openexr_ver: v2.4.0
161162
pybind11_ver: v2.4.2
162163
python_ver: 2.7
163164
simd: 0
164165
setenvs: export EMBEDPLUGINS=0
165166
CMAKE_VERSION=3.15.5
166-
PTEX_VERSION=v2.3.1
167+
PTEX_VERSION=v2.3.2
167168
WEBP_VERSION=v1.0.0
168169
USE_JPEGTURBO=0
169170
USE_OPENCOLORIO=0

CHANGES.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
Release 2.5 (summer 2023?) -- compared to 2.4
22
-------------------------------------------------
33
### New minimum dependencies and compatibility changes:
4-
* LibRaw: minimum has ben raised from 0.15 to 0.18. (2.5.2.1)
4+
* CMake: minimum needed to build OpenImageIO has been raised from 3.12 to
5+
3.15. #3924 (2.5.2.1)
6+
* LibRaw: minimum has ben raised from 0.15 to 0.18. #3921 (2.5.2.1)
7+
* The new OpenEXR minimum is 2.4 (raised from 2.3). #3928 (2.5.2.1)
58

69
### ⛰️ New features and public API changes:
710
* TextureSystem color management: #3761 (2.5.1.0)

INSTALL.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ NEW or CHANGED MINIMUM dependencies since the last major release are **bold**.
2020
* Compilers: gcc 6.1 - 12.1, clang 3.4 - 16, MSVS 2017 - 2019,
2121
Intel icc 17+, Intel OneAPI C++ compiler 2022+.
2222
* **CMake >= 3.15** (tested through 3.27)
23-
* OpenEXR/Imath >= 2.3 (recommended: 2.4 or higher; tested through 3.1 and main)
23+
* **OpenEXR/Imath >= 2.4** (recommended: 3.1 or higher; tested through 3.2
24+
and main) (ADVISORY: We expect that OIIO 2.6 in 2024 will require OpenEXR >= 3.1)
2425
* libTIFF >= 3.9 (recommended: 4.0+; tested through 4.5)
2526
* libjpeg >= 8, or libjpeg-turbo >= 1.1 (tested through jpeg9d and jpeg-turbo
2627
2.1)

src/build-scripts/build_openexr.bash

Lines changed: 15 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -40,37 +40,21 @@ mkdir -p ${OPENEXR_INSTALL_DIR} && true
4040
pushd ${OPENEXR_SOURCE_DIR}
4141
git checkout ${OPENEXR_VERSION} --force
4242

43-
if [[ ${OPENEXR_VERSION} == "v2.3.0" ]] ; then
44-
# Simplified setup for 2.3+
45-
cmake -S . -B ${OPENEXR_BUILD_DIR} \
46-
-DCMAKE_BUILD_TYPE=${OPENEXR_BUILD_TYPE} \
47-
-DCMAKE_INSTALL_PREFIX="${OPENEXR_INSTALL_DIR}" \
48-
-DCMAKE_PREFIX_PATH="${CMAKE_PREFIX_PATH}" \
49-
-DILMBASE_PACKAGE_PREFIX="${OPENEXR_INSTALL_DIR}" \
50-
-DOPENEXR_BUILD_UTILS=0 \
51-
-DOPENEXR_BUILD_TESTS=0 \
52-
-DOPENEXR_BUILD_PYTHON_LIBS=0 \
53-
-DCMAKE_CXX_FLAGS="${OPENEXR_CXX_FLAGS}" \
54-
${OPENEXR_CMAKE_FLAGS}
55-
time cmake --build ${OPENEXR_BUILD_DIR} --target install --config ${OPENEXR_BUILD_TYPE}
56-
else
57-
# Simplified setup for 2.4+
58-
cmake -S . -B ${OPENEXR_BUILD_DIR} \
59-
-DCMAKE_BUILD_TYPE=${OPENEXR_BUILD_TYPE} \
60-
-DCMAKE_INSTALL_PREFIX="${OPENEXR_INSTALL_DIR}" \
61-
-DCMAKE_PREFIX_PATH="${CMAKE_PREFIX_PATH}" \
62-
-DILMBASE_PACKAGE_PREFIX="${OPENEXR_INSTALL_DIR}" \
63-
-DOPENEXR_BUILD_UTILS=0 \
64-
-DBUILD_TESTING=0 \
65-
-DPYILMBASE_ENABLE=0 \
66-
-DOPENEXR_VIEWERS_ENABLE=0 \
67-
-DINSTALL_OPENEXR_EXAMPLES=0 \
68-
-DOPENEXR_INSTALL_EXAMPLES=0 \
69-
-DCMAKE_INSTALL_LIBDIR=lib \
70-
-DCMAKE_CXX_FLAGS="${OPENEXR_CXX_FLAGS}" \
71-
${OPENEXR_CMAKE_FLAGS}
72-
time cmake --build ${OPENEXR_BUILD_DIR} --target install --config ${OPENEXR_BUILD_TYPE}
73-
fi
43+
cmake -S . -B ${OPENEXR_BUILD_DIR} \
44+
-DCMAKE_BUILD_TYPE=${OPENEXR_BUILD_TYPE} \
45+
-DCMAKE_INSTALL_PREFIX="${OPENEXR_INSTALL_DIR}" \
46+
-DCMAKE_PREFIX_PATH="${CMAKE_PREFIX_PATH}" \
47+
-DILMBASE_PACKAGE_PREFIX="${OPENEXR_INSTALL_DIR}" \
48+
-DOPENEXR_BUILD_UTILS=0 \
49+
-DBUILD_TESTING=0 \
50+
-DPYILMBASE_ENABLE=0 \
51+
-DOPENEXR_VIEWERS_ENABLE=0 \
52+
-DINSTALL_OPENEXR_EXAMPLES=0 \
53+
-DOPENEXR_INSTALL_EXAMPLES=0 \
54+
-DCMAKE_INSTALL_LIBDIR=lib \
55+
-DCMAKE_CXX_FLAGS="${OPENEXR_CXX_FLAGS}" \
56+
${OPENEXR_CMAKE_FLAGS}
57+
time cmake --build ${OPENEXR_BUILD_DIR} --target install --config ${OPENEXR_BUILD_TYPE}
7458

7559
popd
7660

src/cmake/externalpackages.cmake

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ checked_find_package (TIFF REQUIRED
9696

9797
# IlmBase & OpenEXR
9898
checked_find_package (OpenEXR REQUIRED
99-
VERSION_MIN 2.3
100-
RECOMMEND_MIN 2.4
99+
VERSION_MIN 2.4
100+
RECOMMEND_MIN 3.1
101101
PRINT IMATH_INCLUDES OPENEXR_INCLUDES)
102102
# Force Imath includes to be before everything else to ensure that we have
103103
# the right Imath/OpenEXR version, not some older version in the system
@@ -120,18 +120,14 @@ set (OPENIMAGEIO_IMATH_TARGETS
120120
# For OpenEXR >= 2.4/2.5 with reliable exported targets
121121
$<TARGET_NAME_IF_EXISTS:IlmBase::Imath>
122122
$<TARGET_NAME_IF_EXISTS:IlmBase::Half>
123-
$<TARGET_NAME_IF_EXISTS:IlmBase::Iex>
124-
# For OpenEXR <= 2.3:
125-
${ILMBASE_LIBRARIES} )
123+
$<TARGET_NAME_IF_EXISTS:IlmBase::Iex> )
126124
set (OPENIMAGEIO_OPENEXR_TARGETS
127125
# For OpenEXR/Imath 3.x:
128126
$<TARGET_NAME_IF_EXISTS:OpenEXR::OpenEXR>
129127
# For OpenEXR >= 2.4/2.5 with reliable exported targets
130128
$<TARGET_NAME_IF_EXISTS:OpenEXR::IlmImf>
131129
$<TARGET_NAME_IF_EXISTS:IlmBase::IlmThread>
132-
$<TARGET_NAME_IF_EXISTS:IlmBase::Iex>
133-
# For OpenEXR <= 2.3:
134-
${OPENEXR_LIBRARIES} )
130+
$<TARGET_NAME_IF_EXISTS:IlmBase::Iex> )
135131
set (OPENIMAGEIO_IMATH_DEPENDENCY_VISIBILITY "PUBLIC" CACHE STRING
136132
"Should we expose Imath library dependency as PUBLIC or PRIVATE")
137133
set (OPENIMAGEIO_CONFIG_DO_NOT_FIND_IMATH OFF CACHE BOOL

src/cmake/modules/FindOpenEXR.cmake

Lines changed: 4 additions & 164 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# Copyright Contributors to the OpenImageIO project.
2-
# SPDX-License-Identifier: BSD-3-Clause and Apache-2.0
2+
# SPDX-License-Identifier: Apache-2.0
33
# https://github.com/OpenImageIO/oiio
44

55
# Module to find OpenEXR and Imath.
66
#
77
# I'm afraid this is a mess, due to needing to support a wide range of
88
# OpenEXR versions.
99
#
10-
# For OpenEXR & Imath 3.0, this will establish the following imported
10+
# For OpenEXR & Imath 3.x, this will establish the following imported
1111
# targets:
1212
#
1313
# Imath::Imath
@@ -24,14 +24,12 @@
2424
# IlmBase::IlmThread
2525
# OpenEXR::IlmImf
2626
#
27-
# For all versions -- but for OpenEXR < 2.4 the only thing this sets --
28-
# are the following CMake variables:
27+
# For all version, the following CMake variables:
2928
#
3029
# OPENEXR_FOUND true, if found
3130
# OPENEXR_INCLUDES directory where OpenEXR headers are found
3231
# OPENEXR_LIBRARIES libraries for OpenEXR + IlmBase
33-
# OPENEXR_VERSION OpenEXR version (accurate for >= 2.0.0,
34-
# otherwise will just guess 1.6.1)
32+
# OPENEXR_VERSION OpenEXR version
3533
# IMATH_INCLUDES directory where Imath headers are found
3634
# ILMBASE_INCLUDES directory where IlmBase headers are found
3735
# ILMBASE_LIBRARIES libraries just IlmBase
@@ -111,162 +109,4 @@ elseif (TARGET OpenEXR::IlmImf AND TARGET IlmBase::Imath AND
111109
string(REGEX REPLACE "include/OpenEXR$" "include" IMATH_INCLUDES "${IMATH_INCLUDES}")
112110
string(REGEX REPLACE "include/OpenEXR$" "include" OPENEXR_INCLUDES "${OPENEXR_INCLUDES}")
113111

114-
else ()
115-
# OpenEXR 2.x older versions without a config or whose configs we don't
116-
# trust.
117-
118-
set (FOUND_OPENEXR_WITH_CONFIG 0)
119-
120-
# Other standard issue macros
121-
include (FindPackageHandleStandardArgs)
122-
include (SelectLibraryConfigurations)
123-
124-
find_package (ZLIB REQUIRED)
125-
126-
# Link with pthreads if required
127-
find_package (Threads)
128-
if (CMAKE_USE_PTHREADS_INIT)
129-
set (ILMBASE_PTHREADS ${CMAKE_THREAD_LIBS_INIT})
130-
endif ()
131-
132-
# Attempt to find OpenEXR with pkgconfig
133-
find_package(PkgConfig)
134-
if (PKG_CONFIG_FOUND)
135-
if (NOT Ilmbase_ROOT AND NOT ILMBASE_ROOT
136-
AND NOT DEFINED ENV{Ilmbase_ROOT} AND NOT DEFINED ENV{ILMBASE_ROOT})
137-
pkg_check_modules(_ILMBASE QUIET IlmBase>=2.0.0)
138-
endif ()
139-
if (NOT OpenEXR_ROOT AND NOT OPENEXR_ROOT
140-
AND NOT DEFINED ENV{OpenEXR_ROOT} AND NOT DEFINED ENV{OPENEXR_ROOT})
141-
pkg_check_modules(_OPENEXR QUIET OpenEXR>=2.0.0)
142-
endif ()
143-
endif (PKG_CONFIG_FOUND)
144-
145-
# List of likely places to find the headers -- note priority override of
146-
# ${OPENEXR_ROOT}/include.
147-
# ILMBASE is needed in case ilmbase an openexr are installed in separate
148-
# directories, like NixOS does
149-
set (GENERIC_INCLUDE_PATHS
150-
${OPENEXR_ROOT}/include
151-
$ENV{OPENEXR_ROOT}/include
152-
${ILMBASE_ROOT}/include
153-
$ENV{ILMBASE_ROOT}/include
154-
${_ILMBASE_INCLUDEDIR}
155-
${_OPENEXR_INCLUDEDIR}
156-
/usr/local/include
157-
/usr/include
158-
/usr/include/${CMAKE_LIBRARY_ARCHITECTURE}
159-
/sw/include
160-
/opt/local/include )
161-
162-
# Find the include file locations.
163-
find_path (ILMBASE_INCLUDE_PATH OpenEXR/IlmBaseConfig.h
164-
HINTS ${ILMBASE_INCLUDE_DIR} ${OPENEXR_INCLUDE_DIR}
165-
${GENERIC_INCLUDE_PATHS} )
166-
find_path (OPENEXR_INCLUDE_PATH OpenEXR/OpenEXRConfig.h
167-
HINTS ${OPENEXR_INCLUDE_DIR}
168-
${GENERIC_INCLUDE_PATHS} )
169-
170-
# Try to figure out version number
171-
if (DEFINED _OPENEXR_VERSION AND NOT "${_OPENEXR_VERSION}" STREQUAL "")
172-
set (OPENEXR_VERSION "${_OPENEXR_VERSION}")
173-
set (OpenEXR_VERSION "${_OPENEXR_VERSION}")
174-
string (REGEX REPLACE "([0-9]+)\\.[0-9\\.]+" "\\1" OpenEXR_VERSION_MAJOR "${_OPENEXR_VERSION}")
175-
string (REGEX REPLACE "[0-9]+\\.([0-9]+)(\\.[0-9]+)?" "\\1" OpenEXR_VERSION_MINOR "${_OPENEXR_VERSION}")
176-
elseif (EXISTS "${OPENEXR_INCLUDE_PATH}/OpenEXR/ImfMultiPartInputFile.h")
177-
# Must be at least 2.0
178-
file(STRINGS "${OPENEXR_INCLUDE_PATH}/OpenEXR/OpenEXRConfig.h" TMP REGEX "^#define OPENEXR_VERSION_STRING .*$")
179-
string (REGEX MATCHALL "[0-9]+[.0-9]+" OpenEXR_VERSION ${TMP})
180-
file(STRINGS "${OPENEXR_INCLUDE_PATH}/OpenEXR/OpenEXRConfig.h" TMP REGEX "^#define OPENEXR_VERSION_MAJOR .*$")
181-
string (REGEX MATCHALL "[0-9]+" OpenEXR_VERSION_MAJOR ${TMP})
182-
file(STRINGS "${OPENEXR_INCLUDE_PATH}/OpenEXR/OpenEXRConfig.h" TMP REGEX "^#define OPENEXR_VERSION_MINOR .*$")
183-
string (REGEX MATCHALL "[0-9]+" OpenEXR_VERSION_MINOR ${TMP})
184-
else ()
185-
# Assume an old one, predates 2.x that had versions
186-
set (OPENEXR_VERSION 1.6.1)
187-
set (OpenEXR_VERSION 1.6.1)
188-
set (OpenEXR_VERSION_MAJOR 1)
189-
set (OpenEXR_VERSION_MINOR 6)
190-
endif ()
191-
192-
193-
# List of likely places to find the libraries -- note priority override of
194-
# ${OPENEXR_ROOT}/lib.
195-
set (GENERIC_LIBRARY_PATHS
196-
${OPENEXR_ROOT}/lib
197-
${ILMBASE_ROOT}/lib
198-
${OPENEXR_INCLUDE_PATH}/../lib
199-
${ILMBASE_INCLUDE_PATH}/../lib
200-
${_ILMBASE_LIBDIR}
201-
${_OPENEXR_LIBDIR}
202-
/usr/local/lib
203-
/usr/local/lib/${CMAKE_LIBRARY_ARCHITECTURE}
204-
/usr/lib
205-
/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}
206-
/sw/lib
207-
/opt/local/lib
208-
$ENV{PROGRAM_FILES}/OpenEXR/lib/static )
209-
210-
# message (STATUS "Generic lib paths: ${GENERIC_LIBRARY_PATHS}")
211-
212-
# Handle request for static libs by altering CMAKE_FIND_LIBRARY_SUFFIXES.
213-
# We will restore it at the end of this file.
214-
set (_openexr_orig_suffixes ${CMAKE_FIND_LIBRARY_SUFFIXES})
215-
if (OpenEXR_USE_STATIC_LIBS)
216-
if (WIN32)
217-
set (CMAKE_FIND_LIBRARY_SUFFIXES .lib .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
218-
else ()
219-
set (CMAKE_FIND_LIBRARY_SUFFIXES .a)
220-
endif ()
221-
endif ()
222-
223-
# Look for the libraries themselves, for all the components.
224-
# This is complicated because the OpenEXR libraries may or may not be
225-
# built with version numbers embedded.
226-
set (_openexr_components IlmThread IlmImf Imath Iex Half)
227-
foreach (COMPONENT ${_openexr_components})
228-
string (TOUPPER ${COMPONENT} UPPERCOMPONENT)
229-
# First try with the version embedded
230-
find_library (OPENEXR_${UPPERCOMPONENT}_LIBRARY
231-
NAMES ${COMPONENT}-${OpenEXR_VERSION_MAJOR}_${OpenEXR_VERSION_MINOR}
232-
${COMPONENT}
233-
${COMPONENT}-${OpenEXR_VERSION_MAJOR}_${OpenEXR_VERSION_MINOR}_d
234-
${COMPONENT}_d
235-
HINTS ${OPENEXR_LIBRARY_DIR} $ENV{OPENEXR_LIBRARY_DIR}
236-
${GENERIC_LIBRARY_PATHS} )
237-
endforeach ()
238-
239-
find_package_handle_standard_args (OpenEXR
240-
REQUIRED_VARS ILMBASE_INCLUDE_PATH OPENEXR_INCLUDE_PATH
241-
OPENEXR_IMATH_LIBRARY OPENEXR_ILMIMF_LIBRARY
242-
OPENEXR_IEX_LIBRARY OPENEXR_HALF_LIBRARY
243-
)
244-
245-
if (OPENEXR_FOUND)
246-
set (OPENEXR_VERSION_MAJOR ${OpenEXR_VERSION_MAJOR})
247-
set (OPENEXR_VERSION_MINOR ${OpenEXR_VERSION_MINOR})
248-
set (Imath_VERSION_MAJOR ${OpenEXR_VERSION_MAJOR})
249-
set (Imath_VERSION_MINOR ${OpenEXR_VERSION_MINOR})
250-
set (ILMBASE_FOUND TRUE)
251-
set (ILMBASE_INCLUDES ${ILMBASE_INCLUDE_PATH})
252-
set (IMATH_INCLUDES ${ILMBASE_INCLUDE_PATH})
253-
set (OPENEXR_INCLUDES ${OPENEXR_INCLUDE_PATH})
254-
set (ILMBASE_INCLUDE_DIR ${ILMBASE_INCLUDE_PATH})
255-
set (IMATH_INCLUDE_DIR ${ILMBASE_INCLUDE_PATH})
256-
set (OPENEXR_INCLUDE_DIR ${OPENEXR_INCLUDE_PATH})
257-
set (ILMBASE_LIBRARIES ${OPENEXR_IMATH_LIBRARY} ${OPENEXR_IEX_LIBRARY} ${OPENEXR_HALF_LIBRARY} ${OPENEXR_ILMTHREAD_LIBRARY} ${ILMBASE_PTHREADS} CACHE STRING "The libraries needed to use IlmBase")
258-
set (OPENEXR_LIBRARIES ${OPENEXR_ILMIMF_LIBRARY} ${ILMBASE_LIBRARIES} ${ZLIB_LIBRARIES} CACHE STRING "The libraries needed to use OpenEXR")
259-
set (FINDOPENEXR_FALLBACK TRUE)
260-
endif ()
261-
262-
mark_as_advanced(
263-
OPENEXR_ILMIMF_LIBRARY
264-
OPENEXR_IMATH_LIBRARY
265-
OPENEXR_IEX_LIBRARY
266-
OPENEXR_HALF_LIBRARY
267-
OPENEXR_VERSION)
268-
269-
# Restore the original CMAKE_FIND_LIBRARY_SUFFIXES
270-
set (CMAKE_FIND_LIBRARY_SUFFIXES ${_openexr_orig_suffixes})
271-
272112
endif ()

src/openexr.imageio/exrinput.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -572,18 +572,10 @@ OpenEXRInput::PartInfo::parse_header(OpenEXRInput* in,
572572
case Imf::ZIP_COMPRESSION: comp = "zip"; break;
573573
case Imf::PIZ_COMPRESSION: comp = "piz"; break;
574574
case Imf::PXR24_COMPRESSION: comp = "pxr24"; break;
575-
#ifdef IMF_B44_COMPRESSION
576-
// The enum Imf::B44_COMPRESSION is not defined in older versions
577-
// of OpenEXR, and there are no explicit version numbers in the
578-
// headers. BUT this other related #define is present only in
579-
// the newer version.
580575
case Imf::B44_COMPRESSION: comp = "b44"; break;
581576
case Imf::B44A_COMPRESSION: comp = "b44a"; break;
582-
#endif
583-
#if OPENEXR_CODED_VERSION >= 20200
584577
case Imf::DWAA_COMPRESSION: comp = "dwaa"; break;
585578
case Imf::DWAB_COMPRESSION: comp = "dwab"; break;
586-
#endif
587579
default: break;
588580
}
589581
if (comp)

0 commit comments

Comments
 (0)