Skip to content

Commit 2c7fbf3

Browse files
authored
build(deps): Raise Imath minimum to 3.1 (#1853)
Cull a whole lot of things that were necessarily only for older Imath/OpenEXR. Signed-off-by: Larry Gritz <[email protected]>
1 parent 9f4aa5e commit 2c7fbf3

File tree

27 files changed

+85
-8522
lines changed

27 files changed

+85
-8522
lines changed

.github/workflows/ci.yml

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,20 @@ jobs:
3838
fail-fast: false
3939
matrix:
4040
include:
41-
- desc: gcc9/C++17 llvm11 py3.7 exr2.5 oiio2.3 sse4 batch-b8avx2
41+
- desc: gcc9/C++17 llvm11 py3.7 oiio2.3 sse4 batch-b8avx2
4242
nametag: linux-vfx2021
4343
runner: ubuntu-latest
4444
container: aswftesting/ci-osl:2021-clang11
4545
vfxyear: 2021
4646
cxx_std: 17
47+
openexr_ver: v3.1.3
4748
openimageio_ver: v2.4.13.0
4849
python_ver: 3.7
4950
pybind11_ver: v2.7.0
5051
simd: sse4.2
5152
batched: b8_AVX2_noFMA
52-
- desc: gcc9/C++17 llvm13 py3.9 exr3.1 oiio-rel avx2
53+
setenvs: export ENABLE_OPENVDB=0
54+
- desc: gcc9/C++17 llvm13 py3.9 oiio-rel avx2
5355
nametag: linux-vfx2022
5456
runner: ubuntu-latest
5557
container: aswftesting/ci-osl:2022-clang13
@@ -60,7 +62,7 @@ jobs:
6062
pybind11_ver: v2.9.0
6163
simd: avx2,f16c
6264
batched: b8_AVX2
63-
- desc: clang12/C++17 llvm12 oiio-master exr3.1 py3.9 avx2 batch-avx512
65+
- desc: clang12/C++17 llvm12 oiio-master py3.9 avx2 batch-avx512
6466
nametag: linux-clang12-llvm12-batch
6567
runner: ubuntu-latest
6668
container: aswftesting/ci-osl:2022-clang12
@@ -72,7 +74,7 @@ jobs:
7274
simd: avx2,f16c
7375
batched: b8_AVX2,b8_AVX512,b16_AVX512
7476
setenvs: USE_OPENVDB=0
75-
- desc: icc/C++17 llvm14 py3.9 exr3.1 oiio-master avx2
77+
- desc: icc/C++17 llvm14 py3.9 oiio-master avx2
7678
nametag: linux-icc
7779
runner: ubuntu-latest
7880
container: aswftesting/ci-osl:2022-clang14
@@ -96,7 +98,7 @@ jobs:
9698
setenvs: export OSL_CMAKE_FLAGS="-DSTOP_ON_WARNING=OFF -DEXTRA_CPP_ARGS=-fp-model=consistent"
9799
OPENIMAGEIO_CMAKE_FLAGS=-DBUILD_FMT_VERSION=7.1.3
98100
USE_OPENVDB=0
99-
- desc: icx/C++17 llvm14 py3.9 exr3.1 oiio2.3 avx2
101+
- desc: icx/C++17 llvm14 py3.9 oiio2.3 avx2
100102
nametag: linux-icx
101103
runner: ubuntu-latest
102104
container: aswftesting/ci-osl:2022-clang14
@@ -112,7 +114,7 @@ jobs:
112114
batched: b8_AVX2_noFMA
113115
setenvs: export OSL_CMAKE_FLAGS="-DSTOP_ON_WARNING=OFF" USE_OPENVDB=0
114116
OPENCOLORIO_VERSION=v2.3.2 OPENCOLORIO_CXX=g++
115-
- desc: gcc11/C++17 llvm15 py3.10 exr3.1 oiio-rel avx2
117+
- desc: gcc11/C++17 llvm15 py3.10 oiio-rel avx2
116118
nametag: linux-vfx2023
117119
runner: ubuntu-latest
118120
container: aswftesting/ci-osl:2023-clang15
@@ -123,7 +125,7 @@ jobs:
123125
pybind11_ver: v2.9.0
124126
simd: avx2,f16c
125127
batched: b8_AVX2
126-
- desc: GPU Cuda11 gcc11/C++17 llvm15 py3.10 exr3.1 OIIO-master avx2
128+
- desc: GPU Cuda11 gcc11/C++17 llvm15 py3.10 OIIO-master avx2
127129
nametag: linux-optix7-2023
128130
runner: ubuntu-latest
129131
container: aswftesting/ci-osl:2023-clang15
@@ -136,19 +138,20 @@ jobs:
136138
skip_tests: 1
137139
setenvs: export OSL_CMAKE_FLAGS="-DOSL_USE_OPTIX=1" OPTIX_VERSION=7.0
138140
OPENIMAGEIO_CMAKE_FLAGS=-DBUILD_FMT_VERSION=9.1.0
139-
- desc: oldest everything gcc9/C++17 llvm9 py3.7 oiio2.3 no-simd exr2.4
141+
- desc: oldest everything gcc9/C++17 llvm9 py3.7 oiio2.3 no-simd
140142
nametag: linux-oldest
141143
runner: ubuntu-latest
142144
container: aswftesting/ci-osl:2021-clang11
143145
vfxyear: 2021
144146
cxx_std: 17
145-
openexr_ver: v2.4.3
147+
openexr_ver: v3.1.0
146148
openimageio_ver: v2.4.13.0
147149
python_ver: 3.7
148150
pybind11_ver: v2.7.0
149151
simd: 0
150152
setenvs: export PUGIXML_VERSION=v1.8
151153
CMAKE_VERSION=3.15.5
154+
ENABLE_OPENVDB=0
152155

153156
# Address and leak sanitizers
154157
- desc: sanitizers
@@ -262,6 +265,13 @@ jobs:
262265
sudo rm -rf /usr/local/lib*/cmake/OpenImageIO
263266
sudo rm -rf /usr/local/lib*/libOpenImageIO*
264267
sudo rm -rf /usr/local/lib*/python3.9/site-packages/OpenImageIO*
268+
- name: Remove existing OpenEXR
269+
if: matrix.openexr_ver != ''
270+
run: |
271+
sudo rm -rf /usr/local/include/OpenEXR
272+
sudo rm -rf /usr/local/lib*/cmake/OpenEXR
273+
sudo rm -rf /usr/local/lib*/libOpenOpenEXR*
274+
sudo rm -rf /usr/local/lib*/python3.9/site-packages/OpenOpenEXR*
265275
- name: Dependencies
266276
run: |
267277
${{matrix.depcmds}}
@@ -314,7 +324,7 @@ jobs:
314324
runner: ubuntu-20.04
315325
cxx_compiler: g++-9
316326
cxx_std: 17
317-
openexr_ver: v2.4.3
327+
openexr_ver: v3.1.11
318328
openimageio_ver: v2.4.13.0
319329
pybind11_ver: v2.6.2
320330
python_ver: 2.7
@@ -323,13 +333,13 @@ jobs:
323333
LLVM_VERSION=9.0.0
324334
PUGIXML_VERSION=v1.9
325335
CTEST_TEST_TIMEOUT=240
326-
- desc: gcc10/C++17 llvm10 oiio-release exr2.5 avx2
336+
- desc: gcc10/C++17 llvm10 oiio-release avx2
327337
nametag: linux-2021ish-gcc10-llvm10
328338
runner: ubuntu-20.04
329339
cxx_compiler: g++-10
330340
cxx_std: 17
331341
fmt_ver: 7.0.1
332-
openexr_ver: v2.5.6
342+
openexr_ver: v3.1.11
333343
openimageio_ver: release
334344
pybind11_ver: v2.8.1
335345
# python_ver: 2.7 FIXME
@@ -369,14 +379,14 @@ jobs:
369379
LLVM_DISTRO_NAME=ubuntu-22.04
370380
OPENCOLORIO_VERSION=main
371381
PUGIXML_VERSION=master
372-
- desc: clang14/C++17 llvm14 exr3.1 py3.8 avx2 batch-b16avx512
382+
- desc: clang14/C++17 llvm14 py3.8 avx2 batch-b16avx512
373383
nametag: linux-latest-releases-clang
374384
runner: ubuntu-20.04
375385
cxx_compiler: clang++
376386
cc_compiler: clang
377387
cxx_std: 17
378388
fmt_ver: 8.1.1
379-
openexr_ver: v3.1.7
389+
openexr_ver: v3.1.11
380390
openimageio_ver: master
381391
pybind11_ver: v2.9.2
382392
python_ver: 3.8
@@ -394,9 +404,9 @@ jobs:
394404
- desc: "clang-format"
395405
nametag: clang-format
396406
runner: ubuntu-latest
397-
container: aswftesting/ci-osl:2022-clang14
398407
cxx_std: 17
399408
extra_artifacts: "src/*.*"
409+
openexr_ver: v3.1.11
400410
openimageio_ver: release
401411
python_ver: "3.10"
402412
simd: avx2,f16c

INSTALL.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,7 @@ NEW or CHANGED dependencies since the last major release are **bold**.
5555
* [Cuda](https://developer.nvidia.com/cuda-downloads) 9.0 or higher. It is
5656
recommended that you use 11.0 or higher.
5757

58-
* [Ilmbase or Imath](https://github.com/AcademySoftwareFoundation/Imath) 2.4
59-
or newer (recommended: 3.1 or higher; tested through 3.2)
60-
NOTE: It is likely that 1.13 is the last release that will support
61-
Imath/OpenEXR 2.x.
58+
* [Imath](https://github.com/AcademySoftwareFoundation/Imath) 3.1 or newer.
6259
* [Flex](https://github.com/westes/flex) 2.5.35 or newer and
6360
[GNU Bison](https://www.gnu.org/software/bison/) 2.7 or newer.
6461
Note that on some MacOS/xcode releases, the system-installed Bison is too

src/build-scripts/gh-installdeps.bash

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ else
7575
time sudo apt-get -q install -y \
7676
git cmake ninja-build ccache g++ \
7777
libboost-dev libboost-thread-dev libboost-filesystem-dev \
78-
libilmbase-dev libopenexr-dev \
7978
libtiff-dev libgif-dev libpng-dev \
8079
flex bison libbison-dev \
8180
libpugixml-dev \
@@ -102,20 +101,16 @@ else
102101
pip3 install numpy
103102
fi
104103

105-
if [[ "$CXX" == "g++-6" ]] ; then
106-
time sudo apt-get install -y g++-6
107-
elif [[ "$CXX" == "g++-7" ]] ; then
108-
time sudo apt-get install -y g++-7
109-
elif [[ "$CXX" == "g++-8" ]] ; then
110-
time sudo apt-get install -y g++-8
111-
elif [[ "$CXX" == "g++-9" ]] ; then
104+
if [[ "$CXX" == "g++-9" ]] ; then
112105
time sudo apt-get install -y g++-9
113106
elif [[ "$CXX" == "g++-10" ]] ; then
114107
time sudo apt-get install -y g++-10
115108
elif [[ "$CXX" == "g++-11" ]] ; then
116109
time sudo apt-get install -y g++-11
117110
elif [[ "$CXX" == "g++-12" ]] ; then
118111
time sudo apt-get install -y g++-12
112+
elif [[ "$CXX" == "g++-13" ]] ; then
113+
time sudo apt-get install -y g++-13
119114
fi
120115

121116
if [[ "$CXX" == "icpc" || "$CC" == "icc" || "$USE_ICC" != "" || "$CXX" == "icpx" || "$CC" == "icx" || "$USE_ICX" != "" ]] ; then

src/build-scripts/gh-win-installdeps.bash

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,7 @@ export PATH="$DEP_DIR/lib:$DEP_DIR/bin:$PATH:$VCPKG_INSTALLATION_ROOT/installed/
140140
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$VCPKG_INSTALLATION_ROOT/installed/x64-windows/lib:$DEP_DIR/lib:$DEP_DIR/bin"
141141

142142

143-
# source src/build-scripts/build_openexr.bash
144-
# export CMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH;$ILMBASE_ROOT;$OPENEXR_ROOT"
143+
# source src/build-scripts/build_imath.bash
145144
# source src/build-scripts/build_opencolorio.bash
146145

147146

src/cmake/Config.cmake.in

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,7 @@
77
include(CMakeFindDependencyMacro)
88

99
# add here all the find_dependency() whenever switching to config based dependencies
10-
if (@OpenEXR_VERSION@ VERSION_GREATER_EQUAL 3.0)
11-
find_dependency(Imath @Imath_VERSION@)
12-
elseif (@OpenEXR_VERSION@ VERSION_GREATER_EQUAL 2.4 AND @FOUND_OPENEXR_WITH_CONFIG@)
13-
find_dependency(IlmBase @OpenEXR_VERSION@)
14-
find_dependency(OpenEXR @OpenEXR_VERSION@)
15-
find_dependency(ZLIB @ZLIB_VERSION@) # Because OpenEXR doesn't do it
16-
find_dependency(Threads) # Because OpenEXR doesn't do it
17-
endif ()
18-
19-
10+
find_dependency(Imath @Imath_VERSION@)
2011
find_dependency(OpenImageIO @OpenImageIO_VERSION@ REQUIRED)
2112

2213
# Compute the installation prefix relative to this file

src/cmake/compiler.cmake

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -463,10 +463,6 @@ if (PROJECT_IS_TOP_LEVEL)
463463
set (CLANG_FORMAT_INCLUDES "src/*.cpp" "src/*.h" "src/*.cu"
464464
CACHE STRING "Glob patterns to include for clang-format")
465465
set (CLANG_FORMAT_EXCLUDES
466-
# Files "imported and modified" that we don't want to reformat, so
467-
# they continue to match their upstream versions.
468-
"src/include/OSL/Imathx/*"
469-
"src/include/OSL/matrix22.h"
470466
# Header files in testsuite are almost certainly osl headers, not C++
471467
"testsuite/*.h"
472468
# Header files in shaders are OSL, not C++

src/cmake/cuda_macros.cmake

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ function ( NVCC_COMPILE cuda_src extra_headers ptx_generated extra_nvcc_args )
4545
"-I${PROJECT_SOURCE_DIR}/src/cuda_common"
4646
${ALL_OpenImageIO_INCLUDES}
4747
${ALL_IMATH_INCLUDES}
48-
${ALL_OPENEXR_INCLUDES}
4948
"-DFMT_DEPRECATED=\"\""
5049
${LLVM_COMPILE_FLAGS}
5150
-DOSL_USE_FAST_MATH=1

src/cmake/externalpackages.cmake

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -36,28 +36,14 @@ option (BUILD_MISSING_DEPS "Try to download and build any missing dependencies"
3636
checked_find_package (ZLIB REQUIRED) # Needed by several packages
3737

3838
# IlmBase & OpenEXR
39-
checked_find_package (OpenEXR REQUIRED
40-
VERSION_MIN 2.4
41-
RECOMMEND_MIN 2.5
42-
RECOMMEND_MIN_REASON
43-
"Even extremely critical patches are no longer supplied to < 2.5"
44-
PRINT IMATH_INCLUDES
39+
checked_find_package (Imath REQUIRED
40+
VERSION_MIN 3.1
41+
PRINT IMATH_INCLUDES Imath_VERSION
4542
)
4643
# Force Imath includes to be before everything else to ensure that we have
47-
# the right Imath/OpenEXR version, not some older version in the system
48-
# library. This shouldn't be necessary, except for the common case of people
49-
# building against Imath/OpenEXR 3.x when there is still a system-level
50-
# install version of 2.x.
44+
# the right Imath version, not some older version in the system library.
5145
include_directories(BEFORE ${IMATH_INCLUDES})
52-
if (MSVC AND NOT LINKSTATIC)
53-
add_compile_definitions (OPENEXR_DLL) # Is this needed for new versions?
54-
endif ()
55-
56-
if (OPENEXR_VERSION VERSION_GREATER_EQUAL 2.5.99)
57-
set (OSL_USING_IMATH 3)
58-
else ()
59-
set (OSL_USING_IMATH 2)
60-
endif ()
46+
set (OSL_USING_IMATH 3)
6147

6248

6349
# OpenImageIO

src/cmake/modules/FindImath.cmake

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Copyright Contributors to the Open Shading Language project.
2+
# SPDX-License-Identifier: BSD-3-Clause
3+
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
4+
5+
# Module to find Imath.
6+
#
7+
# For Imath 3.x, this will establish the following imported
8+
# targets:
9+
#
10+
# Imath::Imath
11+
# Imath::Half
12+
#
13+
# and sets the following CMake variables:
14+
#
15+
# IMATH_FOUND true, if found
16+
# IMATH_VERSION Imath version
17+
# IMATH_INCLUDES directory where Imath headers are found
18+
#
19+
20+
# First, try to fine just the right config files
21+
find_package(Imath CONFIG)
22+
23+
if (TARGET Imath::Imath)
24+
# Imath 3.x if both of these targets are found
25+
if (NOT Imath_FIND_QUIETLY)
26+
message (STATUS "Found CONFIG for Imath 3 (Imath_VERSION=${Imath_VERSION})")
27+
endif ()
28+
29+
# Mimic old style variables
30+
set (IMATH_VERSION ${Imath_VERSION})
31+
get_target_property(IMATH_INCLUDES Imath::Imath INTERFACE_INCLUDE_DIRECTORIES)
32+
get_target_property(IMATH_LIBRARY Imath::Imath INTERFACE_LINK_LIBRARIES)
33+
set (IMATH_LIBRARIES ${IMATH_LIBRARY})
34+
set (IMATH_FOUND true)
35+
36+
endif ()

0 commit comments

Comments
 (0)