summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Beddek <telans@posteo.de>2022-07-03 19:59:03 +1200
committerAlfredo Tupone <tupone@gentoo.org>2022-07-03 12:49:38 +0200
commit51a62dbc390c29214e3364cce32f01f28c16eefd (patch)
tree9d32b693b8a48a6ef3084906f8841279dd68f5de /sci-libs/pytorch
parentdev-python/lxml: ppc stable wrt bug #855815 (diff)
downloadgentoo-51a62dbc390c29214e3364cce32f01f28c16eefd.tar.gz
gentoo-51a62dbc390c29214e3364cce32f01f28c16eefd.tar.bz2
gentoo-51a62dbc390c29214e3364cce32f01f28c16eefd.zip
sci-libs/pytorch: add 1.12.0
Signed-off-by: James Beddek <telans@posteo.de> Closes: https://github.com/gentoo/gentoo/pull/26209 Signed-off-by: Alfredo Tupone <tupone@gentoo.org>
Diffstat (limited to 'sci-libs/pytorch')
-rw-r--r--sci-libs/pytorch/Manifest1
-rw-r--r--sci-libs/pytorch/pytorch-1.12.0.ebuild56
2 files changed, 57 insertions, 0 deletions
diff --git a/sci-libs/pytorch/Manifest b/sci-libs/pytorch/Manifest
index ae4d5567b7fc..0d28654e641f 100644
--- a/sci-libs/pytorch/Manifest
+++ b/sci-libs/pytorch/Manifest
@@ -1 +1,2 @@
DIST pytorch-1.11.0.tar.gz 20719323 BLAKE2B 24e7aaa2c26821d36f8092542de9d8d5ac85a619fb9fffb5131987958842afb1cad395780662d15f3411a7cc6ff83a445871960eca1e469fcbf0b9895d83d6e0 SHA512 2342eb7a1a241f5855a7cf12e11f62bc4baaa78d1d0864e53bfc946e783eb4addd05ca154a814d2376cd602098b5547e61c158d6eddb7cad5a9f3b0c1357adca
+DIST pytorch-1.12.0.tar.gz 106286765 BLAKE2B ff9bafedb35f859f7dccb9b606299cf9c345bdaa0deb87ecfe0c0c30c3c828414d989e1d9a243d9b7cd3f376d56a2f81c241ca2e3c9a8a2b30cddcdeddd3a5c7 SHA512 c9c748a2e0047daaaf199a1ba3198d2d1aee47f664170a9b34ccacd3deeb95f2070e4035eeb900012ef48dc62cf6fb6806f1a1dfe22de8c94892963076e593b7
diff --git a/sci-libs/pytorch/pytorch-1.12.0.ebuild b/sci-libs/pytorch/pytorch-1.12.0.ebuild
new file mode 100644
index 000000000000..0a1cae78f4bb
--- /dev/null
+++ b/sci-libs/pytorch/pytorch-1.12.0.ebuild
@@ -0,0 +1,56 @@
+# Copyright 2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_USE_PEP517=setuptools
+PYTHON_COMPAT=( python3_{8,9,10} )
+inherit distutils-r1
+
+DESCRIPTION="Tensors and Dynamic neural networks in Python"
+HOMEPAGE="https://pytorch.org/"
+SRC_URI="https://github.com/pytorch/${PN}/archive/refs/tags/v${PV}.tar.gz
+ -> ${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64"
+RESTRICT="test"
+
+REQUIRED_USE=${PYTHON_REQUIRED_USE}
+RDEPEND="
+ ${PYTHON_DEPS}
+ ~sci-libs/caffe2-${PV}[${PYTHON_USEDEP}]
+ dev-python/typing-extensions[${PYTHON_USEDEP}]
+"
+DEPEND="${RDEPEND}
+ dev-python/pyyaml[${PYTHON_USEDEP}]
+"
+
+src_prepare() {
+ eapply \
+ "${FILESDIR}"/0002-Don-t-build-libtorch-again-for-PyTorch-1.7.1.patch \
+ "${FILESDIR}"/pytorch-1.9.0-Change-library-directory-according-to-CMake-build.patch \
+ "${FILESDIR}"/${PN}-1.6.0-global-dlopen.patch \
+ "${FILESDIR}"/pytorch-1.7.1-torch_shm_manager.patch
+
+ # Set build dir for pytorch's setup
+ sed -i \
+ -e "/BUILD_DIR/s|build|/var/lib/caffe2/|" \
+ tools/setup_helpers/env.py \
+ || die
+ distutils-r1_src_prepare
+}
+
+src_compile() {
+ PYTORCH_BUILD_VERSION=${PV} \
+ PYTORCH_BUILD_NUMBER=0 \
+ USE_SYSTEM_LIBS=ON \
+ CMAKE_BUILD_DIR="${BUILD_DIR}" \
+ BUILD_DIR= \
+ distutils-r1_src_compile
+}
+
+src_install() {
+ USE_SYSTEM_LIBS=ON distutils-r1_src_install
+}