diff options
author | V3n3RiX <venerix@koprulu.sector> | 2023-03-25 00:48:54 +0000 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2023-03-25 00:48:54 +0000 |
commit | b0b85e141f6a9a74d9d6bdce989a626ff5e92523 (patch) | |
tree | 18a9a4fc7bf0724456198e68c0012407c085de02 /sci-libs/pytorch/pytorch-1.13.1-r2.ebuild | |
parent | 61148529b1734102fa937560847f47719bbd9bd4 (diff) |
gentoo auto-resync : 25:03:2023 - 00:48:54
Diffstat (limited to 'sci-libs/pytorch/pytorch-1.13.1-r2.ebuild')
-rw-r--r-- | sci-libs/pytorch/pytorch-1.13.1-r2.ebuild | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/sci-libs/pytorch/pytorch-1.13.1-r2.ebuild b/sci-libs/pytorch/pytorch-1.13.1-r2.ebuild new file mode 100644 index 000000000000..f93b9a108820 --- /dev/null +++ b/sci-libs/pytorch/pytorch-1.13.1-r2.ebuild @@ -0,0 +1,63 @@ +# Copyright 2022-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DISTUTILS_USE_PEP517=setuptools +PYTHON_COMPAT=( python3_{9..11} ) +DISTUTILS_SINGLE_IMPL=1 +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_SINGLE_USEDEP}] + $(python_gen_cond_dep ' + dev-python/typing-extensions[${PYTHON_USEDEP}] + ') +" +DEPEND="${RDEPEND} + $(python_gen_cond_dep ' + 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}"/${P}-global-dlopen.patch \ + "${FILESDIR}"/pytorch-1.7.1-torch_shm_manager.patch \ + "${FILESDIR}"/${PN}-1.13.0-setup.patch \ + "${FILESDIR}"/${P}-emptyso.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 +} |