GNU bug report logs - #47646
[PATCH] gnu: blis: Update to 0.8.1.

Previous Next

Package: guix-patches;

Reported by: Philip McGrath <philip <at> philipmcgrath.com>

Date: Wed, 7 Apr 2021 22:52:02 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludovic.courtes <at> inria.fr>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 47646 in the body.
You can then email your comments to 47646 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#47646; Package guix-patches. (Wed, 07 Apr 2021 22:52:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Philip McGrath <philip <at> philipmcgrath.com>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Wed, 07 Apr 2021 22:52:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Philip McGrath <philip <at> philipmcgrath.com>
To: guix-patches <at> gnu.org
Cc: Philip McGrath <philip <at> philipmcgrath.com>
Subject: [PATCH] gnu: blis: Update to 0.8.1.
Date: Wed,  7 Apr 2021 18:51:23 -0400
* gnu/packages/maths.scm (make-blis): Remove internal function.
Inline into ...
(bliss): ... this variable. Update to 0.8.1.
[native-inputs]: Add "python" and "perl".
[arguments]: Adjust 'configure' phase to take advantage of new support
for "configuration families" with runtime hardware detection. Select
configuration automatically based on target systems, and allow
"--blis-config=" in #:configure-flags to override the default.
When building for x86_64, include all supported microarchetecture
specializations. Add "--enable-verbose-make" configure flag for better
build logs. Stop ignoring other flags from #:configure-flags.
Remove explicit #:substitutable? argument: the package is now always
substitutable. Add (srfi srfi-1) to #:modules.
(blis/x86_64): Remove internal macro.
(blis-sandybridge): Remove package: included in 'blis'.
(blis-haswell): Remove package: included in 'blis'.
(blis-knl): Remove package: included in 'blis'.
---
 gnu/packages/maths.scm | 142 +++++++++++++++++++++++------------------
 1 file changed, 79 insertions(+), 63 deletions(-)

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index ff1b46f095..e7d6eef893 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -44,6 +44,7 @@
 ;;; Copyright © 2020 Martin Becze <mjbecze <at> riseup.net>
 ;;; Copyright © 2021 Gerd Heber <gerd.heber <at> gmail.com>
 ;;; Copyright © 2021 Franck Pérignon <franck.perignon <at> univ-grenoble-alpes.fr>
+;;; Copyright © 2021 Philip McGrath <philip <at> philipmcgrath.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -3824,52 +3825,94 @@ parts of it.")
     (synopsis "Optimized BLAS library based on GotoBLAS (ILP64 version)")
     (license license:bsd-3)))
 
