From a8d3f40966c06178308ec9a4c7ef354c012ee03a Mon Sep 17 00:00:00 2001 From: David Elsing Date: Wed, 25 Jun 2025 19:10:17 +0200 Subject: gnu: python-pytorch: Improve package. This fixes the build of python-pytorch-for-r-torch and moves the new patches introduced in 81d309de8745605eb76b85e6c445b896c2ba10f3 to the existing patch files for python-pytorch. Fixes guix/guix#779. * gnu/packages/machine-learning.scm (python-pytorch)[source]: Update patches. [arguments]: Adjust the 'use-system-libraries phase. * gnu/packages/patches/python-pytorch-fix-codegen.patch: Adjust patch. * gnu/packages/patches/python-pytorch-runpath.patch: Adjust patch. * gnu/packages/patches/python-pytorch-system-libraries.patch: Adjust patch. * gnu/packages/patches/python-pytorch-runpath-2.7.0.patch: Remove patch. * gnu/packages/patches/python-pytorch-system-libraries-2.7.0.patch: Remove patch. * gnu/packages/patches/python-pytorch-without-kineto-2.7.0.patch: Remove patch. * gnu/packages/patches/python-pytorch-fix-codegen-2.7.0.patch: Remove patch. * gnu/local.mk (dist_patch_DATA): Remove them. --- .../patches/python-pytorch-runpath-2.7.0.patch | 30 ---------------------- 1 file changed, 30 deletions(-) delete mode 100644 gnu/packages/patches/python-pytorch-runpath-2.7.0.patch (limited to 'gnu/packages/patches/python-pytorch-runpath-2.7.0.patch') diff --git a/gnu/packages/patches/python-pytorch-runpath-2.7.0.patch b/gnu/packages/patches/python-pytorch-runpath-2.7.0.patch deleted file mode 100644 index cd8bea370b8..00000000000 --- a/gnu/packages/patches/python-pytorch-runpath-2.7.0.patch +++ /dev/null @@ -1,30 +0,0 @@ -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/cmake/Dependencies.cmake b/cmake/Dependencies.cmake -index be45936a8..7b19e5359 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 bdfa4bfe4..2a75e3825 100644 ---- a/functorch/CMakeLists.txt -+++ b/functorch/CMakeLists.txt -@@ -26,7 +26,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 -- cgit v1.3