1
0
mirror of synced 2024-12-23 05:10:24 +01:00
TheChymera-overlay/sci-libs/pytorch/files/pytorch-1.6.0-global-dlopen.patch
Horea Christian 61db1849ca
sci-libs/pytorch: fix ahead of Gentoo Science
Bug: https://bugs.gentoo.org/738592
Package-Manager: Portage-3.0.2, Repoman-2.3.23
Signed-off-by: Horea Christian <chr@chymera.eu>
2020-08-23 04:12:34 -04:00

16 lines
592 B
Diff

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 \