commit:     02baca534283f0b8bfda69c603033418726a34b2
Author:     Jonathan Scruggs <j.scruggs <AT> gmail <DOT> com>
AuthorDate: Sun Dec 24 18:37:08 2017 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Sun Dec 24 22:15:56 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=02baca53

media-libs/opensubdiv: Add CUDA 9 compatibility patch

Closes: https://bugs.gentoo.org/641242
Closes: https://github.com/gentoo/gentoo/pull/6624

 .../opensubdiv-3.3.0-add-CUDA9-compatibility.patch | 25 ++++++++++++++++++++++
 media-libs/opensubdiv/opensubdiv-3.3.0.ebuild      |  7 +++---
 2 files changed, 29 insertions(+), 3 deletions(-)

diff --git 
a/media-libs/opensubdiv/files/opensubdiv-3.3.0-add-CUDA9-compatibility.patch 
b/media-libs/opensubdiv/files/opensubdiv-3.3.0-add-CUDA9-compatibility.patch
new file mode 100644
index 00000000000..9fe81c4ee19
--- /dev/null
+++ b/media-libs/opensubdiv/files/opensubdiv-3.3.0-add-CUDA9-compatibility.patch
@@ -0,0 +1,25 @@
+From 7b9157bca7138480c387ef3d5b69b6cf1eb498e5 Mon Sep 17 00:00:00 2001
+From: "Daniel M. Weeks" <[email protected]>
+Date: Fri, 15 Dec 2017 22:45:55 -0500
+Subject: [PATCH] CUDA 9 compatible gpu-architecture default
+
+---
+ CMakeLists.txt | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 4f3cd9d4..fa438b46 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -513,8 +513,10 @@ if(CUDA_FOUND)
+         if (NOT DEFINED OSD_CUDA_NVCC_FLAGS)
+             if (CUDA_VERSION_MAJOR LESS 6)
+                 set( OSD_CUDA_NVCC_FLAGS --gpu-architecture compute_11 )
+-            else()
++            elseif (CUDA_VERSION_MAJOR LESS 9)
+                 set( OSD_CUDA_NVCC_FLAGS --gpu-architecture compute_20 )
++            else()
++                set( OSD_CUDA_NVCC_FLAGS --gpu-architecture compute_30 )
+             endif()
+         endif()
+     endif()

diff --git a/media-libs/opensubdiv/opensubdiv-3.3.0.ebuild 
b/media-libs/opensubdiv/opensubdiv-3.3.0.ebuild
index 1c1abebee36..a85444ac261 100644
--- a/media-libs/opensubdiv/opensubdiv-3.3.0.ebuild
+++ b/media-libs/opensubdiv/opensubdiv-3.3.0.ebuild
@@ -12,7 +12,7 @@ 
SRC_URI="https://github.com/PixarAnimationStudios/OpenSubdiv/archive/v${MY_PV}.t
 LICENSE="ZLIB"
 SLOT="0"
 KEYWORDS="~amd64 ~x86"
-IUSE="cuda doc opencl openmp ptex tbb"
+IUSE="cuda doc examples opencl openmp ptex tbb tutorials"
 
 RDEPEND="media-libs/glew:=
        media-libs/glfw:=
@@ -32,6 +32,7 @@ S="${WORKDIR}/OpenSubdiv-${MY_PV}"
 PATCHES=(
        "${FILESDIR}/${P}-fix-quotes.patch"
        "${FILESDIR}/${P}-use-gnuinstalldirs.patch"
+       "${FILESDIR}/${P}-add-CUDA9-compatibility.patch"
 )
 
 pkg_pretend() {
@@ -53,8 +54,8 @@ src_configure() {
                -DNO_OPENCL=$(usex !opencl)
                -DNO_CUDA=$(usex !cuda)
                -DNO_REGRESSION=1 # They don't work with certain settings
-               -DNO_EXAMPLES=1 # Not needed.
-               -DNO_TUTORIALS=1 # They install illegally. Need to find a 
better solution.
+               -DNO_EXAMPLES=$(usex !examples)
+               -DNO_TUTORIALS=$(usex !tutorials)
                -DGLEW_LOCATION="${EPREFIX}/usr/$(get_libdir)"
                -DGLFW_LOCATION="${EPREFIX}/usr/$(get_libdir)"
                -DCMAKE_INSTALL_DOCDIR="share/doc/${PF}"

Reply via email to