public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Benda XU" <heroxbd@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/sci:master commit in: sci-libs/pytorch/, sci-libs/pytorch/files/
Date: Tue, 11 Aug 2020 13:44:25 +0000 (UTC)	[thread overview]
Message-ID: <1597153456.72df8ef8dc56f868d4feaf7b558e93562b7627f3.heroxbd@gentoo> (raw)

commit:     72df8ef8dc56f868d4feaf7b558e93562b7627f3
Author:     Benda Xu <heroxbd <AT> gentoo <DOT> org>
AuthorDate: Tue Aug 11 13:41:24 2020 +0000
Commit:     Benda XU <heroxbd <AT> gentoo <DOT> 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 <heroxbd <AT> 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}
 


             reply	other threads:[~2020-08-11 13:44 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-11 13:44 Benda XU [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-07-03  8:37 [gentoo-commits] proj/sci:master commit in: sci-libs/pytorch/, sci-libs/pytorch/files/ Andrew Ammerlaan
2021-12-27 11:50 Andrew Ammerlaan
2021-12-26 14:12 Andrew Ammerlaan
2021-12-26 13:38 Benda XU
2021-12-22 14:33 Andrew Ammerlaan
2021-01-30 15:39 Andrew Ammerlaan
2021-01-24 13:38 Benda XU
2020-08-07 12:56 Benda XU
2020-08-06  1:10 Benda XU

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1597153456.72df8ef8dc56f868d4feaf7b558e93562b7627f3.heroxbd@gentoo \
    --to=heroxbd@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox