Compile OpenImageIO
Tested on version 2.5.4.0
Requirements
- cmake (tested with v3.28.20231017)
- gcc (tested with v6.5.0)
- 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
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