diff --git a/CHANGES b/CHANGES index 46ac51525f..720c8f9fd0 100644 --- a/CHANGES +++ b/CHANGES @@ -3,9 +3,19 @@ OpenVDB Version History Version 9.0.0 - October 29, 2021 + This version introduces ABI changes relative to older major releases, + so to preserve ABI compatibility it might be necessary to define the + macro OPENVDB_ABI_VERSION_NUMBER=N, where, for example, N is 7 for + Houdini 18.5 and 8 for Houdini 19.0. + + Official release of NanoVDB, which for the first time offers GPU support + for static sparse volumes in OpenVDB. + New features: - - NanoVDB, which for the first time offers GPU support for static sparse - volumes in OpenVDB. + - Faster build times from support for explicit template instantiation, + which is enabled by default for most of the tools. + - Added support for OpenEXR 3 and TBB 2021. + - Added transient data to the RootNode, InternalNode, and LeafNode. Improvements: - Added tools::countActiveLeafVoxels(), tools::countInactiveVoxels(), diff --git a/CMakeLists.txt b/CMakeLists.txt index 8dfbc5e4e0..d6ca1e02c5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -141,7 +141,8 @@ option(OPENVDB_USE_FUTURE_ABI_10 "Bypass future ABI check" OFF) option(OPENVDB_FUTURE_DEPRECATION "Generate messages for upcoming deprecation" ON) option(OPENVDB_ENABLE_UNINSTALL "Adds a CMake uninstall target." ON) option(USE_COLORED_OUTPUT "Always produce ANSI-colored output (GNU/Clang only)." OFF) -option(USE_PKGCONFIG "Use pkg-config to search for dependent libraries." ON) +cmake_dependent_option(USE_PKGCONFIG "Use pkg-config to search for dependent libraries." ON "NOT WIN32" OFF) + option(USE_EXPLICIT_INSTANTIATION "Use explicit instantiation for all supported classes and methods against a pre-defined list of OpenVDB trees. This makes the core library larger and slower to compile, but speeds up the compilation of all dependent code by bypassing the expensive template instantation." ON) @@ -208,9 +209,6 @@ if(USE_AX) endif() endif() -# Top-level location for all openvdb headers -set(OPENVDB_INSTALL_INCLUDEDIR "${CMAKE_INSTALL_INCLUDEDIR}/openvdb") - ###### Deprecated options if(OPENVDB_BUILD_HOUDINI_SOPS) @@ -245,12 +243,8 @@ mark_as_advanced( # Configure minimum version requirements - some are treated specially and fall # outside of the DISABLE_DEPENDENCY_VERSION_CHECKS catch - set(MINIMUM_CXX_STANDARD 14) -# @note Blosc version is currently treated as exception which must be adhered -# to. The minimum version must be at least 1.5.0. Previous versions are incompatible. -set(MINIMUM_BLOSC_VERSION 1.5.0) # @note ABI always enforced so the correct deprecation messages are available. # OPENVDB_USE_DEPRECATED_ABI_ should be used to circumvent this set(MINIMUM_OPENVDB_ABI_VERSION 6) @@ -270,6 +264,7 @@ if(NOT DISABLE_DEPENDENCY_VERSION_CHECKS) set(MINIMUM_ZLIB_VERSION 1.2.7) set(MINIMUM_TBB_VERSION 2019.0) set(MINIMUM_LLVM_VERSION 7.0.0) + set(MINIMUM_BLOSC_VERSION 1.5.0) set(MINIMUM_PYTHON_VERSION 2.7) # @warning should be 3.7.x, but H18.5+ can still be used with 2.7.x set(MINIMUM_NUMPY_VERSION 1.14.0) @@ -291,6 +286,7 @@ set(FUTURE_MINIMUM_GCC_VERSION 9.3.1) set(FUTURE_MINIMUM_ICC_VERSION 19) # set(FUTURE_MINIMUM_MSVC_VERSION 19.10) +# set(FUTURE_MINIMUM_CMAKE_VERSION 3.18) # set(FUTURE_MINIMUM_ILMBASE_VERSION 2.4) # set(FUTURE_MINIMUM_OPENEXR_VERSION 2.4) set(FUTURE_MINIMUM_BOOST_VERSION 1.73) @@ -552,6 +548,7 @@ if(USE_STATIC_DEPENDENCIES) endif() # Configure OpenVDB Library and ABI versions + set(NEEDS_OPENVDB OFF) if(OPENVDB_BUILD_AX OR diff --git a/CODEOWNERS b/CODEOWNERS index 6f9dbd33b8..a8feda0be8 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -23,6 +23,9 @@ CHANGES @kmuseth @apradhana # OpenVDB AX /openvdb_ax/ @idclip @richhones +# NanoVDB +/nanovdb/ @kmuseth + # OpenVDB Houdini - Default /openvdb_houdini/ @kmuseth diff --git a/README.md b/README.md index f97e02eb0d..abcaf29aec 100644 --- a/README.md +++ b/README.md @@ -33,12 +33,12 @@ OpenVDB welcomes contributions to the OpenVDB project. Please refer to the [cont ### Developer Quick Start -The following provides basic installation examples for the core OpenVDB library. Other components, such as the python module, OpenVDB AX and various executables, may require additional dependencies. See the [build documentation](https://academysoftwarefoundation.github.io/openvdb/build.html) for help with installations. +The following provides basic installation examples for the core OpenVDB library. Other components, such as the python module, OpenVDB AX, NanoVDB and various executables, may require additional dependencies. See the [build documentation](https://academysoftwarefoundation.github.io/openvdb/build.html) for help with installations. #### Linux ##### Installing Dependencies (Boost, TBB, Blosc) -``` +```bash apt-get install -y libboost-iostreams-dev apt-get install -y libboost-system-dev apt-get install -y libtbb-dev @@ -46,31 +46,29 @@ apt-get install -y libblosc-dev ``` ##### Building OpenVDB -``` +```bash git clone git@github.com:AcademySoftwareFoundation/openvdb.git cd openvdb mkdir build cd build cmake .. -make -j4 -make install +make -j4 && make install ``` #### macOS ##### Installing Dependencies (Boost, TBB, Blosc) -``` +```bash brew install boost brew install tbb brew install c-blosc ``` ##### Building OpenVDB -``` +```bash git clone git@github.com:AcademySoftwareFoundation/openvdb.git cd openvdb mkdir build cd build cmake .. -make -j4 -make install +make -j4 && make install ``` #### Windows ##### Installing Dependencies (Boost, TBB, Blosc) @@ -81,7 +79,7 @@ It is recommended to set the `VCPKG_DEFAULT_TRIPLET` environment variable to [Git](https://git-scm.com/downloads), [vcpkg](https://github.com/microsoft/vcpkg) and [CMake](https://cmake.org/download/) to be installed. -``` +```bash vcpkg install zlib:x64-windows vcpkg install blosc:x64-windows vcpkg install tbb:x64-windows @@ -93,7 +91,7 @@ vcpkg install boost-uuid:x64-windows vcpkg install boost-interprocess:x64-windows ``` ##### Building OpenVDB -``` +```bash git clone git@github.com:AcademySoftwareFoundation/openvdb.git cd openvdb mkdir build @@ -102,48 +100,42 @@ cmake -DCMAKE_TOOLCHAIN_FILE=\scripts\buildsystems\vcpkg.cmake -D cmake --build . --parallel 4 --config Release --target install ``` +#### Building OpenVDB AX + +OpenVDB AX depends on the core OpenVDB library. See the [build documentation](https://academysoftwarefoundation.github.io/openvdb/build.html) for all available AX component options: + +```bash +git clone git@github.com:AcademySoftwareFoundation/openvdb.git +cd openvdb +mkdir build +cd build +cmake -DOPENVDB_BUILD_AX=ON .. +make -j4 && make install +``` + #### Building NanoVDB -**First example: building NanoVDB and OpenVDB core** - -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): - ```console - foo@bar:~$ mkdir build - foo@bar:~$ cd build - foo@bar:~$ cmake .. -DUSE_NANOVDB=ON -DTBB_ROOT=/path/to/tbb -DBOOST_ROOT=/path/to/boost -DBLOSC_ROOT=/path/to/blosc -DCMAKE_INSTALL_PREFIX=/install/path - foo@bar:~$ make -j 4 && make install - ``` -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. - -**Second example: NanoVDB with no dependencies** - -From the 'root' OpenVDB project directory: - ```console - foo@bar:~$ mkdir build - foo@bar:~$ cd build - foo@bar:~$ cmake .. -DUSE_NANOVDB=ON -DOPENVDB_BUILD_CORE=OFF -DOPENVDB_BUILD_BINARIES=OFF -DNANOVDB_USE_TBB=OFF -DNANOVDB_USE_BLOSC=OFF -DNANOVDB_USE_ZLIB=OFF -DCMAKE_INSTALL_PREFIX=/install/path - foo@bar:~$ make -j 4 && make install - ``` - -Another option is to build it from the NanoVDB directory itself, which is much simpler: - ```console - foo@bar:~$ cd nanovdb/nanovdb - foo@bar:~$ mkdir build - foo@bar:~$ cd build - foo@bar:~$ cmake .. -DCMAKE_INSTALL_PREFIX=/install/path - foo@bar:~$ make -j 4 && make install - ``` -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. - -**Third example: build 'everything' in NanoVDB along with OpenVDB core** - -From the root OpenVDB directory: - ```console - foo@bar:~$ mkdir build - foo@bar:~$ cd build - foo@bar:~$ cmake .. -DUSE_NANOVDB=ON -DNANOVDB_BUILD_UNITTESTS=ON -DNANOVDB_BUILD_EXAMPLES=ON -DNANOVDB_BUILD_BENCHMARK=ON -DNANOVDB_USE_INTRINSICS=ON -DNANOVDB_USE_CUDA=ON -DNANOVDB_CUDA_KEEP_PTX=ON -DTBB_ROOT=/path/to/tbb -DBOOST_ROOT=/path/to/boost -DBLOSC_ROOT=/path/to/blosc -DGTEST_ROOT=/path/to/gtest -DCMAKE_INSTALL_PREFIX=/install/path - foo@bar:~$ make -j 4 && make install - ``` -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`. +NanoVDB can be built with and without OpenVDB support. To see full build instructions +see the [NanoVDB build documentation](https://academysoftwarefoundation.github.io/openvdb/NanoVDB_HowToBuild.html) + +#### Building Without OpenVDB Support + +```bash +git clone git@github.com:AcademySoftwareFoundation/openvdb.git +cd openvdb/nanovdb/nanovdb # Build from the subdirectory +mkdir build +cd build +cmake .. +make -j4 && make install +``` + +#### Building With OpenVDB Support + +```bash +git clone git@github.com:AcademySoftwareFoundation/openvdb.git +cd openvdb +mkdir build +cd build +cmake -DOPENVDB_BUILD_NANOVDB=ON .. +make -j4 && make install +``` diff --git a/cmake/config/OpenVDBBuildTypes.cmake b/cmake/config/OpenVDBBuildTypes.cmake index e353629df4..b367951ce5 100644 --- a/cmake/config/OpenVDBBuildTypes.cmake +++ b/cmake/config/OpenVDBBuildTypes.cmake @@ -153,7 +153,7 @@ add_compile_options("$<$,$,$>:-fno-omit-frame-pointer;-g;-O1>") add_compile_options("$<$,$>:-fsanitize-address-use-after-scope;-fno-optimize-sibling-calls>") # -fsanitize-address-use-after-scope added in GCC 7 -add_compile_options("$<$,$,$,7.0.0>>:-fsanitize-address-use-after-scope>") +add_compile_options("$<$,$,$,7.0.0>>:-fsanitize-address-use-after-scope>") add_link_options("$<$,$>:-fsanitize=address>") # LeakSanitizer diff --git a/doc/build.txt b/doc/build.txt index 48ad902cf4..31805aec07 100644 --- a/doc/build.txt +++ b/doc/build.txt @@ -191,6 +191,10 @@ OpenVDB AX Library | The OpenVDB AX library OpenVDB AX Binary | Command line binary for running OpenVDB AX code | OPENVDB_BUILD_AX_BINARIES | OFF | OpenVDB AX Grammar | Allows for re-generation of AX grammar, typically not required | OPENVDB_BUILD_AX_GRAMMAR | OFF | OpenVDB AX Unit Tests | OpenVDB AX's Unit Test suite | OPENVDB_BUILD_AX_UNITTESTS | OFF | +NanoVDB | NanoVDB headers | OPENVDB_BUILD_NANOVDB | OFF | +NanoVDB Tools | NanoVDB command line tools | NANOVDB_BUILD_TOOLS | OFF | +NanoVDB Examples | NanoVDB example binaries and benchmarks | NANOVDB_BUILD_EXAMPLES / NANOVDB_BUILD_BENCHMARK | OFF / OFF | +NanoVDB Unit Tests | NanoVDB Unit Test suite | NANOVDB_BUILD_UNITTESTS | OFF | Documentation | The OpenVDB doxygen documentation | OPENVDB_BUILD_DOCS | OFF | @@ -236,6 +240,7 @@ DCC | Supported Version | OpenVDB ABI | -------- | ----------------- | ----------- | Houdini | 18.0 | 6 | Houdini | 18.5 | 7 | +Houdini | 19.0 | 8 | Maya | 2017 | Any | Maya | 2018 | Any | Maya | 2019 | Any | diff --git a/doc/changes.txt b/doc/changes.txt index 15eb3241b5..5c7d5475cb 100644 --- a/doc/changes.txt +++ b/doc/changes.txt @@ -22,26 +22,12 @@ static sparse volumes in OpenVDB. See the for details. -@par -
-Faster build times from support for explicit template instantiation, -which is enabled by default for most of the tools. -
- -@par -
-Added support for OpenEXR 3. This is contributed by Cary Phillips. -
- -@par -
-Added transient data to the RootNode, InternalNode, and LeafNode. -
- @par New features: -- NanoVDB, which for the first time offers GPU support for static sparse volumes - in OpenVDB. +- Faster build times from support for explicit template instantiation, + which is enabled by default for most of the tools. +- Added support for OpenEXR 3 and TBB 2021. +- Added transient data to the RootNode, InternalNode, and LeafNode. @par Improvements: diff --git a/doc/dependencies.txt b/doc/dependencies.txt index c0e9b0d0dc..6cf4c50b97 100644 --- a/doc/dependencies.txt +++ b/doc/dependencies.txt @@ -44,6 +44,7 @@ OpenVDB Render | Core Library dependencies OpenVDB View | Core Library dependencies, OpenGL, GLFW3, GLEW* | - OpenVDB Python | Core Library dependencies, Python, Boost::python | Boost::numpy, NumPy OpenVDB AX | Core Library dependencies, LLVM | Bison, Flex +NanoVDB | - | Core Library, CUDA, TBB, Blosc, ZLib OpenVDB UnitTests | Core Library dependencies, GoogleTest | CppUnit** OpenVDB Documentation | Doxygen | - @@ -73,12 +74,13 @@ Python | 2.7 | 2.7 | The python interpreter and libraries fo NumPy | 1.14.0 | 1.14.0 | Scientific computing with Python | Y | Y | http://www.numpy.org GoogleTest | 1.10 | Latest | A unit testing framework module for C++ | Y | Y | https://github.com/google/googletest CppUnit | 1.10 | Latest | A unit testing framework module for C++ | N | Y | https://freedesktop.org/wiki/Software/cppunit -Blosc | 1.5.0* | 1.17.0 | Recommended dependency for improved disk compression | Y | Y | https://github.com/Blosc/c-blosc/releases +Blosc | 1.17.0* | 1.17.0 | Recommended dependency for improved disk compression | Y | Y | https://github.com/Blosc/c-blosc/releases Log4cplus | 1.1.2 | Latest | An optional dependency for improved OpenVDB Logging | Y | Y | https://github.com/log4cplus/log4cplus libpng | - | Latest | Library for manipulating PNG images | Y | Y | http://www.libpng.org/pub/png/libpng.html GLFW | 3.1 | Latest | Simple API for OpenGL development | Y | Y | https://www.glfw.org OpenGL | 3.2 | Latest | Environment for developing portable graphics applications | Y | Y | https://www.opengl.org GLEW | 1.0.0 | Latest | A cross-platform OpenGL extension loading library. | Y | Y | http://glew.sourceforge.net +CUDA | - | Latest | Parallel computing platform for graphical processing units. | Y | N | https://developer.nvidia.com/cuda-downloads Doxygen | 1.8.8 | 1.8.11 | Documentation generation from C++ | Y | Y | http://www.doxygen.nl - @b * See the note in [known issues](@ref depKnownIssues) regarding supported blosc versions. @@ -153,6 +155,8 @@ apt-get install googletest # GoogleTest apt-get install libglfw3-dev # GLFW # Documentation apt-get install doxygen # doxygen +# CUDA for NanoVDB +apt-get install nvidia-cuda-toolkit # CUDA @endcode @subsection depUsingHomebrew Using Homebrew diff --git a/openvdb/openvdb/CMakeLists.txt b/openvdb/openvdb/CMakeLists.txt index 1d5b75f667..cff5b6302f 100644 --- a/openvdb/openvdb/CMakeLists.txt +++ b/openvdb/openvdb/CMakeLists.txt @@ -717,12 +717,12 @@ if(OPENVDB_CORE_SHARED) ) endif() -install(FILES ${OPENVDB_LIBRARY_INCLUDE_FILES} DESTINATION ${OPENVDB_INSTALL_INCLUDEDIR}) -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/openvdb/version.h DESTINATION ${OPENVDB_INSTALL_INCLUDEDIR}) -install(FILES ${OPENVDB_LIBRARY_IO_INCLUDE_FILES} DESTINATION ${OPENVDB_INSTALL_INCLUDEDIR}/io) -install(FILES ${OPENVDB_LIBRARY_MATH_INCLUDE_FILES} DESTINATION ${OPENVDB_INSTALL_INCLUDEDIR}/math) -install(FILES ${OPENVDB_LIBRARY_POINTS_INCLUDE_FILES} DESTINATION ${OPENVDB_INSTALL_INCLUDEDIR}/points) -install(FILES ${OPENVDB_LIBRARY_TOOLS_INCLUDE_FILES} DESTINATION ${OPENVDB_INSTALL_INCLUDEDIR}/tools) -install(FILES ${OPENVDB_LIBRARY_TREE_INCLUDE_FILES} DESTINATION ${OPENVDB_INSTALL_INCLUDEDIR}/tree) -install(FILES ${OPENVDB_LIBRARY_UTIL_INCLUDE_FILES} DESTINATION ${OPENVDB_INSTALL_INCLUDEDIR}/util) -install(FILES ${OPENVDB_LIBRARY_THREAD_INCLUDE_FILES} DESTINATION ${OPENVDB_INSTALL_INCLUDEDIR}/thread) +install(FILES ${OPENVDB_LIBRARY_INCLUDE_FILES} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/openvdb) +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/openvdb/version.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/openvdb) +install(FILES ${OPENVDB_LIBRARY_IO_INCLUDE_FILES} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/openvdb/io) +install(FILES ${OPENVDB_LIBRARY_MATH_INCLUDE_FILES} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/openvdb/math) +install(FILES ${OPENVDB_LIBRARY_POINTS_INCLUDE_FILES} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/openvdb/points) +install(FILES ${OPENVDB_LIBRARY_TOOLS_INCLUDE_FILES} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/openvdb/tools) +install(FILES ${OPENVDB_LIBRARY_TREE_INCLUDE_FILES} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/openvdb/tree) +install(FILES ${OPENVDB_LIBRARY_UTIL_INCLUDE_FILES} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/openvdb/util) +install(FILES ${OPENVDB_LIBRARY_THREAD_INCLUDE_FILES} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/openvdb/thread) diff --git a/openvdb/openvdb/python/CMakeLists.txt b/openvdb/openvdb/python/CMakeLists.txt index 5e9141e8c7..2821efb5d5 100644 --- a/openvdb/openvdb/python/CMakeLists.txt +++ b/openvdb/openvdb/python/CMakeLists.txt @@ -262,7 +262,7 @@ install(TARGETS ${PYOPENVDB_INSTALL_DIRECTORY} ) -install(FILES ${PYTHON_PUBLIC_INCLUDE_NAMES} DESTINATION ${OPENVDB_INSTALL_INCLUDEDIR}/python) +install(FILES ${PYTHON_PUBLIC_INCLUDE_NAMES} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/openvdb/python) # pytest if(OPENVDB_BUILD_PYTHON_UNITTESTS) diff --git a/openvdb_ax/openvdb_ax/CMakeLists.txt b/openvdb_ax/openvdb_ax/CMakeLists.txt index ea8075eb83..a6bd469578 100644 --- a/openvdb_ax/openvdb_ax/CMakeLists.txt +++ b/openvdb_ax/openvdb_ax/CMakeLists.txt @@ -229,12 +229,12 @@ if(NOT LLVM_ENABLE_ASSERTIONS) # otherwise we get a missing symbol error from LLVM: # undefined reference to `llvm::cfg::Update::dump() const' list(APPEND OPENVDB_AX_PUBLIC_DEFINES - "$<$,$,$,$>>:NDEBUG>") + "$<$,$>:NDEBUG>") endif() if(NOT LLVM_ENABLE_RTTI) # If llvm has been built without rtti, disable the vptr sanitizer for AX list(APPEND OPENVDB_AX_PUBLIC_OPTIONS - "$<$,$,$,$>>:-fno-sanitize=vptr>") + "$<$,$>:-fno-sanitize=vptr>") endif() if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")