Subject: gnu: maths: Build with LAPACK.
From: Dave Love <[email-masked]>
To: [email-masked]
Date: Fri, 22 Dec 2017 13:23:28 +0000
List-Id: <debbugs-submit.debbugs.gnu.org>

This restores the optimizations for LAPACK which OpenBLAS provides.

From c570eaa41688e76e466179dd55bfdc567f1d8110 Mon Sep 17 00:00:00 2001
From: Dave Love <[email-masked]>
Date: Fri, 22 Dec 2017 13:16:12 +0000
Subject: [PATCH] gnu: maths: Build with LAPACK.

* gnu/packages/maths.scm (openblas)[arguments]: Don't disable LAPACK;
add set-extralib phase.
[inputs]: Add fortran-lib.
---
 gnu/packages/maths.scm | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 8a48ec2fc..6c07125b2 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -21,6 +21,7 @@
 ;;; Copyright © 2017 Theodoros Foradis <[email-masked]>
 ;;; Copyright © 2017 Arun Isaac <[email-masked]>
 ;;; Copyright © 2017 Tobias Geerinckx-Rice <[email-masked]>
+;;; Copyright © 2017 Dave Love <me@[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -2649,7 +2650,6 @@ parts of it.")
        #:make-flags
        (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
              "SHELL=bash"
-             "NO_LAPACK=1"
              ;; Build the library for all supported CPUs.  This allows
              ;; switching CPU targets at runtime with the environment variable
              ;; OPENBLAS_CORETYPE=<type>, where "type" is a supported CPU type.
@@ -2670,11 +2670,20 @@ parts of it.")
                    '("TARGET=ARMV8"))
                   (else '()))))
        ;; no configure script
-       #:phases (alist-delete 'configure %standard-phases)))
+       #:phases
+       (modify-phases %standard-phases
+         (delete 'configure)
+         (add-before 'build 'set-extralib
+           (lambda* (#:key inputs #:allow-other-keys)
+             ;; Get libgfortran found when building in utest.
+             (setenv "FEXTRALIB"
+                     (string-append "-L" (assoc-ref inputs "fortran-lib")
+                                    "/lib")))))))
     (native-inputs
      `(("cunit" ,cunit)
        ("perl" ,perl)
        ("fortran" ,gfortran)))
+    (inputs `(("fortran-lib" ,gfortran "lib")))
     (home-page "http://www.openblas.net/")
     (synopsis "Optimized BLAS library based on GotoBLAS")
     (description
-- 
2.11.0