OpenVDB
9.0.1
|
Note that NanoVDB can be built in many different ways, in the sense that its many external dependencies are optional. This includes OpenVDB, TBB, graphics APIs like CUDA, OpenGL, and OpenCL, as well as compression like ZLIB and BLOSC. However, since the core data structure in NanoVDB.h is self-contained, client code may only depend on this single header file.
Also, note that if the environment variable VDB_DATA_PATH
is set to a directory containing the OpenVDB files from the OpenVDB web site, they will be used for the unit and the benchmark tests. Else a simple narrow-band level set sphere is used. Set the environment variable VDB_SCRATCH_PATH
to define the path to where images generated in the benchmark tests are stored (defaults to the build directory).
To explicitly remove a dependency, X
, add the argument -DNANOVDB_USE_X=OFF
where X = {OPENVDB, TBB, BLOSC, ZLIB, CUDA}
. These options are set in the NanoVDB root CMakeLists.txt. The same file also defines options to build NanoVDB examples, benchmarks, unit-tests, and command-line tools. The default values for these options are OFF
. A user can override each of these options by passing, for example, -DNANOVDB_BUILD_UNITTESTS=ON
flag while running cmake from the command line.
To see the compiler arguments add -DCMAKE_VERBOSE_MAKEFILE=ON
.
NanoVDB is now a module of the larger OpenVDB project. A user can build both libraries together. This will build the OpenVDB core library, install the NanoVDB header files, and build the NanoVDB command-line tools in the build/nanovdb/cmd
directory. From the 'root' OpenVDB project directory (change the dependency paths to match your environment):
Note that the default value of NANOVDB_USE_OPENVDB
is linked to OPENVDB_BUILD_CORE
option and can be overriden by passing on -DNANOVDB_USE_OPENVDB=OFF
. The Boost
library is included because it is a requirement for building OpenVDB.
In general, CMake will try to find every optional dependency when a user opts to add an additional dependency. Be sure to check the CMake log to see what dependencies were not found.
From the 'root' OpenVDB project directory:
Another option is to build it from the NanoVDB directory itself, which is much simpler:
Both options will install the NanoVDB header files to the /install/path
as well as building nanovdb_print
and nanovdb_validate
executable. The path where these executables are installed will be different: in the first option they will be under build/nanovdb/cmd
directory; whilst in the second option they will be under the build/cmd/
directory.
From the root OpenVDB directory:
Note that if you already have the correct version of OpenVDB pre-installed, you can configure CMake to link against that library by passing the arguments -DOPENVDB_BUILD_CORE=OFF -DOPENVDB_BUILD_BINARIES=OFF -DOPENVDB_ROOT=/path/to/openvdb
when invoking cmake
.