guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

09/09: gnu: Add libflame.


From: guix-commits
Subject: 09/09: gnu: Add libflame.
Date: Thu, 27 Aug 2020 11:20:12 -0400 (EDT)

efraim pushed a commit to branch master
in repository guix.

commit 9bb7534a3dd81c4ecfdb90a50927fcb268de0963
Author: Efraim Flashner <efraim@flashner.co.il>
AuthorDate: Tue Aug 25 18:52:18 2020 +0300

    gnu: Add libflame.
    
    * gnu/packages/maths.scm (libflame): New variable.
---
 gnu/packages/maths.scm | 81 +++++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 80 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index ce8ab22..97f57dd 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -135,7 +135,8 @@
   #:use-module (gnu packages version-control)
   #:use-module (gnu packages wxwidgets)
   #:use-module (gnu packages xml)
-  #:use-module (srfi srfi-1))
+  #:use-module (srfi srfi-1)
+  #:use-module (srfi srfi-26))
 
 (define-public aris
   (package
@@ -1756,6 +1757,84 @@ linear and quadratic objectives.  There are limited 
facilities for nonlinear
 and quadratic objectives using the Simplex algorithm.")
     (license license:epl1.0)))
 
+(define-public libflame
+  (package
+    (name "libflame")
+    (version "5.2.0")
+    (outputs '("out" "static"))
+    (source
+      (origin
+        (method git-fetch)
+        (uri (git-reference
+               (url "https://github.com/flame/libflame";)
+               (commit version)))
+        (file-name (git-file-name name version))
+        (sha256
+         (base32
+          "1n6lf0wvpp77lxqlr721h2jbfbzigphdp19wq8ajiccilcksh7ay"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:configure-flags
+       ;; Sensible defaults: https://github.com/flame/libflame/issues/28
+       (list "--enable-dynamic-build"
+             "--enable-max-arg-list-hack"
+             "--enable-lapack2flame"
+             "--enable-verbose-make-output"
+             "--enable-multithreading=pthreads" ; Openblas isn't built with 
openmp.
+             ,@(if (any (cute string-prefix? <> (or (%current-target-system)
+                                                    (%current-system)))
+                        '("x86_64" "i686"))
+                 '("--enable-vector-intrinsics=sse")
+                 '())
+             "--enable-supermatrix"
+             "--enable-memory-alignment=16"
+             "--enable-ldim-alignment")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-/usr/bin/env-bash
+           (lambda _
+             (substitute* "build/config.mk.in"
+               (("/usr/bin/env bash") (which "bash")))
+             #t))
+         (replace 'check
+           (lambda* (#:key tests? #:allow-other-keys)
+             (substitute* "test/Makefile"
+               (("LIBBLAS .*") "LIBBLAS = -lblas\n")
+               (("LIBLAPACK .*") "LIBLAPACK = -llapack\n"))
+             (if tests?
+               (with-directory-excursion "test"
+                 (mkdir "obj")
+                 (invoke "make")
+                 (invoke "./test_libflame.x"))
+               #t)))
+         (add-after 'install 'install-static
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((out (assoc-ref outputs "out"))
+                   (static (assoc-ref outputs "static")))
+               (mkdir-p (string-append static "/lib"))
+               (rename-file (string-append out "/lib/libflame.a")
+                            (string-append static "/lib/libflame.a"))
+               (install-file (string-append out "/include/FLAME.h")
+                             (string-append static "/include"))
+               #t))))))
+    (inputs
+     `(("gfortran" ,gfortran)))
+    (native-inputs
+     `(("lapack" ,lapack)
+       ("openblas" ,openblas)
+       ("perl" ,perl)
+       ("python" ,python-wrapper)))
+    (home-page "https://github.com/flame/libflame";)
+    (synopsis "High-performance object-based library for DLA computations")
+    (description "@code{libflame} is a portable library for dense matrix
+computations, providing much of the functionality present in LAPACK, developed
+by current and former members of the @acronym{SHPC, Science of High-Performance
+Computing} group in the @url{https://www.ices.utexas.edu/, Institute for
+Computational Engineering and Sciences} at The University of Texas at Austin.
+@code{libflame} includes a compatibility layer, @code{lapack2flame}, which
+includes a complete LAPACK implementation.")
+    (license license:bsd-3)))
+
 (define-public ceres
   (package
     (name "ceres-solver")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]