Compile OpenImageIO
Tested on version 2.5.4.0
Requirements
- cmake (tested with v3.26.1)
- gcc (tested with v10.3)
- libjpeg-turbo (tested with v3.0.1)
- boost (tested with v1.83.0)
- OpenEXR (tested with v3.2.1)
- tiff (tested with v4.5.1)
- Python (tested with 3.10) (TODO)
- zlib (tested with v1.3)
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.
EnvVariable | CMakeVariable | Value | Pkg | Tested |
---|---|---|---|---|
JPEGTurbo_ROOT and JPEGTurbo_ROOT | -Dlibjpeg-turbo_ROOT | <LIBJPEDTURBO_CLONE_DIR>/install | libjpeg-turbo | true |
Boost_ROOT | -DBoost_ROOT | <BOOST_CLONE_DIR>/install | boost | true |
OpenEXR_ROOT | -DOpenEXR_ROOT | <OPENEXR_CLONE_DIR>/install | OpenEXR | true |
LIBTIFF_ROOT and LD_LIBRARY_PATH to <TIFF_CLONE_DIR>/install/lib | -DTIFF_ROOT | <TIFF_CLONE_DIR>/install | tiff | true |
ZLIB_ROOT | -DZLIB_ROOT | <ZLIB_CLONE_DIR>/install | zlib | true |
bash
cmake -S . -B ./build \
-DBoost_USE_STATIC_LIBS=ON \
-DCMAKE_INSTALL_PREFIX=<OIIO_SOURCE_DIR>\install \
-DBoost_ROOT=<BOOST_SOURCE_DIR>\boost-1.83.0\install_prefix \
-DOpenEXR_ROOT=<OEXR_SOURCE_DIR>\install \
-DTIFF_ROOT=<LIBTIFF_SOURCE_DIR>\install_prefix \
-Dlibjpeg-turbo_ROOT=<LIBJPEG-TURBO_SOURCE_DIR>install \
-DCMAKE_BUILD_TYPE=Release \
-DZLIB_ROOT=<ZLIB_SOURCE_DIR>\prefix_install \
-Dpybind11_ROOT=<PYBIND11_SOURCE_DIR>\mock_install \
-DPython_ROOT=M:\rez_package\python\3.10.5\platform-windows
cmake --build ./build --config Release --target check
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