Skip to content

Compile OpenImageIO ​

Tested on version 2.5.4.0

Requirements ​

Get OpenImageIO source ​

You can get OpenImageIO source from here

Build ​

You need to set some environment variables to help cmake to find dependencies.

You only to set the EnvVariable nor the CMakeVariable, not both.

EnvVariableCMakeVariableValuePkgTested
JPEGTurbo_ROOT and JPEGTurbo_ROOT-Dlibjpeg-turbo_ROOT<LIBJPEDTURBO_CLONE_DIR>/installlibjpeg-turbotrue
Boost_ROOT-DBoost_ROOT<BOOST_CLONE_DIR>/installboosttrue
OpenEXR_ROOT-DOpenEXR_ROOT<OPENEXR_CLONE_DIR>/installOpenEXRtrue
LIBTIFF_ROOT and LD_LIBRARY_PATH to <TIFF_CLONE_DIR>/install/lib-DTIFF_ROOT<TIFF_CLONE_DIR>/installtifftrue
ZLIB_ROOT-DZLIB_ROOT<ZLIB_CLONE_DIR>/installzlibtrue
bash
cd <OIIO_SOURCE_DIR>
./src/build-scripts/build_pybind11.bash # todo compile by ourself
cmake -S . -B ./build -DCMAKE_INSTALL_PREFIX=<CLONE_DIR>/install \
 -DBoost_ROOT=<BOOST_CLONE_DIR>/build -DOpenEXR_ROOT=<OPENEXR_CLONE_DIR>/install \
 -DTIFF_ROOT=<TIFF_CLONE_DIR>/build -Dlibjpeg-turbo_ROOT=<LIBJPEDTURBO_CLONE_DIR>/install \
 -DZLIB_ROOT=<ZLIB_CLONE_DIR>/install
cmake --build <OIIO_SOURCE_DIR>/build --target install --config Release

All the compiled files will be in <CLONE_DIR>/install And the python module will be in <CLONE_DIR>/install/lib64/python3.10/site-packages

References ​