1
0
mirror of https://git.savannah.gnu.org/git/guix.git synced 2026-04-06 21:20:33 +02:00

gnu: python-pytorch-for-r-torch: Fix build and RUNPATH.

* gnu/packages/machine-learning.scm (python-pytorch-for-r-torch):
[arguments] <#:phases>: In 'use-system-libraries', replace the
'build_bundled' import workaround with a no-op 'create_bundled'
binding.  Adjust functorch INSTALL_RPATH to "$ORIGIN/../torch/lib".

Change-Id: I6386137d658dc11c6b0a3b553de87524a4b1d708
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Merges: #6004
This commit is contained in:
Ayan Das
2026-02-20 23:14:12 +05:30
committed by Ludovic Courtès
parent b373a5ccff
commit 19cac579d7

View File

@@ -5425,6 +5425,12 @@ in the audio domain.")
;; For Vulkan
(substitute* "CMakeLists.txt"
(("append_cxx_flag.*-Werror=(return-type|range-loop-construct).*") ""))
;; In this variant functorch is installed directly under
;; site-packages/functorch, so use a direct rpath to
;; site-packages/torch/lib.
(substitute* "functorch/CMakeLists.txt"
(("set_target_properties\\(\\$\\{PROJECT_NAME\\} PROPERTIES INSTALL_RPATH \"\\$\\{_rpath_portable_origin\\}/\\.\\./torch/lib\"\\)")
"set_target_properties(${PROJECT_NAME} PROPERTIES INSTALL_RPATH \"$ORIGIN/../torch/lib\")"))
(substitute*
(cons*
"torch/csrc/Module.cpp"
@@ -5454,7 +5460,11 @@ in the audio domain.")
(setenv "USE_QNNPACK" "0"))
(substitute* '("requirements.txt" "setup.py")
(("sympy>=1\\.13\\.3")
"sympy>=1.13.1"))))
"sympy>=1.13.1"))
;; Avoid ModuleNotFoundError while preserving setup.py flow.
(substitute* "setup.py"
(("from build_bundled import create_bundled")
"create_bundled = lambda *args, **kwargs: None"))))
(replace 'skip-nccl-call
(lambda _
;; Comment-out `checkout_nccl()` invokation in build_pytorch().