-(define* (make-blis implementation #:optional substitutable?)
-  "Return a BLIS package with the given IMPLEMENTATION (see config/ in the
-source tree for a list of implementations.)
-
-SUBSTITUTABLE? determines whether the package is made available as a
-substitute.
-
-Currently the specialization must be selected at configure-time, but work is
-underway to allow BLIS to select the right optimized kernels at run time:
-<https://github.com/flame/blis/issues/129>."
+(define-public blis
   (package
-    (name (if (string=? implementation "reference")
-              "blis"
-              (string-append "blis-" implementation)))
-    (version "0.2.2")
+    (name "blis")
+    (version "0.8.1")
     (home-page "https://github.com/flame/blis")
     (source (origin
               (method git-fetch)
               (uri (git-reference (url home-page) (commit version)))
               (sha256
                (base32
-                "1wr79a50nm4abhw8w3sn96nmwp5mrzifcigk7khw9qcgyyyqayfh"))
+                "05ifil6jj9424sr8kmircl8k4bmxnl3y12a79vwj1kxxva5gz50g"))
               (file-name (git-file-name "blis" version))))
+    (native-inputs
+     `(("python" ,python)
+       ("perl" ,perl)))
     (build-system gnu-build-system)
     (arguments
-     `(#:test-target "test"
-
-       #:substitutable? ,substitutable?
-
-       #:phases (modify-phases %standard-phases
-                  (replace 'configure
-                    (lambda* (#:key outputs #:allow-other-keys)
-                      ;; This is a home-made 'configure' script.
-                      (let ((out (assoc-ref outputs "out")))
-                        (invoke "./configure" "-p" out
-                                "-d" "opt"
-                                "--disable-static"
-                                "--enable-shared"
-                                "--enable-threading=openmp"
-
-                                ,implementation))))
-                  (add-before 'check 'show-test-output
-                    (lambda _
-                      ;; By default "make check" is silent.  Make it verbose.
-                      (system "tail -F output.testsuite &")
-                      #t)))))
+     `(#:modules
+       ((guix build gnu-build-system)
+        (guix build utils)
+        (srfi srfi-1))
+        #:test-target "test"
+       #:phases
+       (modify-phases %standard-phases
+         (replace 'configure
+           (lambda* (#:key outputs
+                           target
+                           system
+                           (configure-flags '())
+                           #:allow-other-keys)
+             ;; This is a home-made 'configure' script.
+             (let* ((out (assoc-ref outputs "out"))
+                     ;; Guix-specific support for choosing the configuration
+                     ;; via #:configure-flags: see below for details.
+                    (config-flag-prefix "--blis-config=")
+                    (maybe-config-flag (find
+                                        (lambda (s)
+                                          (string-prefix? config-flag-prefix s))
+                                        configure-flags))
+                    (configure-flags (if maybe-config-flag
+                                         (delete maybe-config-flag
+                                                 configure-flags)
+                                         configure-flags))
+                    ;; Select the "configuration" to build.
+                    ;; The "generic" configuration is non-optimized but
+                    ;; portable (no assembly).
+                    ;; The "x86_64" configuration family includes
+                    ;; sub-configurations for all supported
+                    ;; x86_64 microarchitectures.
+                    ;; BLIS currently lacks runtime hardware detection
+                    ;; for other architectures: see
+                    ;; <https://github.com/flame/blis/commit/c534da6>.
+                    ;; Conservatively, we stick to "generic" on armhf,
+                    ;; aarch64, and ppc64le for now. (But perhaps
+                    ;; "power9", "cortexa9", and "cortexa57" might be
+                    ;; general enough to use?)
+                    ;; Another approach would be to use the "auto"
+                    ;; configuration and make this package
+                    ;; non-substitutable.
+                    ;; The build is fairly intensive, though.
+                    (blis-config
+                     (cond
+                      (maybe-config-flag
+                       (substring maybe-config-flag
+                                  (string-length config-flag-prefix)))
+                      ((string-prefix? "x86_64" (or target system))
+                       "x86_64")
+                      (else
+                       "generic")))
+                    (configure-args
+                     `("-p" ,out
+                       "-d" "opt"
+                       "--disable-static"
+                       "--enable-shared"
+                       "--enable-threading=openmp"
+                       "--enable-verbose-make"
+                       ,@configure-flags
+                       ,blis-config)))
+               (format #t "configure args: ~s~%" configure-args)
+               (apply invoke
+                      "./configure"
+                      configure-args)
+               #t)))
+         (add-before 'check 'show-test-output
+           (lambda _
+             ;; By default "make check" is silent.  Make it verbose.
+             (system "tail -F output.testsuite &")
+             #t)))))
     (synopsis "High-performance basic linear algebra (BLAS) routines")
     (description
      "BLIS is a portable software framework for instantiating high-performance
@@ -3881,35 +3924,8 @@ it also includes a BLAS compatibility layer which gives application developers
 access to BLIS implementations via traditional BLAS routine calls.")
     (license license:bsd-3)))
 
-(define-public blis
-  ;; This is the "reference" implementation, which is the non-optimized but
-  ;; portable variant (no assembly).
-  (make-blis "reference" #t))
-
 (define ignorance blis)
 
-(define-syntax-rule (blis/x86_64 processor)
-  "Expand to a package specialized for PROCESSOR."
-  (package
-    (inherit (make-blis processor))
-    (supported-systems '("x86_64-linux"))))
-
-(define-public blis-sandybridge
-  ;; BLIS specialized for Sandy Bridge processors (launched 2011):
-  ;; <http://ark.intel.com/products/codename/29900/Sandy-Bridge>.
-  (blis/x86_64 "sandybridge"))
-
-(define-public blis-haswell
-  ;; BLIS specialized for Haswell processors (launched 2013):
-  ;; <http://ark.intel.com/products/codename/42174/Haswell>.
-  (blis/x86_64 "haswell"))
-
-(define-public blis-knl
-  ;; BLIS specialized for Knights Landing processor (launched 2016):
-  ;; <http://ark.intel.com/products/series/92650/Intel-Xeon-Phi-x200-Product-Family>.
-  (blis/x86_64 "knl"))
-
-
 (define-public openlibm
   (package
     (name "openlibm")
-- 
2.21.1 (Apple Git-122.3)





Reply sent to Ludovic Courtès <ludovic.courtes <at> inria.fr>:
You have taken responsibility. (Mon, 12 Apr 2021 10:40:01 GMT) Full text and rfc822 format available.

Notification sent to Philip McGrath <philip <at> philipmcgrath.com>:
bug acknowledged by developer. (Mon, 12 Apr 2021 10:40:01 GMT) Full text and rfc822 format available.

Message #10 received at 47646-done <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludovic.courtes <at> inria.fr>
To: Philip McGrath <philip <at> philipmcgrath.com>
Cc: 47646-done <at> debbugs.gnu.org
Subject: Re: bug#47646: [PATCH] gnu: blis: Update to 0.8.1.
Date: Mon, 12 Apr 2021 12:39:14 +0200
Hi Philip,

Philip McGrath <philip <at> philipmcgrath.com> skribis:

> * gnu/packages/maths.scm (make-blis): Remove internal function.
> Inline into ...
> (bliss): ... this variable. Update to 0.8.1.
> [native-inputs]: Add "python" and "perl".
> [arguments]: Adjust 'configure' phase to take advantage of new support
> for "configuration families" with runtime hardware detection. Select
> configuration automatically based on target systems, and allow
> "--blis-config=" in #:configure-flags to override the default.
> When building for x86_64, include all supported microarchetecture
> specializations. Add "--enable-verbose-make" configure flag for better
> build logs. Stop ignoring other flags from #:configure-flags.
> Remove explicit #:substitutable? argument: the package is now always
> substitutable. Add (srfi srfi-1) to #:modules.
> (blis/x86_64): Remove internal macro.
> (blis-sandybridge): Remove package: included in 'blis'.
> (blis-haswell): Remove package: included in 'blis'.
> (blis-knl): Remove package: included in 'blis'.

Nice!

I applied it and followed up with a commit that adds deprecated aliases
for “blis-sandybridge” & co.

Thanks,
Ludo’.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 10 May 2021 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 349 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.