unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>
To: guix-devel@gnu.org
Subject: Re: [PATCH] Add LAPACKE
Date: Mon, 11 Jul 2016 11:17:44 +0200	[thread overview]
Message-ID: <idjoa64ttxj.fsf@bimsb-sys02.mdc-berlin.net> (raw)
In-Reply-To: <20160708154008.24871-1-ricardo.wurmus@mdc-berlin.de>

[-- 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


  parent reply	other threads:[~2016-07-11  9:17 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2016-07-12 13:45   ` [PATCH] Add LAPACKE 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=idjoa64ttxj.fsf@bimsb-sys02.mdc-berlin.net \
    --to=ricardo.wurmus@mdc-berlin.de \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).