Skip to content

Commit fb26ed8

Browse files
authored
deps: Make OCIO 2.2+ a required dependency (#4367)
Make OCIO a hard dependency, at least version 2.2. Revise and improve the OCIO "auto-build" scripts. Remove OCIO 1.x testsuite reference output. No longer need FindOpenColorIO.cmake module As part of this, I split the CI "oldest/hobbled" test into two different tests: * oldest -- test against the oldest supported versions of all dependencies. * hobbled -- test against most optional dependencies missing and optional features disabled. --------- Signed-off-by: Larry Gritz <lg@larrygritz.com>
1 parent af13eb9 commit fb26ed8

41 files changed

Lines changed: 104 additions & 104520 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ jobs:
9494
container: aswf/ci-osl:2022
9595
vfxyear: 2022
9696
cxx_std: 17
97+
opencolorio_ver: v2.2.1
9798
python_ver: 3.9
9899
# simd: "avx2,f16c"
99100
fmt_ver: 7.1.3
@@ -104,18 +105,22 @@ jobs:
104105
FREETYPE_VERSION=VER-2-13-0
105106
# For icc, use fp-model precise to eliminate needless LSB errors
106107
# that make test results differ from other platforms.
107-
- desc: icx/C++17 py3.9 exr3.1 ocio2.1 qt5.15
108+
- desc: icx/C++17 py3.9 exr3.1 ocio2.2 qt5.15
108109
nametag: linux-vfx2022-icx
109110
runner: ubuntu-latest
110111
container: aswf/ci-osl:2022
111112
vfxyear: 2022
112113
cc_compiler: icx
113114
cxx_compiler: icpx
114115
cxx_std: 17
116+
opencolorio_ver: v2.3.2
115117
python_ver: 3.9
116-
simd: "avx2,f16c"
117118
pybind11_ver: v2.9.0
119+
simd: "avx2,f16c"
118120
setenvs: export USE_OPENVDB=0
121+
OPENCOLORIO_CXX=g++
122+
# OCIO doesn't build with icx, so we have to force the ocio build
123+
# to use g++.
119124
- desc: sanitizers
120125
nametag: sanitizer
121126
runner: ubuntu-latest
@@ -124,6 +129,7 @@ jobs:
124129
cc_compiler: clang
125130
cxx_compiler: clang++
126131
cxx_std: 17
132+
opencolorio_ver: v2.3.2
127133
python_ver: 3.9
128134
setenvs: export SANITIZE=address,undefined
129135
OIIO_CMAKE_FLAGS="-DSANITIZE=address,undefined -DUSE_PYTHON=0"
@@ -150,42 +156,42 @@ jobs:
150156
simd: "avx2,f16c"
151157
fmt_ver: 10.1.1
152158
pybind11_ver: v2.12.0
153-
- desc: oldest gcc9.3/C++17 py3.7 exr-3.1 no-sse no-ocio
154-
# Oldest versions of the dependencies that we can muster, and various
155-
# things disabled (no SSE, OCIO, or OpenCV, don't embed plugins).
159+
- desc: oldest gcc9.3/C++17 py3.7 exr-3.1
160+
# Oldest versions of the dependencies that we support.
156161
nametag: linux-oldest
157162
runner: ubuntu-latest
158163
container: aswf/ci-osl:2021
159164
vfxyear: 2021
160165
cxx_std: 17
161166
fmt_ver: 7.0.1
167+
opencolorio_ver: v2.2.1
162168
openexr_ver: v3.1.0
163169
pybind11_ver: v2.7.0
164170
python_ver: 3.7
165171
setenvs: export CMAKE_VERSION=3.15.5
166172
PTEX_VERSION=v2.3.2
167173
WEBP_VERSION=v1.1.0
168174
depcmds: sudo rm -rf /usr/local/include/OpenEXR
169-
- desc: hobbled gcc9.3/C++17 py3.7 exr-3.1 no-sse no-ocio
175+
- desc: hobbled gcc9.3/C++17 py3.7 exr-3.1 no-sse
170176
# Use the oldest supported versions of required dependencies, and
171-
# disable most optional dependencies and features (no SSE, OCIO,
172-
# or OpenCV, don't embed plugins).
177+
# disable most optional dependencies and features (no SSE or
178+
# OpenCV, don't embed plugins).
173179
nametag: linux-disabled
174180
runner: ubuntu-latest
175181
container: aswf/ci-osl:2021
176182
vfxyear: 2021
177183
cxx_std: 17
178184
fmt_ver: 7.0.1
185+
opencolorio_ver: v2.2.1
179186
openexr_ver: v3.1.0
180-
pybind11_ver: v2.7.0
187+
pybind11_ver: v2.4.2
181188
python_ver: 3.7
182189
simd: 0
183190
setenvs: export EMBEDPLUGINS=0
184191
CMAKE_VERSION=3.15.5
185192
PTEX_VERSION=v2.3.2
186193
WEBP_VERSION=v1.1.0
187194
USE_JPEGTURBO=0
188-
USE_OPENCOLORIO=0
189195
USE_OPENCV=0
190196
FREETYPE_VERSION=VER-2-10-0
191197
depcmds: sudo rm -rf /usr/local/include/OpenEXR
@@ -220,6 +226,7 @@ jobs:
220226
CMAKE_CXX_STANDARD: ${{matrix.cxx_std}}
221227
USE_SIMD: ${{matrix.simd}}
222228
FMT_VERSION: ${{matrix.fmt_ver}}
229+
OPENCOLORIO_VERSION: ${{matrix.opencolorio_ver}}
223230
OPENEXR_VERSION: ${{matrix.openexr_ver}}
224231
PYBIND11_VERSION: ${{matrix.pybind11_ver}}
225232
PYTHON_VERSION: ${{matrix.python_ver}}
@@ -308,14 +315,14 @@ jobs:
308315
cxx_compiler: g++-12
309316
cxx_std: 17
310317
fmt_ver: 10.1.1
318+
opencolorio_ver: v2.3.2
311319
openexr_ver: v3.2.4
312320
pybind11_ver: v2.12.0
313321
python_ver: "3.10"
314322
simd: avx2,f16c
315323
setenvs: export LIBJPEGTURBO_VERSION=3.0.1
316324
LIBRAW_VERSION=0.21.2
317325
LIBTIFF_VERSION=v4.6.0
318-
OPENCOLORIO_VERSION=v2.3.2
319326
OPENJPEG_VERSION=v2.4.0
320327
PTEX_VERSION=v2.4.2
321328
PUGIXML_VERSION=v1.14
@@ -329,14 +336,14 @@ jobs:
329336
cxx_compiler: g++-14
330337
cxx_std: 20
331338
fmt_ver: master
339+
opencolorio_ver: main
332340
openexr_ver: main
333341
pybind11_ver: master
334342
python_ver: "3.12"
335343
simd: avx2,f16c
336344
setenvs: export LIBJPEGTURBO_VERSION=main
337345
LIBRAW_VERSION=master
338346
LIBTIFF_VERSION=master
339-
OPENCOLORIO_VERSION=main
340347
OPENJPEG_VERSION=master
341348
PTEX_VERSION=main
342349
PUGIXML_VERSION=master
@@ -376,12 +383,12 @@ jobs:
376383
cc_compiler: clang
377384
cxx_std: 20
378385
fmt_ver: 10.1.1
386+
opencolorio_ver: v2.2.1
379387
openexr_ver: v3.1.13
380388
pybind11_ver: v2.12.0
381389
python_ver: 3.8
382390
simd: avx2,f16c
383391
setenvs: export LLVM_VERSION=14.0.0
384-
OPENCOLORIO_VERSION=v2.1.2
385392
USE_OPENVDB=0
386393
# The installed OpenVDB has a TLS conflict with Python 3.8
387394
- desc: debug gcc9/C++17, sse4.2, exr3.1
@@ -425,7 +432,8 @@ jobs:
425432
OIIO_CMAKE_FLAGS=-DUSE_PYTHON=0
426433
LLVM_VERSION=17.0.6 LLVM_DISTRO_NAME=ubuntu-22.04
427434
SKIP_SYSTEM_DEPS_INSTALL=1 QT_VERSION=0
428-
OpenImageIO_BUILD_MISSING_DEPS=none
435+
xOpenImageIO_BUILD_MISSING_DEPS=missing
436+
OpenImageIO_OPTIONAL_DEPS=ALL
429437

430438
runs-on: ${{ matrix.runner }}
431439
env:
@@ -434,6 +442,7 @@ jobs:
434442
CMAKE_CXX_STANDARD: ${{matrix.cxx_std}}
435443
USE_SIMD: ${{matrix.simd}}
436444
FMT_VERSION: ${{matrix.fmt_ver}}
445+
OPENCOLORIO_VERSION: ${{matrix.opencolorio_ver}}
437446
OPENEXR_VERSION: ${{matrix.openexr_ver}}
438447
PYBIND11_VERSION: ${{matrix.pybind11_ver}}
439448
PYTHON_VERSION: ${{matrix.python_ver}}

INSTALL.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ NEW or CHANGED MINIMUM dependencies since the last major release are **bold**.
2323
* **Imath >= 3.1** (tested through 3.1.x and main)
2424
* **OpenEXR >= 3.1** (tested through 3.2 and main)
2525
* **libTIFF >= 4.0** (tested through 4.6)
26+
* **OpenColorIO >= 2.2** (tested through 2.3)
2627
* libjpeg >= 8 (tested through jpeg9e), or **libjpeg-turbo >= 2.1** (tested
2728
through 3.0)
2829
* **[fmtlib](https://github.com/fmtlib/fmt) >= 7.0** (tested through 10.2).
@@ -66,8 +67,6 @@ NEW or CHANGED MINIMUM dependencies since the last major release are **bold**.
6667
* DCMTK >= 3.6.1 (tested through 3.6.8)
6768
* If you want support for WebP images:
6869
* **WebP >= 1.1** (tested through 1.4)
69-
* If you want support for OpenColorIO color transformations:
70-
* OpenColorIO >= 1.1 (tested through 2.3; 2.0+ is recommended)
7170
* If you want support for Ptex:
7271
* Ptex >= 2.3.1 (probably works for older; tested through 2.4.2)
7372
* If you want to be able to do font rendering into images:

src/build-scripts/build_opencolorio.bash

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,15 @@ set -ex
1111

1212
# Which OCIO to retrieve, how to build it
1313
OPENCOLORIO_REPO=${OPENCOLORIO_REPO:=https://github.com/AcademySoftwareFoundation/OpenColorIO.git}
14-
OPENCOLORIO_VERSION=${OPENCOLORIO_VERSION:=v2.2.1}
14+
OPENCOLORIO_VERSION=${OPENCOLORIO_VERSION:=v2.3.2}
1515

1616
# Where to install the final results
1717
LOCAL_DEPS_DIR=${LOCAL_DEPS_DIR:=${PWD}/ext}
1818
OPENCOLORIO_SOURCE_DIR=${OPENCOLORIO_SOURCE_DIR:=${LOCAL_DEPS_DIR}/OpenColorIO}
1919
OPENCOLORIO_BUILD_DIR=${OPENCOLORIO_BUILD_DIR:=${LOCAL_DEPS_DIR}/OpenColorIO-build}
2020
OPENCOLORIO_INSTALL_DIR=${OPENCOLORIO_INSTALL_DIR:=${LOCAL_DEPS_DIR}/dist}
2121
OPENCOLORIO_BUILD_TYPE=${OPENCOLORIO_BUILD_TYPE:=Release}
22+
OPENCOLORIO_CXX=${OPENCOLORIO_CXX:=g++}
2223
OPENCOLORIO_CXX_FLAGS=${OPENCOLORIO_CXX_FLAGS:="-Wno-unused-function -Wno-deprecated-declarations -Wno-cast-qual -Wno-write-strings"}
2324
# Just need libs:
2425
OPENCOLORIO_BUILDOPTS="-DOCIO_BUILD_APPS=OFF -DOCIO_BUILD_NUKE=OFF \
@@ -46,6 +47,7 @@ git checkout ${OPENCOLORIO_VERSION} --force
4647
time cmake -S . -B ${OPENCOLORIO_BUILD_DIR} \
4748
-DCMAKE_BUILD_TYPE=${OPENCOLORIO_BUILD_TYPE} \
4849
-DCMAKE_INSTALL_PREFIX=${OPENCOLORIO_INSTALL_DIR} \
50+
-DCMAKE_CXX_COMPILER=${OPENCOLORIO_CXX} \
4951
-DCMAKE_CXX_FLAGS="${OPENCOLORIO_CXX_FLAGS}" \
5052
${OPENCOLORIO_BUILDOPTS}
5153
time cmake --build ${OPENCOLORIO_BUILD_DIR} --config Release --target install

src/build-scripts/ci-build.bash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ cmake -S $OIIO_SRC_DIR -B $OIIO_BUILD_DIR -G "$CMAKE_GENERATOR" \
4343
$OIIO_CMAKE_FLAGS -DVERBOSE=1
4444

4545
# Save a copy of the generated files for debugging broken CI builds.
46-
mkdir ${OIIO_BUILD_DIR}/cmake-save || /bin/true
46+
mkdir ${OIIO_BUILD_DIR}/cmake-save || true
4747
cp -r ${OIIO_BUILD_DIR}/CMake* ${OIIO_BUILD_DIR}/*.cmake ${OIIO_BUILD_DIR}/cmake-save
4848

4949
: ${BUILDTARGET:=install}

src/build-scripts/ci-startup.bash

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ export LD_LIBRARY_PATH=${LOCAL_DEPS_DIR}/dist/lib:$LD_LIBRARY_PATH
4444
export LD_LIBRARY_PATH=${LOCAL_DEPS_DIR}/dist/lib64:$LD_LIBRARY_PATH
4545
export DYLD_LIBRARY_PATH=${LOCAL_DEPS_DIR}/dist/lib:$DYLD_LIBRARY_PATH
4646

47-
# export OCIO="$PWD/testsuite/common/OpenColorIO/nuke-default/config.ocio"
4847
export TESTSUITE_CLEANUP_ON_SUCCESS=${TESTSUITE_CLEANUP_ON_SUCCESS:=1}
4948

5049
# For CI, default to building missing dependencies automatically

src/cmake/Config.cmake.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ if (NOT @BUILD_SHARED_LIBS@)
2121
# INTERFACE_LINK_LIBRARIES. If the project does not know about PNG target, it will cause
2222
# configuration error about unknown targets being linked in.
2323
find_dependency(TIFF)
24+
find_dependency(OpenColorIO)
2425
if (@JPEG_FOUND@)
2526
find_dependency(JPEG)
2627
endif()

src/cmake/build_OpenColorIO.cmake

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,14 @@ set_cache (OpenColorIO_BUILD_SHARED_LIBS ON
1515
# it all work with the static dependencies, it just makes things complicated
1616
# downstream.
1717

18+
# Clear variables from the failed find_package
19+
unset (OPENCOLORIO_LIBRARY)
20+
unset (OPENCOLORIO_INCLUDE_DIR)
21+
unset (FIND_PACKAGE_MESSAGE_DETAILS_OpenColorIO)
22+
unset (OPENCOLORIO_VERSION_MAJOR)
23+
unset (OPENCOLORIO_VERSION_MINOR)
24+
unset (OpenColorIO_DIR)
25+
1826
string (MAKE_C_IDENTIFIER ${OpenColorIO_BUILD_VERSION} OpenColorIO_VERSION_IDENT)
1927

2028
build_dependency_with_cmake(OpenColorIO
@@ -35,8 +43,8 @@ build_dependency_with_cmake(OpenColorIO
3543
-D OCIO_INSTALL_EXT_PACKAGES=MISSING
3644
# Give the library a custom name and symbol namespace so it can't
3745
# conflict with any others in the system or linked into the same app.
38-
-D OCIO_NAMESPACE=${PROJ_NAMESPACE_V}_OpenColorIO
39-
-D OCIO_LIBNAME_SUFFIX=_v${OpenColorIO_VERSION_IDENT}_${PROJ_NAMESPACE_V}
46+
# -D OCIO_NAMESPACE=${OpenColorIO_VERSION_IDENT}_${PROJ_NAME}
47+
-D OCIO_LIBNAME_SUFFIX=_v${OpenColorIO_VERSION_IDENT}_${PROJ_NAME}
4048
)
4149

4250
# Set some things up that we'll need for a subsequent find_package to work
@@ -46,8 +54,9 @@ set (OpenColorIO_ROOT ${OpenColorIO_LOCAL_INSTALL_DIR})
4654
set (OpenColorIO_DIR ${OpenColorIO_LOCAL_INSTALL_DIR})
4755

4856
# Signal to caller that we need to find again at the installed location
49-
set (OpenColorIO_REFIND TRUE)
50-
set (OpenColorIO_REFIND_ARGS CONFIG)
57+
# set (OpenColorIO_REFIND TRUE)
58+
# set (OpenColorIO_REFIND_ARGS CONFIG)
59+
find_package (OpenColorIO ${OpenColorIO_BUILD_VERSION} EXACT CONFIG REQUIRED)
5160

5261
if (OpenColorIO_BUILD_SHARED_LIBS)
5362
install_local_dependency_libs (OpenColorIO OpenColorIO)

src/cmake/externalpackages.cmake

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -129,23 +129,13 @@ checked_find_package (Freetype
129129
VERSION_MIN 2.10.0
130130
DEFINITIONS USE_FREETYPE=1 )
131131

132-
checked_find_package (OpenColorIO
133-
VERSION_MIN 1.1
132+
checked_find_package (OpenColorIO REQUIRED
133+
VERSION_MIN 2.2
134134
VERSION_MAX 2.9
135-
NO_FP_RANGE_CHECK
136-
DEFINITIONS USE_OCIO=1 USE_OPENCOLORIO=1
137-
)
138-
if (OpenColorIO_FOUND)
139-
option (OIIO_DISABLE_BUILTIN_OCIO_CONFIGS
140-
"For deveoper debugging/testing ONLY! Disable OCIO 2.2 builtin configs." OFF)
141-
if (OIIO_DISABLE_BUILTIN_OCIO_CONFIGS OR "$ENV{OIIO_DISABLE_BUILTIN_OCIO_CONFIGS}")
142-
add_compile_definitions(OIIO_DISABLE_BUILTIN_OCIO_CONFIGS)
143-
endif ()
144-
if (NOT OPENCOLORIO_INCLUDES)
145-
get_target_property(OPENCOLORIO_INCLUDES OpenColorIO::OpenColorIO INTERFACE_INCLUDE_DIRECTORIES)
146-
endif ()
147-
else ()
148-
set (OpenColorIO_FOUND 0)
135+
PREFER_CONFIG
136+
)
137+
if (NOT OPENCOLORIO_INCLUDES)
138+
get_target_property(OPENCOLORIO_INCLUDES OpenColorIO::OpenColorIO INTERFACE_INCLUDE_DIRECTORIES)
149139
endif ()
150140
include_directories(BEFORE ${OPENCOLORIO_INCLUDES})
151141

0 commit comments

Comments
 (0)