unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
blob 2c1724cdb0e4c036cf2ef2c66ab9494067dd09c3 1933 bytes (raw)
name: gnu/packages/patches/python-pytorch-runpath.patch 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
 
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.

diff --git a/caffe2/CMakeLists.txt b/caffe2/CMakeLists.txt
index 74836372..c8eb69d1 100644
--- a/caffe2/CMakeLists.txt
+++ b/caffe2/CMakeLists.txt
@@ -1910,7 +1910,7 @@ 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})
 
   # Must also include `CMAKE_SHARED_LINKER_FLAGS` in linker flags for
diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake
index acc95842..8f8fb7d7 100644
--- 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)
diff --git a/functorch/CMakeLists.txt b/functorch/CMakeLists.txt
index f2f32745..db21b656 100644
--- a/functorch/CMakeLists.txt
+++ b/functorch/CMakeLists.txt
@@ -21,7 +21,7 @@ target_link_libraries(${PROJECT_NAME} PRIVATE pybind::pybind11)
 
 set_target_properties(${PROJECT_NAME} PROPERTIES LIBRARY_OUTPUT_DIRECTORY
       ${CMAKE_BINARY_DIR}/functorch)
-set_target_properties(${PROJECT_NAME} PROPERTIES INSTALL_RPATH "${_rpath_portable_origin}/../torch/lib")
+set_target_properties(${PROJECT_NAME} PROPERTIES INSTALL_RPATH "$ORIGIN/../torch/lib")
 
 # Copy-pasted prefix/suffix logic for Python extensions from
 # https://github.com/pytorch/pytorch/blob/33bb8ae350611760139457b85842b1d7edf9aa11/caffe2/CMakeLists.txt#L1975

debug log:

solving 2c1724cdb0 ...
found 2c1724cdb0 in https://yhetil.org/guix-patches/20240306194037.17992-26-david.elsing@posteo.net/ ||
	https://yhetil.org/guix-patches/20240312225211.16427-26-david.elsing@posteo.net/ ||
	https://yhetil.org/guix-patches/20240320223906.13214-26-david.elsing@posteo.net/ ||
	https://yhetil.org/guix-patches/20240323220518.25063-26-david.elsing@posteo.net/
found 7f95b88a2b in https://git.savannah.gnu.org/cgit/guix.git
preparing index
index prepared:
100644 7f95b88a2b5576faba43e4ca3ad60e7029456de0	gnu/packages/patches/python-pytorch-runpath.patch

applying [1/1] https://yhetil.org/guix-patches/20240306194037.17992-26-david.elsing@posteo.net/
diff --git a/gnu/packages/patches/python-pytorch-runpath.patch b/gnu/packages/patches/python-pytorch-runpath.patch
index 7f95b88a2b..2c1724cdb0 100644

1:36: trailing whitespace.
 
1:41: trailing whitespace.
 
Checking patch gnu/packages/patches/python-pytorch-runpath.patch...
Applied patch gnu/packages/patches/python-pytorch-runpath.patch cleanly.
warning: 2 lines add whitespace errors.

skipping https://yhetil.org/guix-patches/20240312225211.16427-26-david.elsing@posteo.net/ for 2c1724cdb0
skipping https://yhetil.org/guix-patches/20240320223906.13214-26-david.elsing@posteo.net/ for 2c1724cdb0
skipping https://yhetil.org/guix-patches/20240323220518.25063-26-david.elsing@posteo.net/ for 2c1724cdb0
index at:
100644 2c1724cdb0e4c036cf2ef2c66ab9494067dd09c3	gnu/packages/patches/python-pytorch-runpath.patch

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).