[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
05/214: gnu: liblantern: Do not hardcode Python version.
From: |
guix-commits |
Subject: |
05/214: gnu: liblantern: Do not hardcode Python version. |
Date: |
Tue, 20 Sep 2022 11:06:52 -0400 (EDT) |
rekado pushed a commit to branch master
in repository guix.
commit 7531efe54ddb3fe2ff5cede8505bae9e292987b2
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")
- branch master updated (9e589ca6e3 -> 8084e3bdb3), guix-commits, 2022/09/20
- 01/214: gnu: Add r-confintr., guix-commits, 2022/09/20
- 03/214: gnu: apache-arrow: Update to 9.0.0., guix-commits, 2022/09/20
- 02/214: gnu: r-rintrojs: Update to 0.3.2., guix-commits, 2022/09/20
- 19/214: gnu: r-babelwhale: Update to 1.1.0., guix-commits, 2022/09/20
- 15/214: gnu: r-datawizard: Update to 0.6.0., guix-commits, 2022/09/20
- 12/214: gnu: r-perfmeas: Update to 1.2.5., guix-commits, 2022/09/20
- 16/214: gnu: r-dixontest: Update to 1.0.4., guix-commits, 2022/09/20
- 24/214: gnu: r-poorman: Update to 0.2.6., guix-commits, 2022/09/20
- 05/214: gnu: liblantern: Do not hardcode Python version.,
guix-commits <=
- 13/214: gnu: r-htscluster: Update to 2.0.10., guix-commits, 2022/09/20
- 09/214: gnu: r-dt: Update to 0.25., guix-commits, 2022/09/20
- 04/214: gnu: r-arrow: Update to 9.0.0.1., guix-commits, 2022/09/20
- 06/214: gnu: liblantern: Update to 0.8.1., guix-commits, 2022/09/20
- 14/214: gnu: r-activedriverwgs: Update to 1.2.0., guix-commits, 2022/09/20
- 80/214: gnu: r-rcppalgos: Update to 2.6.0., guix-commits, 2022/09/20
- 93/214: gnu: r-future: Update to 1.28.0., guix-commits, 2022/09/20
- 116/214: gnu: r-covr: Update to 3.6.1., guix-commits, 2022/09/20
- 136/214: gnu: r-tam: Update to 4.1-4., guix-commits, 2022/09/20
- 43/214: gnu: r-xfun: Update to 0.33., guix-commits, 2022/09/20