1 |
commit: 725ad515274266020396fdae1a5b949b30fdc127 |
2 |
Author: Alfredo Tupone <tupone <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Feb 28 20:37:40 2023 +0000 |
4 |
Commit: Alfredo Tupone <tupone <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Feb 28 20:38:24 2023 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=725ad515 |
7 |
|
8 |
sci-libs/caffe2: add tensorpipe use flag |
9 |
|
10 |
Signed-off-by: Alfredo Tupone <tupone <AT> gentoo.org> |
11 |
|
12 |
.../{caffe2-1.13.1-r3.ebuild => caffe2-1.13.1-r4.ebuild} | 7 +++++-- |
13 |
sci-libs/caffe2/files/caffe2-1.13.1-tensorpipe.patch | 10 ++++++++++ |
14 |
sci-libs/caffe2/metadata.xml | 1 + |
15 |
3 files changed, 16 insertions(+), 2 deletions(-) |
16 |
|
17 |
diff --git a/sci-libs/caffe2/caffe2-1.13.1-r3.ebuild b/sci-libs/caffe2/caffe2-1.13.1-r4.ebuild |
18 |
similarity index 96% |
19 |
rename from sci-libs/caffe2/caffe2-1.13.1-r3.ebuild |
20 |
rename to sci-libs/caffe2/caffe2-1.13.1-r4.ebuild |
21 |
index 04521a5c26ef..9411531dd1ec 100644 |
22 |
--- a/sci-libs/caffe2/caffe2-1.13.1-r3.ebuild |
23 |
+++ b/sci-libs/caffe2/caffe2-1.13.1-r4.ebuild |
24 |
@@ -17,12 +17,13 @@ SRC_URI="https://github.com/pytorch/${MYPN}/archive/refs/tags/v${PV}.tar.gz |
25 |
LICENSE="BSD" |
26 |
SLOT="0" |
27 |
KEYWORDS="~amd64" |
28 |
-IUSE="cuda distributed ffmpeg mpi nnpack +numpy opencl opencv openmp qnnpack xnnpack" |
29 |
+IUSE="cuda distributed ffmpeg mpi nnpack +numpy opencl opencv openmp qnnpack tensorpipe xnnpack" |
30 |
RESTRICT="test" |
31 |
REQUIRED_USE=" |
32 |
${PYTHON_REQUIRED_USE} |
33 |
ffmpeg? ( opencv ) |
34 |
mpi? ( distributed ) |
35 |
+ tensorpipe? ( distributed ) |
36 |
" # ?? ( cuda rocm ) |
37 |
|
38 |
# CUDA 12 not supported yet: https://github.com/pytorch/pytorch/issues/91122 |
39 |
@@ -52,6 +53,7 @@ RDEPEND=" |
40 |
opencl? ( virtual/opencl ) |
41 |
opencv? ( media-libs/opencv:= ) |
42 |
qnnpack? ( sci-libs/QNNPACK ) |
43 |
+ tensorpipe? ( sci-libs/tensorpipe ) |
44 |
xnnpack? ( sci-libs/XNNPACK ) |
45 |
" |
46 |
DEPEND=" |
47 |
@@ -77,6 +79,7 @@ PATCHES=( |
48 |
"${FILESDIR}"/${PN}-1.13.0-install-dirs.patch |
49 |
"${FILESDIR}"/${PN}-1.12.0-glog-0.6.0.patch |
50 |
"${FILESDIR}"/${PN}-1.12.0-clang.patch |
51 |
+ "${FILESDIR}"/${P}-tensorpipe.patch |
52 |
) |
53 |
|
54 |
src_prepare() { |
55 |
@@ -127,6 +130,7 @@ src_configure() { |
56 |
-DUSE_QNNPACK=$(usex qnnpack) |
57 |
-DUSE_XNNPACK=$(usex xnnpack) |
58 |
-DUSE_SYSTEM_XNNPACK=$(usex xnnpack) |
59 |
+ -DUSE_TENSORPIPE=$(usex tensorpipe) |
60 |
-DUSE_PYTORCH_QNNPACK=OFF |
61 |
-DUSE_NUMPY=$(usex numpy) |
62 |
-DUSE_OPENCL=$(usex opencl) |
63 |
@@ -147,7 +151,6 @@ src_configure() { |
64 |
-DUSE_SYSTEM_GLOO=ON |
65 |
-DUSE_SYSTEM_ONNX=ON |
66 |
-DUSE_SYSTEM_SLEEF=ON |
67 |
- -DUSE_TENSORPIPE=OFF |
68 |
|
69 |
-Wno-dev |
70 |
-DTORCH_INSTALL_LIB_DIR="${EPREFIX}"/usr/$(get_libdir) |
71 |
|
72 |
diff --git a/sci-libs/caffe2/files/caffe2-1.13.1-tensorpipe.patch b/sci-libs/caffe2/files/caffe2-1.13.1-tensorpipe.patch |
73 |
new file mode 100644 |
74 |
index 000000000000..ae0cac9fb947 |
75 |
--- /dev/null |
76 |
+++ b/sci-libs/caffe2/files/caffe2-1.13.1-tensorpipe.patch |
77 |
@@ -0,0 +1,10 @@ |
78 |
+--- a/cmake/Dependencies.cmake 2023-02-28 14:14:49.099057348 +0100 |
79 |
++++ b/cmake/Dependencies.cmake 2023-02-28 14:15:05.326790806 +0100 |
80 |
+@@ -1404,7 +1404,6 @@ |
81 |
+ |
82 |
+ # Tensorpipe uses cuda_add_library |
83 |
+ torch_update_find_cuda_flags() |
84 |
+- add_subdirectory(${PROJECT_SOURCE_DIR}/third_party/tensorpipe) |
85 |
+ |
86 |
+ list(APPEND Caffe2_DEPENDENCY_LIBS tensorpipe) |
87 |
+ if(USE_CUDA) |
88 |
|
89 |
diff --git a/sci-libs/caffe2/metadata.xml b/sci-libs/caffe2/metadata.xml |
90 |
index f009baee81bb..531b9cbf5879 100644 |
91 |
--- a/sci-libs/caffe2/metadata.xml |
92 |
+++ b/sci-libs/caffe2/metadata.xml |
93 |
@@ -19,6 +19,7 @@ |
94 |
<flag name="opencv">Add support for image processing operators</flag> |
95 |
<flag name="openmp">Use OpenMP for parallel code</flag> |
96 |
<flag name="qnnpack">Use QNNPACK</flag> |
97 |
+ <flag name="tensorpipe">Use tensorpipe</flag> |
98 |
<flag name="xnnpack">Use XNNPACK</flag> |
99 |
</use> |
100 |
<upstream> |