diff options
Diffstat (limited to 'gnu/packages/patches/python-pytorch-runpath.patch')
| -rw-r--r-- | gnu/packages/patches/python-pytorch-runpath.patch | 25 |
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 00000000000..6f270ef9b12 --- /dev/null +++ b/gnu/packages/patches/python-pytorch-runpath.patch | |||
| @@ -0,0 +1,25 @@ | |||
| 1 | Libraries (such as 'libtorch_cpu.so') and executables (such as 'torch_shm_manager') | ||
| 2 | get installed, quite surprisingly, to 'lib/python3.8/site-packages/{bin,lib}'. | ||
| 3 | Make sure RUNPATH matches that. | ||
| 4 | |||
| 5 | --- a/cmake/Dependencies.cmake | ||
| 6 | +++ b/cmake/Dependencies.cmake | ||
| 7 | @@ -4,7 +4,7 @@ if(APPLE) | ||
| 8 | set(CMAKE_MACOSX_RPATH ON) | ||
| 9 | set(_rpath_portable_origin "@loader_path") | ||
| 10 | else() | ||
| 11 | - set(_rpath_portable_origin $ORIGIN) | ||
| 12 | + set(_rpath_portable_origin $ORIGIN/../lib) | ||
| 13 | endif(APPLE) | ||
| 14 | # Use separate rpaths during build and install phases | ||
| 15 | set(CMAKE_SKIP_BUILD_RPATH FALSE) | ||
| 16 | |||
| 17 | --- a/caffe2/CMakeLists.txt | ||
| 18 | +++ b/caffe2/CMakeLists.txt | ||
| 19 | @@ -1797,5 +1797,5 @@ if(BUILD_PYTHON) | ||
| 20 | if(${BUILDING_WITH_TORCH_LIBS}) | ||
| 21 | # site-packages/caffe2/python/caffe2_pybind11_state | ||
| 22 | # site-packages/torch/lib | ||
| 23 | - set(caffe2_pybind11_rpath "${_rpath_portable_origin}/../../torch/lib") | ||
| 24 | + set(caffe2_pybind11_rpath $ORIGIN/../../torch/lib) | ||
| 25 | endif(${BUILDING_WITH_TORCH_LIBS}) | ||
