[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Add LAPACKE
From: |
Ricardo Wurmus |
Subject: |
Re: [PATCH] Add LAPACKE |
Date: |
Mon, 11 Jul 2016 11:23:33 +0200 |
User-agent: |
mu4e 0.9.16; emacs 24.5.1 |
Andreas Enge <address@hidden> writes:
> On Fri, Jul 08, 2016 at 05:40:07PM +0200, Ricardo Wurmus wrote:
>> A third option would be to move LAPACKE to its own output.
>
> if this is easily possible, I think this option would be more elegant.
A patch is attached. It produces two output directories:
/gnu/store/40g0xqcikbz6ya7h2gbyj8gck043ajl8-lapack-3.5.0-lapacke
/gnu/store/lqnm7fmpz3si0rgyqz1pzax4ipa25xlx-lapack-3.5.0
The closure of the lapacke output is larger:
$ guix size /gnu/store/40g0xqcikbz6ya7h2gbyj8gck043ajl8-lapack-3.5.0-lapacke
store item total self
/gnu/store/40g0xqcikbz6ya7h2gbyj8gck043ajl8-lapack-3.5.0-lapacke 97.2
2.9 3.0%
/gnu/store/lqnm7fmpz3si0rgyqz1pzax4ipa25xlx-lapack-3.5.0 71.4
6.4 6.6%
/gnu/store/gaximh48qbqf4712bw224ghq919hqp64-gfortran-4.9.3-lib 64.9
27.1 27.9%
/gnu/store/v39bh3ln3ncnzhyw0kd12d46kww9747v-gcc-4.9.3-lib 60.7
22.9 23.5%
/gnu/store/8m00x5x8ykmar27s9248cmhnkdb2n54a-glibc-2.22 37.9
36.5 37.5%
/gnu/store/5y72ql4zbnbd50lf88k91k0y766kq75x-bash-static-4.3.42 1.4
1.4 1.4%
total: 97.2 MiB
But the plain output is unchanged:
$ guix size /gnu/store/lqnm7fmpz3si0rgyqz1pzax4ipa25xlx-lapack-3.5.0
store item total self
/gnu/store/lqnm7fmpz3si0rgyqz1pzax4ipa25xlx-lapack-3.5.0 71.4
6.4 9.0%
/gnu/store/gaximh48qbqf4712bw224ghq919hqp64-gfortran-4.9.3-lib 64.9
27.1 38.0%
/gnu/store/8m00x5x8ykmar27s9248cmhnkdb2n54a-glibc-2.22 37.9
36.5 51.1%
/gnu/store/5y72ql4zbnbd50lf88k91k0y766kq75x-bash-static-4.3.42 1.4
1.4 2.0%
total: 71.4 MiB
I have yet to test that this works as expected with the package I’m
working on.
~~ Ricardo
>From 4e04199427902f535f772cd534a9bd20fb2e4112 Mon Sep 17 00:00:00 2001
From: Ricardo Wurmus <address@hidden>
Date: Fri, 8 Jul 2016 17:34:30 +0200
Subject: [PATCH] gnu: lapack: Add output for lapacke.
* gnu/packages/maths.scm (lapack)[outputs]: New field.
[arguments]: Add build phase to move lapacke to separate output.
---
gnu/packages/maths.scm | 21 ++++++++++++++++++---
1 file changed, 18 insertions(+), 3 deletions(-)
diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 68fb272..86a466e 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -331,10 +331,12 @@ large scale eigenvalue problems.")
"0lk3f97i9imqascnlf6wr5mjpyxqcdj73pgj97dj2mgvyg9z1n4s"))))
(build-system cmake-build-system)
(home-page "http://www.netlib.org/lapack/")
+ (outputs '("out" "lapacke"))
(inputs `(("fortran" ,gfortran)
("python" ,python-2)))
(arguments
- `(#:configure-flags '("-DBUILD_SHARED_LIBS:BOOL=YES")
+ `(#:configure-flags '("-DBUILD_SHARED_LIBS:BOOL=YES"
+ "-DLAPACKE=ON")
#:phases
(modify-phases %standard-phases
(add-before 'check 'patch-python
@@ -342,13 +344,26 @@ large scale eigenvalue problems.")
(let ((python (assoc-ref inputs "python")))
(substitute* "lapack_testing.py"
(("/usr/bin/env python") python))
- #t))))))
+ #t)))
+ (add-after 'install 'use-separate-outputs
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out"))
+ (lapacke (assoc-ref outputs "lapacke")))
+ (mkdir-p (string-append lapacke "/lib/pkgconfig"))
+ (for-each
+ (lambda (file)
+ (rename-file (string-append out file)
+ (string-append lapacke file)))
+ (list "/lib/liblapacke.so"
+ "/lib/pkgconfig/lapacke.pc"
+ "/include")))
+ #t)))))
(synopsis "Library for numerical linear algebra")
(description
"LAPACK is a Fortran 90 library for solving the most commonly occurring
problems in numerical linear algebra.")
(license (license:non-copyleft "file://LICENSE"
- "See LICENSE in the distribution."))))
+ "See LICENSE in the distribution."))))
(define-public scalapack
(package
--
2.9.0