196.5. openvdb-13.0.0
OpenVDB and NanoVDB: sparse volumes — Blender's smoke, fire and volume objects
| Version | 13.0.0, release 2 |
| Shelf | 3d — 3D modelling, animation, voxel and mesh tools and libraries, and scientific visualisation |
| Phase | 42_graphics (Graphics Stack), 21 of 189 in build order |
| Licence | Apache-2.0 |
| Homepage | https://www.openvdb.org/ |
| Build time | 34.7 SBU |
| Installed size | 74.1 MiB in 265 files |
| Recipe | ports/core/3d/openvdb/kpkgbuild |
About
OpenVDB is the sparse volume format and library for smoke, fire, clouds and other volumetric data, and NanoVDB is its compact read-only form for renderers. Blender reads and writes volumes through OpenVDB, and its Cycles renderer compiles against the NanoVDB headers; OpenImageIO and PrusaSlicer link the library too. The package carries the core library, the vdb_print tool, the NanoVDB headers and the Python module.
Sources
openvdb-13.0.0.tar.gz(4.7 MiB)
sha2564d6a91df5f347017496fe8d22c3dbb7c4b5d7289499d4eb4d53dd2c75bb454e1
upstream: https://github.com/AcademySoftwareFoundation/openvdb/archive/refs/tags/v13.0.0.tar.gz
archive copy: sources-1/3d--openvdb-13.0.0.tar.gz
Dependencies
Depends on: cmake, ninja, onetbb, c-blosc, zlib, python3, python3-nanobind.
Required by (3): blender, openimageio, prusaslicer.
Optional, off in KDOS
These switches in build.sh turn off a feature whose library is a port here. The recipe may turn each off on purpose, or because the library was not yet a port when the recipe was written; this list cannot tell which.
Patches
build.sh applies these; kpkg applies nothing by itself.
tbb-version.patch— In the installedopenvdb/thread/Threading.h, includestbb/version.hwhen that header exists, andtbb/task_arena.hotherwise, ahead of the TBB headers the file already includes. Unpatched, the header reaches TBB’s version macros only throughtbb/blocked_range.h, which in oneTBB 2023 includes no version header;TBB_INTERFACE_VERSIONis then undefined, the branch for the old TBB task API (tbb::task::self()), which oneTBB does not have, is chosen, and neither OpenVDB nor anything that includes the header compiles.
Installation
From the repository root, inside the build container, this is the line kdosbuild runs for the port:
script/chroot/exec.sh bash -c 'source script/phases/42_graphics/phase.env && kpkg install openvdb'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/3d/openvdb.
1. Verify every declared source. Each file a sha256 = line names, found in the port directory or in /var/cache/kpkg/sources, must hash to its line; a mismatch stops the build before anything is unpacked.
cd /ports/core/3d/openvdb
echo '4d6a91df5f347017496fe8d22c3dbb7c4b5d7289499d4eb4d53dd2c75bb454e1 openvdb-13.0.0.tar.gz' | sha256sum -c -
2. Unpack. The work directory is emptied and the first source is unpacked into $SRC with its top directory stripped; any later tarball lands unstripped beside it in $SRC_ROOT, and a file that is not a tarball is copied into $SRC.
SRC_ROOT=/var/cache/kpkg/work/openvdb
SRC=$SRC_ROOT/openvdb-13.0.0
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf openvdb-13.0.0.tar.gz -C "$SRC" --strip-components=1
Every config.guess and config.sub older than automake’s is then replaced with automake’s, so a configure script recognises the musl target.
3. Build. build.sh is sourced in a subshell under set -e, from $SRC, with name, version, release and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:
patch -p1 -i "$PORT_SRC/tbb-version.patch"
_nanobind=$(python3 -m nanobind --cmake_dir)
mkdir build && cd build
cmake .. -G Ninja -DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_INSTALL_LIBDIR=lib \
-DOPENVDB_ENABLE_RPATH=OFF \
-DOPENVDB_BUILD_CORE=ON \
-DOPENVDB_CORE_SHARED=ON \
-DOPENVDB_CORE_STATIC=OFF \
-DOPENVDB_BUILD_BINARIES=ON \
-DOPENVDB_BUILD_PYTHON_MODULE=ON \
-Dnanobind_DIR="$_nanobind" \
-DPython_EXECUTABLE=/usr/bin/python3 \
-DOPENVDB_BUILD_UNITTESTS=OFF \
-DOPENVDB_BUILD_DOCS=OFF \
-DOPENVDB_BUILD_AX=OFF \
-DOPENVDB_BUILD_NANOVDB=ON \
-DOPENVDB_USE_DELAYED_LOADING=OFF \
-DOPENVDB_ENABLE_UNINSTALL=OFF \
-DUSE_NANOVDB=ON \
-DUSE_BLOSC=ON \
-DUSE_ZLIB=ON \
-DUSE_TBB=ON \
-DUSE_EXR=OFF \
-DUSE_PNG=OFF \
-DUSE_LOG4CPLUS=OFF \
-DUSE_CCACHE=OFF \
-DCONCURRENT_MALLOC=Tbbmalloc \
-DNANOVDB_BUILD_TOOLS=OFF \
-DNANOVDB_USE_CUDA=OFF \
-DNANOVDB_USE_OPENVDB=OFF \
-DNANOVDB_ALLOW_FETCHCONTENT=OFF
ninja
DESTDIR=$PKG ninja install
test -e "$PKG"/usr/lib/python3*/site-packages/openvdb*.so
The switches, and why each is set:
-DOPENVDB_ENABLE_RPATH=OFF— Install the library and tools with no RPATH; everything is in/usr/lib.-DOPENVDB_BUILD_CORE=ON,-DOPENVDB_CORE_SHARED=ON,-DOPENVDB_CORE_STATIC=OFF— Build the core library, shared only. Upstream builds both a shared and a static library by default.-DOPENVDB_BUILD_BINARIES=ON— Build the command-line tools whose own switches are on, which by upstream’s defaults isvdb_printalone.-DOPENVDB_BUILD_PYTHON_MODULE=ON— Build theopenvdbPython module, off by default upstream. It is written on nanobind:-Dnanobind_DIRis the CMake directory that python3-nanobind reports withpython3 -m nanobind --cmake_dir, and-DPython_EXECUTABLEnames the system Python.build.shfails if the module was not installed.-DOPENVDB_BUILD_UNITTESTS=OFF,-DOPENVDB_BUILD_DOCS=OFF— No unit tests and no Doxygen documentation.-DOPENVDB_BUILD_AX=OFF— No OpenVDB AX, the expression language for volumes, which needs LLVM.-DOPENVDB_BUILD_NANOVDB=ON,-DUSE_NANOVDB=ON— Install NanoVDB with OpenVDB.-DOPENVDB_USE_DELAYED_LOADING=OFF— Build without delayed loading, the memory-mapped reader that loads a grid’s voxels only when they are first touched. It is on by default upstream, and it is the one part of the library that needs Boost (Boost::iostreams); with it off, Boost is not linked.-DOPENVDB_ENABLE_UNINSTALL=OFF— Nouninstalltarget.-DUSE_BLOSC=ON,-DUSE_ZLIB=ON,-DUSE_TBB=ON— Blosc and zlib compression of grids on disk, and oneTBB for threading. c-blosc, zlib and onetbb are independs.-DUSE_EXR=OFF,-DUSE_PNG=OFF,-DUSE_LOG4CPLUS=OFF— No OpenEXR or PNG image output, which only thevdb_renderprogram uses, and it is not built; and no log4cplus logging.USE_EXRoff also leavesUSE_IMATH_HALFoff, so the library uses its own embedded half-float type instead of Imath’s.-DUSE_CCACHE=OFF— Do not compile through ccache, which upstream uses by default whenever it is on the path.-DCONCURRENT_MALLOC=Tbbmalloc— Linkvdb_printagainst oneTBB’s scalable allocator. The switch applies to the programs only; the library links no allocator and leaves the choice to the program that uses it. The default,Auto, takes jemalloc whenever the build root holds it and falls back to tbbmalloc, so the allocator would follow what other ports happened to install.-DNANOVDB_BUILD_TOOLS=OFF,-DNANOVDB_USE_OPENVDB=OFF— NanoVDB as headers only, without its command-line tools:nanovdb_print,nanovdb_validate, andnanovdb_convert, which converts OpenVDB grids and is built only withNANOVDB_USE_OPENVDB. Nothing here runs them.-DNANOVDB_USE_CUDA=OFF— No CUDA.-DNANOVDB_ALLOW_FETCHCONTENT=OFF— Do not let NanoVDB’s CMake download a missing dependency; the build has no network.
The common switches of each build system are explained in the Flag glossary.
4. Package. kpkg removes libtool archives, the info directory index, mimeinfo.cache and every fonts.dir from $PKG, copies the source’s licence files into /usr/share/licenses/openvdb, prunes what the image does not ship, lints the tree and rolls it reproducibly:
tar --sort=name --format=gnu --numeric-owner --owner=0 --group=0 \
--mtime=@$SOURCE_DATE_EPOCH \
--use-compress-program='xz -9 -T0 --block-size=32MiB --no-adjust' \
-cf openvdb-13.0.0-2.tar.xz -C "$PKG" .
5. Adopt. kpkgadd installs the package’s files over the root, refusing a path another package owns, records the file list in /var/lib/kpkg/db/openvdb, and runs the triggers its paths call for.
Contents
Installed programs: vdb_print.
Installed libraries: libopenvdb.so.
Installed directories: /usr/include/nanovdb, /usr/include/openvdb, /usr/lib/cmake/OpenVDB, /usr/share/licenses/openvdb.
Notes
The version follows the one Blender pins. Cycles compiles against the NanoVDB headers, whose API moves between minor releases, so a bump of either port checks the other.