Compile Alembic on Windows
We needed to compile alembic to use python in nuke-14, so we have check the python version of our nuke, and tried to compile it with the same python version (3.9.10).
Requierements
- Python 3.9.10
- Numpy (pip install numpy)
- CMake
- Boost (tested with 1.81.0)
- IMath (v3.1.8!!)
Build and Compile boost
Download Boost cmake version
sh
cmake -S . -B ./build -DBOOST_ENABLE_PYTHON=ON -DPython_ROOT_DIR=C:/python39 -DCMAKE_INSTALL_PREFIX=install_prefix
cmake --build .\build\ --config Release --target install
Build and compile Imath
You can get Imath source here: Imath
bash
cmake -S . -B ./build -DPYTHON=ON -DCMAKE_INSTALL_PREFIX=install -DCMAKE_BUILD_TYPE=Release -DBoost_ROOT=<BOOST_SOURCE_ROOT>/install_prefix -DPython_EXECUTABLE=C:/Python39/python.exe -DBoost_NO_BOOST_CMAKE=OFF
cmake --build .\build\ --config Release --target install
Compile Alembic
bash
cmake -S . -B ./build/ -DImath_ROOT=install -DUSE_PYALEMBIC=ON -DCMAKE_INSTALL_PREFIX=<ALEMBIC_SOURCE_ROOT>/install -DBoost_INCLUDE_DIR=<BOOST_SOURCE_ROOT>/prefix_install/include/boost-<BOOST_VERSION>/ -DUSE_STATIC_BOOST=OFF
cmake --build .\build\ --config Release --target install
Troubleshooting
- If you got errors like "version 0.0.0 of boost..." this happen when boost install dir are not correctly specify in cmake command, check your boost include dir path and retry.
- If you got errors like
get_target_property() called with non-existent target "Imath::PyImath_Python3_9".
, check you version of imath and retry with 3.1.8