This patch enables building of pyopenvdb with make deps. This is a first step towards integration of pyopenvdb into Blender, see design task T73201. Aim is to be able to import pyopenvdb in Blender Python Console. This does not include ability to modify Blender OpenVDB grids, only to have access to out-of-box pyopenvdb.
Related devtalk thread for discussion: https://devtalk.blender.org/t/build-pyopenvdb-as-part-of-make-deps/14148
- this patch requires D8212 is applied (build Boost Python)
- currently works at least on Windows and XUbuntu 20.04.
- to enable, add CMake option WITH_PYOPENVDB to make deps in GNUmakefile by e.g. command sed -i 's/cmake\ \-H\"\$(DEPS_SOURCE_DIR/cmake\ -DWITH_PYOPENVDB\=ON\ -DWITH_BOOST_PYTHON\=ON\ \-H\"\$(DEPS_SOURCE_DIR/' GNUmakefile
- NumPy is enabled, since it allows use of copyFromArray and copyToArray for fast data transfer from NumPy arrays, which is likely needed by users.
- open issue: provide pyopenvdb as static or dynamic library setup?
- currently after building Blender with make, Blender needs to be started with command LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.2 /path/to/blender in order to avoid ImportError: /lib/x86_64-linux-gnu/libjemalloc.so.2: cannot allocate memory in static TLS block error upon import pyopenvdb