commit: 30026dbff7043a9061e76cc827eca5891a6b8ce3 Author: Paul Zander <negril.nx+gentoo <AT> gmail <DOT> com> AuthorDate: Thu May 1 19:46:24 2025 +0000 Commit: Sam James <sam <AT> gentoo <DOT> org> CommitDate: Thu May 8 06:26:54 2025 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=30026dbf
media-gfx/openvdb: add 12.0.1 Closes: https://bugs.gentoo.org/952522 Closes: https://bugs.gentoo.org/949649 Bug: https://bugs.gentoo.org/934813 Closes: https://bugs.gentoo.org/928153 Closes: https://bugs.gentoo.org/926205 Signed-off-by: Paul Zander <negril.nx+gentoo <AT> gmail.com> Part-of: https://github.com/gentoo/gentoo/pull/41967 Signed-off-by: Sam James <sam <AT> gentoo.org> media-gfx/openvdb/Manifest | 1 + ....0.0-fix-linking-of-vdb_tool-with-OpenEXR.patch | 26 + ...b-12.0.0-loosen-float-equality-tolerances.patch | 45 ++ .../openvdb-12.0.0-remove-c-style-casts.patch | 26 + media-gfx/openvdb/metadata.xml | 6 + media-gfx/openvdb/openvdb-12.0.1.ebuild | 552 +++++++++++++++++++++ profiles/arch/arm/package.use.mask | 5 + profiles/arch/arm64/package.use.mask | 4 + profiles/arch/powerpc/ppc32/package.use.mask | 1 + profiles/arch/powerpc/ppc64/package.use.mask | 6 + profiles/arch/riscv/package.use.mask | 6 + profiles/arch/x86/package.use.mask | 4 + profiles/features/big-endian/use.mask | 4 + 13 files changed, 686 insertions(+) diff --git a/media-gfx/openvdb/Manifest b/media-gfx/openvdb/Manifest index 05f3290b9538..6ee3d7a31be3 100644 --- a/media-gfx/openvdb/Manifest +++ b/media-gfx/openvdb/Manifest @@ -1,2 +1,3 @@ DIST openvdb-11.0.0-drop-obsolete-isActive-gcc15.patch 3410 BLAKE2B ac63f3bd72891bdc2f51eccceb37fb7077e215edd8474457618f5b49c5603fdbb68ed6a80ce18e0c55107beb10d7517b88c9995c3326520a644c339025bbcc2e SHA512 393d47f98240d1340660461cc4d0bc4882d404302c5944a60e9fa1269bc07060f386280cd617232fffe788ac05a74f88fe2b5f6420b4b2393a1d82bd7fc6a465 DIST openvdb-11.0.0.tar.gz 4620858 BLAKE2B b970167fffa10f28f89c0a3497c7a6076462702c7ede6aacc098239a81f5f09f408b56c37f84ea68e301cedff24920f02a6d08c1f00a2b9ca48925ef7cdc85c7 SHA512 f2c90ca8435ecbacefda429341000ecb555385c746a3e0233220cd78540cee2a26cc17df7b560fdfe2dc03f2b2e960a2fa226a85980189c3e018164ccc037bd4 +DIST openvdb-12.0.1.tar.gz 4708771 BLAKE2B 424f3ccd4f0db741cd0b6fa0fa7eced1d806116f00875ffb2882efe2c2798a0f15b170e0e58d08f9530a58d4af53cae7eae60f247cb027ef6673cc4ab534d30b SHA512 67b859bf77c53e68116faa7915bb6a5a50a8cff10435762890e13348625e8aebdb6661b722017632471648afe31e2f9d4cd2e18456c728192bfd0accd70a40ef diff --git a/media-gfx/openvdb/files/openvdb-12.0.0-fix-linking-of-vdb_tool-with-OpenEXR.patch b/media-gfx/openvdb/files/openvdb-12.0.0-fix-linking-of-vdb_tool-with-OpenEXR.patch new file mode 100644 index 000000000000..32d34a655f45 --- /dev/null +++ b/media-gfx/openvdb/files/openvdb-12.0.0-fix-linking-of-vdb_tool-with-OpenEXR.patch @@ -0,0 +1,26 @@ +From 2b6195c6dc479692aa5b7b07356d788b3dd21596 Mon Sep 17 00:00:00 2001 +From: Bernd Waibel <[email protected]> +Date: Mon, 5 Dec 2022 07:19:51 +0100 +Subject: [PATCH] fix linking of vdb_tool with OpenEXR + +This patch is Gentoo specific. Ideally it should respect the OpenEXR version +being installed. Because we only support OpenEXR-3 for OpenVDB, the patch +works on Gentoo, but not on setups where OpenEXR-2 is still being used to +build OpenVDB. + +Bug: https://github.com/AcademySoftwareFoundation/openvdb/issues/1541 +Signed-off-by: Bernd Waibel <[email protected]> +--- a/openvdb_cmd/vdb_tool/CMakeLists.txt ++++ b/openvdb_cmd/vdb_tool/CMakeLists.txt +@@ -108,7 +108,7 @@ endif() + if(OPENVDB_TOOL_USE_EXR) + target_compile_definitions(vdb_tool_common INTERFACE "VDB_TOOL_USE_EXR") + find_package(OpenEXR ${MINIMUM_OPENEXR_VERSION} REQUIRED) +- target_link_libraries(vdb_tool_common INTERFACE OpenEXR::IlmImf) ++ target_link_libraries(vdb_tool_common INTERFACE OpenEXR::OpenEXR) + endif() + + if(OPENVDB_TOOL_USE_ABC) +-- +2.38.1 + diff --git a/media-gfx/openvdb/files/openvdb-12.0.0-loosen-float-equality-tolerances.patch b/media-gfx/openvdb/files/openvdb-12.0.0-loosen-float-equality-tolerances.patch new file mode 100644 index 000000000000..e201677adb3c --- /dev/null +++ b/media-gfx/openvdb/files/openvdb-12.0.0-loosen-float-equality-tolerances.patch @@ -0,0 +1,45 @@ +From b2c1bf2ad677997689b3d57cc01c5876e11fd2a0 Mon Sep 17 00:00:00 2001 +From: Paul Zander <[email protected]> +Date: Fri, 10 Jan 2025 23:23:07 +0100 +Subject: [PATCH] loosen float equality tolerances + +Signed-off-by: Paul Zander <[email protected]> + +diff --git a/nanovdb/nanovdb/unittest/TestNanoVDB.cc b/nanovdb/nanovdb/unittest/TestNanoVDB.cc +index 33e120c..7be2480 100644 +--- a/nanovdb/nanovdb/unittest/TestNanoVDB.cc ++++ b/nanovdb/nanovdb/unittest/TestNanoVDB.cc +@@ -5458,7 +5458,7 @@ TEST_F(TestNanoVDB, ScalarSampleFromVoxels) + //std::cerr << "2'th order: v = " << sampler2(xyz) << std::endl; + EXPECT_NEAR(exact, sampler2(xyz), 1e-4); + //std::cerr << "3'rd order: v = " << sampler3(xyz) << std::endl; +- EXPECT_NEAR(exact, sampler3(xyz), 1e-5); ++ EXPECT_NEAR(exact, sampler3(xyz), 2e-5); + + EXPECT_FALSE(sampler1.zeroCrossing()); + const auto gradIndex = sampler1.gradient(xyz); //in index space +diff --git a/openvdb/openvdb/unittest/TestPointRasterizeFrustum.cc b/openvdb/openvdb/unittest/TestPointRasterizeFrustum.cc +index 9d0d1ff..3e93032 100644 +--- a/openvdb/openvdb/unittest/TestPointRasterizeFrustum.cc ++++ b/openvdb/openvdb/unittest/TestPointRasterizeFrustum.cc +@@ -33,7 +33,7 @@ public: + + TEST_F(TestPointRasterizeFrustum, testScaleByVoxelVolume) + { +- const double tolerance = 1.0e-6; ++ const double tolerance = 2.0e-4; + + // four our of five positions live in (0,0,0) voxels + +@@ -312,7 +312,7 @@ TEST_F(TestPointRasterizeFrustum, testScaleByVoxelVolume) + + TEST_F(TestPointRasterizeFrustum, testPointRasterization) + { +- const double tolerance = 1.0e-5; ++ const double tolerance = 2.0e-5; + + // four our of five positions live in (0,0,0) voxels + +-- +2.47.1 + diff --git a/media-gfx/openvdb/files/openvdb-12.0.0-remove-c-style-casts.patch b/media-gfx/openvdb/files/openvdb-12.0.0-remove-c-style-casts.patch new file mode 100644 index 000000000000..fabf7c4430cf --- /dev/null +++ b/media-gfx/openvdb/files/openvdb-12.0.0-remove-c-style-casts.patch @@ -0,0 +1,26 @@ +From bb599c155929dad1838288d124f2dbc63b8389a9 Mon Sep 17 00:00:00 2001 +From: Paul Zander <[email protected]> +Date: Sat, 11 Jan 2025 17:22:43 +0100 +Subject: [PATCH] remove c-style casts + +Signed-off-by: Paul Zander <[email protected]> + +diff --git a/nanovdb/nanovdb/PNanoVDB.h b/nanovdb/nanovdb/PNanoVDB.h +index 3e7b306..6f9a9b6 100644 +--- a/nanovdb/nanovdb/PNanoVDB.h ++++ b/nanovdb/nanovdb/PNanoVDB.h +@@ -348,9 +348,9 @@ PNANOVDB_FORCE_INLINE pnanovdb_int64_t pnanovdb_uint64_as_int64(pnanovdb_uint64_ + PNANOVDB_FORCE_INLINE pnanovdb_uint64_t pnanovdb_int64_as_uint64(pnanovdb_int64_t v) { return (pnanovdb_uint64_t)v; } + PNANOVDB_FORCE_INLINE pnanovdb_uint32_t pnanovdb_int32_as_uint32(pnanovdb_int32_t v) { return (pnanovdb_uint32_t)v; } + PNANOVDB_FORCE_INLINE float pnanovdb_uint32_as_float(pnanovdb_uint32_t v) { float vf; pnanovdb_memcpy(&vf, &v, sizeof(vf)); return vf; } +-PNANOVDB_FORCE_INLINE pnanovdb_uint32_t pnanovdb_float_as_uint32(float v) { return *((pnanovdb_uint32_t*)(&v)); } ++PNANOVDB_FORCE_INLINE pnanovdb_uint32_t pnanovdb_float_as_uint32(float v) { pnanovdb_uint32_t vf; pnanovdb_memcpy(&vf, &v, sizeof(vf)); return vf; } + PNANOVDB_FORCE_INLINE double pnanovdb_uint64_as_double(pnanovdb_uint64_t v) { double vf; pnanovdb_memcpy(&vf, &v, sizeof(vf)); return vf; } +-PNANOVDB_FORCE_INLINE pnanovdb_uint64_t pnanovdb_double_as_uint64(double v) { return *((pnanovdb_uint64_t*)(&v)); } ++PNANOVDB_FORCE_INLINE pnanovdb_uint64_t pnanovdb_double_as_uint64(double v) { pnanovdb_uint64_t vf; pnanovdb_memcpy(&vf, &v, sizeof(vf)); return vf; } + PNANOVDB_FORCE_INLINE pnanovdb_uint32_t pnanovdb_uint64_low(pnanovdb_uint64_t v) { return (pnanovdb_uint32_t)v; } + PNANOVDB_FORCE_INLINE pnanovdb_uint32_t pnanovdb_uint64_high(pnanovdb_uint64_t v) { return (pnanovdb_uint32_t)(v >> 32u); } + PNANOVDB_FORCE_INLINE pnanovdb_uint64_t pnanovdb_uint32_as_uint64(pnanovdb_uint32_t x, pnanovdb_uint32_t y) { return ((pnanovdb_uint64_t)x) | (((pnanovdb_uint64_t)y) << 32u); } +-- +2.47.1 + diff --git a/media-gfx/openvdb/metadata.xml b/media-gfx/openvdb/metadata.xml index 783bb8e73f1d..c74d499d96a3 100644 --- a/media-gfx/openvdb/metadata.xml +++ b/media-gfx/openvdb/metadata.xml @@ -15,6 +15,9 @@ Chance of Meatballs2' and 'How to Train Your Dragon 2'. </longdescription> <use> + <flag name="abi13-compat"> + Disables newer features to maintain compatibility with ABI13 + </flag> <flag name="abi12-compat"> Disables newer features to maintain compatibility with ABI12 </flag> @@ -47,6 +50,9 @@ <flag name="numpy"> Build pyopenvdb with support for <pkg>dev-python/numpy</pkg> </flag> + <flag name="pdal"> + Enable support for PDAL for point clouds via <pkg>sci-libs/pdal</pkg> + </flag> <flag name="utils"> Build utility binaries </flag> diff --git a/media-gfx/openvdb/openvdb-12.0.1.ebuild b/media-gfx/openvdb/openvdb-12.0.1.ebuild new file mode 100644 index 000000000000..3406b44270ab --- /dev/null +++ b/media-gfx/openvdb/openvdb-12.0.1.ebuild @@ -0,0 +1,552 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +# TODO +# drop OPENVDB_SIMD +# split out nanovdb + +PYTHON_COMPAT=( python3_{11..13} ) + +inherit cmake cuda flag-o-matic python-single-r1 toolchain-funcs + +DESCRIPTION="Library for the efficient manipulation of volumetric data" +HOMEPAGE="https://www.openvdb.org" + +if [[ "${PV}" == *9999* ]] ; then + LLVM_COMPAT=( 15 ) + inherit llvm-r2 + EGIT_REPO_URI="https://github.com/AcademySoftwareFoundation/${PN}.git" +else + SRC_URI=" + https://github.com/AcademySoftwareFoundation/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz + " + KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~riscv ~x86" +fi + +LICENSE="MPL-2.0" +OPENVDB_ABI=$(ver_cut 1) +SLOT="0/$(ver_cut 1-2)" + +CPU_FEATURES_X86=( + avx:avx + sse4_2:sse4_2 +) +CPU_FEATURES_ARM=( + neon:neon +) +CPU_FEATURES=( + "${CPU_FEATURES_X86[@]/#/cpu_flags_x86_}" + "${CPU_FEATURES_ARM[@]/#/cpu_flags_arm_}" +) + +IUSE=" + abi$((OPENVDB_ABI + 1))-compat + +abi${OPENVDB_ABI}-compat + abi$((OPENVDB_ABI - 1))-compat + abi$((OPENVDB_ABI - 2))-compat + + ${CPU_FEATURES[*]%:*} + alembic +blosc cuda doc examples jpeg +nanovdb numpy openexr pdal png python static-libs test utils +zlib +" + +if [[ "${PV}" == *9999* ]] ; then +IUSE+=" ax" +fi +RESTRICT="!test? ( test )" + +REQUIRED_USE=" + ?? ( + abi$((OPENVDB_ABI + 1))-compat + abi${OPENVDB_ABI}-compat + abi$((OPENVDB_ABI - 1))-compat + abi$((OPENVDB_ABI - 2))-compat + ) + cpu_flags_x86_avx? ( cpu_flags_x86_sse4_2 ) + python? ( ${PYTHON_REQUIRED_USE} ) + blosc? ( zlib ) + test? ( + nanovdb? ( + blosc + ) + ) +" + +# OPTDEPEND=( +# dev-util/gcovr +# ) + +RDEPEND=" + >=dev-cpp/tbb-2020.3:= + dev-libs/boost:= + dev-libs/jemalloc:= + blosc? ( + dev-libs/c-blosc:= + ) + nanovdb? ( + cuda? ( + dev-util/nvidia-cuda-toolkit + ) + python? ( ${PYTHON_DEPS} + $(python_gen_cond_dep ' + dev-python/nanobind[${PYTHON_USEDEP}] + ') + ) + ) + openexr? ( >=media-libs/openexr-3:= ) + python? ( + ${PYTHON_DEPS} + $(python_gen_cond_dep ' + dev-libs/boost:=[numpy?,${PYTHON_USEDEP}] + dev-python/nanobind[${PYTHON_USEDEP}] + numpy? ( dev-python/numpy[${PYTHON_USEDEP}] ) + ') + ) + utils? ( + media-libs/glfw + media-libs/glu + alembic? ( media-gfx/alembic ) + jpeg? ( media-libs/libjpeg-turbo:= ) + pdal? ( sci-libs/pdal:= ) + png? ( media-libs/libpng:= ) + openexr? ( >=media-libs/openexr-3:= ) + media-libs/libglvnd[X] + ) + zlib? ( + sys-libs/zlib:= + ) +" + +if [[ "${PV}" == *9999* ]] ; then +RDEPEND+=" + ax? ( + $(llvm_gen_dep ' + llvm-core/llvm:${LLVM_SLOT}= + ') + ) + !ax? ( + dev-libs/log4cplus:= + ) +" +else + RDEPEND+=" + dev-libs/log4cplus:= + " +fi + +DEPEND="${RDEPEND} + utils? ( + openexr? ( + dev-libs/imath:= + ) + ) +" +BDEPEND=" + virtual/pkgconfig + doc? ( + app-text/doxygen + dev-texlive/texlive-bibtexextra + dev-texlive/texlive-fontsextra + dev-texlive/texlive-fontutils + dev-texlive/texlive-latex + dev-texlive/texlive-latexextra + ) + test? ( + dev-cpp/gtest + dev-util/cppunit + ) +" + +PATCHES=( + "${FILESDIR}/${PN}-8.1.0-glfw-libdir.patch" + + "${FILESDIR}/${PN}-9.0.0-fix-atomic.patch" + + "${FILESDIR}/${PN}-10.0.1-log4cplus-version.patch" + + "${FILESDIR}/${PN}-11.0.0-cmake_fixes.patch" + + "${FILESDIR}/${PN}-12.0.0-fix-linking-of-vdb_tool-with-OpenEXR.patch" + "${FILESDIR}/${PN}-12.0.0-loosen-float-equality-tolerances.patch" + "${FILESDIR}/${PN}-12.0.0-remove-c-style-casts.patch" +) + +cuda_get_host_compiler() { + if [[ -v NVCC_CCBIN ]]; then + echo "${NVCC_CCBIN}" + return + fi + + if [[ -v CUDAHOSTCXX ]]; then + echo "${CUDAHOSTCXX}" + return + fi + + einfo "Trying to find working CUDA host compiler" + + if ! tc-is-gcc && ! tc-is-clang; then + die "$(tc-get-compiler-type) compiler is not supported (use gcc or clang)" + fi + + local compiler compiler_type compiler_version + local package package_version + local NVCC_CCBIN_default + + compiler_type="$(tc-get-compiler-type)" + compiler_version="$("${compiler_type}-major-version")" + + # try the default compiler first + NVCC_CCBIN="$(tc-getCXX)" + NVCC_CCBIN_default="${NVCC_CCBIN}-${compiler_version}" + + compiler="${NVCC_CCBIN/%-${compiler_version}}" + + # store the package so we can re-use it later + package="sys-devel/${compiler_type}" + package_version="${package}" + + ebegin "testing ${NVCC_CCBIN_default} (default)" + + while ! nvcc -v -ccbin "${NVCC_CCBIN}" - -x cu <<<"int main(){}" &>> "${T}/cuda_get_host_compiler.log" ; do + eend 1 + + while true; do + # prepare next version + if ! package_version="<$(best_version "${package_version}")"; then + die "could not find a supported version of ${compiler}" + fi + + NVCC_CCBIN="${compiler}-$(ver_cut 1 "${package_version/#<${package}-/}")" + + [[ "${NVCC_CCBIN}" != "${NVCC_CCBIN_default}" ]] && break + done + ebegin "testing ${NVCC_CCBIN}" + done + eend $? + + # clean temp file + nonfatal rm -f a.out + + echo "${NVCC_CCBIN}" + export NVCC_CCBIN + + einfo "Using ${NVCC_CCBIN} to build (via ${package} iteration)" +} + +# We could default to all-major, all here +cuda_get_host_native_arch() { + if [[ -n ${CUDAARCHS} ]]; then + echo "${CUDAARCHS}" + return + fi + + if ! SANDBOX_WRITE=/dev/nvidiactl test -w /dev/nvidiactl ; then + eerror + eerror "Can not access the GPU at /dev/nvidiactl." + eerror "User $(id -nu) is not in the group \"video\"." + eerror + ewarn + ewarn "Can not query the native device." + ewarn "Not setting CUDAARCHS." + ewarn + ewarn "Continuing with default value." + ewarn "Set CUDAARCHS manually if needed." + ewarn + return 1 + fi + + __nvcc_device_query || eerror "failed to query the native device" +} + +pkg_setup() { + if [[ "${PV}" == *9999* ]] ; then + use ax && llvm-r2_pkg_setup + fi + use python && python-single-r1_pkg_setup + + if use cuda; then + # sets up /dev files as a side-effect + # needs to be run in pkg_setup as root + nvidia-smi -L >/dev/null + fi +} + +src_prepare() { + # remove outdated + rm "cmake/Find"{OpenEXR,TBB}".cmake" || die + + if use nanovdb; then + sed \ + -e 's#message(WARNING " - OpenVDB required to build#message(VERBOSE " - OpenVDB required to build#g' \ + -i "nanovdb/nanovdb/"*"/CMakeLists.txt" || die + fi + + # sed \ + # -e "/find_package(OpenGL/s#OpenGL#OpenGL COMPONENTS OpenGL GLX#g" \ + # -i openvdb_cmd/vdb_view/CMakeLists.txt || die + + sed \ + -e '/find_package(Boost/s/)/ CONFIG)/g' \ + -i \ + openvdb/openvdb/CMakeLists.txt \ + cmake/FindOpenVDB.cmake \ + || die + + if use python; then + python_fix_shebang openvdb/openvdb/python/test/TestOpenVDB.py + fi + + cmake_src_prepare +} + +src_configure() { + # -Werror=strict-aliasing + # https://bugs.gentoo.org/926820 + # https://github.com/AcademySoftwareFoundation/openvdb/issues/1784 + append-flags -fno-strict-aliasing + filter-lto + + local version abi_version + version=$(ver_cut 1) + abi_version="${version}" + if use "abi$(( version + 1 ))-compat"; then + abi_version=$(( version + 1 )) + elif use "abi$(( version - 1 ))-compat"; then + abi_version=$(( version - 1 )) + elif use "abi$(( version - 2 ))-compat"; then + abi_version=$(( version - 2 )) + fi + + local mycmakeargs=( + # -DCMAKE_CXX_STANDARD="20" + -DCMAKE_FIND_PACKAGE_PREFER_CONFIG="yes" + -DCMAKE_INSTALL_DOCDIR="share/doc/${PF}/" + + -DOPENVDB_ABI_VERSION_NUMBER="${abi_version}" + + -DOPENVDB_BUILD_DOCS="$(usex doc)" + # -DOPENVDB_BUILD_MAYA_PLUGIN="no" + -DOPENVDB_BUILD_BINARIES="$(usex utils)" + -DOPENVDB_BUILD_NANOVDB="$(usex nanovdb)" + -DOPENVDB_BUILD_UNITTESTS="$(usex test)" + + -DOPENVDB_CORE_SHARED="yes" + -DOPENVDB_CORE_STATIC="$(usex static-libs)" + # -DOPENVDB_CXX_STRICT="yes" + -DOPENVDB_ENABLE_UNINSTALL="no" + -DOPENVDB_FUTURE_DEPRECATION="yes" + # -DOPENVDB_USE_DELAYED_LOADING="yes" + + -DUSE_CCACHE="no" + # -DUSE_COLORED_OUTPUT="no" # only adds the flag + -DUSE_EXPLICIT_INSTANTIATION="no" + + # not packaged + # -DOPENVDB_BUILD_HOUDINI_PLUGIN="no" + # -DOPENVDB_BUILD_HOUDINI_ABITESTS="$(usex houdini "$(usex test)"))" + + # for nanovdb + -DUSE_BLOSC="$(usex blosc)" + -DUSE_TBB="yes" + -DUSE_ZLIB="$(usex zlib)" + + "-DOPENVDB_USE_FUTURE_ABI_$(( version + 1 ))=$(usex "abi$(( version + 1 ))-compat")" + "-DOPENVDB_USE_DEPRECATED_ABI_$(( version - 1 ))=$(usex "abi$(( version - 1 ))-compat")" + "-DOPENVDB_USE_DEPRECATED_ABI_$(( version - 2 ))=$(usex "abi$(( version - 2 ))-compat")" + ) + + if [[ "${PV}" == *9999* ]] ; then + mycmakeargs+=( + -DOPENVDB_BUILD_AX="$(usex ax)" + -DUSE_LOG4CPLUS="$(usex !ax)" + ) + if use ax; then + # NOTE Certain tests expect bit equality and don't set tolerance violating the C standard + # 6.5 8) + # A floating expression may be contracted, that is, evaluated as though it were an atomic operation, + # thereby omitting rounding errors implied by the source code and the expression evaluation method. + # The FP_CONTRACT pragma in <math.h> provides a way to disallow contracted expressions. + # Otherwise, whether and how expressions are contracted is implementation-defined. + # + # To reproduce the upstream tests the testsuite is compiled separate with FP_CONTRACT=OFF + # append-cflags "-ffp-contract=off" + # append-cxxflags "-ffp-contract=off" + mycmakeargs+=( + -DOPENVDB_AX_STATIC="$(usex static-libs)" + # due to multibuild # TODO + -DOPENVDB_AX_TEST_CMD="$(usex test)" + -DOPENVDB_AX_TEST_CMD_DOWNLOADS="$(usex test)" + -DOPENVDB_BUILD_AX_UNITTESTS="$(usex test)" # FIXME: log4cplus init and other errors + -DOPENVDB_BUILD_VDB_AX="$(usex utils)" + -DOPENVDB_DOXYGEN_AX="$(usex doc)" + ) + fi + else + # stuck on llvm-15 + # #934813 + # https://github.com/AcademySoftwareFoundation/openvdb/issues/1804 + mycmakeargs+=( + -DOPENVDB_BUILD_AX="no" + -DUSE_LOG4CPLUS="yes" + ) + fi + + if use doc; then + mycmakeargs+=( + -DOPENVDB_DOXYGEN_HOUDINI="no" + -DOPENVDB_DOXYGEN_NANOVDB="$(usex nanovdb)" + -DOPENVDB_DOXYGEN_INTERNAL="no" + ) + fi + + if use nanovdb; then + mycmakeargs+=( + -DUSE_NANOVDB="yes" + # NOTE intentional so it breaks in sandbox if files are missing + -DNANOVDB_ALLOW_FETCHCONTENT="yes" + -DNANOVDB_BUILD_EXAMPLES="$(usex examples)" + -DNANOVDB_BUILD_TOOLS="$(usex utils)" + -DNANOVDB_BUILD_UNITTESTS="$(usex test)" + -DNANOVDB_USE_BLOSC="$(usex blosc)" + -DNANOVDB_USE_CUDA="$(usex cuda)" + -DNANOVDB_USE_ZLIB="$(usex zlib)" + + # TODO add openvdb use flag or split nanovdb as they can be build independent of each other + -DNANOVDB_USE_OPENVDB="yes" + ) + if use cpu_flags_x86_avx || use cpu_flags_x86_sse4_2; then + mycmakeargs+=( + -DNANOVDB_USE_INTRINSICS="yes" + ) + fi + + if use cuda; then + cuda_add_sandbox -w + addwrite "/proc/self/task/" + addpredict "/dev/char" + + if [[ ! -v CUDAARCHS ]]; then + local -x CUDAARCHS + CUDAARCHS="$(cuda_get_host_native_arch)" + fi + einfo "Building with CUDAARCHS=${CUDAARCHS}" + + if [[ ! -v CUDAHOSTCXX ]]; then + local -x CUDAHOSTCXX + CUDAHOSTCXX="$(cuda_get_host_compiler)" + fi + + if [[ ! -v CUDAHOSTLD ]]; then + local -x CUDAHOSTLD + CUDAHOSTLD="$(tc-getCXX)" + fi + + if tc-is-gcc; then + # Filter out IMPLICIT_LINK_DIRECTORIES picked up by CMAKE_DETERMINE_COMPILER_ABI(CUDA) + # See /usr/share/cmake/Help/variable/CMAKE_LANG_IMPLICIT_LINK_DIRECTORIES.rst + CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES_EXCLUDE=$( + "${CUDAHOSTLD}" -E -v - <<<"int main(){}" |& \ + grep LIBRARY_PATH | cut -d '=' -f 2 | cut -d ':' -f 1 + ) + fi + fi + + if use python; then + if use test; then + # we are building openvdb, so ensure the just build openvdb python bindings are used + local -x PYTHONPATH="${BUILD_DIR}/openvdb/openvdb/python" + fi + mycmakeargs+=( + -DNANOVDB_BUILD_PYTHON_MODULE="yes" + -DNANOVDB_BUILD_PYTHON_UNITTESTS="$(usex test)" + ) + fi + fi + + if use python; then + mycmakeargs+=( + -DOPENVDB_BUILD_PYTHON_MODULE="yes" + -DUSE_NUMPY="$(usex numpy)" + -DVDB_PYTHON_INSTALL_DIRECTORY="$(python_get_sitedir)" + -DPython_INCLUDE_DIR="$(python_get_includedir)" + -Dnanobind_DIR="$(python_get_sitedir)/nanobind/cmake" + ) + if use test; then + mycmakeargs+=( + -DPython_EXECUTABLE="${PYTHON}" + -DOPENVDB_BUILD_PYTHON_UNITTESTS="yes" + ) + fi + fi + + # options for the new vdb_tool binary + if use utils; then + mycmakeargs+=( + -DOPENVDB_BUILD_VDB_LOD="yes" + -DOPENVDB_BUILD_VDB_RENDER="yes" + -DOPENVDB_BUILD_VDB_TOOL="yes" + -DOPENVDB_BUILD_VDB_VIEW="yes" + + # vdb_tool + -DOPENVDB_BUILD_VDB_TOOL_UNITTESTS="$(usex test)" + + -DOPENVDB_TOOL_USE_NANO="$(usex nanovdb)" + -DOPENVDB_TOOL_NANO_USE_BLOSC="$(usex nanovdb "$(usex blosc)")" + -DOPENVDB_TOOL_NANO_USE_ZIP="$(usex nanovdb "$(usex zlib)")" + + -DOPENVDB_TOOL_USE_ABC="$(usex alembic)" + + # only used by vdb_tool, defaults to OFF + -DOPENVDB_TOOL_USE_EXR="$(usex openexr)" + # only used by vdb_render, defaults to OFF + -DUSE_EXR="$(usex openexr)" + + -DOPENVDB_TOOL_USE_JPG="$(usex jpeg)" # libjpeg-turbo + -DOPENVDB_TOOL_USE_PDAL="$(usex pdal)" + + # only used by vdb_tool, defaults to OFF + -DOPENVDB_TOOL_USE_PNG="$(usex png)" # libpng + # only used by vdb_render, defaults to OFF + -DUSE_PNG="$(usex png)" + ) + fi + + if use cpu_flags_x86_avx; then + mycmakeargs+=( -DOPENVDB_SIMD="AVX" ) + elif use cpu_flags_x86_sse4_2; then + mycmakeargs+=( -DOPENVDB_SIMD="SSE42" ) + elif use cpu_flags_arm_neon; then + # NOTE openvdb/openvdb/Platform.h -> /// SIMD Intrinsic Headers + # arm_neon.h is only included when OPENVDB_USE_SSE42 or OPENVDB_USE_AVX are defined + # The AVX and SSE42 is guarded by CMAKE_SYSTEM_PROCESSOR checks + mycmakeargs+=( -DOPENVDB_SIMD="AVX" ) + fi + + cmake_src_configure +} + +src_test() { + if [[ "${PV}" == *9999* ]] ; then + if use ax; then + ln -sr "${CMAKE_USE_DIR}/openvdb_ax/openvdb_ax/test" "${BUILD_DIR}/test" || die + local CMAKE_SKIP_TESTS=( + "^vdb_ax_unit_test$" + ) + fi + fi + + if use cuda; then + cuda_add_sandbox -w + addwrite "/proc/self/task/" + addpredict "/dev/char/" + + local -x GTEST_FILTER='-TestNanoVDBCUDA.CudaIndexGridToGrid_basic' + fi + + local myctestargs=( + --output-on-failure + ) + + cmake_src_test +} diff --git a/profiles/arch/arm/package.use.mask b/profiles/arch/arm/package.use.mask index e4fd98c0a966..84cdaad00159 100644 --- a/profiles/arch/arm/package.use.mask +++ b/profiles/arch/arm/package.use.mask @@ -1,6 +1,11 @@ # Copyright 1999-2025 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 + +# Paul Zander <[email protected]> (2025-05-06) +# dev-python/nanobind is not keyworded here +media-gfx/openvdb python + # Paul Zander <[email protected]> (2025-05-06) # oidn is not available on 32 bits arch media-gfx/blender oidn diff --git a/profiles/arch/arm64/package.use.mask b/profiles/arch/arm64/package.use.mask index 04df73691362..e5ae8613fbc7 100644 --- a/profiles/arch/arm64/package.use.mask +++ b/profiles/arch/arm64/package.use.mask @@ -1,6 +1,10 @@ # Copyright 1999-2025 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 +# Paul Zander <[email protected]> (2025-05-06) +# dev-python/nanobind is not keyworded here +media-gfx/openvdb python + # Alfredo Tupone <[email protected]> (2025-05-03) # dependencies not arm64 ready sci-ml/caffe2 distributed gloo fbgemm nnpack onednn qnnpack rocm xnnpack diff --git a/profiles/arch/powerpc/ppc32/package.use.mask b/profiles/arch/powerpc/ppc32/package.use.mask index 11ab2ec13a70..ba7bc858e1c1 100644 --- a/profiles/arch/powerpc/ppc32/package.use.mask +++ b/profiles/arch/powerpc/ppc32/package.use.mask @@ -97,6 +97,7 @@ sci-mathematics/maxima vtk # Broken bundled Eigen, fails to compile. See bug #865191. sci-geosciences/grass pdal sci-libs/vtk pdal +media-gfx/openvdb pdal # Sam James <[email protected]> (2023-04-14) # Needs dev-python/sympy which is not keyworded diff --git a/profiles/arch/powerpc/ppc64/package.use.mask b/profiles/arch/powerpc/ppc64/package.use.mask index 479b422cd4f1..11fb2a964e1b 100644 --- a/profiles/arch/powerpc/ppc64/package.use.mask +++ b/profiles/arch/powerpc/ppc64/package.use.mask @@ -1,6 +1,12 @@ # Copyright 1999-2025 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 +# Paul Zander <[email protected]> (2025-05-06) +# Broken bundled Eigen, fails to compile. See bug #865191. +sci-geosciences/grass pdal +sci-libs/vtk pdal +media-gfx/openvdb pdal + # Alfredo Tupone <[email protected]> (2025-05-03) # dependencies not yet keyworded sci-ml/caffe2 distributed gloo fbgemm nnpack onednn qnnpack rocm xnnpack diff --git a/profiles/arch/riscv/package.use.mask b/profiles/arch/riscv/package.use.mask index cbc0ac236312..fc81ac2612b5 100644 --- a/profiles/arch/riscv/package.use.mask +++ b/profiles/arch/riscv/package.use.mask @@ -1,6 +1,12 @@ # Copyright 2019-2025 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 +# Paul Zander <[email protected]> (2025-05-02) +# Broken bundled Eigen, fails to compile. See bug #865191. +sci-geosciences/grass pdal +sci-libs/vtk pdal +media-gfx/openvdb pdal + # PPN-SD <[email protected]> (2025-04-26) # dev-python/sphinx-panels is not keyworded net-dns/knot doc diff --git a/profiles/arch/x86/package.use.mask b/profiles/arch/x86/package.use.mask index 71d140aac62d..e8c794f0990c 100644 --- a/profiles/arch/x86/package.use.mask +++ b/profiles/arch/x86/package.use.mask @@ -1,6 +1,10 @@ # Copyright 1999-2025 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 +# Paul Zander <[email protected]> (2025-05-02) +# dev-python/nanobind is not keyworded here +media-gfx/openvdb python + # Alfredo Tupone <[email protected]> (2025-04-21) # ocamlopt is not available on 32 bits arch >=dev-lang/ocaml-5 ocamlopt diff --git a/profiles/features/big-endian/use.mask b/profiles/features/big-endian/use.mask index 792562b3f91a..5056e649fe3b 100644 --- a/profiles/features/big-endian/use.mask +++ b/profiles/features/big-endian/use.mask @@ -1,6 +1,10 @@ # Copyright 2023-2024 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 +# Paul Zander <[email protected]> (2025-05-02) +# media-gfx/alembic is masked (#884295) +alembic + # matoro <[email protected]> (2023-06-30) # media-libs/libjxl casualties # https://github.com/libjxl/libjxl/issues/2433
