summaryrefslogtreecommitdiff
path: root/gnu/packages/patches/python-pytorch-runpath.patch
diff options
context:
space:
mode:
authorLudovic Courtès <ludovic.courtes@inria.fr>2021-08-04 16:15:17 +0200
committerLudovic Courtès <ludo@gnu.org>2021-08-04 17:22:19 +0200
commitdd55ad7ff896a0a099c669ef0b420ae2bcdb4498 (patch)
tree0efc262e70471635e14b12fe6b6f1caec5646416 /gnu/packages/patches/python-pytorch-runpath.patch
parent38d319d38aeb501490e5e803da92e2255e1d8a8f (diff)
downloadguix-patches-dd55ad7ff896a0a099c669ef0b420ae2bcdb4498.tar
guix-patches-dd55ad7ff896a0a099c669ef0b420ae2bcdb4498.tar.gz
gnu: Add python-pytorch.
* gnu/packages/machine-learning.scm (python-pytorch): New variable. * gnu/packages/patches/python-pytorch-runpath.patch, gnu/packages/patches/python-pytorch-system-libraries.patch: New files. * gnu/local.mk (dist_patch_DATA): Add them.
Diffstat (limited to 'gnu/packages/patches/python-pytorch-runpath.patch')
-rw-r--r--gnu/packages/patches/python-pytorch-runpath.patch25
1 files changed, 25 insertions, 0 deletions
diff --git a/gnu/packages/patches/python-pytorch-runpath.patch b/gnu/packages/patches/python-pytorch-runpath.patch
new file mode 100644
index 0000000000..6f270ef9b1
--- /dev/null
+++ b/gnu/packages/patches/python-pytorch-runpath.patch
@@ -0,0 +1,25 @@
+Libraries (such as 'libtorch_cpu.so') and executables (such as 'torch_shm_manager')
+get installed, quite surprisingly, to 'lib/python3.8/site-packages/{bin,lib}'.
+Make sure RUNPATH matches that.
+
+--- a/cmake/Dependencies.cmake
++++ b/cmake/Dependencies.cmake
+@@ -4,7 +4,7 @@ if(APPLE)
+ set(CMAKE_MACOSX_RPATH ON)
+ set(_rpath_portable_origin "@loader_path")
+ else()
+- set(_rpath_portable_origin $ORIGIN)
++ set(_rpath_portable_origin $ORIGIN/../lib)
+ endif(APPLE)
+ # Use separate rpaths during build and install phases
+ set(CMAKE_SKIP_BUILD_RPATH FALSE)
+
+--- a/caffe2/CMakeLists.txt
++++ b/caffe2/CMakeLists.txt
+@@ -1797,5 +1797,5 @@ if(BUILD_PYTHON)
+ if(${BUILDING_WITH_TORCH_LIBS})
+ # site-packages/caffe2/python/caffe2_pybind11_state
+ # site-packages/torch/lib
+- set(caffe2_pybind11_rpath "${_rpath_portable_origin}/../../torch/lib")
++ set(caffe2_pybind11_rpath $ORIGIN/../../torch/lib)
+ endif(${BUILDING_WITH_TORCH_LIBS})