unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] Add LAPACKE
@ 2016-07-08 15:40 Ricardo Wurmus
  2016-07-08 15:40 ` [PATCH] gnu: Add lapack-with-lapacke Ricardo Wurmus
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Ricardo Wurmus @ 2016-07-08 15:40 UTC (permalink / raw)
  To: guix-devel

Hi Guix,

here's an alternative to the patch provided here:

    https://lists.gnu.org/archive/html/guix-devel/2016-06/msg00099.html

Instead of building LAPACKE as part of the lapack package this patch adds a
new package "lapack-with-lapacke".  I did this because an increase in closure
size of 20MiB is a little much for a commonly used package, in my opinion.

A third option would be to move LAPACKE to its own output.

WDYT?


Ricardo Wurmus (1):
  gnu: Add lapack-with-lapacke.

 gnu/packages/maths.scm | 8 ++++++++
 1 file changed, 8 insertions(+)

-- 
2.5.5

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH] gnu: Add lapack-with-lapacke.
  2016-07-08 15:40 [PATCH] Add LAPACKE Ricardo Wurmus
@ 2016-07-08 15:40 ` Ricardo Wurmus
  2016-07-11  9:17 ` [PATCH] Add LAPACKE Ricardo Wurmus
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 9+ messages in thread
From: Ricardo Wurmus @ 2016-07-08 15:40 UTC (permalink / raw)
  To: guix-devel

* gnu/packages/maths.scm (lapack-with-lapacke): New variable.
---
 gnu/packages/maths.scm | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 68fb272..4abbb2f 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -350,6 +350,14 @@ problems in numerical linear algebra.")
     (license (license:non-copyleft "file://LICENSE"
                                 "See LICENSE in the distribution."))))
 
+(define-public lapack-with-lapacke
+  (package (inherit lapack)
+    (name "lapack-with-lapacke")
+    (arguments
+     (substitute-keyword-arguments (package-arguments lapack)
+       ((#:configure-flags flags)
+        `(cons "-DLAPACKE=ON" ,flags))))))
+
 (define-public scalapack
   (package
     (name "scalapack")
-- 
2.5.5

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] Add LAPACKE
  2016-07-08 15:40 [PATCH] Add LAPACKE Ricardo Wurmus
  2016-07-08 15:40 ` [PATCH] gnu: Add lapack-with-lapacke Ricardo Wurmus
@ 2016-07-11  9:17 ` Ricardo Wurmus
  2016-07-12 13:45   ` Ricardo Wurmus
       [not found] ` <20160710142058.GA5924@solar>
  2016-07-12 15:21 ` Ludovic Courtès
  3 siblings, 1 reply; 9+ messages in thread
From: Ricardo Wurmus @ 2016-07-11  9:17 UTC (permalink / raw)
  To: guix-devel

[-- Attachment #1: Type: text/plain, Size: 1992 bytes --]


Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de> writes:

> Instead of building LAPACKE as part of the lapack package this patch adds a
> new package "lapack-with-lapacke".  I did this because an increase in closure
> size of 20MiB is a little much for a commonly used package, in my opinion.
>
> A third option would be to move LAPACKE to its own output.

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, as expected:

$ 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


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-lapack-Add-output-for-lapacke.patch --]
[-- Type: text/x-patch, Size: 2521 bytes --]

From 4e04199427902f535f772cd534a9bd20fb2e4112 Mon Sep 17 00:00:00 2001
From: Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>
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


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] Add LAPACKE
       [not found] ` <20160710142058.GA5924@solar>
@ 2016-07-11  9:23   ` Ricardo Wurmus
  0 siblings, 0 replies; 9+ messages in thread
From: Ricardo Wurmus @ 2016-07-11  9:23 UTC (permalink / raw)
  To: Andreas Enge; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 1868 bytes --]


Andreas Enge <andreas@enge.fr> 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


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-lapack-Add-output-for-lapacke.patch --]
[-- Type: text/x-patch, Size: 2521 bytes --]

From 4e04199427902f535f772cd534a9bd20fb2e4112 Mon Sep 17 00:00:00 2001
From: Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>
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


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] Add LAPACKE
  2016-07-11  9:17 ` [PATCH] Add LAPACKE Ricardo Wurmus
@ 2016-07-12 13:45   ` Ricardo Wurmus
  0 siblings, 0 replies; 9+ messages in thread
From: Ricardo Wurmus @ 2016-07-12 13:45 UTC (permalink / raw)
  To: guix-devel


Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de> writes:

> Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de> writes:
>
>> Instead of building LAPACKE as part of the lapack package this patch adds a
>> new package "lapack-with-lapacke".  I did this because an increase in closure
>> size of 20MiB is a little much for a commonly used package, in my opinion.
>>
>> A third option would be to move LAPACKE to its own output.
>
> A patch is attached.  It produces two output directories:

[...]

> I have yet to test that this works as expected with the package I’m
> working on.

This works.  I think this is the best of the available options.

~~ Ricardo

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Add LAPACKE
  2016-07-08 15:40 [PATCH] Add LAPACKE Ricardo Wurmus
                   ` (2 preceding siblings ...)
       [not found] ` <20160710142058.GA5924@solar>
@ 2016-07-12 15:21 ` Ludovic Courtès
  2016-07-13 12:22   ` Ricardo Wurmus
  3 siblings, 1 reply; 9+ messages in thread
From: Ludovic Courtès @ 2016-07-12 15:21 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: guix-devel

Hi!

Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de> skribis:

> here's an alternative to the patch provided here:
>
>     https://lists.gnu.org/archive/html/guix-devel/2016-06/msg00099.html
>
> Instead of building LAPACKE as part of the lapack package this patch adds a
> new package "lapack-with-lapacke".  I did this because an increase in closure
> size of 20MiB is a little much for a commonly used package, in my opinion.

The 20 MiB increase shown in the message above correspond mostly to
gcc:lib, which is present anyway, so I would say it’s acceptable.

WDYT?

Ludo’.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Add LAPACKE
  2016-07-12 15:21 ` Ludovic Courtès
@ 2016-07-13 12:22   ` Ricardo Wurmus
  2016-07-14 16:15     ` Andreas Enge
  0 siblings, 1 reply; 9+ messages in thread
From: Ricardo Wurmus @ 2016-07-13 12:22 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel


Ludovic Courtès <ludo@gnu.org> writes:

> Hi!
>
> Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de> skribis:
>
>> here's an alternative to the patch provided here:
>>
>>     https://lists.gnu.org/archive/html/guix-devel/2016-06/msg00099.html
>>
>> Instead of building LAPACKE as part of the lapack package this patch adds a
>> new package "lapack-with-lapacke".  I did this because an increase in closure
>> size of 20MiB is a little much for a commonly used package, in my opinion.
>
> The 20MiB increase shown in the message above correspond mostly to
> gcc:lib, which is present anyway, so I would say it’s acceptable.

Well, in this case I’ll just apply Dave’s patch then (see email in the
ML archive).

“guix refresh -l lapack” shows me that 51 packages are affected, which
results in a rebuild of 86 dependent packages.  Okay to push to master?

~~ Ricardo

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Add LAPACKE
  2016-07-13 12:22   ` Ricardo Wurmus
@ 2016-07-14 16:15     ` Andreas Enge
  2016-07-17 15:52       ` Ricardo Wurmus
  0 siblings, 1 reply; 9+ messages in thread
From: Andreas Enge @ 2016-07-14 16:15 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: guix-devel

On Wed, Jul 13, 2016 at 02:22:12PM +0200, Ricardo Wurmus wrote:
> “guix refresh -l lapack” shows me that 51 packages are affected, which
> results in a rebuild of 86 dependent packages.  Okay to push to master?

I would do so.

Andreas

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Add LAPACKE
  2016-07-14 16:15     ` Andreas Enge
@ 2016-07-17 15:52       ` Ricardo Wurmus
  0 siblings, 0 replies; 9+ messages in thread
From: Ricardo Wurmus @ 2016-07-17 15:52 UTC (permalink / raw)
  To: Andreas Enge; +Cc: guix-devel


Andreas Enge <andreas@enge.fr> writes:

> On Wed, Jul 13, 2016 at 02:22:12PM +0200, Ricardo Wurmus wrote:
>> “guix refresh -l lapack” shows me that 51 packages are affected, which
>> results in a rebuild of 86 dependent packages.  Okay to push to master?
>
> I would do so.

Okay.  I’ve pushed the change.

~~ Ricardo

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2016-07-17 15:52 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-08 15:40 [PATCH] Add LAPACKE Ricardo Wurmus
2016-07-08 15:40 ` [PATCH] gnu: Add lapack-with-lapacke Ricardo Wurmus
2016-07-11  9:17 ` [PATCH] Add LAPACKE Ricardo Wurmus
2016-07-12 13:45   ` Ricardo Wurmus
     [not found] ` <20160710142058.GA5924@solar>
2016-07-11  9:23   ` Ricardo Wurmus
2016-07-12 15:21 ` Ludovic Courtès
2016-07-13 12:22   ` Ricardo Wurmus
2016-07-14 16:15     ` Andreas Enge
2016-07-17 15:52       ` Ricardo Wurmus

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).