1 |
commit: 4c15677854b501ff60e87f35c1b52c2ac2e2db91 |
2 |
Author: Miezhiko <Miezhiko <AT> gmail <DOT> com> |
3 |
AuthorDate: Wed Dec 22 06:53:36 2021 +0000 |
4 |
Commit: Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Dec 22 12:42:22 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/sci.git/commit/?id=4c156778 |
7 |
|
8 |
Update pytorch to 1.10.1 improve ebuild quality + switch to EAPI 8 |
9 |
|
10 |
Signed-off-by: Miezhiko <Miezhiko <AT> gmail.com> |
11 |
Signed-off-by: Andrew Ammerlaan <andrewammerlaan <AT> gentoo.org> |
12 |
|
13 |
...pytorch-1.10.0.ebuild => pytorch-1.10.1.ebuild} | 32 ++++++++++++---------- |
14 |
1 file changed, 17 insertions(+), 15 deletions(-) |
15 |
|
16 |
diff --git a/sci-libs/pytorch/pytorch-1.10.0.ebuild b/sci-libs/pytorch/pytorch-1.10.1.ebuild |
17 |
similarity index 96% |
18 |
rename from sci-libs/pytorch/pytorch-1.10.0.ebuild |
19 |
rename to sci-libs/pytorch/pytorch-1.10.1.ebuild |
20 |
index 36d68fb14..8fb18d3a0 100644 |
21 |
--- a/sci-libs/pytorch/pytorch-1.10.0.ebuild |
22 |
+++ b/sci-libs/pytorch/pytorch-1.10.1.ebuild |
23 |
@@ -1,9 +1,9 @@ |
24 |
# Copyright 1999-2021 Gentoo Authors |
25 |
# Distributed under the terms of the GNU General Public License v2 |
26 |
|
27 |
-EAPI=7 |
28 |
+EAPI=8 |
29 |
|
30 |
-PYTHON_COMPAT=( python3_{7..10} ) |
31 |
+PYTHON_COMPAT=( python3_{8..10} ) |
32 |
|
33 |
inherit cmake cuda distutils-r1 prefix |
34 |
|
35 |
@@ -56,10 +56,9 @@ https://github.com/mikey/linux-syscall-support/archive/e1e7b0ad8ee99a875b272c8e3 |
36 |
|
37 |
LICENSE="BSD" |
38 |
SLOT="0" |
39 |
-KEYWORDS="~x86 ~amd64" |
40 |
+KEYWORDS="~amd64 ~x86" |
41 |
|
42 |
-IUSE="asan blas cuda +fbgemm ffmpeg gflags glog +gloo leveldb lmdb mkldnn mpi namedtensor +nnpack numa +observers opencl opencv +openmp +python +qnnpack redis rocm static test tools zeromq" |
43 |
-RESTRICT="!test? ( test )" |
44 |
+IUSE="asan blas cuda +fbgemm ffmpeg gflags glog +gloo leveldb lmdb mkldnn mpi namedtensor +nnpack numa +observers opencl opencv +openmp +python +qnnpack redis rocm static tools zeromq" |
45 |
REQUIRED_USE=" |
46 |
?? ( cuda rocm ) |
47 |
" |
48 |
@@ -104,7 +103,6 @@ RDEPEND=" |
49 |
BDEPEND="dev-python/pyyaml" |
50 |
|
51 |
DEPEND="${RDEPEND} |
52 |
- test? ( dev-python/pytest[${PYTHON_USEDEP}] ) |
53 |
dev-cpp/tbb |
54 |
app-arch/zstd |
55 |
dev-python/pybind11[${PYTHON_USEDEP}] |
56 |
@@ -122,6 +120,8 @@ PATCHES=( |
57 |
"${FILESDIR}"/${PN}-1.10.0-nonull.patch |
58 |
) |
59 |
|
60 |
+distutils_enable_tests pytest |
61 |
+ |
62 |
src_prepare() { |
63 |
cmake_src_prepare |
64 |
eprefixify torch/__init__.py |
65 |
@@ -208,11 +208,11 @@ src_prepare() { |
66 |
#Allow escaping sandbox |
67 |
addread /dev/kfd |
68 |
addread /dev/dri |
69 |
- addwrite /dev/kfd |
70 |
- addwrite /dev/dri |
71 |
+ addpredict /dev/kfd |
72 |
+ addpredict /dev/dri |
73 |
|
74 |
ebegin "HIPifying cuda sources" |
75 |
- tools/amd_build/build_amd.py |
76 |
+ ${EPYTHON} tools/amd_build/build_amd.py || die |
77 |
eend $? |
78 |
|
79 |
export PYTORCH_ROCM_ARCH=$(rocminfo | egrep -o "gfx[0-9]+" | uniq | awk -vORS=';' "{print $1}" | sed 's/;$/\n/') || die |
80 |
@@ -307,21 +307,23 @@ src_install() { |
81 |
rm -rfv "${ED}/usr/include/include" |
82 |
rm -rfv "${ED}/usr/include/var" |
83 |
|
84 |
- cp -rv "${WORKDIR}/${P}/third_party/pybind11/include/pybind11" "${ED}/usr/include/" |
85 |
+ cp -rv "${WORKDIR}/${P}/third_party/pybind11/include/pybind11" "${ED}/usr/include/" || die |
86 |
|
87 |
- rm -fv "${ED}/usr/${LIB}/libtbb.so" |
88 |
- rm -rfv "${ED}/usr/${LIB}/cmake" |
89 |
+ rm -v "${ED}/usr/${LIB}/libtbb.so" || die |
90 |
+ rm -r "${ED}/usr/${LIB}/cmake" || die |
91 |
|
92 |
if use python; then |
93 |
- scanelf -r --fix "${BUILD_DIR}/caffe2/python" |
94 |
+ scanelf -r --fix "${BUILD_DIR}/caffe2/python" || die |
95 |
USE_SYSTEM_LIBS=ON CMAKE_BUILD_DIR=${BUILD_DIR} distutils-r1_src_install |
96 |
|
97 |
python_foreach_impl python_optimize |
98 |
fi |
99 |
|
100 |
- find "${ED}/usr/${LIB}" -name "*.a" -exec rm -fv {} \; |
101 |
+ find "${ED}/usr/${LIB}" -name "*.a" -exec rm -fv {} \; || die |
102 |
|
103 |
- use test && rm -rfv "${ED}/usr/test" "${ED}"/usr/bin/test_{api,jit} |
104 |
+ if use test; then |
105 |
+ rm -r "${ED}/usr/test" "${ED}"/usr/bin/test_{api,jit} || die |
106 |
+ fi |
107 |
|
108 |
# Remove the empty directories by CMake Python: |
109 |
find "${ED}" -type d -empty -delete || die |