summaryrefslogtreecommitdiff
path: root/gnu/packages/machine-learning.scm
diff options
context:
space:
mode:
authorAyan Das <bvits@riseup.net>2026-02-20 23:14:12 +0530
committerLudovic Courtès <ludo@gnu.org>2026-02-22 18:41:11 +0100
commit19cac579d7d8885fce841bb536e3af5c596433cf (patch)
treea37ae8be07c67d86381899963a5259f1eb7b3c45 /gnu/packages/machine-learning.scm
parentb373a5ccffaa2f9017ec2abd17c70282157f58ca (diff)
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
Diffstat (limited to 'gnu/packages/machine-learning.scm')
-rw-r--r--gnu/packages/machine-learning.scm12
1 files changed, 11 insertions, 1 deletions
diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm
index 66871b229d1..abad5200104 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -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().