From c884f73010d4d4459e9c9fb257a1d7d4467c7b70 Mon Sep 17 00:00:00 2001 From: Alfredo Tupone Date: Sun, 24 Dec 2023 12:47:13 +0100 Subject: sci-libs/pytorch: nvfuser installed in caffe2 Bug: https://bugs.gentoo.org/914572 Signed-off-by: Alfredo Tupone --- sci-libs/pytorch/pytorch-2.1.1-r1.ebuild | 66 +++++++++++++++++++++++++++++++ sci-libs/pytorch/pytorch-2.1.1.ebuild | 68 -------------------------------- 2 files changed, 66 insertions(+), 68 deletions(-) create mode 100644 sci-libs/pytorch/pytorch-2.1.1-r1.ebuild delete mode 100644 sci-libs/pytorch/pytorch-2.1.1.ebuild (limited to 'sci-libs/pytorch') diff --git a/sci-libs/pytorch/pytorch-2.1.1-r1.ebuild b/sci-libs/pytorch/pytorch-2.1.1-r1.ebuild new file mode 100644 index 000000000000..6d8199663ff6 --- /dev/null +++ b/sci-libs/pytorch/pytorch-2.1.1-r1.ebuild @@ -0,0 +1,66 @@ +# 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 +DISTUTILS_EXT=1 +inherit distutils-r1 prefix + +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}] + dev-python/sympy[${PYTHON_USEDEP}] + ') +" +DEPEND="${RDEPEND} + $(python_gen_cond_dep ' + dev-python/pyyaml[${PYTHON_USEDEP}] + ') +" + +src_prepare() { + eapply \ + "${FILESDIR}"/${P}-dontbuildagain.patch \ + "${FILESDIR}"/pytorch-1.9.0-Change-library-directory-according-to-CMake-build.patch \ + "${FILESDIR}"/${PN}-2.0.0-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 + + hprefixify tools/setup_helpers/env.py +} + +python_compile() { + PYTORCH_BUILD_VERSION=${PV} \ + PYTORCH_BUILD_NUMBER=0 \ + USE_SYSTEM_LIBS=ON \ + CMAKE_BUILD_DIR="${BUILD_DIR}" \ + distutils-r1_python_compile develop sdist +} + +python_install() { + USE_SYSTEM_LIBS=ON distutils-r1_python_install +} diff --git a/sci-libs/pytorch/pytorch-2.1.1.ebuild b/sci-libs/pytorch/pytorch-2.1.1.ebuild deleted file mode 100644 index e53135e714a6..000000000000 --- a/sci-libs/pytorch/pytorch-2.1.1.ebuild +++ /dev/null @@ -1,68 +0,0 @@ -# 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 -DISTUTILS_EXT=1 -inherit distutils-r1 prefix - -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}] - dev-python/sympy[${PYTHON_USEDEP}] - ') -" -DEPEND="${RDEPEND} - $(python_gen_cond_dep ' - dev-python/pyyaml[${PYTHON_USEDEP}] - ') -" - -src_prepare() { - eapply \ - "${FILESDIR}"/${P}-dontbuildagain.patch \ - "${FILESDIR}"/pytorch-1.9.0-Change-library-directory-according-to-CMake-build.patch \ - "${FILESDIR}"/${PN}-2.0.0-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 - - hprefixify tools/setup_helpers/env.py -} - -python_compile() { - PYTORCH_BUILD_VERSION=${PV} \ - PYTORCH_BUILD_NUMBER=0 \ - USE_SYSTEM_LIBS=ON \ - CMAKE_BUILD_DIR="${BUILD_DIR}" \ - distutils-r1_python_compile develop sdist -} - -python_install() { - USE_SYSTEM_LIBS=ON distutils-r1_python_install - python_moduleinto nvfuser - python_domodule third_party/nvfuser/python/__init__.py -} -- cgit v1.2.3-65-gdbad