[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
05/211: gnu: liblantern: Do not hardcode Python version.
From: |
guix-commits |
Subject: |
05/211: gnu: liblantern: Do not hardcode Python version. |
Date: |
Tue, 20 Sep 2022 06:23:34 -0400 (EDT) |
rekado pushed a commit to branch wip-r
in repository guix.
commit a389f3f7331849666fe35c29be2567af228f8a34
Author: Ricardo Wurmus <rekado@elephly.net>
AuthorDate: Mon Sep 19 20:26:00 2022 +0200
gnu: liblantern: Do not hardcode Python version.
* gnu/packages/machine-learning.scm (liblantern)[arguments]: Do not hardcode
Python version.
---
gnu/packages/machine-learning.scm | 77 +++++++++++++++++++++------------------
1 file changed, 41 insertions(+), 36 deletions(-)
diff --git a/gnu/packages/machine-learning.scm
b/gnu/packages/machine-learning.scm
index 0a12065978..3ef4283771 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -3180,42 +3180,47 @@ of Hidden Markov Models.")
(list
#:tests? #false ;no test target
#:phases
- #~(modify-phases %standard-phases
- (add-after 'unpack 'chdir
- (lambda _ (chdir "lantern")))
- (add-after 'chdir 'do-not-download-binaries
- (lambda* (#:key inputs #:allow-other-keys)
- (substitute* "CMakeLists.txt"
- (("find_package\\(Torch.*") "set(TORCH_CXX_FLAGS
\"-ltorch\")\n")
- (("retrieve_lib\\(.*") ""))
- (setenv "LIBRARY_PATH"
- (string-append
- (search-input-directory
- inputs "/lib/python3.9/site-packages/torch/lib")
- ":" (or (getenv "LIBRARY_PATH") "")))
- (setenv "CPLUS_INCLUDE_PATH"
- (string-append
- (search-input-directory
- inputs
"lib/python3.9/site-packages/torch/include/torch/csrc/api/include/")
- ":"
- (search-input-directory
- inputs "lib/python3.9/site-packages/torch/include/")
- ":"
- (or (getenv "CPLUS_INCLUDE_PATH") "")))
- (setenv "C_INCLUDE_PATH"
- (string-append
- (search-input-directory
- inputs "lib/python3.9/site-packages/torch/include/")
- ":"
- (or (getenv "C_INCLUDE_PATH") "")))))
- (replace 'install
- (lambda _
- (install-file
- "../build/liblantern.so"
- (string-append #$output "/lib"))
- (copy-recursively
- "../lantern/include"
- (string-append #$output "/include")))))))
+ (let ((python-version (version-major+minor (package-version python))))
+ #~(modify-phases %standard-phases
+ (add-after 'unpack 'chdir
+ (lambda _ (chdir "lantern")))
+ (add-after 'chdir 'do-not-download-binaries
+ (lambda* (#:key inputs #:allow-other-keys)
+ (substitute* "CMakeLists.txt"
+ (("find_package\\(Torch.*") "set(TORCH_CXX_FLAGS
\"-ltorch\")\n")
+ (("retrieve_lib\\(.*") ""))
+ (let ((site-packages (string-append "/lib/python"
+ #$python-version
+ "/site-packages")))
+ (setenv "LIBRARY_PATH"
+ (string-append
+ (search-input-directory
+ inputs (string-append site-packages "/torch/lib"))
+ ":" (or (getenv "LIBRARY_PATH") "")))
+ (setenv "CPLUS_INCLUDE_PATH"
+ (string-append
+ (search-input-directory
+ inputs (string-append
+ site-packages
"/torch/include/torch/csrc/api/include/"))
+ ":"
+ (search-input-directory
+ inputs (string-append site-packages
"/torch/include/"))
+ ":"
+ (or (getenv "CPLUS_INCLUDE_PATH") "")))
+ (setenv "C_INCLUDE_PATH"
+ (string-append
+ (search-input-directory
+ inputs (string-append site-packages
"/torch/include/"))
+ ":"
+ (or (getenv "C_INCLUDE_PATH") ""))))))
+ (replace 'install
+ (lambda _
+ (install-file
+ "../build/liblantern.so"
+ (string-append #$output "/lib"))
+ (copy-recursively
+ "../lantern/include"
+ (string-append #$output "/include"))))))))
(inputs (list python-pytorch-for-r-torch))
(home-page "https://github.com/mlverse/torch/")
(synopsis "C API to libtorch")
- 39/211: gnu: r-broom: Update to 1.0.1., (continued)
- 39/211: gnu: r-broom: Update to 1.0.1., guix-commits, 2022/09/20
- 27/211: gnu: r-reprex: Update to 2.0.2., guix-commits, 2022/09/20
- 47/211: gnu: r-urca: Update to 1.3-3., guix-commits, 2022/09/20
- 61/211: gnu: r-flextable: Update to 0.8.0., guix-commits, 2022/09/20
- 35/211: gnu: r-prismatic: Update to 1.1.1., guix-commits, 2022/09/20
- 60/211: gnu: r-insight: Update to 0.18.3., guix-commits, 2022/09/20
- 30/211: gnu: r-modelr: Update to 0.1.9., guix-commits, 2022/09/20
- 68/211: gnu: r-mosaic: Update to 1.8.4., guix-commits, 2022/09/20
- 12/211: gnu: r-perfmeas: Update to 1.2.5., guix-commits, 2022/09/20
- 11/211: gnu: r-valr: Update to 0.6.5., guix-commits, 2022/09/20
- 05/211: gnu: liblantern: Do not hardcode Python version.,
guix-commits <=
- 06/211: gnu: liblantern: Update to 0.8.1., guix-commits, 2022/09/20
- 22/211: gnu: r-ggpmisc: Update to 0.5.0., guix-commits, 2022/09/20
- 14/211: gnu: r-activedriverwgs: Update to 1.2.0., guix-commits, 2022/09/20
- 20/211: gnu: r-zoo: Update to 1.8-11., guix-commits, 2022/09/20
- 24/211: gnu: r-poorman: Update to 0.2.6., guix-commits, 2022/09/20
- 15/211: gnu: r-datawizard: Update to 0.6.0., guix-commits, 2022/09/20
- 17/211: gnu: r-googlesheets4: Update to 1.0.1., guix-commits, 2022/09/20
- 23/211: gnu: r-scales: Update to 1.2.1., guix-commits, 2022/09/20
- 70/211: gnu: r-emmeans: Update to 1.8.1-1., guix-commits, 2022/09/20
- 65/211: gnu: r-ggformula: Update to 0.10.2., guix-commits, 2022/09/20