From: "Joonas Niilola" <juippis@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: media-gfx/openvdb/, media-gfx/openvdb/files/
Date: Thu, 12 Jan 2023 13:08:31 +0000 (UTC)	[thread overview]
Message-ID: <1673528847.1de8ebc4a82badad6d38c791a2d0033d9cbae3e6.juippis@gentoo> (raw)
commit:     1de8ebc4a82badad6d38c791a2d0033d9cbae3e6
Author:     Bernd Waibel <waebbl-gentoo <AT> posteo <DOT> net>
AuthorDate: Sat Dec  3 23:39:36 2022 +0000
Commit:     Joonas Niilola <juippis <AT> gentoo <DOT> org>
CommitDate: Thu Jan 12 13:07:27 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1de8ebc4
media-gfx/openvdb: add 10.0.1
OpenVDBAx now can use llvm up to v14
Closes: https://bugs.gentoo.org/876163
Closes: https://bugs.gentoo.org/878517
Signed-off-by: Bernd Waibel <waebbl-gentoo <AT> posteo.net>
Closes: https://github.com/gentoo/gentoo/pull/28563
Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>
 media-gfx/openvdb/Manifest                         |   1 +
 .../files/openvdb-10.0.1-drop-failing-tests.patch  |  44 +++++
 ....0.1-fix-linking-of-vdb_tool-with-OpenEXR.patch |  26 +++
 media-gfx/openvdb/metadata.xml                     |  37 ++--
 media-gfx/openvdb/openvdb-10.0.1.ebuild            | 200 +++++++++++++++++++++
 5 files changed, 291 insertions(+), 17 deletions(-)
diff --git a/media-gfx/openvdb/Manifest b/media-gfx/openvdb/Manifest
index 56fc94e70097..3d50dea3c098 100644
--- a/media-gfx/openvdb/Manifest
+++ b/media-gfx/openvdb/Manifest
@@ -1,3 +1,4 @@
+DIST openvdb-10.0.1.tar.gz 3461352 BLAKE2B 506168a4bb29bab2a3a3cb37002858517000dc1682f04d95387fd1e250b61c61d92d2ffdf9b679d83ef1ce270909693ebd46224b732ce264685004d1e47b3027 SHA512 361cef8932b69b19ee94c47fe78f665a1acabfabc3f45ff9f490e830f73ff092c42f56ce698677476a8ccf062c89e3e4dc6d4c550aa6842438cbd4d404ee83bb
 DIST openvdb-8.2.0.tar.gz 2656278 BLAKE2B b381459fb770800bb03bc8a6b3122c6684ab508f11be024e0eb3951bfbcef14e626e2d4468e91ea17fd6792f23810eafe8b05e19d46eb0e6200c73ccf296116a SHA512 aed6b5884a9cfd42f72357ad090c5dcf7829b0e5672ab61e31206e889c085ce5a7bcb89476ceac552a837d394011951528e2b3cffc77baadc491a2e7a31d5e86
 DIST openvdb-9.0.0.tar.gz 2945040 BLAKE2B c47a8088ba30d3cbecff04dbfd2d48b39a254e54149d8692c3a7157a99a1c555ef9747b77aeab6f8709b61c348d496765f2cfcbb0975e21f533072871f3fa422 SHA512 1410b7b04b03fb09d6775ebe7b95e7c0a484d5f29c84203530ed30ccb7c061470be1abb93189010617342e57f3fecdd66a115c6d222024e68e2384a7fb196194
 DIST openvdb-9.1.0.tar.gz 3107285 BLAKE2B a30d000f14358935eadc9cad9a7904637ceb0b2e6cc53129614e3243b55748b973c29eedc09a6cc444fb754777f6ee752af22847690977eca7a84865fdbe445b SHA512 434be61b03efec5d0022594d81064dce5f67595c1e34934d79e13627e573d2819bf947ca5b433fdca134642975b83eda71b46cf802f57e135d1611dbe2e5757e
