me
/
guix
Archived
1
0
Fork 0

gnu: OpenBLAS: Use G-expressions.

* gnu/packages/maths.scm (openblas, openblas-ilp64)[arguments]: Convert to
gexp's.
master
Marius Bakke 2022-06-30 22:31:29 +02:00
parent 5e2ecfab7c
commit 8ee9d25ebc
No known key found for this signature in database
GPG Key ID: A2A06DF2A33A54FA
1 changed files with 62 additions and 61 deletions

View File

@ -4487,66 +4487,67 @@ parts of it.")
"0r4sz3rn68fyc2paq0a04pgfi7iszpm95f6ggbzxpvjzx9qxbcql")))) "0r4sz3rn68fyc2paq0a04pgfi7iszpm95f6ggbzxpvjzx9qxbcql"))))
(build-system gnu-build-system) (build-system gnu-build-system)
(arguments (arguments
`(#:test-target "test" (list
;; DYNAMIC_ARCH is only supported on x86. When it is disabled and no #:test-target "test"
;; TARGET is specified, OpenBLAS will tune itself to the build host, so ;; DYNAMIC_ARCH is only supported on x86. When it is disabled and no
;; we need to disable substitutions. ;; TARGET is specified, OpenBLAS will tune itself to the build host, so
#:substitutable? ;; we need to disable substitutions.
,(let ((system (or (%current-target-system) (%current-system)))) #:substitutable?
(or (string-prefix? "x86_64" system) (let ((system (or (%current-target-system) (%current-system))))
(string-prefix? "i686" system) (or (string-prefix? "x86_64" system)
(string-prefix? "mips" system) (string-prefix? "i686" system)
(string-prefix? "aarch64" system))) (string-prefix? "mips" system)
#:make-flags (string-prefix? "aarch64" system)))
(list (string-append "PREFIX=" (assoc-ref %outputs "out")) #:make-flags
"SHELL=bash" #~(list (string-append "PREFIX=" #$output)
"MAKE_NB_JOBS=0" ;use jobserver for submakes "SHELL=bash"
"NO_STATIC=1" ;avoid a 67 MiB static archive "MAKE_NB_JOBS=0" ;use jobserver for submakes
"NO_STATIC=1" ;avoid a 67 MiB static archive
;; This is the maximum number of threads OpenBLAS will ever use (that ;; This is the maximum number of threads OpenBLAS will ever use (that
;; is, if $OPENBLAS_NUM_THREADS is greater than that, then NUM_THREADS ;; is, if $OPENBLAS_NUM_THREADS is greater than that, then NUM_THREADS
;; is used.) If we don't set it, the makefile sets it to the number ;; is used.) If we don't set it, the makefile sets it to the number
;; of cores of the build machine, which is obviously wrong. ;; of cores of the build machine, which is obviously wrong.
"NUM_THREADS=128" "NUM_THREADS=128"
;; Build the library for all supported CPUs. This allows ;; Build the library for all supported CPUs. This allows
;; switching CPU targets at runtime with the environment variable ;; switching CPU targets at runtime with the environment variable
;; OPENBLAS_CORETYPE=<type>, where "type" is a supported CPU type. ;; OPENBLAS_CORETYPE=<type>, where "type" is a supported CPU type.
;; Unfortunately, this is not supported on all architectures, ;; Unfortunately, this is not supported on all architectures,
;; where it leads to failed builds. ;; where it leads to failed builds.
,@(let ((system (or (%current-target-system) (%current-system)))) #$@(let ((system (or (%current-target-system) (%current-system))))
(cond (cond
((or (string-prefix? "x86_64" system) ((or (string-prefix? "x86_64" system)
(string-prefix? "i686" system) (string-prefix? "i686" system)
(string-prefix? "powerpc64le" system) (string-prefix? "powerpc64le" system)
(string-prefix? "aarch64" system)) (string-prefix? "aarch64" system))
;; Dynamic older enables a few extra CPU architectures that ;; Dynamic older enables a few extra CPU architectures that
;; were released before 2010. ;; were released before 2010.
'("DYNAMIC_ARCH=1" "DYNAMIC_OLDER=1" "TARGET=GENERIC")) '("DYNAMIC_ARCH=1" "DYNAMIC_OLDER=1" "TARGET=GENERIC"))
;; On some of these architectures the CPU can't be detected. ;; On some of these architectures the CPU can't be detected.
;; On MIPS we force the "SICORTEX" TARGET, as for the other ;; On MIPS we force the "SICORTEX" TARGET, as for the other
;; two available MIPS targets special extended instructions ;; two available MIPS targets special extended instructions
;; for Loongson cores are used. ;; for Loongson cores are used.
((string-prefix? "mips" system) ((string-prefix? "mips" system)
'("TARGET=SICORTEX")) '("TARGET=SICORTEX"))
;; Failed to detect CPU. ;; Failed to detect CPU.
((string-prefix? "armhf" system) ((string-prefix? "armhf" system)
'("TARGET=ARMV7")) '("TARGET=ARMV7"))
((string-prefix? "riscv64" system) ((string-prefix? "riscv64" system)
'("TARGET=RISCV64_GENERIC")) '("TARGET=RISCV64_GENERIC"))
(else '())))) (else '()))))
;; no configure script ;; no configure script
#:phases #:phases
(modify-phases %standard-phases #~(modify-phases %standard-phases
(delete 'configure) (delete 'configure)
(add-before 'build 'set-extralib (add-before 'build 'set-extralib
(lambda* (#:key inputs #:allow-other-keys) (lambda* (#:key inputs #:allow-other-keys)
;; Get libgfortran found when building in utest. ;; Get libgfortran found when building in utest.
(setenv "FEXTRALIB" (setenv "FEXTRALIB"
(string-append (string-append
"-L" "-L"
(dirname (dirname
(search-input-file inputs "/lib/libgfortran.so"))))))))) (search-input-file inputs "/lib/libgfortran.so")))))))))
(inputs (inputs
(list `(,gfortran "lib"))) (list `(,gfortran "lib")))
(native-inputs (native-inputs
@ -4563,9 +4564,9 @@ parts of it.")
(supported-systems '("x86_64-linux" "aarch64-linux" "mips64el-linux")) (supported-systems '("x86_64-linux" "aarch64-linux" "mips64el-linux"))
(arguments (arguments
(substitute-keyword-arguments (package-arguments openblas) (substitute-keyword-arguments (package-arguments openblas)
((#:make-flags flags '()) ((#:make-flags flags #~'())
`(append (list "INTERFACE64=1" "LIBNAMESUFFIX=ilp64") #~(append (list "INTERFACE64=1" "LIBNAMESUFFIX=ilp64")
,flags)))) #$flags))))
(synopsis "Optimized BLAS library based on GotoBLAS (ILP64 version)") (synopsis "Optimized BLAS library based on GotoBLAS (ILP64 version)")
(license license:bsd-3))) (license license:bsd-3)))