Gentoo Archives: gentoo-commits

From: Alfredo Tupone <tupone@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sci-libs/caffe2/files/, sci-libs/caffe2/
Date: Sat, 02 Jul 2022 21:12:55
Message-Id: 1656796360.0f9a010a044de133417cbd56f63c32692451732c.tupone@gentoo
1 commit: 0f9a010a044de133417cbd56f63c32692451732c
2 Author: Alfredo Tupone <tupone <AT> gentoo <DOT> org>
3 AuthorDate: Sat Jul 2 21:12:40 2022 +0000
4 Commit: Alfredo Tupone <tupone <AT> gentoo <DOT> org>
5 CommitDate: Sat Jul 2 21:12:40 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0f9a010a
7
8 sci-libs/caffe2: add support for nnpack
9
10 Package-Manager: Portage-3.0.30, Repoman-3.0.3
11 Signed-off-by: Alfredo Tupone <tupone <AT> gentoo.org>
12
13 .../{caffe2-1.11.0-r1.ebuild => caffe2-1.11.0-r2.ebuild} | 5 +++--
14 sci-libs/caffe2/files/caffe2-1.11.0-gentoo.patch | 11 +++++++++++
15 sci-libs/caffe2/metadata.xml | 1 +
16 3 files changed, 15 insertions(+), 2 deletions(-)
17
18 diff --git a/sci-libs/caffe2/caffe2-1.11.0-r1.ebuild b/sci-libs/caffe2/caffe2-1.11.0-r2.ebuild
19 similarity index 96%
20 rename from sci-libs/caffe2/caffe2-1.11.0-r1.ebuild
21 rename to sci-libs/caffe2/caffe2-1.11.0-r2.ebuild
22 index d48fb9082441..c59a498341cd 100644
23 --- a/sci-libs/caffe2/caffe2-1.11.0-r1.ebuild
24 +++ b/sci-libs/caffe2/caffe2-1.11.0-r2.ebuild
25 @@ -18,7 +18,7 @@ LICENSE="BSD"
26 SLOT="0"
27 KEYWORDS="~amd64"
28 RESTRICT="test"
29 -IUSE="xnnpack"
30 +IUSE="nnpack xnnpack"
31 REQUIRED_USE="${PYTHON_REQUIRED_USE}"
32
33 RDEPEND="
34 @@ -30,6 +30,7 @@ RDEPEND="
35 sci-libs/lapack
36 sci-libs/onnx
37 sci-libs/foxi
38 + nnpack? ( sci-libs/NNPACK )
39 xnnpack? ( sci-libs/XNNPACK )
40 "
41 DEPEND="${RDEPEND}
42 @@ -62,7 +63,6 @@ src_configure() {
43 -DUSE_GLOO=OFF
44 -DUSE_SYSTEM_FP16=ON
45 -DUSE_FBGEMM=OFF
46 - -DUSE_NNPACK=OFF
47 -DUSE_PYTORCH_QNNPACK=OFF
48 -DUSE_QNNPACK=OFF
49 -DUSE_SYSTEM_CPUINFO=ON
50 @@ -81,6 +81,7 @@ src_configure() {
51 -DUSE_SYSTEM_FXDIV=ON
52 -DUSE_XNNPACK=$(usex xnnpack ON OFF)
53 -DUSE_SYSTEM_XNNPACK=$(usex xnnpack ON OFF)
54 + -DUSE_NNPACK=$(usex nnpack ON OFF)
55 )
56 cmake_src_configure
57 }
58
59 diff --git a/sci-libs/caffe2/files/caffe2-1.11.0-gentoo.patch b/sci-libs/caffe2/files/caffe2-1.11.0-gentoo.patch
60 index f34216ea0970..b6b35e2329e8 100644
61 --- a/sci-libs/caffe2/files/caffe2-1.11.0-gentoo.patch
62 +++ b/sci-libs/caffe2/files/caffe2-1.11.0-gentoo.patch
63 @@ -110,3 +110,14 @@
64 endif()
65
66 # ==========================================================
67 +--- a/cmake/External/nnpack.cmake 2022-07-02 21:56:54.905696921 +0200
68 ++++ b/cmake/External/nnpack.cmake 2022-07-02 21:57:03.665696739 +0200
69 +@@ -58,7 +58,7 @@
70 + set(PTHREADPOOL_SOURCE_DIR "${CAFFE2_THIRD_PARTY_ROOT}/pthreadpool" CACHE STRING "pthreadpool source directory")
71 + set(GOOGLETEST_SOURCE_DIR "${CAFFE2_THIRD_PARTY_ROOT}/googletest" CACHE STRING "Google Test source directory")
72 +
73 +- if(NOT TARGET nnpack)
74 ++ if(FALSE)
75 + if(NOT USE_SYSTEM_PTHREADPOOL AND USE_INTERNAL_PTHREADPOOL_IMPL)
76 + set(NNPACK_CUSTOM_THREADPOOL ON CACHE BOOL "")
77 + endif()
78
79 diff --git a/sci-libs/caffe2/metadata.xml b/sci-libs/caffe2/metadata.xml
80 index bdd11115f0fe..da10df6e0739 100644
81 --- a/sci-libs/caffe2/metadata.xml
82 +++ b/sci-libs/caffe2/metadata.xml
83 @@ -6,6 +6,7 @@
84 <name>Tupone Alfredo</name>
85 </maintainer>
86 <use>
87 + <flag name="nnpack">Use NNPACK</flag>
88 <flag name="xnnpack">Use XNNPACK</flag>
89 </use>
90 <upstream>