commit:     a5bc890e5d880b2b99952060fe82170a4680eb81
Author:     Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
AuthorDate: Sun Dec 26 14:10:33 2021 +0000
Commit:     Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
CommitDate: Sun Dec 26 14:12:03 2021 +0000
URL:        https://gitweb.gentoo.org/proj/sci.git/commit/?id=a5bc890e

sci-libs/pytorch: add clhpp patch, fix setuptools dep

Package-Manager: Portage-3.0.30, Repoman-3.0.3
Signed-off-by: Andrew Ammerlaan <andrewammerlaan <AT> gentoo.org>

 sci-libs/pytorch/files/pytorch-1.10.0-clhpp2.patch | 52 ++++++++++++++++++++++
 sci-libs/pytorch/pytorch-1.10.1.ebuild             |  8 ++--
 2 files changed, 57 insertions(+), 3 deletions(-)

diff --git a/sci-libs/pytorch/files/pytorch-1.10.0-clhpp2.patch 
b/sci-libs/pytorch/files/pytorch-1.10.0-clhpp2.patch
new file mode 100644
index 000000000..9c267dc6e
--- /dev/null
+++ b/sci-libs/pytorch/files/pytorch-1.10.0-clhpp2.patch
@@ -0,0 +1,52 @@
+diff --git a/caffe2/contrib/opencl/OpenCL/cl.hpp 
b/caffe2/contrib/opencl/OpenCL/cl.hpp
+index 87cc4a1..7c27e33 100644
+--- a/caffe2/contrib/opencl/OpenCL/cl.hpp
++++ b/caffe2/contrib/opencl/OpenCL/cl.hpp
+@@ -76,7 +76,7 @@
+  * #if defined(__APPLE__) || defined(__MACOSX)
+  * #include <OpenCL/cl.hpp>
+  * #else
+- * #include <CL/cl.hpp>
++ * #include <CL/cl2.hpp>
+  * #endif
+  * #include <cstdio>
+  * #include <cstdlib>
+diff --git a/caffe2/contrib/opencl/context.h b/caffe2/contrib/opencl/context.h
+index b1e61c2..968d3c7 100644
+--- a/caffe2/contrib/opencl/context.h
++++ b/caffe2/contrib/opencl/context.h
+@@ -11,7 +11,7 @@
+ #if defined(__APPLE__) || defined(__MACOSX)
+ #include <OpenCL/cl.hpp>
+ #else
+-#include <CL/cl.hpp>
++#include <CL/cl2.hpp>
+ #endif
+ 
+ #define OPENCL_CHECK(expr) (void)expr
+diff --git a/caffe2/mobile/contrib/libopencl-stub/include/CL/cl.hpp 
b/caffe2/mobile/contrib/libopencl-stub/include/CL/cl.hpp
+index f3badf7..928c9f0 100644
+--- a/caffe2/mobile/contrib/libopencl-stub/include/CL/cl.hpp
++++ b/caffe2/mobile/contrib/libopencl-stub/include/CL/cl.hpp
+@@ -76,7 +76,7 @@
+  * #if defined(__APPLE__) || defined(__MACOSX)
+  * #include <OpenCL/cl.hpp>
+  * #else
+- * #include <CL/cl.hpp>
++ * #include <CL/cl2.hpp>
+  * #endif
+  * #include <cstdio>
+  * #include <cstdlib>
+diff --git a/third_party/tensorflow_cuda_bazel_build/cuda/BUILD 
b/third_party/tensorflow_cuda_bazel_build/cuda/BUILD
+index f7271af..334f4ec 100755
+--- a/third_party/tensorflow_cuda_bazel_build/cuda/BUILD
++++ b/third_party/tensorflow_cuda_bazel_build/cuda/BUILD
+@@ -188,7 +188,7 @@ CUDA_INCLUDES_FILES = [
+     "include/CL/cl_gl_ext.h",
+     "include/CL/cl_gl.h",
+     "include/CL/cl.h",
+-    "include/CL/cl.hpp",
++    "include/CL/cl2.hpp",
+     "include/CL/cl_platform.h",
+     "include/CL/opencl.h",
+     "include/common_functions.h",

diff --git a/sci-libs/pytorch/pytorch-1.10.1.ebuild 
b/sci-libs/pytorch/pytorch-1.10.1.ebuild
index 2a11e6240..98afa9662 100644
--- a/sci-libs/pytorch/pytorch-1.10.1.ebuild
+++ b/sci-libs/pytorch/pytorch-1.10.1.ebuild
@@ -3,7 +3,7 @@
 
 EAPI=8
 
-DISTUTILS_USE_SETUPTOOLS=no
+DISTUTILS_USE_SETUPTOOLS=manual
 PYTHON_COMPAT=( python3_{8..10} )
 
 inherit cmake cuda distutils-r1 prefix
@@ -84,9 +84,10 @@ RDEPEND="
        leveldb? ( dev-libs/leveldb )
        lmdb? ( dev-db/lmdb )
        mpi? ( virtual/mpi )
-       opencl? ( dev-libs/clhpp virtual/opencl )
+       opencl? ( dev-libs/clhpp )
        opencv? ( media-libs/opencv )
        python? ( ${PYTHON_DEPS}
+               dev-python/setuptools[${PYTHON_USEDEP}]
                dev-python/pybind11[${PYTHON_USEDEP}]
                dev-python/numpy[${PYTHON_USEDEP}]
                dev-python/protobuf-python:=
@@ -118,9 +119,10 @@ PATCHES=(
        "${FILESDIR}"/${PN}-1.7.1-torch_shm_manager.patch
        "${FILESDIR}"/${PN}-1.10.0-nonull.patch
        "${FILESDIR}"/${PN}-1.10.0-fix-distutils.patch
+       "${FILESDIR}"/${PN}-1.10.0-clhpp2.patch
 )
 
-distutils_enable_tests pytest
+distutils_enable_tests --install pytest
 
 src_prepare() {
        cmake_src_prepare

Reply via email to