Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[openvdb] Add nanovdb feature #34224

Merged
merged 8 commits into from
Oct 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions ports/openvdb/fix_nanovdb.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
diff --git a/nanovdb/nanovdb/CMakeLists.txt b/nanovdb/nanovdb/CMakeLists.txt
index d20b4928..257d005a 100644
--- a/nanovdb/nanovdb/CMakeLists.txt
+++ b/nanovdb/nanovdb/CMakeLists.txt
@@ -128,7 +128,7 @@ if(NANOVDB_USE_TBB AND NOT TARGET TBB::tbb)
endif()

if(NANOVDB_USE_BLOSC AND NOT TARGET Blosc::blosc)
BillyONeal marked this conversation as resolved.
Show resolved Hide resolved
- find_package(Blosc REQUIRED)
+ find_package(Blosc REQUIRED NAMES blosc)
endif()

if(NANOVDB_USE_ZLIB AND NOT TARGET ZLIB::ZLIB)
@@ -224,7 +224,7 @@ if(NANOVDB_USE_TBB)
endif()

if(NANOVDB_USE_BLOSC)
- target_link_libraries(nanovdb INTERFACE Blosc::blosc)
+ target_link_libraries(nanovdb INTERFACE $<IF:$<TARGET_EXISTS:blosc_shared>,blosc_shared,blosc_static>)
target_compile_definitions(nanovdb INTERFACE -DNANOVDB_USE_BLOSC)
endif()

16 changes: 15 additions & 1 deletion ports/openvdb/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ vcpkg_from_github(
SHA512 92301bf675d700fedb0a2b3c4653158eeda6105e70623e5e4bda15d73391427cf0295a0426204888e2fe062847025542717bff34ceb923e51cffa1721e9d4105
PATCHES
0003-fix-cmake.patch
fix_nanovdb.patch
)

file(REMOVE "${SOURCE_PATH}/cmake/FindTBB.cmake")
Expand All @@ -20,8 +21,19 @@ vcpkg_check_features(
FEATURES
"tools" OPENVDB_BUILD_TOOLS
"ax" OPENVDB_BUILD_AX
"nanovdb" OPENVDB_BUILD_NANOVDB
)

if (OPENVDB_BUILD_NANOVDB)
set(NANOVDB_OPTIONS
-DNANOVDB_BUILD_TOOLS=OFF
-DNANOVDB_USE_INTRINSICS=ON
-DNANOVDB_USE_CUDA=ON
eclipse0922 marked this conversation as resolved.
Show resolved Hide resolved
-DNANOVDB_CUDA_KEEP_PTX=ON
-DNANOVDB_USE_OPENVDB=ON
)
endif()

vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
Expand All @@ -37,10 +49,12 @@ vcpkg_cmake_configure(
-DOPENVDB_BUILD_VDB_RENDER=${OPENVDB_BUILD_TOOLS}
-DOPENVDB_BUILD_VDB_LOD=${OPENVDB_BUILD_TOOLS}
-DUSE_PKGCONFIG=OFF
-DOPENVDB_BUILD_AX=${OPENVDB_BUILD_AX}
${FEATURE_OPTIONS}
-DUSE_EXPLICIT_INSTANTIATION=OFF
${NANOVDB_OPTIONS}
MAYBE_UNUSED_VARIABLES
OPENVDB_3_ABI_COMPATIBLE
OPENVDB_BUILD_TOOLS
)

vcpkg_cmake_install()
Expand Down
8 changes: 7 additions & 1 deletion ports/openvdb/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "openvdb",
"version": "10.0.0",
"port-version": 5,
"port-version": 6,
"description": "Sparse volume data structure and tools",
"homepage": "https://github.com/dreamworksanimation/openvdb",
"license": "MPL-2.0",
Expand Down Expand Up @@ -39,6 +39,12 @@
}
]
},
"nanovdb": {
"description": "A lightweight GPU friendly version of VDB initially targeting rendering applications",
"dependencies": [
"cuda"
]
},
"tools": {
"description": "OpenVDB utilities: view, print and render",
"dependencies": [
Expand Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -6194,7 +6194,7 @@
},
"openvdb": {
"baseline": "10.0.0",
"port-version": 5
"port-version": 6
},
"openvino": {
"baseline": "2023.1.0",
Expand Down
5 changes: 5 additions & 0 deletions versions/o-/openvdb.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "8565eefd07d9a9d108cec2545039261b53d2e3b1",
"version": "10.0.0",
"port-version": 6
},
{
"git-tree": "6200720b464b3cc005edd767613f3978f614a32f",
"version": "10.0.0",
Expand Down