diff options
author | 2022-06-26 09:58:44 +0200 | |
---|---|---|
committer | 2022-06-26 09:58:44 +0200 | |
commit | 8337afbc16f16f0799c2e08094f5dc36fdbcc3ea (patch) | |
tree | f4caa5bb993e27ec3ce9ea8f59a7d6681a4a6811 /sci-libs/pytorch/pytorch-1.11.0.ebuild | |
parent | media-plugins/ams-lv2: eapi7, added python 3.10, deps versions cleanup (diff) | |
download | gentoo-8337afbc16f16f0799c2e08094f5dc36fdbcc3ea.tar.gz gentoo-8337afbc16f16f0799c2e08094f5dc36fdbcc3ea.tar.bz2 gentoo-8337afbc16f16f0799c2e08094f5dc36fdbcc3ea.zip |
sci-libs/pytorch: add to tree
Package-Manager: Portage-3.0.30, Repoman-3.0.3
Signed-off-by: Alfredo Tupone <tupone@gentoo.org>
Diffstat (limited to 'sci-libs/pytorch/pytorch-1.11.0.ebuild')
-rw-r--r-- | sci-libs/pytorch/pytorch-1.11.0.ebuild | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/sci-libs/pytorch/pytorch-1.11.0.ebuild b/sci-libs/pytorch/pytorch-1.11.0.ebuild new file mode 100644 index 000000000000..a57ff0163fd0 --- /dev/null +++ b/sci-libs/pytorch/pytorch-1.11.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[${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 +} |