diff options
author | 2023-12-08 15:36:04 +0100 | |
---|---|---|
committer | 2024-02-20 15:12:10 +0200 | |
commit | 9ec9ce46d4e4a91169d9985976f683d5106de67d (patch) | |
tree | 8e869e447d672cda0937b495c6f5f26a642ac045 /media-gfx/openvdb/files | |
parent | dev-python/orjson: Fix copyright header (diff) | |
download | gentoo-9ec9ce46d4e4a91169d9985976f683d5106de67d.tar.gz gentoo-9ec9ce46d4e4a91169d9985976f683d5106de67d.tar.bz2 gentoo-9ec9ce46d4e4a91169d9985976f683d5106de67d.zip |
media-gfx/openvdb: add 11.0.0
Automatically detects working host compiler for CUDA.
Automatically detects host CUDA arch, can be overridden by setting CUDAARCHS env var.
Re-enabled ax requiring <=llvm-15.
Modified NanoVDB.h so Blender can decern the NanoVDB version and include the correct header.
Closes: https://bugs.gentoo.org/664796
Closes: https://bugs.gentoo.org/686824
Closes: https://bugs.gentoo.org/831043
Closes: https://bugs.gentoo.org/833168
Closes: https://bugs.gentoo.org/921246
Signed-off-by: Paul Zander <negril.nx+gentoo@gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/34564
Signed-off-by: Joonas Niilola <juippis@gentoo.org>
Diffstat (limited to 'media-gfx/openvdb/files')
-rw-r--r-- | media-gfx/openvdb/files/openvdb-11.0.0-cmake_fixes.patch | 84 | ||||
-rw-r--r-- | media-gfx/openvdb/files/openvdb-11.0.0-constexpr-version.patch | 55 |
2 files changed, 139 insertions, 0 deletions
diff --git a/media-gfx/openvdb/files/openvdb-11.0.0-cmake_fixes.patch b/media-gfx/openvdb/files/openvdb-11.0.0-cmake_fixes.patch new file mode 100644 index 000000000000..491a3781ba7c --- /dev/null +++ b/media-gfx/openvdb/files/openvdb-11.0.0-cmake_fixes.patch @@ -0,0 +1,84 @@ +From: Paul Zander <negril.nx+gentoo@gmail.com> + +remove redundant Find*.cmake files +use CMake 3.20 GTest targets for nanovdb +change vdb_ax_test WORKING_DIRECTORY so testfiles can be found +fix syntax for OpenVDBCXX.cmake + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 9ecdaef..9dd416e 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -287,9 +287,7 @@ if(OPENVDB_INSTALL_CMAKE_MODULES) + cmake/FindBlosc.cmake + cmake/FindJemalloc.cmake + cmake/FindLog4cplus.cmake +- cmake/FindOpenEXR.cmake + cmake/FindOpenVDB.cmake +- cmake/FindTBB.cmake + cmake/OpenVDBGLFW3Setup.cmake + cmake/OpenVDBHoudiniSetup.cmake + cmake/OpenVDBMayaSetup.cmake +diff --git a/nanovdb/nanovdb/unittest/CMakeLists.txt b/nanovdb/nanovdb/unittest/CMakeLists.txt +index b0a32be..4d294f4 100644 +--- a/nanovdb/nanovdb/unittest/CMakeLists.txt ++++ b/nanovdb/nanovdb/unittest/CMakeLists.txt +@@ -20,7 +20,7 @@ message(STATUS "----------------------------------------------------") + + ############################################################################### + # TODO: Benchmark should probably not require gtest. +-if(NOT TARGET GTest::GTest) ++if(NOT TARGET GTest::gtest_main) + message(WARNING " - GTest required to build unittests. Skipping.") + return() + endif() +@@ -36,14 +36,14 @@ file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/data") + # ----------------------------------------------------------------------------- + + add_executable(nanovdb_test_nanovdb "TestNanoVDB.cc") +-target_link_libraries(nanovdb_test_nanovdb PRIVATE nanovdb GTest::GTest GTest::Main) ++target_link_libraries(nanovdb_test_nanovdb PRIVATE nanovdb GTest::gtest GTest::gtest_main) + add_test(nanovdb_unit_test nanovdb_test_nanovdb) + + # ----------------------------------------------------------------------------- + + if(NANOVDB_USE_CUDA) + add_executable(nanovdb_test_cuda "TestNanoVDB.cu") +- target_link_libraries(nanovdb_test_cuda PRIVATE nanovdb GTest::GTest GTest::Main) ++ target_link_libraries(nanovdb_test_cuda PRIVATE nanovdb GTest::gtest GTest::gtest_main) + add_test(nanovdb_cuda_unit_test nanovdb_test_cuda) + endif() + +@@ -55,5 +55,5 @@ if(NOT (NANOVDB_USE_TBB AND NANOVDB_USE_OPENVDB)) + endif() + + add_executable(nanovdb_test_openvdb "TestOpenVDB.cc") +-target_link_libraries(nanovdb_test_openvdb PRIVATE nanovdb GTest::GTest GTest::Main) ++target_link_libraries(nanovdb_test_openvdb PRIVATE nanovdb GTest::gtest GTest::gtest_main) + add_test(nanovdb_openvdb_unit_test nanovdb_test_openvdb) +diff --git a/openvdb_ax/openvdb_ax/test/CMakeLists.txt b/openvdb_ax/openvdb_ax/test/CMakeLists.txt +index e403f71..91774f8 100644 +--- a/openvdb_ax/openvdb_ax/test/CMakeLists.txt ++++ b/openvdb_ax/openvdb_ax/test/CMakeLists.txt +@@ -131,7 +131,7 @@ if(OPENVDB_AX_TEST_PROFILE) + target_compile_definitions(vdb_ax_test PRIVATE "-DPROFILE") + endif() + +-add_test(NAME vdb_ax_unit_test COMMAND vdb_ax_test -v WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/../) ++add_test(NAME vdb_ax_unit_test COMMAND vdb_ax_test -v WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) + + # For the undefined behaviour sanitizer, add the suppression file and + # additional options +diff --git a/cmake/config/OpenVDBCXX.cmake b/cmake/config/OpenVDBCXX.cmake +index 5ad5d18..a6c4ebe 100644 +--- a/cmake/config/OpenVDBCXX.cmake ++++ b/cmake/config/OpenVDBCXX.cmake +@@ -252,7 +252,7 @@ set(EXTRA_BUILD_TYPES coverage tsan asan lsan msan ubsan) + # DebugNoInfo - An internal build type only used by the OpenVDB CI. no optimizations, no symbols, asserts enabled + set(CMAKE_CXX_FLAGS_DebugNoInfo "" CACHE STRING "Flags used by the C++ compiler during DebugNoInfo builds.") + +-foreach(TYPE ${EXTRA_BUILD_TYPES}) ++foreach(TYPE IN LISTS EXTRA_BUILD_TYPES) + set(CMAKE_CXX_FLAGS_${U_TYPE} "" CACHE STRING "Flags used by the C++ compiler during ${TYPE} builds.") + set(CMAKE_SHARED_LINKER_FLAGS_${U_TYPE} "" CACHE STRING "Flags used by the linker during ${TYPE} builds.") + set(CMAKE_EXE_LINKER_FLAGS_${U_TYPE} "" CACHE STRING "Flags used by the linker during ${TYPE} builds.") diff --git a/media-gfx/openvdb/files/openvdb-11.0.0-constexpr-version.patch b/media-gfx/openvdb/files/openvdb-11.0.0-constexpr-version.patch new file mode 100644 index 000000000000..17377a411d2c --- /dev/null +++ b/media-gfx/openvdb/files/openvdb-11.0.0-constexpr-version.patch @@ -0,0 +1,55 @@ +From: Paul Zander <negril.nx+gentoo@gmail.com> + +make Version constexpr so it can be used to decern the API at runtime (see Blender) + +--- a/nanovdb/nanovdb/NanoVDB.h 2023-11-23 15:03:52.227292525 +0100 ++++ b/nanovdb/nanovdb/NanoVDB.h 2023-11-23 15:05:10.508818683 +0100 +@@ -948,34 +948,34 @@ + { + uint32_t mData; // 11 + 11 + 10 bit packing of major + minor + patch + public: +- __hostdev__ Version() ++ __hostdev__ constexpr Version() + : mData(uint32_t(NANOVDB_MAJOR_VERSION_NUMBER) << 21 | + uint32_t(NANOVDB_MINOR_VERSION_NUMBER) << 10 | + uint32_t(NANOVDB_PATCH_VERSION_NUMBER)) + { + } +- __hostdev__ Version(uint32_t data) : mData(data) {} +- __hostdev__ Version(uint32_t major, uint32_t minor, uint32_t patch) ++ __hostdev__ constexpr Version(uint32_t data) : mData(data) {} ++ __hostdev__ constexpr Version(uint32_t major, uint32_t minor, uint32_t patch) + : mData(major << 21 | minor << 10 | patch) + { + NANOVDB_ASSERT(major < (1u << 11)); // max value of major is 2047 + NANOVDB_ASSERT(minor < (1u << 11)); // max value of minor is 2047 + NANOVDB_ASSERT(patch < (1u << 10)); // max value of patch is 1023 + } +- __hostdev__ bool operator==(const Version& rhs) const { return mData == rhs.mData; } +- __hostdev__ bool operator<( const Version& rhs) const { return mData < rhs.mData; } +- __hostdev__ bool operator<=(const Version& rhs) const { return mData <= rhs.mData; } +- __hostdev__ bool operator>( const Version& rhs) const { return mData > rhs.mData; } +- __hostdev__ bool operator>=(const Version& rhs) const { return mData >= rhs.mData; } +- __hostdev__ uint32_t id() const { return mData; } +- __hostdev__ uint32_t getMajor() const { return (mData >> 21) & ((1u << 11) - 1); } +- __hostdev__ uint32_t getMinor() const { return (mData >> 10) & ((1u << 11) - 1); } +- __hostdev__ uint32_t getPatch() const { return mData & ((1u << 10) - 1); } +- __hostdev__ bool isCompatible() const { return this->getMajor() == uint32_t(NANOVDB_MAJOR_VERSION_NUMBER);} ++ __hostdev__ constexpr bool operator==(const Version& rhs) const { return mData == rhs.mData; } ++ __hostdev__ constexpr bool operator<( const Version& rhs) const { return mData < rhs.mData; } ++ __hostdev__ constexpr bool operator<=(const Version& rhs) const { return mData <= rhs.mData; } ++ __hostdev__ constexpr bool operator>( const Version& rhs) const { return mData > rhs.mData; } ++ __hostdev__ constexpr bool operator>=(const Version& rhs) const { return mData >= rhs.mData; } ++ __hostdev__ constexpr uint32_t id() const { return mData; } ++ __hostdev__ constexpr uint32_t getMajor() const { return (mData >> 21) & ((1u << 11) - 1); } ++ __hostdev__ constexpr uint32_t getMinor() const { return (mData >> 10) & ((1u << 11) - 1); } ++ __hostdev__ constexpr uint32_t getPatch() const { return mData & ((1u << 10) - 1); } ++ __hostdev__ constexpr bool isCompatible() const { return this->getMajor() == uint32_t(NANOVDB_MAJOR_VERSION_NUMBER);} + /// @brief Check the major version of this instance relative to NANOVDB_MAJOR_VERSION_NUMBER + /// @return return 0 if the major version equals NANOVDB_MAJOR_VERSION_NUMBER, else a negative age if it is + /// older, i.e. smaller, and a positive age if it's newer, i.e.e larger. +- __hostdev__ int age() const {return int(this->getMajor()) - int(NANOVDB_MAJOR_VERSION_NUMBER);} ++ __hostdev__ constexpr int age() const {return int(this->getMajor()) - int(NANOVDB_MAJOR_VERSION_NUMBER);} + + #ifndef __CUDACC_RTC__ + const char* c_str() const |