From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 18EE8138359 for ; Tue, 11 Aug 2020 13:44:28 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 61999E087B; Tue, 11 Aug 2020 13:44:27 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 4B8A8E087B for ; Tue, 11 Aug 2020 13:44:27 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 6B47D34ED86 for ; Tue, 11 Aug 2020 13:44:26 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 12EC4274 for ; Tue, 11 Aug 2020 13:44:25 +0000 (UTC) From: "Benda XU" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Benda XU" Message-ID: <1597153456.72df8ef8dc56f868d4feaf7b558e93562b7627f3.heroxbd@gentoo> Subject: [gentoo-commits] proj/sci:master commit in: sci-libs/pytorch/, sci-libs/pytorch/files/ X-VCS-Repository: proj/sci X-VCS-Files: sci-libs/pytorch/files/pytorch-1.6.0-global-dlopen.patch sci-libs/pytorch/pytorch-1.6.0.ebuild X-VCS-Directories: sci-libs/pytorch/files/ sci-libs/pytorch/ X-VCS-Committer: heroxbd X-VCS-Committer-Name: Benda XU X-VCS-Revision: 72df8ef8dc56f868d4feaf7b558e93562b7627f3 X-VCS-Branch: master Date: Tue, 11 Aug 2020 13:44:25 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: c26e2de0-9bc8-4e7e-8486-7ff345338f45 X-Archives-Hash: ee18fb3ba4637e43ab273c02b4d068a8 commit: 72df8ef8dc56f868d4feaf7b558e93562b7627f3 Author: Benda Xu gentoo org> AuthorDate: Tue Aug 11 13:41:24 2020 +0000 Commit: Benda XU gentoo org> CommitDate: Tue Aug 11 13:44:16 2020 +0000 URL: https://gitweb.gentoo.org/proj/sci.git/commit/?id=72df8ef8 sci-libs/pytorch: donot hardcode the library path. Closes: https://bugs.gentoo.org/736643 Package-Manager: Portage-2.3.88, Repoman-2.3.18 Signed-off-by: Benda Xu gentoo.org> sci-libs/pytorch/files/pytorch-1.6.0-global-dlopen.patch | 15 +++++++++++++++ sci-libs/pytorch/pytorch-1.6.0.ebuild | 3 ++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/sci-libs/pytorch/files/pytorch-1.6.0-global-dlopen.patch b/sci-libs/pytorch/files/pytorch-1.6.0-global-dlopen.patch new file mode 100644 index 000000000..1e9388ff1 --- /dev/null +++ b/sci-libs/pytorch/files/pytorch-1.6.0-global-dlopen.patch @@ -0,0 +1,15 @@ +Don't hardcode the library path. Leave it to the dynamic loader. + +Index: pytorch-1.6.0/torch/__init__.py +=================================================================== +--- pytorch-1.6.0.orig/torch/__init__.py ++++ pytorch-1.6.0/torch/__init__.py +@@ -138,7 +138,7 @@ def _load_global_deps(): + here = os.path.abspath(__file__) + lib_path = os.path.join(os.path.dirname(here), 'lib', lib_name) + +- ctypes.CDLL(lib_path, mode=ctypes.RTLD_GLOBAL) ++ ctypes.CDLL(lib_name, mode=ctypes.RTLD_GLOBAL) + + + if (USE_RTLD_GLOBAL_WITH_LIBTORCH or os.getenv('TORCH_USE_RTLD_GLOBAL')) and \ diff --git a/sci-libs/pytorch/pytorch-1.6.0.ebuild b/sci-libs/pytorch/pytorch-1.6.0.ebuild index 1394bdbe3..8c3236244 100644 --- a/sci-libs/pytorch/pytorch-1.6.0.ebuild +++ b/sci-libs/pytorch/pytorch-1.6.0.ebuild @@ -110,6 +110,7 @@ DEPEND="${RDEPEND} PATCHES=( "${FILESDIR}"/${PN}-1.6.0-setup.patch "${FILESDIR}"/${PN}-1.6.0-skip-tests.patch + "${FILESDIR}"/${PN}-pytorch-1.6.0-global-dlopen.patch "${FILESDIR}"/0002-Don-t-build-libtorch-again-for-PyTorch-1.4.0.patch "${FILESDIR}"/0003-Change-path-to-caffe2-build-dir-made-by-libtorch.patch "${FILESDIR}"/0005-Change-library-directory-according-to-CMake-build.patch @@ -272,7 +273,7 @@ src_install() { python_foreach_impl python_optimize fi - find "${ED}/usr/lib64" -name "*.a" -exec rm -fv {} \; + find "${ED}/usr/${LIB}" -name "*.a" -exec rm -fv {} \; use test && rm -rfv "${ED}/usr/test" "${ED}"/usr/bin/test_{api,jit}