summaryrefslogtreecommitdiff
path: root/gnu/packages/maths.scm
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages/maths.scm')
-rw-r--r--gnu/packages/maths.scm534
1 files changed, 298 insertions, 236 deletions
diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 83f31c1396..ea374a4f4c 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -5,7 +5,7 @@
;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Eric Bavier <bavier@posteo.net>
;;; Copyright © 2014 Federico Beffa <beffa@fbengineering.ch>
;;; Copyright © 2014 Mathieu Lirzin <mathieu.lirzin@openmailbox.org>
-;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2015–2021 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com>
;;; Copyright © 2015, 2018 Mark H Weaver <mhw@netris.org>
;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020, 2021 Efraim Flashner <efraim@flashner.co.il>
@@ -26,7 +26,7 @@
;;; Copyright © 2018 Joshua Sierles, Nextjournal <joshua@nextjournal.com>
;;; Copyright © 2018 Nadya Voronova <voronovank@gmail.com>
;;; Copyright © 2018 Adam Massmann <massmannak@gmail.com>
-;;; Copyright © 2018, 2020 Marius Bakke <mbakke@fastmail.com>
+;;; Copyright © 2018, 2020, 2021 Marius Bakke <marius@gnu.org>
;;; Copyright © 2018 Eric Brown <brown@fastmail.com>
;;; Copyright © 2018, 2021 Julien Lepiller <julien@lepiller.eu>
;;; Copyright © 2018 Amin Bandali <bandali@gnu.org>
@@ -48,6 +48,7 @@
;;; Copyright © 2021 Paul A. Patience <paul@apatience.com>
;;; Copyright © 2021 Ivan Gankevich <i.gankevich@spbu.ru>
;;; Copyright © 2021 Jean-Baptiste Volatier <jbv@pm.me>
+;;; Copyright © 2021 Guillaume Le Vaillant <glv@posteo.net>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -72,6 +73,7 @@
#:use-module (guix packages)
#:use-module (guix download)
#:use-module (guix git-download)
+ #:use-module (guix gexp)
#:use-module (guix utils)
#:use-module ((guix build utils) #:select (alist-replace))
#:use-module (guix build-system cmake)
@@ -84,6 +86,7 @@
#:use-module (gnu packages audio)
#:use-module (gnu packages autotools)
#:use-module (gnu packages base)
+ #:use-module (gnu packages bash)
#:use-module (gnu packages bison)
#:use-module (gnu packages boost)
#:use-module (gnu packages check)
@@ -144,6 +147,7 @@
#:use-module (gnu packages scheme)
#:use-module (gnu packages serialization)
#:use-module (gnu packages shells)
+ #:use-module (gnu packages sphinx)
#:use-module (gnu packages tcl)
#:use-module (gnu packages texinfo)
#:use-module (gnu packages tex)
@@ -167,6 +171,8 @@
(inputs `(("gtk+" ,gtk+)
("libxml2" ,libxml2)))
(native-inputs `(("pkg-config" ,pkg-config)))
+ (arguments
+ `(#:configure-flags '("CFLAGS=-O2 -g -fcommon")))
(synopsis "Natural deduction first-order logic interface")
(description "Aris is a program for performing logical proofs. It supports
propositional and predicate logic, as well as Boolean algebra and
@@ -376,8 +382,8 @@ programming language.")
(let* ((out (assoc-ref outputs "out"))
(bin (string-append out "/bin")))
(wrap-program (string-append bin "/units_cur")
- `("PYTHONPATH" ":" prefix
- ,(search-path-as-string->list (getenv "PYTHONPATH"))))
+ `("GUIX_PYTHONPATH" ":" prefix
+ ,(search-path-as-string->list (getenv "GUIX_PYTHONPATH"))))
#t))))))
(synopsis "Conversion between thousands of scales")
(description
@@ -515,46 +521,56 @@ precision floating point numbers.")
(define-public gsl
(package
(name "gsl")
- (version "2.6")
+ (version "2.7")
(source (origin
(method url-fetch)
(uri (string-append "mirror://gnu/gsl/gsl-"
version ".tar.gz"))
(sha256
(base32
- "1a460zj9xmbgvcymkdhqh313c4l29mn9cffbi5vf33x3qygk70mp"))))
+ "0av04cpblphvvs3kl5rwphniarml503501vrpqw31rd0bmwg7fzg"))))
(build-system gnu-build-system)
(arguments
(let ((system (%current-system)))
- (cond
- ((or (string-prefix? "aarch64" system)
- (string-prefix? "powerpc" system))
- ;; Some sparse matrix tests are failing on AArch64 and PowerPC:
- ;; https://lists.gnu.org/archive/html/bug-gsl/2020-04/msg00001.html
- '(#:phases (modify-phases %standard-phases
- (add-before 'check 'disable-failing-tests
- (lambda _
- (substitute* "spmatrix/test.c"
- ((".*test_complex.*") "\n"))
- #t)))))
- ((string-prefix? "i686" system)
- ;; There are rounding issues with these tests on i686:
- ;; https://lists.gnu.org/archive/html/bug-gsl/2016-10/msg00000.html
- ;; https://lists.gnu.org/archive/html/bug-gsl/2020-04/msg00000.html
- '(#:phases (modify-phases %standard-phases
- (add-before 'check 'disable-failing-tests
- (lambda _
- (substitute* "linalg/test.c"
- ((".*gsl_test\\(test_LU_decomp.*") "\n")
- ((".*gsl_test\\(test_LUc_decomp.*") "\n")
- ((".*gsl_test\\(test_cholesky_decomp.*") "\n")
- ((".*gsl_test\\(test_COD_lssolve2.*") "\n"))
- (substitute* "spmatrix/test.c"
- ((".*test_all.*") "\n")
- ((".*test_float.*") "\n")
- ((".*test_complex.*") "\n"))
- #t)))))
- (else '()))))
+ `(#:configure-flags (list "--disable-static") ;halves package size
+ #:phases
+ (modify-phases %standard-phases
+ ,@(cond
+ ((or (string-prefix? "aarch64" system)
+ (string-prefix? "powerpc" system))
+ ;; Some sparse matrix tests are failing on AArch64 and PowerPC:
+ ;; https://lists.gnu.org/archive/html/bug-gsl/2020-04/msg00001.html
+ '((add-before 'check 'disable-failing-tests
+ (lambda _
+ (substitute* "spmatrix/test.c"
+ ((".*test_complex.*") "\n"))))))
+
+ ((string-prefix? "i686" system)
+ ;; There are rounding issues with these tests on i686:
+ ;; https://lists.gnu.org/archive/html/bug-gsl/2016-10/msg00000.html
+ ;; https://lists.gnu.org/archive/html/bug-gsl/2020-04/msg00000.html
+ '((add-before 'check 'disable-failing-tests
+ (lambda _
+ (substitute* "linalg/test.c"
+ ((".*gsl_test\\(test_LU_decomp.*") "\n")
+ ((".*gsl_test\\(test_LUc_decomp.*") "\n")
+ ((".*gsl_test\\(test_QR_decomp_r.*") "\n")
+ ((".*gsl_test\\(test_cholesky_decomp.*") "\n")
+ ((".*gsl_test\\(test_pcholesky_solve.*") "\n")
+ ((".*gsl_test\\(test_COD_lssolve2.*") "\n"))
+ (substitute* "spmatrix/test.c"
+ ((".*test_all.*") "\n")
+ ((".*test_float.*") "\n")
+ ((".*test_complex.*") "\n"))
+
+ ;; XXX: These tests abort with:
+ ;; gsl: cholesky.c:645: ERROR: matrix is not positive definite
+ (substitute* '("multifit_nlinear/test.c"
+ "multilarge_nlinear/test.c")
+ (("gsl_ieee_env_setup.*" all)
+ (string-append "exit (77);\n" all)))))))
+
+ (else '()))))))
(home-page "https://www.gnu.org/software/gsl/")
(synopsis "Numerical library for C and C++")
(description
@@ -916,15 +932,15 @@ problems in numerical linear algebra.")
"0nnap9q1mv14g57dl3vkvxrdr10k5w7zzyxs6rgxhia8q8mphgqb"))))
(build-system cmake-build-system)
(arguments
- `(#:phases
+ `(#:configure-flags '("-DCMAKE_C_FLAGS=-fcommon -O2")
+ #:phases
(modify-phases %standard-phases
;; These tests use a lot of stack variables and segfault without
;; lifting resource limits.
(add-after 'unpack 'disable-broken-tests
(lambda _
(substitute* "TESTING/CMakeLists.txt"
- (("add_lapack_test.* xeigtstz\\)") ""))
- #t))
+ (("add_lapack_test.* xeigtstz\\)") ""))))
(replace 'install
(lambda* (#:key outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
@@ -946,8 +962,7 @@ problems in numerical linear algebra.")
"\\.h$")))
(copy-recursively (string-append "../clapack-"
,version "-CMAKE/INCLUDE")
- (string-append out "/include"))
- #t))))))
+ (string-append out "/include"))))))))
(home-page "https://www.netlib.org/clapack/")
(synopsis "Numerical linear algebra library for C")
(description
@@ -961,7 +976,7 @@ provide LAPACK for someone who does not have access to a Fortran compiler.")
(define-public scalapack
(package
(name "scalapack")
- (version "2.0.2")
+ (version "2.1.0")
(source
(origin
(method url-fetch)
@@ -969,8 +984,8 @@ provide LAPACK for someone who does not have access to a Fortran compiler.")
version ".tgz"))
(sha256
(base32
- "0p1r61ss1fq0bs8ynnx7xq4wwsdvs32ljvwjnx6yxr8gd6pawx0c"))
- (patches (search-patches "scalapack-blacs-mpi-deprecations.patch"))))
+ "19i0h9vdc3zsy58r6fy1vs2kz2l7amifkz0cf926j90xz1n23nb1"))
+ (patches (search-patches "scalapack-gcc-10-compilation.patch"))))
(build-system cmake-build-system)
(inputs
`(("mpi" ,openmpi)
@@ -980,7 +995,15 @@ provide LAPACK for someone who does not have access to a Fortran compiler.")
`(#:configure-flags `("-DBUILD_SHARED_LIBS:BOOL=YES")
#:phases (modify-phases %standard-phases
(add-before 'check 'mpi-setup
- ,%openmpi-setup))))
+ ,%openmpi-setup)
+ (add-after 'unpack 'skip-faulty-test
+ (lambda _
+ ;; FIXME: Skip these two tests that fail to complete for
+ ;; unknown reasons:
+ ;; <https://github.com/Reference-ScaLAPACK/scalapack/issues/43>.
+ (substitute* "TESTING/CMakeLists.txt"
+ (("^add_test\\(x[sd]hseqr.*" all)
+ (string-append "# " all "\n"))))))))
(home-page "http://www.netlib.org/scalapack/")
(synopsis "Library for scalable numerical linear algebra")
(description
@@ -1081,6 +1104,8 @@ computations.")
(arguments
`(#:parallel-tests? #f
#:configure-flags (list "--enable-shared"
+ "FCFLAGS=-fallow-argument-mismatch"
+ "FFLAGS=-fallow-argument-mismatch"
(string-append "CPPFLAGS=-I"
(assoc-ref %build-inputs "libtirpc")
"/include/tirpc"))
@@ -1114,7 +1139,7 @@ computations.")
;; .so-files. We truncate the hashes to avoid
;; unnecessary store references to those compilers:
(substitute* "libhdf4.settings"
- (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
+ (("(/gnu/store/)([0-9A-Za-z]*)" all prefix hash)
(string-append prefix (string-take hash 10) "...")))
#t))
(add-after 'install 'provide-absolute-libjpeg-reference
@@ -1363,9 +1388,9 @@ extremely large and complex data collections.")
#:make-flags
(list (string-append "HDFLIB=" (assoc-ref %build-inputs "hdf4") "/lib")
(string-append "HDF5LIB=" (assoc-ref %build-inputs "hdf5") "/lib")
- (string-append "ZLIB=" (assoc-ref %build-inputs "zlib") "/lib/libz.so")
+ (string-append "ZLIB=" (search-input-file %build-inputs "/lib/libz.so"))
(string-append "JPEGLIB="
- (assoc-ref %build-inputs "libjpeg") "/lib/libjpeg.so")
+ (search-input-file %build-inputs "/lib/libjpeg.so"))
"LLEXT=so")
#:phases
@@ -1382,16 +1407,20 @@ extremely large and complex data collections.")
"hdf/hdf5lib/exceptions/Makefile.in"
"hdf/hdflib/Makefile.in")
(("\\$\\(TOP\\)/lib/slf4j-api-1\\.7\\.5\\.jar")
- (string-append (assoc-ref inputs "slf4j-api")
- "/share/java/slf4j-api.jar")))
+ ;; 'slf4j-api-X.Y.Z.jar' is installed in a Maven-style
+ ;; directory, so use 'find-files' to find it.
+ (car (find-files (assoc-ref inputs "slf4j-api")
+ "^slf4j-api.*\\.jar$"))))
;; Replace outdated config.sub and config.guess:
(with-directory-excursion "config"
(for-each (lambda (file)
(install-file
- (string-append (assoc-ref inputs "automake")
- "/share/automake-"
- ,(version-major+minor (package-version automake))
- "/" file) "."))
+ (search-input-file inputs
+ (string-append
+ "/share/automake-"
+ ,(version-major+minor (package-version automake))
+ "/" file))
+ "."))
'("config.sub" "config.guess")))
;; Fix embedded version number
@@ -1409,8 +1438,9 @@ extremely large and complex data collections.")
(testjars
(append
(map (lambda (i)
- (string-append (assoc-ref inputs i)
- "/share/java/" i ".jar"))
+ (car (find-files (assoc-ref inputs i)
+ (string-append "^" i
+ ".*\\.jar$"))))
'("slf4j-api" "slf4j-simple"))
(list
(car (find-files (assoc-ref inputs "junit") "jar$"))
@@ -1423,11 +1453,9 @@ extremely large and complex data collections.")
"test/hdf5lib/junit.sh.in"
"examples/runExample.sh.in")
(("/usr/bin/test")
- (string-append (assoc-ref inputs "coreutils")
- "/bin/test"))
+ (search-input-file inputs "/bin/test"))
(("/usr/bin/uname")
- (string-append (assoc-ref inputs "coreutils")
- "/bin/uname"))
+ (search-input-file inputs "/bin/uname"))
(("CLASSPATH=[^\n]*")
(string-append "CLASSPATH=" class-path)))
(setenv "CLASSPATH" class-path))
@@ -1661,6 +1689,13 @@ similar to MATLAB, GNU Octave or SciPy.")
(sha256
(base32
"1a2fpp15a2rl1m50gcvvzd9y6bavl6vjf9zzf63sz5gdmq06yiqf"))
+ (modules '((guix build utils)))
+ (snippet
+ ;; Make sure this variable is defined only once. Failing to do so
+ ;; would break builds of 'netcdf-parallel-openmpi' with a
+ ;; multiple-definition link error with GCC 10.
+ '(substitute* "ncdump/ocprint.c"
+ (("^int ocdebug") "static int ocdebug")))
(patches (search-patches "netcdf-date-time.patch"))))
(build-system gnu-build-system)
(native-inputs
@@ -1694,7 +1729,7 @@ similar to MATLAB, GNU Octave or SciPy.")
;; filenames to avoid unnecessary references to the corresponding
;; store items.
(substitute* "libnetcdf.settings"
- (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
+ (("(/gnu/store/)([0-9A-Za-z]*)" all prefix hash)
(string-append prefix (string-take hash 10) "...")))
#t)))
@@ -1743,7 +1778,9 @@ sharing of scientific data.")
"0x4acvfhbsx1q79dkkwrwbgfhm0w5ngnp4zj5kk92s1khihmqfhj"))))
(build-system gnu-build-system)
(arguments
- `(#:parallel-tests? #f))
+ `(#:configure-flags '("FCFLAGS=-fallow-argument-mismatch"
+ "FFLAGS=-fallow-argument-mismatch")
+ #:parallel-tests? #f))
(inputs
`(("netcdf" ,netcdf)))
(native-inputs
@@ -1971,7 +2008,7 @@ interfaces.")
(lambda* (#:key inputs outputs #:allow-other-keys)
(delete-file (string-append
(site-packages inputs outputs)
- "PyNomad-0.0.0-py"
+ "/PyNomad-0.0.0-py"
(python-version (assoc-ref inputs "python"))
".egg-info"))
#t)))))
@@ -2503,7 +2540,7 @@ script files.")
,@(package-inputs octave-cli)))
(native-inputs
`(("qttools" , qttools) ;for lrelease
- ("texlive" ,(texlive-union (list texlive-epsf))) ; for texi2dvi
+ ("texlive" ,(texlive-updmap.cfg (list texlive-epsf))) ; for texi2dvi
,@(package-native-inputs octave-cli)))
(arguments
(substitute-keyword-arguments (package-arguments octave-cli)
@@ -2637,7 +2674,7 @@ Open CASCADE library.")
("libxi" ,libxi)
("libxmu" ,libxmu)
("mesa" ,mesa)
- ("tbb" ,tbb)
+ ("tbb" ,tbb-2020)
("tcl" ,tcl)
("tk" ,tk)))
;; TODO: build Overview documentation and add 'doc' output.
@@ -2839,7 +2876,7 @@ September 2004}")
(define-public petsc
(package
(name "petsc")
- (version "3.11.2")
+ (version "3.16.1")
(source
(origin
(method url-fetch)
@@ -2847,12 +2884,13 @@ September 2004}")
(uri (string-append "http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/"
"petsc-lite-" version ".tar.gz"))
(sha256
- (base32 "1645nwwcp9bcnfnxikk480mhbbacdvhsay2c401818hk97dqj5nx"))))
+ (base32 "0sm03vpg010q9icidiq587n325m0598cj6hab2rdv85nwyygg74h"))))
(outputs '("out" ; libraries and headers
"examples")) ; ~30MiB of examples
(build-system gnu-build-system)
(native-inputs
- `(("python" ,python-2)))
+ `(("python" ,python)
+ ("which" ,which)))
(inputs
`(("gfortran" ,gfortran)
("openblas" ,openblas)
@@ -2861,75 +2899,80 @@ September 2004}")
;; leaving out opengl, as configuration seems to only be for mac
))
(arguments
- `(#:test-target "test"
- #:parallel-build? #f ; build is parallel by default
- #:configure-flags
- `("--with-mpi=0"
- "--with-openmp=1"
- "--with-openblas=1"
- "--with-superlu=1")
- #:make-flags
- ;; Honor (parallel-job-count) for build. Do not use --with-make-np,
- ;; whose value is dumped to $out/lib/petsc/conf/petscvariables.
- (list (format #f "MAKE_NP=~a" (parallel-job-count)))
- #:phases
- (modify-phases %standard-phases
- (replace 'configure
- ;; PETSc's configure script is actually a python script, so we can't
- ;; run it with bash.
- (lambda* (#:key outputs (configure-flags '())
- #:allow-other-keys)
- (let* ((prefix (assoc-ref outputs "out"))
- (flags `(,(string-append "--prefix=" prefix)
- ,@configure-flags)))
- (format #t "build directory: ~s~%" (getcwd))
- (format #t "configure flags: ~s~%" flags)
- (apply invoke "./configure" flags))))
- (add-after 'configure 'clean-local-references
- (lambda* (#:key outputs #:allow-other-keys)
- (let ((out (assoc-ref outputs "out")))
- (substitute* (find-files "." "^petsc(conf|machineinfo).h$")
- ;; Prevent build directory from leaking into compiled code
- (((getcwd)) out)
- ;; Scrub timestamp for reproducibility
- ((".*Libraries compiled on.*") ""))
- (substitute* (find-files "." "petscvariables")
- ;; Do not expose build machine characteristics, set to defaults.
- (("MAKE_NP = [:digit:]+") "MAKE_NP = 2")
- (("NPMAX = [:digit:]+") "NPMAX = 2"))
- #t)))
- (add-after 'install 'clean-install
- ;; Try to keep installed files from leaking build directory names.
- (lambda* (#:key inputs outputs #:allow-other-keys)
- (let ((out (assoc-ref outputs "out")))
- (substitute* (map (lambda (file)
- (string-append out "/lib/petsc/conf/" file))
- '("petscvariables"))
- (((getcwd)) out))
- ;; Make compiler references point to the store
- (substitute* (string-append out "/lib/petsc/conf/petscvariables")
- (("= (gcc|g\\+\\+|gfortran)" _ compiler)
- (string-append "= " (which compiler))))
- ;; PETSc installs some build logs, which aren't necessary.
- (for-each (lambda (file)
- (let ((f (string-append out "/lib/petsc/conf/" file)))
- (when (file-exists? f)
- (delete-file f))))
- '("configure.log" "make.log" "gmake.log"
- "test.log" "error.log" "RDict.db"
- "PETScBuildInternal.cmake"
- ;; Once installed, should uninstall with Guix
- "uninstall.py"))
- #t)))
- (add-after 'install 'move-examples
- (lambda* (#:key outputs #:allow-other-keys)
- (let* ((out (assoc-ref outputs "out"))
- (examples (assoc-ref outputs "examples"))
- (exdir (string-append out "/share/petsc/examples"))
- (exdir' (string-append examples "/share/petsc/examples")))
- (copy-recursively exdir exdir')
- (delete-file-recursively exdir)
- #t))))))
+ (list
+ #:test-target "test"
+ #:parallel-build? #f ; build is parallel by default
+ #:configure-flags
+ #~(list "--with-mpi=0"
+ "--with-openmp=1"
+ "--with-openblas=1"
+ (string-append "--with-openblas-dir="
+ #$(this-package-input "openblas"))
+ "--with-superlu=1")
+ #:make-flags
+ ;; Honor (parallel-job-count) for build. Do not use --with-make-np,
+ ;; whose value is dumped to $out/lib/petsc/conf/petscvariables.
+ #~(list (format #f "MAKE_NP=~a" (parallel-job-count)))
+ #:phases
+ #~(modify-phases %standard-phases
+ (replace 'configure
+ ;; PETSc's configure script is actually a python script, so we can't
+ ;; run it with bash.
+ (lambda* (#:key outputs (configure-flags '())
+ #:allow-other-keys)
+ (let* ((prefix (assoc-ref outputs "out"))
+ (flags `(,(string-append "--prefix=" prefix)
+ ,@configure-flags)))
+ (format #t "build directory: ~s~%" (getcwd))
+ (format #t "configure flags: ~s~%" flags)
+ (apply invoke "./configure" flags)
+
+ ;; Generate test scripts with the right shebang.
+ (substitute* "config/example_template.py"
+ (("#!/usr/bin/env bash")
+ (string-append "#!" (which "bash")))))))
+ (add-after 'configure 'clean-local-references
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out")))
+ (substitute* (find-files "." "^petsc(conf|machineinfo).h$")
+ ;; Prevent build directory from leaking into compiled code
+ (((getcwd)) out)
+ ;; Scrub timestamp for reproducibility
+ ((".*Libraries compiled on.*") ""))
+ (substitute* (find-files "." "petscvariables")
+ ;; Do not expose build machine characteristics, set to defaults.
+ (("MAKE_NP = [:digit:]+") "MAKE_NP = 2")
+ (("NPMAX = [:digit:]+") "NPMAX = 2")))))
+ (add-after 'install 'clean-install
+ ;; Try to keep installed files from leaking build directory names.
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out")))
+ (substitute* (map (lambda (file)
+ (string-append out "/lib/petsc/conf/" file))
+ '("petscvariables"))
+ (((getcwd)) out))
+ ;; Make compiler references point to the store
+ (substitute* (string-append out "/lib/petsc/conf/petscvariables")
+ (("= (gcc|g\\+\\+|gfortran)" _ compiler)
+ (string-append "= " (which compiler))))
+ ;; PETSc installs some build logs, which aren't necessary.
+ (for-each (lambda (file)
+ (let ((f (string-append out "/lib/petsc/conf/" file)))
+ (when (file-exists? f)
+ (delete-file f))))
+ '("configure.log" "make.log" "gmake.log"
+ "test.log" "error.log" "RDict.db"
+ "PETScBuildInternal.cmake"
+ ;; Once installed, should uninstall with Guix
+ "uninstall.py")))))
+ (add-after 'install 'move-examples
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (examples (assoc-ref outputs "examples"))
+ (exdir (string-append out "/share/petsc/examples"))
+ (exdir' (string-append examples "/share/petsc/examples")))
+ (copy-recursively exdir exdir')
+ (delete-file-recursively exdir)))))))
(home-page "https://www.mcs.anl.gov/petsc")
(synopsis "Library to solve PDEs")
(description "PETSc, pronounced PET-see (the S is silent), is a suite of
@@ -2939,16 +2982,18 @@ scientific applications modeled by partial differential equations.")
"https://www.mcs.anl.gov/petsc/documentation/copyright.html"))))
(define-public petsc-complex
- (package (inherit petsc)
+ (package
+ (inherit petsc)
(name "petsc-complex")
(arguments
(substitute-keyword-arguments (package-arguments petsc)
((#:configure-flags cf)
- `(cons "--with-scalar-type=complex" ,cf))))
+ #~(cons "--with-scalar-type=complex" #$cf))))
(synopsis "Library to solve PDEs (with complex scalars)")))
(define-public petsc-openmpi
- (package (inherit petsc)
+ (package
+ (inherit petsc)
(name "petsc-openmpi")
(inputs
`(("hdf5" ,hdf5-parallel-openmpi)
@@ -2962,27 +3007,28 @@ scientific applications modeled by partial differential equations.")
(arguments
(substitute-keyword-arguments (package-arguments petsc)
((#:configure-flags cf)
- ``("--with-hypre=1"
- "--with-mpiexec=mpirun"
- "--with-metis=1"
- "--with-mumps=1"
- "--with-scalapack=1"
- "--with-ptscotch=1"
- ,(string-append "--with-mpi-dir="
- (assoc-ref %build-inputs "openmpi"))
- ,(string-append "--with-hdf5-include="
- (assoc-ref %build-inputs "hdf5") "/include")
- ,(string-append "--with-hdf5-lib="
- (assoc-ref %build-inputs "hdf5") "/lib/libhdf5.a")
- ,@(delete "--with-mpi=0" ,cf)))
+ #~`("--with-hypre=1"
+ "--with-mpiexec=mpirun"
+ "--with-metis=1"
+ "--with-mumps=1"
+ "--with-scalapack=1"
+ "--with-ptscotch=1"
+ ,(string-append "--with-mpi-dir="
+ #$(this-package-input "openmpi"))
+ ,(string-append "--with-hdf5-include="
+ #$(this-package-input "hdf5") "/include")
+ ,(string-append "--with-hdf5-lib="
+ #$(this-package-input "hdf5") "/lib/libhdf5.a")
+ ,@(delete "--with-mpi=0" #$cf)))
((#:phases phases)
- `(modify-phases ,phases
- (add-before 'configure 'mpi-setup
- ,%openmpi-setup)))))
+ #~(modify-phases #$phases
+ (add-before 'configure 'mpi-setup
+ #$%openmpi-setup)))))
(synopsis "Library to solve PDEs (with MUMPS and MPI support)")))
(define-public petsc-complex-openmpi
- (package (inherit petsc-complex)
+ (package
+ (inherit petsc-complex)
(name "petsc-complex-openmpi")
(inputs
`(("openmpi" ,openmpi)
@@ -2990,14 +3036,14 @@ scientific applications modeled by partial differential equations.")
(arguments
(substitute-keyword-arguments (package-arguments petsc-complex)
((#:configure-flags cf)
- ``("--with-mpiexec=mpirun"
- ,(string-append "--with-mpi-dir="
- (assoc-ref %build-inputs "openmpi"))
- ,@(delete "--with-mpi=0" ,cf)))
+ #~`("--with-mpiexec=mpirun"
+ ,(string-append "--with-mpi-dir="
+ #$(this-package-input "openmpi"))
+ ,@(delete "--with-mpi=0" #$cf)))
((#:phases phases)
- `(modify-phases ,phases
- (add-before 'configure 'mpi-setup
- ,%openmpi-setup)))))
+ #~(modify-phases #$phases
+ (add-before 'configure 'mpi-setup
+ #$%openmpi-setup)))))
(synopsis "Library to solve PDEs (with complex scalars and MPI support)")))
(define-public python-petsc4py
@@ -3075,7 +3121,7 @@ savings are consistently > 5x.")
(define-public slepc
(package
(name "slepc")
- (version "3.11.1")
+ (version "3.16.1")
(source
(origin
(method url-fetch)
@@ -3083,10 +3129,11 @@ savings are consistently > 5x.")
version ".tar.gz"))
(sha256
(base32
- "1yq84q9wannc8xwapxpay4ypdd675picwi395hhsdvng9q6hf5j8"))))
+ "1ysfm77s5fcissv3q0k5d65mlp93zi4anqg62q3cd25dn66sva5i"))))
(build-system gnu-build-system)
(native-inputs
- `(("python" ,python-2)
+ `(("python" ,python)
+ ("which" ,which)
("petsc:examples" ,petsc "examples"))) ;for gmakegen.py script
(inputs
`(("arpack" ,arpack-ng)
@@ -3147,7 +3194,9 @@ as well as other related problems such as the singular value decomposition.
The emphasis of the software is on methods and techniques appropriate for
problems in which the associated matrices are sparse, for example, those
arising after the discretization of partial differential equations.")
- (license license:bsd-2)))
+ (license license:bsd-2)
+ (properties
+ `((release-monitoring-url . "http://slepc.upv.es/download/")))))
(define-public slepc-complex
(package (inherit slepc)
@@ -4142,8 +4191,9 @@ to BMP, JPEG or PNG image formats.")
(patches (search-patches "maxima-defsystem-mkdir.patch"))))
(build-system gnu-build-system)
(inputs
- `(("gcl" ,gcl)
+ `(("bash" ,bash-minimal)
("gnuplot" ,gnuplot) ;for plots
+ ("sbcl" ,sbcl)
("sed" ,sed)
("tk" ,tk))) ;Tcl/Tk is used by 'xmaxima'
(native-inputs
@@ -4152,15 +4202,11 @@ to BMP, JPEG or PNG image formats.")
("python" ,python)))
(arguments
`(#:configure-flags
- (list "--enable-gcl"
- (string-append "--with-posix-shell="
- (assoc-ref %build-inputs "bash")
- "/bin/sh")
- (string-append "--with-wish="
- (assoc-ref %build-inputs "tk")
- "/bin/wish"
- (let ((v ,(package-version tk)))
- (string-take v (string-index-right v #\.)))))
+ ,#~(list "--enable-sbcl"
+ (string-append "--with-sbcl=" #$sbcl "/bin/sbcl")
+ (string-append "--with-posix-shell=" #$bash-minimal "/bin/sh")
+ (string-append "--with-wish=" #$tk "/bin/wish"
+ #$(version-major+minor (package-version tk))))
;; By default Maxima attempts to write temporary files to
;; '/tmp/nix-build-maxima-*', which won't exist at run time.
;; Work around that.
@@ -4169,13 +4215,12 @@ to BMP, JPEG or PNG image formats.")
(modify-phases %standard-phases
(add-after 'unpack 'patch-paths
(lambda* (#:key inputs #:allow-other-keys)
- (let* ((sed (string-append (assoc-ref inputs "sed") "/bin/sed"))
+ (let* ((sed (search-input-file inputs "/bin/sed"))
(coreutils (assoc-ref inputs "coreutils"))
(dirname (string-append coreutils "/bin/dirname"))
(head (string-append coreutils "/bin/head"))
- (perl (string-append (assoc-ref inputs "perl") "/bin/perl"))
- (python (string-append (assoc-ref inputs "python")
- "/bin/python3")))
+ (perl (search-input-file inputs "/bin/perl"))
+ (python (search-input-file inputs "/bin/python3")))
(substitute* "src/maxima.in"
(("sed ") (string-append sed " "))
(("dirname") dirname)
@@ -4198,7 +4243,7 @@ to BMP, JPEG or PNG image formats.")
(invoke "sh" "-c"
(string-append
"./maxima-local "
- "--lisp=gcl "
+ "--lisp=sbcl "
"--batch-string=\"run_testsuite();\" "
"| grep -q \"No unexpected errors found\""))))
;; Make sure the doc and emacs files are found in the
@@ -4209,8 +4254,7 @@ to BMP, JPEG or PNG image formats.")
(let* ((gnuplot (assoc-ref inputs "gnuplot"))
(out (assoc-ref outputs "out"))
(datadir (string-append out "/share/maxima/" ,version))
- (binutils (string-append (assoc-ref inputs "binutils")
- "/bin")))
+ (binutils (dirname (search-input-file inputs "/bin/as"))))
(with-directory-excursion out
(mkdir-p "share/emacs")
(mkdir-p "share/doc")
@@ -4376,16 +4420,17 @@ parts of it.")
(define-public openblas
(package
(name "openblas")
- (version "0.3.9")
+ (version "0.3.18")
(source
(origin
- (method url-fetch)
- (uri (string-append "mirror://sourceforge/openblas/v" version "/OpenBLAS%20"
- version "%20version.tar.gz"))
- (file-name (string-append name "-" version ".tar.gz"))
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/xianyi/OpenBLAS")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
(sha256
(base32
- "14iz9xnrb9xiwgj84j94mc74gg0zn2vsy9fmsijxxma1n7dck4w3"))))
+ "17zdd8asylz2w71hczrz5y344p6d5ds1jn4901maw7zcp3dbk63g"))))
(build-system gnu-build-system)
(arguments
`(#:test-target "test"
@@ -4402,6 +4447,7 @@ parts of it.")
(list (string-append "PREFIX=" (assoc-ref %outputs "out"))
"SHELL=bash"
"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
;; is, if $OPENBLAS_NUM_THREADS is greater than that, then NUM_THREADS
@@ -4417,20 +4463,18 @@ parts of it.")
,@(let ((system (or (%current-target-system) (%current-system))))
(cond
((or (string-prefix? "x86_64" system)
- (string-prefix? "i686" system))
- '("DYNAMIC_ARCH=1"))
+ (string-prefix? "i686" system)
+ (string-prefix? "powerpc64le" system)
+ (string-prefix? "aarch64" system))
+ ;; Dynamic older enables a few extra CPU architectures that
+ ;; were released before 2010.
+ '("DYNAMIC_ARCH=1" "DYNAMIC_OLDER=1" "TARGET=GENERIC"))
;; On some of these architectures the CPU can't be detected.
- ((string-prefix? "powerpc64le" system)
- '("DYNAMIC_ARCH=1"
- "TARGET=GENERIC"))
;; On MIPS we force the "SICORTEX" TARGET, as for the other
;; two available MIPS targets special extended instructions
;; for Loongson cores are used.
((string-prefix? "mips" system)
'("TARGET=SICORTEX"))
- ;; On aarch64 force the generic 'armv8-a' target
- ((string-prefix? "aarch64" system)
- '("TARGET=ARMV8"))
;; Failed to detect CPU.
((string-prefix? "armhf" system)
'("TARGET=ARMV7"))
@@ -4444,8 +4488,7 @@ parts of it.")
;; Get libgfortran found when building in utest.
(setenv "FEXTRALIB"
(string-append "-L" (assoc-ref inputs "fortran-lib")
- "/lib"))
- #t)))))
+ "/lib")))))))
(inputs
`(("fortran-lib" ,gfortran "lib")))
(native-inputs
@@ -4735,6 +4778,7 @@ packages.")
(method url-fetch)
(uri (string-append "mirror://sourceforge/math-atlas/Stable/"
version "/atlas" version ".tar.bz2"))
+ (patches (search-patches "atlas-gfortran-compat.patch"))
(sha256
(base32
"1dyjlq3fiparvm8ypwk6rsmjzmnwk81l88gkishphpvc79ryp216"))))
@@ -5410,7 +5454,7 @@ set.")
(define-public hypre
(package
(name "hypre")
- (version "2.15.1")
+ (version "2.20.0")
(source
(origin
(method git-fetch)
@@ -5419,28 +5463,55 @@ set.")
(commit (string-append "v" version))))
(file-name (git-file-name name version))
(sha256
- (base32 "1lvh4ybqkriyqfg2zmic6mrg1981qv1i9vry1fdgsabn81hb71g4"))
- (modules '((guix build utils)))
- (snippet
- '(begin
- ;; Remove use of __DATE__ and __TIME__ for reproducibility;
- ;; substitute the release date.
- (substitute* "src/utilities/HYPRE_utilities.h"
- (("Date Compiled: .*$")
- "Date Compiled: Oct 19 2018 15:23:00 +0000\"\n"))
- #t))))
+ (base32 "14iqjwg5sv1qjn7c2cfv0xxmn9rwamjrhh9hgs8fjbywcbvrkjdi"))))
(build-system gnu-build-system)
- (outputs '("out" ; 6.1 MiB of headers and libraries
- "doc")) ; 4.8 MiB of documentation
+ (outputs '("out" ;5.3 MiB of headers and libraries
+ "doc")) ;12 MiB of documentation
(native-inputs
`(("doc++" ,doc++)
- ("netpbm" ,netpbm)
- ("perl" ,perl) ; needed to run 'ppmquant' during tests
- ("texlive" ,(texlive-union (list texlive-xypic
- texlive-cm
- texlive-latex-hyperref
- texlive-bibtex)))
- ("ghostscript" ,ghostscript)))
+ ("doxygen" ,doxygen)
+ ("python" ,python)
+ ("python-breathe" ,python-breathe)
+ ("python-sphinx" ,python-sphinx)
+ ("texlive" ,(texlive-updmap.cfg (list texlive-adjustbox
+ texlive-amsfonts
+ texlive-bibtex
+ texlive-caption
+ texlive-cm
+ texlive-etoolbox
+ texlive-jknappen
+ texlive-sectsty
+ texlive-tex-gyre
+ texlive-wasy
+ texlive-xcolor
+ texlive-xypic
+ texlive-generic-listofitems
+ texlive-generic-ulem
+ texlive-latex-capt-of
+ texlive-latex-cmap
+ texlive-latex-colortbl
+ texlive-latex-etoc
+ texlive-latex-fancyhdr
+ texlive-latex-fancyvrb
+ texlive-latex-float
+ texlive-latex-fncychap
+ texlive-latex-framed
+ texlive-latex-geometry
+ texlive-latex-hanging
+ texlive-hyperref
+ texlive-latex-multirow
+ texlive-latex-natbib
+ texlive-latex-needspace
+ texlive-latex-newunicodechar
+ texlive-latex-parskip
+ texlive-latex-stackengine
+ texlive-latex-tabulary
+ texlive-latex-titlesec
+ texlive-latex-tocloft
+ texlive-latex-upquote
+ texlive-latex-varwidth
+ texlive-wasysym
+ texlive-latex-wrapfig)))))
(inputs
`(("blas" ,openblas)
("lapack" ,lapack)))
@@ -5456,12 +5527,6 @@ set.")
"--with-blas")
#:phases
(modify-phases %standard-phases
- (add-before 'build 'set-HOME
- (lambda _
- ;; FIXME: texlive-union does not find the built
- ;; metafonts, so it tries to generate them in HOME.
- (setenv "HOME" "/tmp")
- #t))
(add-before 'configure 'chdir-src
(lambda _ (chdir "src")))
(replace 'configure
@@ -5476,7 +5541,7 @@ set.")
configure-flags)))))))
(add-after 'build 'build-docs
(lambda _
- (invoke "make" "-Cdocs" "pdf" "html")))
+ (invoke "make" "-C" "docs")))
(replace 'check
(lambda _
(setenv "LD_LIBRARY_PATH" (string-append (getcwd) "/hypre/lib"))
@@ -5487,8 +5552,7 @@ set.")
(when (positive? size)
(error (format #f "~a size ~d; error indication~%"
filename size)))))
- (find-files "test" ".*\\.err$"))
- #t))
+ (find-files "test" ".*\\.err$"))))
(add-after 'install 'install-docs
(lambda* (#:key outputs #:allow-other-keys)
;; Custom install because docs/Makefile doesn't honor ${docdir}.
@@ -5497,10 +5561,9 @@ set.")
(with-directory-excursion "docs"
(for-each (lambda (base)
(install-file (string-append base ".pdf") docdir)
- (copy-recursively base docdir)) ; html docs
- '("HYPRE_usr_manual"
- "HYPRE_ref_manual")))
- #t))))))
+ (copy-recursively (string-append base "-html")
+ (string-append docdir "/" base)))
+ '("usr-manual" "ref-manual")))))))))
(home-page "https://computing.llnl.gov/projects\
/hypre-scalable-linear-solvers-multigrid-methods")
(synopsis "Library of solvers and preconditioners for linear equations")
@@ -7225,9 +7288,8 @@ of C, Java, or Ada programs.")
(modify-phases %standard-phases
(add-before 'configure 'export-shell
(lambda* (#:key inputs #:allow-other-keys)
- (setenv "CONFIG_SHELL" (string-append (assoc-ref inputs "bash")
- "/bin/sh"))
- #t)))))
+ (setenv "CONFIG_SHELL"
+ (search-input-file inputs "/bin/sh")))))))
(inputs
`(("gmp" ,gmp)))
(propagated-inputs