From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Brown Subject: bug#32681: OpenBLAS with ILP64 storage model Date: Thu, 13 Sep 2018 09:16:12 -0500 Message-ID: <87y3c5trdf.fsf@fastmail.com> References: <87h8ixjwq2.fsf@fastmail.com> <87muso9w2c.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:44511) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g0SQd-0005x9-CF for bug-guix@gnu.org; Thu, 13 Sep 2018 10:17:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g0SQY-0002h2-Ao for bug-guix@gnu.org; Thu, 13 Sep 2018 10:17:07 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:35088) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g0SQX-0002gu-RQ for bug-guix@gnu.org; Thu, 13 Sep 2018 10:17:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1g0SQX-0004km-Mr for bug-guix@gnu.org; Thu, 13 Sep 2018 10:17:01 -0400 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <87muso9w2c.fsf@gnu.org> ("Ludovic =?UTF-8?Q?Court=C3=A8s?="'s message of "Tue, 11 Sep 2018 12:18:19 +0200") List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: Eric Bavier , 32681@debbugs.gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable ludovic.courtes@inria.fr (Ludovic Court=C3=A8s) writes: > Should we write it as: > > (package > (inherit openblas) > =E2=80=A6) > > ? That would avoid duplication with the =E2=80=98openblas=E2=80=99 packa= ge. > > Also, should we add a =E2=80=98supported-systems=E2=80=99 field to restri= ct builds to > x86_64-linux, aarch64-linux, and mips64el-linux? > > Apart from that it LGTM. > > Thanks for the patch! > > Ludo=E2=80=99. Hi Ludo', Please find a patch attached which incorporates your suggestions. Best regards, Eric --=-=-= Content-Type: text/x-diff; charset=utf-8 Content-Disposition: inline; filename=0001-openblas-ilp64-Add-support-for-the-ILP64-storage-mod.patch Content-Transfer-Encoding: quoted-printable >From 08ec9c94431af425d5dfc2cafc428bee10904ff6 Mon Sep 17 00:00:00 2001 From: Eric Brown Date: Thu, 13 Sep 2018 08:54:36 -0500 Subject: [PATCH] openblas-ilp64: Add support for the ILP64 storage model. * gnu/packages/maths.scm (openblas-ilp64): New variable. --- gnu/packages/maths.scm | 59 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm index af41093fb..7f1034dc4 100644 --- a/gnu/packages/maths.scm +++ b/gnu/packages/maths.scm @@ -27,6 +27,7 @@ ;;; Copyright =C2=A9 2018 Nadya Voronova ;;; Copyright =C2=A9 2018 Adam Massmann ;;; Copyright =C2=A9 2018 Marius Bakke +;;; Copyright =C2=A9 2018 Eric Brown ;;; ;;; This file is part of GNU Guix. ;;; @@ -2873,6 +2874,64 @@ parts of it.") "OpenBLAS is a BLAS library forked from the GotoBLAS2-1.13 BSD versio= n.") (license license:bsd-3))) =20 +(define-public openblas-ilp64 + (package (inherit openblas) + (name "openblas-ilp64") + (version "0.3.2") + (supported-systems (list + "x86_64-linux" + "aarch64-linux" + "mips64el-linux")) + (arguments + `(#:test-target "test" + ;; DYNAMIC_ARCH is only supported on x86. When it is disabled and = no + ;; TARGET is specified, OpenBLAS will tune itself to the build host= , so + ;; we need to disable substitutions. + #:substitutable? + ,(let ((system (or (%current-target-system) (%current-system)))) + (or (string-prefix? "x86_64" system) + (string-prefix? "mips" system) + (string-prefix? "aarch64" system))) + #:make-flags + (list (string-append "PREFIX=3D" (assoc-ref %outputs "out")) + "SHELL=3Dbash" + ;; Build the library for all supported CPUs. This allows + ;; switching CPU targets at runtime with the environment vari= able + ;; OPENBLAS_CORETYPE=3D, where "type" is a supported CP= U type. + ;; Unfortunately, this is not supported on non-x86 architectu= res, + ;; where it leads to failed builds. + "INTERFACE64=3D1" + "LIBNAMESUFFIX=3Dilp64" + ,@(let ((system (or (%current-target-system) (%current-system= )))) + (cond + ((string-prefix? "x86_64" system) + '("DYNAMIC_ARCH=3D1")) + ;; On MIPS we force the "SICORTEX" TARGET, as for the ot= her + ;; two available MIPS targets special extended instructi= ons + ;; for Loongson cores are used. + ((string-prefix? "mips" system) + '("TARGET=3DSICORTEX")) + ;; On aarch64 force the generic 'armv8-a' target + ((string-prefix? "aarch64" system) + '("TARGET=3DARMV8")) + (else '())))) + ;; no configure script + #: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")) + #t))))) + (synopsis "Optimized BLAS library based on GotoBLAS (ILP64 version)") + (description + "OpenBLAS is a BLAS library forked from the GotoBLAS2-1.13 BSD versio= n. (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.) --=20 2.19.0 --=-=-= Content-Type: text/x-diff; charset=utf-8 Content-Disposition: attachment; filename=0001-openblas-ilp64-Add-support-for-the-ILP64-storage-mod.patch Content-Transfer-Encoding: quoted-printable >From 08ec9c94431af425d5dfc2cafc428bee10904ff6 Mon Sep 17 00:00:00 2001 From: Eric Brown Date: Thu, 13 Sep 2018 08:54:36 -0500 Subject: [PATCH] openblas-ilp64: Add support for the ILP64 storage model. * gnu/packages/maths.scm (openblas-ilp64): New variable. --- gnu/packages/maths.scm | 59 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm index af41093fb..7f1034dc4 100644 --- a/gnu/packages/maths.scm +++ b/gnu/packages/maths.scm @@ -27,6 +27,7 @@ ;;; Copyright =C2=A9 2018 Nadya Voronova ;;; Copyright =C2=A9 2018 Adam Massmann ;;; Copyright =C2=A9 2018 Marius Bakke +;;; Copyright =C2=A9 2018 Eric Brown ;;; ;;; This file is part of GNU Guix. ;;; @@ -2873,6 +2874,64 @@ parts of it.") "OpenBLAS is a BLAS library forked from the GotoBLAS2-1.13 BSD versio= n.") (license license:bsd-3))) =20 +(define-public openblas-ilp64 + (package (inherit openblas) + (name "openblas-ilp64") + (version "0.3.2") + (supported-systems (list + "x86_64-linux" + "aarch64-linux" + "mips64el-linux")) + (arguments + `(#:test-target "test" + ;; DYNAMIC_ARCH is only supported on x86. When it is disabled and = no + ;; TARGET is specified, OpenBLAS will tune itself to the build host= , so + ;; we need to disable substitutions. + #:substitutable? + ,(let ((system (or (%current-target-system) (%current-system)))) + (or (string-prefix? "x86_64" system) + (string-prefix? "mips" system) + (string-prefix? "aarch64" system))) + #:make-flags + (list (string-append "PREFIX=3D" (assoc-ref %outputs "out")) + "SHELL=3Dbash" + ;; Build the library for all supported CPUs. This allows + ;; switching CPU targets at runtime with the environment vari= able + ;; OPENBLAS_CORETYPE=3D, where "type" is a supported CP= U type. + ;; Unfortunately, this is not supported on non-x86 architectu= res, + ;; where it leads to failed builds. + "INTERFACE64=3D1" + "LIBNAMESUFFIX=3Dilp64" + ,@(let ((system (or (%current-target-system) (%current-system= )))) + (cond + ((string-prefix? "x86_64" system) + '("DYNAMIC_ARCH=3D1")) + ;; On MIPS we force the "SICORTEX" TARGET, as for the ot= her + ;; two available MIPS targets special extended instructi= ons + ;; for Loongson cores are used. + ((string-prefix? "mips" system) + '("TARGET=3DSICORTEX")) + ;; On aarch64 force the generic 'armv8-a' target + ((string-prefix? "aarch64" system) + '("TARGET=3DARMV8")) + (else '())))) + ;; no configure script + #: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")) + #t))))) + (synopsis "Optimized BLAS library based on GotoBLAS (ILP64 version)") + (description + "OpenBLAS is a BLAS library forked from the GotoBLAS2-1.13 BSD versio= n. (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.) --=20 2.19.0 --=-=-=--