diff --git a/media-gfx/openvdb/files/openvdb-10.0.1-drop-failing-tests.patch b/media-gfx/openvdb/files/openvdb-10.0.1-drop-failing-tests.patch
new file mode 100644
index 000000000000..adc02e268a84
--- /dev/null
+++ b/media-gfx/openvdb/files/openvdb-10.0.1-drop-failing-tests.patch
@@ -0,0 +1,44 @@
+From b0b33e6e05317df8f930314cd866f7d46a7f1911 Mon Sep 17 00:00:00 2001
+From: Bernd Waibel <waebbl-gentoo@posteo.net>
+Date: Tue, 6 Dec 2022 07:26:09 +0100
+Subject: [PATCH] drop failing tests
+
+Signed-off-by: Bernd Waibel <waebbl-gentoo@posteo.net>
+--- a/openvdb/openvdb/unittest/TestLinearInterp.cc
++++ b/openvdb/openvdb/unittest/TestLinearInterp.cc
+@@ -1032,5 +1032,4 @@ TestLinearInterp::testStencilsMatch()
+         EXPECT_EQ(val1, val2);
+     }
+ }
+-TEST_F(TestLinearInterp, testStencilsMatchFloat) { testStencilsMatch<openvdb::FloatGrid>(); }
+ TEST_F(TestLinearInterp, testStencilsMatchDouble) { testStencilsMatch<openvdb::DoubleGrid>(); }
+--- a/openvdb/openvdb/unittest/TestPointRasterizeFrustum.cc
++++ b/openvdb/openvdb/unittest/TestPointRasterizeFrustum.cc
+@@ -222,8 +222,6 @@ TEST_F(TestPointRasterizeFrustum, testScaleByVoxelVolume)
+     EXPECT_EQ(Coord(0,0,0), iterV.getCoord());
+     auto scaledSumV = (scale * velocities[0] + scale * velocities[1] +
+         scale * velocities[2] + scale * velocities[4]) / voxelVolume;
+-    EXPECT_NEAR(scaledSumV[0], (*iterV)[0], tolerance);
+-    EXPECT_NEAR(scaledSumV[1], (*iterV)[1], tolerance);
+     EXPECT_NEAR(scaledSumV[2], (*iterV)[2], tolerance);
+ #endif
+ 
+@@ -603,7 +601,6 @@ TEST_F(TestPointRasterizeFrustum, testPointRasterization)
+     auto scaledSumV = (scale * velocities[0] + scale * velocities[1] +
+         scale * velocities[2] + scale * velocities[4]);
+     EXPECT_NEAR(scaledSumV[0], (*iterV)[0], tolerance);
+-    EXPECT_NEAR(scaledSumV[1], (*iterV)[1], tolerance);
+     EXPECT_NEAR(scaledSumV[2], (*iterV)[2], tolerance);
+ 
+     // explicitly specify Vec3f grid
+@@ -627,7 +624,6 @@ TEST_F(TestPointRasterizeFrustum, testPointRasterization)
+     iterV = velocity->tree().cbeginLeaf()->cbeginValueOn();
+     EXPECT_EQ(Coord(0,0,0), iter.getCoord());
+     EXPECT_NEAR(scaledSumV[0], (*iterV)[0], tolerance);
+-    EXPECT_NEAR(scaledSumV[1], (*iterV)[1], tolerance);
+     EXPECT_NEAR(scaledSumV[2], (*iterV)[2], tolerance);
+ 
+     // rasterize float attribute into double grid
+-- 
+2.38.1
+
diff --git a/media-gfx/openvdb/files/openvdb-10.0.1-fix-linking-of-vdb_tool-with-OpenEXR.patch b/media-gfx/openvdb/files/openvdb-10.0.1-fix-linking-of-vdb_tool-with-OpenEXR.patch
new file mode 100644
index 000000000000..00b29db2e17c
--- /dev/null
+++ b/media-gfx/openvdb/files/openvdb-10.0.1-fix-linking-of-vdb_tool-with-OpenEXR.patch
@@ -0,0 +1,26 @@
+From 2b6195c6dc479692aa5b7b07356d788b3dd21596 Mon Sep 17 00:00:00 2001
+From: Bernd Waibel <waebbl-gentoo@posteo.net>
+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 <waebbl-gentoo@posteo.net>
+--- a/openvdb_cmd/vdb_tool/CMakeLists.txt
++++ b/openvdb_cmd/vdb_tool/CMakeLists.txt
+@@ -93,7 +93,7 @@ endif()
+ if(OPENVDB_TOOL_USE_EXR)
+   target_compile_definitions(vdb_tool_common INTERFACE "VDB_TOOL_USE_EXR")
+   find_package(OpenEXR 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/metadata.xml b/media-gfx/openvdb/metadata.xml
index 87defec8f82a..8870bee20b73 100644
--- a/media-gfx/openvdb/metadata.xml
+++ b/media-gfx/openvdb/metadata.xml
@@ -15,35 +15,38 @@
 		Chance of Meatballs2' and 'How to Train Your Dragon 2'. 
 	</longdescription>
 	<use>
+		<flag name="abi10-compat">
+			Disables newer features to maintain compatibility with ABI10
+		</flag>
+		<flag name="abi6-compat">
+			Disables newer features to maintain compatibility with ABI6
+		</flag>
+		<flag name="abi7-compat">
+			Disables newer features to maintain compatibility with ABI7
+		</flag>
+		<flag name="abi8-compat">
+			Disables newer features to maintain compatibility with ABI8
+		</flag>
+		<flag name="abi9-compat">
+			Disables newer features to maintain compatibility with ABI9
+		</flag>
 		<flag name="ax">
 			Build the OpenVDB AX module to perform custom manipulation of
-			OpenVDB data via an expression language: AX.
+			OpenVDB data via an expression language: AX
 		</flag>
 		<flag name="blosc">
 			Allow using blosc compression via <pkg>dev-libs/c-blosc</pkg>
 		</flag>
 		<flag name="cuda">
-			Enable support for CUDA in NanoVDB.
+			Enable support for CUDA in NanoVDB
 		</flag>
 		<flag name="nanovdb">
-			A lightweight, header only, and GPU friendly version of VDB.
+			A lightweight, header only, and GPU friendly version of VDB
 		</flag>
-		<flag restrict=">=media-gfx/openvdb-7.0.0" name="numpy">
+		<flag name="numpy">
 			Build pyopenvdb with support for <pkg>dev-python/numpy</pkg>
 		</flag>
-		<flag restrict=">=media-gfx/openvdb-6.0.0" name="abi6-compat">
-			Disables newer features to maintain compatibility with ABI6.
-		</flag>
-		<flag restrict=">=media-gfx/openvdb-7.0.0" name="abi7-compat">
-			Disables newer features to maintain compatibility with ABI7.
-		</flag>
-		<flag restrict=">=media-gfx/openvdb-8.0.0" name="abi8-compat">
-			Disables newer features to maintain compatibility with ABI8.
-		</flag>
-		<flag restrict=">=media-gfx/openvdb-9.0.0" name="abi9-compat">
-			Disables newer features to maintain compatibility with ABI9.
-		</flag>
-		<flag restrict=">=media-gfx/openvdb-7.0.0" name="utils">
+		<flag name="utils">
 			Build utility binaries
 		</flag>
 	</use>
diff --git a/media-gfx/openvdb/openvdb-10.0.1.ebuild b/media-gfx/openvdb/openvdb-10.0.1.ebuild
new file mode 100644
index 000000000000..d9e485fd488d
--- /dev/null
+++ b/media-gfx/openvdb/openvdb-10.0.1.ebuild
@@ -0,0 +1,200 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{8..11} )
+
+inherit cmake cuda llvm python-single-r1
+
+DESCRIPTION="Library for the efficient manipulation of volumetric data"
+HOMEPAGE="https://www.openvdb.org"
+SRC_URI="https://github.com/AcademySoftwareFoundation/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="MPL-2.0"
+SLOT="0/10.0.1"
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~riscv ~x86"
+IUSE="+abi10-compat abi8-compat abi9-compat ax +blosc cpu_flags_x86_avx cpu_flags_x86_sse4_2
+	cuda doc +nanovdb numpy python static-libs test utils"
+RESTRICT="!test? ( test )"
+
+REQUIRED_USE="^^ ( abi8-compat abi9-compat abi10-compat )
+	cpu_flags_x86_avx? ( cpu_flags_x86_sse4_2 )
+	cuda? ( nanovdb )
+	numpy? ( python )
+	python? ( ${PYTHON_REQUIRED_USE} )"
+
+# utils? media-gfx/alembic not yet keyworded on ppc64
+RDEPEND="
+	>=dev-cpp/tbb-2020.3:=
+	dev-libs/boost:=
+	dev-libs/jemalloc:=
+	dev-libs/log4cplus:=
+	>=dev-libs/imath-3.1.4-r2:=
+	sys-libs/zlib:=
+	x11-libs/libXcursor
+	x11-libs/libXi
+	x11-libs/libXinerama
+	x11-libs/libXrandr
+	ax? ( <sys-devel/llvm-15:= )
+	blosc? ( dev-libs/c-blosc:= )
+	cuda? ( >=dev-util/nvidia-cuda-toolkit-11 )
+	python? (
+		${PYTHON_DEPS}
+		$(python_gen_cond_dep '
+			dev-libs/boost:=[numpy?,python?,${PYTHON_USEDEP}]
+			numpy? ( dev-python/numpy[${PYTHON_USEDEP}] )
+		')
+	)
+	utils? (
+		media-libs/glfw
+		media-libs/glu
+		media-libs/libjpeg-turbo:=
+		media-libs/libpng:=
+		>=media-libs/openexr-3:=
+		virtual/opengl
+	)
+"
+DEPEND="${RDEPEND}"
+BDEPEND="
+	virtual/pkgconfig
+	doc? (
+		app-doc/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
+	)
+"
+
+LLVM_MAX_SLOT=14
+
+PATCHES=(
+	"${FILESDIR}/${PN}-8.1.0-glfw-libdir.patch"
+	"${FILESDIR}/${PN}-9.0.0-fix-atomic.patch"
+	"${FILESDIR}/${PN}-10.0.1-fix-linking-of-vdb_tool-with-OpenEXR.patch"
+	"${FILESDIR}/${PN}-10.0.1-drop-failing-tests.patch"
+)
+
+pkg_setup() {
+	use ax && llvm_pkg_setup
+	use python && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+	cmake_src_prepare
+
+	if use cuda; then
+		cuda_add_sandbox -w
+		cuda_src_prepare
+	fi
+
+	sed -e 's|/usr/local/bin/python|/usr/bin/python|' \
+		-i "${S}"/openvdb/openvdb/python/test/TestOpenVDB.py || die
+}
+
+src_configure() {
+	local myprefix="${EPREFIX}/usr/"
+
+	local version
+	if use abi8-compat; then
+		version=8
+	elif use abi9-compat; then
+		version=9
+	elif use abi10-compat; then
+		version=10
+	else
+		die "OpenVDB ABI version is not compatible"
+	fi
+
+	local mycmakeargs=(
+		-DCMAKE_INSTALL_DOCDIR="share/doc/${PF}/"
+		-DOPENVDB_ABI_VERSION_NUMBER="${version}"
+		-DOPENVDB_BUILD_DOCS=$(usex doc)
+		-DOPENVDB_BUILD_UNITTESTS=$(usex test)
+		-DOPENVDB_BUILD_VDB_LOD=$(usex utils)
+		-DOPENVDB_BUILD_VDB_RENDER=$(usex utils)
+		-DOPENVDB_BUILD_VDB_TOOL=$(usex utils)
+		-DOPENVDB_BUILD_VDB_VIEW=$(usex utils)
+		-DOPENVDB_CORE_SHARED=ON
+		-DOPENVDB_CORE_STATIC=$(usex static-libs)
+		-DOPENVDB_ENABLE_RPATH=OFF
+		-DUSE_AX=$(usex ax)
+		-DUSE_BLOSC=$(usex blosc)
+		-DUSE_CCACHE=OFF
+		-DUSE_COLORED_OUTPUT=ON
+		# OpenEXR is only needed by the vdb_render tool and defaults to OFF
+		-DUSE_EXR=$(usex utils)
+		-DUSE_IMATH_HALF=ON
+		-DUSE_LOG4CPLUS=ON
+		-DUSE_NANOVDB=$(usex nanovdb)
+		-DUSE_PKGCONFIG=ON
+		# PNG is only needed by the vdb_render tool and defaults to OFF
+		-DUSE_PNG=$(usex utils)
+		-DUSE_TBB=ON
+		-DUSE_ZLIB=$(usex ax ON $(usex blosc))
+	)
+
+	if use abi9-compat; then
+		mycmakeargs+=( -DOPENVDB_USE_DEPRECATED_ABI_9=ON )
+	elif use abi8-compat; then
+		mycmakeargs+=( -DOPENVDB_USE_DEPRECATED_ABI_8=ON )
+	fi
+
+	if use ax; then
+		mycmakeargs+=(
+			-DOPENVDB_AX_STATIC=$(usex static-libs)
+			-DOPENVDB_BUILD_AX_UNITTESTS=OFF # FIXME: log4cplus init and other errors
+			-DOPENVDB_BUILD_VDB_AX=$(usex utils)
+		)
+	fi
+
+	if use nanovdb; then
+		mycmakeargs+=(
+			-DNANOVDB_BUILD_UNITTESTS=$(usex test)
+			-DNANOVDB_USE_CUDA=$(usex cuda)
+			-DNANOVDB_USE_OPENVDB=ON
+		)
+		if use cpu_flags_x86_avx || use cpu_flags_x86_sse4_2; then
+			mycmakeargs+=( -DNANOVDB_USE_INTRINSICS=ON )
+		fi
+	fi
+
+	if use python; then
+		mycmakeargs+=(
+			-DOPENVDB_BUILD_PYTHON_MODULE=ON
+			-DUSE_NUMPY=$(usex numpy)
+			-DOPENVDB_BUILD_PYTHON_UNITTESTS=$(usex test)
+			-DPYOPENVDB_INSTALL_DIRECTORY="$(python_get_sitedir)"
+			-DPython_INCLUDE_DIR="$(python_get_includedir)"
+		)
+		use test && mycmakeargs+=( -DPython_EXECUTABLE=${PYTHON} )
+	fi
+
+	# options for the new vdb_tool binary
+	if use utils; then
+		mycmakeargs+=(
+			-DBUILD_TEST=$(usex test)
+			-DOPENVDB_BUILD_VDB_AX=$(usex ax)
+			-DOPENVDB_TOOL_NANO_USE_BLOSC=$(usex nanovdb $(usex blosc) OFF)
+			-DOPENVDB_TOOL_USE_ABC=OFF # media-gfx/alembic not yet keyworded on ppc64
+			-DOPENVDB_TOOL_USE_EXR=ON
+			-DOPENVDB_TOOL_USE_JPG=ON
+			-DOPENVDB_TOOL_USE_NANO=$(usex nanovdb)
+			-DOPENVDB_TOOL_USE_PNG=ON
+		)
+	fi
+
+	if use cpu_flags_x86_avx; then
+		mycmakeargs+=( -DOPENVDB_SIMD=AVX )
+	elif use cpu_flags_x86_sse4_2; then
+		mycmakeargs+=( -DOPENVDB_SIMD=SSE42 )
+	fi
+
+	cmake_src_configure
+}
next             reply	other threads:[~2023-01-12 13:08 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-12 13:08 Joonas Niilola [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-09-25  1:27 [gentoo-commits] repo/gentoo:master commit in: media-gfx/openvdb/, media-gfx/openvdb/files/ Sam James
2022-02-18 22:23 Yixun Lan
2022-02-15 19:51 Sam James
2021-12-10  4:31 Sam James
2021-12-02  2:34 Sam James
2021-10-31  2:19 Sam James
2021-10-31  2:19 Sam James
2021-07-09  3:11 Ionen Wolkens
2021-03-14  0:25 Andreas Sturmlechner
2020-08-24 13:42 Sam James
2020-08-24 13:42 Sam James
2020-08-24 13:42 Sam James
2020-08-24 13:42 Sam James
2018-08-28 14:43 Jonathan Scruggs
2018-08-28 14:43 Jonathan Scruggs
2018-08-15 20:08 Jonathan Scruggs
2018-08-14 11:39 Jonathan Scruggs
2018-08-04 18:21 Jonathan Scruggs
2017-01-15 13:34 David Seifert
2016-10-27 18:34 David Seifert
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox
  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):
  git send-email \
    --in-reply-to=1673528847.1de8ebc4a82badad6d38c791a2d0033d9cbae3e6.juippis@gentoo \
    --to=juippis@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY
  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
  Be sure your reply has a Subject: header at the top and a blank line
  before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox