gnu: arpack-ng: Update to 3.6.3.
[jackhill/guix/guix.git] / gnu / packages / maths.scm
index 2608756..e51afb3 100644 (file)
@@ -15,7 +15,7 @@
 ;;; Copyright © 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
 ;;; Copyright © 2016, 2017 Thomas Danckaert <post@thomasdanckaert.be>
-;;; Copyright © 2017 Paul Garlick <pgarlick@tourbillion-technology.com>
+;;; Copyright © 2017, 2018 Paul Garlick <pgarlick@tourbillion-technology.com>
 ;;; Copyright © 2017 Nils Gillmann <ng0@n0.is>
 ;;; Copyright © 2017 Ben Woodcroft <donttrustben@gmail.com>
 ;;; Copyright © 2017 Theodoros Foradis <theodoros@foradis.org>
@@ -27,6 +27,7 @@
 ;;; Copyright © 2018 Nadya Voronova <voronovank@gmail.com>
 ;;; Copyright © 2018 Adam Massmann <massmannak@gmail.com>
 ;;; Copyright © 2018 Marius Bakke <mbakke@fastmail.com>
+;;; Copyright © 2018 Eric Brown <brown@fastmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -276,22 +277,20 @@ enough to be used effectively as a scientific calculator.")
 (define-public double-conversion
   (package
     (name "double-conversion")
-    (version "1.1.5")
+    (version "3.0.0")
+    (home-page "https://github.com/google/double-conversion")
     (source (origin
               (method url-fetch)
-              (uri (string-append
-                    "https://github.com/floitsch/double-conversion/archive/v"
-                    version ".tar.gz"))
+              (uri (string-append home-page "/archive/v" version ".tar.gz"))
               (file-name (string-append name "-" version ".tar.gz"))
               (sha256
                (base32
-                "0cnr8xhyjfxijay8ymkqcph3672wp2lj23qhdmr3m4kia5kpdf83"))))
+                "059r1czs28ljjd388pn6l3njg1ghbf1cv3q9nkxv3dj2a8siabqm"))))
     (build-system cmake-build-system)
     (arguments
      '(#:test-target "test"
        #:configure-flags '("-DBUILD_SHARED_LIBS=ON"
                            "-DBUILD_TESTING=ON")))
-    (home-page "https://github.com/floitsch/double-conversion")
     (synopsis "Conversion routines for IEEE doubles")
     (description
      "The double-conversion library provides binary-decimal and decimal-binary
@@ -355,17 +354,17 @@ numbers.")
 (define-public ocaml-gsl
   (package
     (name "ocaml-gsl")
-    (version "1.19.3")
+    (version "1.22.0")
     (source
      (origin
        (method url-fetch)
        (uri
         (string-append
-         "https://github.com/mmottl/gsl-ocaml/releases/download/v"
-         version"/gsl-ocaml-" version ".tar.gz"))
+         "https://github.com/mmottl/gsl-ocaml/releases/download/"
+         version "/gsl-" version ".tbz"))
        (sha256
         (base32
-         "0nzp43hp8pbjqkrxnwp5lgjrabxayf61h18fjaydi0s5faq6f3xh"))))
+         "17vcswipliq1b2idbzx1z95kskn1a4q4s5v04igilg0f7lnkaarb"))))
     (build-system ocaml-build-system)
     (inputs
      `(("gsl" ,gsl)))
@@ -436,7 +435,7 @@ integer programming problems and computes Markov bases for statistics.")
 (define-public cddlib
   (package
     (name "cddlib")
-    (version "0.94h")
+    (version "0.94i")
     (source
      (origin
       (method url-fetch)
@@ -444,7 +443,7 @@ integer programming problems and computes Markov bases for statistics.")
                           (string-delete #\. version) ".tar.gz"))
       (sha256
        (base32
-        "1dasasscwfg793q8fwzgwf64xwj7w62yfvszpr8x8g38jka08vgy"))))
+        "00zdgiqb91vx6gd2103h3ijij0llspsxc6zz3iw2bll39fvkl4xq"))))
     (build-system gnu-build-system)
     (inputs
      `(("gmp" ,gmp)))
@@ -461,22 +460,16 @@ computing convex hulls.")
 (define-public arpack-ng
   (package
     (name "arpack-ng")
-    (version "3.5.0")
+    (version "3.6.3")
     (home-page "https://github.com/opencollab/arpack-ng")
-    (source
-     (origin
-       (method url-fetch)
-       (uri (string-append home-page "/archive/" version ".tar.gz"))
-       (file-name (string-append name "-" version ".tar.gz"))
-       (sha256
-        (base32
-         "0f8jx3fifmj9qdp289zr7r651y1q48k1jya859rqxq62mvis7xsh"))))
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference (url home-page) (commit version)))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "1wljl96yqxc9v8r49c37lscwkdp58kaacfb9p6s6nvpm31haax4y"))))
     (build-system gnu-build-system)
-    (arguments
-     '(#:phases (modify-phases %standard-phases
-                  (add-after 'unpack 'autoreconf
-                    (lambda _
-                      (invoke "autoreconf" "-vfi"))))))
     (native-inputs
      `(("autoconf" ,autoconf)
        ("automake" ,automake)
@@ -515,7 +508,11 @@ large scale eigenvalue problems.")
     (arguments
      (substitute-keyword-arguments (package-arguments arpack-ng)
        ((#:configure-flags _ '())
-        ''("--enable-mpi"))))
+        ''("--enable-mpi"))
+       ((#:phases phases '%standard-phases)
+        `(modify-phases ,phases
+           (add-before 'check 'mpi-setup
+             ,%openmpi-setup)))))
     (synopsis "Fortran subroutines for solving eigenvalue problems with MPI")))
 
 (define-public lapack
@@ -576,14 +573,8 @@ problems in numerical linear algebra.")
     (arguments
      `(#:configure-flags `("-DBUILD_SHARED_LIBS:BOOL=YES")
        #:phases (modify-phases %standard-phases
-                  (add-before 'check 'set-test-environment
-                    (lambda _
-                      ;; By default, running the test suite would fail because
-                      ;; 'ssh' could not be found in $PATH.  Define this
-                      ;; variable to placate Open MPI without adding a
-                      ;; dependency on OpenSSH (the agent isn't used anyway.)
-                      (setenv "OMPI_MCA_plm_rsh_agent" (which "cat"))
-                      #t)))))
+                  (add-before 'check 'mpi-setup
+                   ,%openmpi-setup))))
     (home-page "http://www.netlib.org/scalapack/")
     (synopsis "Library for scalable numerical linear algebra")
     (description
@@ -597,7 +588,7 @@ singular value problems.")
 (define-public gnuplot
   (package
     (name "gnuplot")
-    (version "5.2.2")
+    (version "5.2.4")
     (source (origin
               (method url-fetch)
               (uri (string-append "mirror://sourceforge/gnuplot/gnuplot/"
@@ -605,7 +596,7 @@ singular value problems.")
                                   version ".tar.gz"))
        (sha256
         (base32
-         "18diyy7aib9mn098x07g25c7jij1x7wbfpicz0z8gwxx08px45m4"))))
+         "1jvh8xmd2cvrhlsg88kxwh55wkwx31sg50v1n59slfippl0g058m"))))
     (build-system gnu-build-system)
     (inputs `(("readline" ,readline)
               ("cairo" ,cairo)
@@ -1350,12 +1341,12 @@ can solve two kinds of problems:
 @end enumerate\n")
     (license license:bsd-3)))
 
-;; For a fully featured Octave, users  are strongly recommended also to install
+;; For a fully featured Octave, users are strongly recommended also to install
 ;; the following packages: less, ghostscript, gnuplot.
 (define-public octave
   (package
     (name "octave")
-    (version "4.4.0")
+    (version "4.4.1")
     (source
      (origin
       (method url-fetch)
@@ -1363,7 +1354,7 @@ can solve two kinds of problems:
                           version ".tar.lz"))
       (sha256
        (base32
-        "0nm766737gbkq9wqry54a026k3dg7rb1065kngfpwgjz8b544xbp"))))
+        "0jsdgizlv02an2ppfjwk5qf209zpwi3317yb7jvlsjzxnir3lvhy"))))
     (build-system gnu-build-system)
     (inputs
      `(("lapack" ,lapack)
@@ -1433,10 +1424,7 @@ script files.")
   (package (inherit octave)
     (name "qtoctave")
     (source (origin
-              (inherit (package-source octave))
-              (patches (append (origin-patches (package-source octave))
-                               (search-patches
-                                "qtoctave-qt-5.11-fix.patch")))))
+              (inherit (package-source octave))))
     (inputs
      `(("qscintilla" ,qscintilla)
        ("qt" ,qtbase)
@@ -1590,7 +1578,7 @@ September 2004}")
 (define-public petsc
   (package
     (name "petsc")
-    (version "3.8.0")
+    (version "3.9.3")
     (source
      (origin
       (method url-fetch)
@@ -1598,7 +1586,9 @@ September 2004}")
       (uri (string-append "http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/"
                           "petsc-lite-" version ".tar.gz"))
       (sha256
-       (base32 "1lajbk3c29hnh83v6cbmm3a8wv6bdykh0p70kwrr4vrnizalk88s"))))
+       (base32 "1fwkbwv4g7zf2lc8fw865xd0bl9anb6jaczfis5dff7h449gwa48"))))
+    (outputs '("out"                    ;libraries and headers
+               "examples"))             ;~30MiB of examples
     (build-system gnu-build-system)
     (native-inputs
      `(("python" ,python-2)))
@@ -1615,11 +1605,7 @@ September 2004}")
        #:configure-flags
        `("--with-mpi=0"
          "--with-openmp=1"
-         "--with-superlu=1"
-         ,(string-append "--with-superlu-include="
-                         (assoc-ref %build-inputs "superlu") "/include")
-         ,(string-append "--with-superlu-lib="
-                         (assoc-ref %build-inputs "superlu") "/lib/libsuperlu.a"))
+         "--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.
@@ -1672,6 +1658,15 @@ September 2004}")
                           "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))))))
     (home-page "http://www.mcs.anl.gov/petsc")
     (synopsis "Library to solve PDEs")
@@ -1695,6 +1690,7 @@ scientific applications modeled by partial differential equations.")
     (name "petsc-openmpi")
     (inputs
      `(("openmpi" ,openmpi)
+       ("hdf5" ,hdf5-parallel-openmpi)
        ,@(package-inputs petsc)))
     (arguments
      (substitute-keyword-arguments (package-arguments petsc)
@@ -1702,7 +1698,15 @@ scientific applications modeled by partial differential equations.")
         ``("--with-mpiexec=mpirun"
            ,(string-append "--with-mpi-dir="
                            (assoc-ref %build-inputs "openmpi"))
-           ,@(delete "--with-mpi=0" ,cf)))))
+           ,(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)))
+       ((#:phases phases)
+        `(modify-phases ,phases
+           (add-before 'check 'mpi-setup
+             ,%openmpi-setup)))))
     (synopsis "Library to solve PDEs (with MPI support)")))
 
 (define-public petsc-complex-openmpi
@@ -1748,7 +1752,7 @@ savings are consistently > 5x.")
 (define-public slepc
   (package
     (name "slepc")
-    (version "3.8.2")
+    (version "3.9.2")
     (source
      (origin
        (method url-fetch)
@@ -1756,7 +1760,7 @@ savings are consistently > 5x.")
                            version ".tar.gz"))
        (sha256
         (base32
-         "04zd48p43rnvg68p6cp28zll0px5whglc5v0sc3s6vdj1v920z8y"))))
+         "0gmhdqac8zm3jx43h935z7bflazjnpvqxjv4jh5za2y1z2rqax94"))))
     (build-system gnu-build-system)
     (native-inputs
      `(("python" ,python-2)))
@@ -1833,14 +1837,8 @@ arising after the discretization of partial differential equations.")
      (substitute-keyword-arguments (package-arguments slepc)
        ((#:phases phases '%standard-phases)
         `(modify-phases ,phases
-           (add-before 'check 'set-test-environment
-             (lambda _
-               ;; By default, running the test suite would fail because 'ssh'
-               ;; could not be found in $PATH.  Define this variable to
-               ;; placate Open MPI without adding a dependency on OpenSSH (the
-               ;; agent isn't used anyway.)
-               (setenv "OMPI_MCA_plm_rsh_agent" (which "cat"))
-               #t))))))
+           (add-before 'check 'mpi-setup
+            ,%openmpi-setup)))))
     (inputs
      `(("mpi" ,openmpi)
        ("arpack" ,arpack-ng-openmpi)
@@ -2010,14 +2008,8 @@ sparse system of linear equations A x = b using Guassian elimination.")
      (substitute-keyword-arguments (package-arguments mumps)
        ((#:phases phases)
         `(modify-phases ,phases
-           (add-before 'check 'set-test-environment
-             (lambda _
-               ;; By default, running the test suite would fail because 'ssh'
-               ;; could not be found in $PATH.  Define this variable to
-               ;; placate Open MPI without adding a dependency on OpenSSH (the
-               ;; agent isn't used anyway.)
-               (setenv "OMPI_MCA_plm_rsh_agent" (which "cat"))
-               #t))
+           (add-before 'check 'mpi-setup
+            ,%openmpi-setup)
            (replace 'check
              (lambda _
                ((assoc-ref ,phases 'check)
@@ -2054,12 +2046,12 @@ programming problems.")
 (define-public r-pracma
   (package
     (name "r-pracma")
-    (version "2.1.4")
+    (version "2.1.5")
     (source (origin
       (method url-fetch)
       (uri (cran-uri "pracma" version))
       (sha256
-        (base32 "1ygm81i7mqvh229dp9935djjyb120p3bqvaf4k572sa4q63fzjhc"))))
+        (base32 "18cv7c2gvagbmggfbsy2xk9bpn47izd0qrmqnc3q7afvj6pr6nf9"))))
     (build-system r-build-system)
     (propagated-inputs
      `(("r-quadprog" ,r-quadprog)))
@@ -2263,13 +2255,10 @@ CDEFS       = -DAdd_"
                                         "/" dir)))
               '("lib" "include"))
              #t))
+        (add-before 'check 'mpi-setup
+          ,%openmpi-setup)
          (replace 'check
            (lambda _
-             ;; By default, running the test suite would fail because 'ssh'
-             ;; could not be found in $PATH.  Define this variable to placate
-             ;; Open MPI without adding a dependency on OpenSSH (the agent
-             ;; isn't used anyway.)
-             (setenv "OMPI_MCA_plm_rsh_agent" (which "cat"))
              (with-directory-excursion "EXAMPLE"
                (invoke "mpirun" "-n" "2"
                        "./pddrive" "-r" "1" "-c" "2" "g20.rua")
@@ -2362,15 +2351,8 @@ YACC = bison -pscotchyy -y -b y
                           ;; "SCOTCH_PTHREAD_NUMBER=2"
                           "restrict=__restrict"))))
             #t))
-         (add-after
-          'build 'build-esmumps
+         (add-after 'build 'build-esmumps
           (lambda _
-            ;; By default, running the test suite would fail because 'ssh'
-            ;; could not be found in $PATH.  Define this variable to placate
-            ;; Open MPI without adding a dependency on OpenSSH (the agent
-            ;; isn't used anyway.)
-            (setenv "OMPI_MCA_plm_rsh_agent" (which "cat"))
-
             (invoke "make"
                     (format #f "-j~a" (parallel-job-count))
                     "esmumps")))
@@ -2553,14 +2535,8 @@ schemes.")
                                            (assoc-ref %build-inputs "lapack")
                                            " -llapack"))
        #:phases (modify-phases %standard-phases
-                  (add-before 'check 'set-test-environment
-                    (lambda _
-                      ;; By default, running the test suite would fail because
-                      ;; 'ssh' could not be found in $PATH.  Define this
-                      ;; variable to placate Open MPI without adding a
-                      ;; dependency on OpenSSH (the agent isn't used anyway.)
-                      (setenv "OMPI_MCA_plm_rsh_agent" (which "cat"))
-                      #t)))))
+                  (add-before 'check 'mpi-setup
+                   ,%openmpi-setup))))
     (home-page "http://www.p4est.org")
     (synopsis "Adaptive mesh refinement on forests of octrees")
     (description
@@ -2769,16 +2745,16 @@ full text searching.")
 (define-public armadillo
   (package
     (name "armadillo")
-    (version "7.800.2")
+    (version "9.100.5")
     (source (origin
               (method url-fetch)
               (uri (string-append "mirror://sourceforge/arma/armadillo-"
                                   version ".tar.xz"))
               (sha256
                (base32
-                "1qqzy7dp891j9v7062mv1599hdwr97vqzrd3j2fl8c3gmc00dmzg"))))
+                "1ka1vd9fcmvp12qkcm4888dkfqwnalvv00x04wy29f3nx3qwczby"))))
     (build-system cmake-build-system)
-    (arguments `(#:tests? #f)) ;no test target
+    (arguments `(#:tests? #f))          ; no test target
     (inputs
      `(("openblas" ,openblas)
        ("lapack" ,lapack)
@@ -2830,16 +2806,16 @@ parts of it.")
 (define-public openblas
   (package
     (name "openblas")
-    (version "0.3.0")
+    (version "0.3.2")
     (source
      (origin
        (method url-fetch)
-       (uri (string-append "https://github.com/xianyi/OpenBLAS/tarball/v"
-                           version))
+       (uri (string-append "mirror://sourceforge/openblas/v" version "/OpenBLAS%20"
+                           version "%20version.tar.gz"))
        (file-name (string-append name "-" version ".tar.gz"))
        (sha256
         (base32
-         "14a9vyvp2k5zpd0axbnqk0d3khc1v3cck10nb5fj7d2sgn8490ky"))))
+         "0b20km2jv7m6qiylrlvhq2vnmkmilb633mr8rhqmgbn1wqrp58jq"))))
     (build-system gnu-build-system)
     (arguments
      `(#:test-target "test"
@@ -2878,16 +2854,6 @@ parts of it.")
        #:phases
        (modify-phases %standard-phases
          (delete 'configure)
-         ;; Conditionally apply a patch on i686 to avoid rebuilding
-         ;; all architectures.  FIXME: This should be moved to the
-         ;; (source (patches ...)) field in the next rebuild cycle.
-         ,@(if (string-prefix? "i686" (or (%current-target-system)
-                                          (%current-system)))
-               `((add-after 'unpack 'fix-tests
-                   (lambda* (#:key inputs #:allow-other-keys)
-                     (invoke "patch" "-p1"
-                             "--input" (assoc-ref inputs "i686-fix-tests.patch")))))
-               '())
          (add-before 'build 'set-extralib
            (lambda* (#:key inputs #:allow-other-keys)
              ;; Get libgfortran found when building in utest.
@@ -2899,11 +2865,6 @@ parts of it.")
      `(("fortran-lib" ,gfortran "lib")))
     (native-inputs
      `(("cunit" ,cunit)
-       ,@(if (string-prefix? "i686" (or (%current-target-system)
-                                        (%current-system)))
-             `(("i686-fix-tests.patch"
-                ,(search-patch "openblas-fix-tests-i686.patch")))
-             '())
        ("fortran" ,gfortran)
        ("perl" ,perl)))
     (home-page "http://www.openblas.net/")
@@ -2912,6 +2873,18 @@ parts of it.")
      "OpenBLAS is a BLAS library forked from the GotoBLAS2-1.13 BSD version.")
     (license license:bsd-3)))
 
+(define-public openblas-ilp64
+  (package (inherit openblas)
+    (name "openblas-ilp64")
+    (supported-systems '("x86_64-linux" "aarch64-linux" "mips64el-linux"))
+    (arguments
+     (substitute-keyword-arguments (package-arguments openblas)
+       ((#:make-flags flags '())
+        `(append (list "INTERFACE64=1" "LIBNAMESUFFIX=ilp64")
+                 ,flags))))
+    (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.)
@@ -3256,7 +3229,7 @@ Failure to do so will result in a library with poor performance.")
 (define-public glm
   (package
     (name "glm")
-    (version "0.9.9.0")
+    (version "0.9.9.1")
     (source
      (origin
        (method url-fetch)
@@ -3264,7 +3237,7 @@ Failure to do so will result in a library with poor performance.")
                            version  "/glm-" version ".zip"))
        (sha256
         (base32
-         "0ihjadp2sb8w312a276skfjsljm3y41bjscbxf79wn23gi00giz1"))))
+         "042a23hmxfs429czkmlg5ixf28aikzfbw18780prj2gcd4flgw8h"))))
     (build-system cmake-build-system)
     (native-inputs
      `(("unzip" ,unzip)))
@@ -3537,7 +3510,7 @@ set.")
 (define-public hypre
   (package
     (name "hypre")
-    (version "2.11.0")
+    (version "2.14.0")
     (source (origin
               (method url-fetch)
               (uri (string-append "https://github.com/LLNL/hypre/archive/"
@@ -3545,7 +3518,7 @@ set.")
               (file-name (string-append name "-" version ".tar.gz"))
               (sha256
                (base32
-                "0q69ia0jivzcr8p049dn3mg8yjpn6nwq4sw9iqac8vr63vi54l6m"))
+                "0v515i73bvaz378h5465b1dy9v2gf924zy2q94cpq4qqarawvkqh"))
               (modules '((guix build utils)))
               (snippet
                '(begin
@@ -3553,7 +3526,7 @@ set.")
                   ;; substitute the tarball creation time.
                   (substitute* "src/utilities/HYPRE_utilities.h"
                     (("Date Compiled: .*$")
-                     "Date Compiled: Mar 28 2016 20:19:59 +0000\"\n"))
+                     "Date Compiled: Apr 11 2018 16:24:59 +0000\"\n"))
                   #t))))
     (build-system gnu-build-system)
     (outputs '("out"                    ;6.1 MiB of headers and libraries
@@ -3642,14 +3615,8 @@ problems.")
            ,@(delete "--without-MPI" ,flags)))
        ((#:phases phases)
         `(modify-phases ,phases
-           (add-before 'check 'set-test-environment
-             (lambda _
-               ;; By default, running the test suite would fail because 'ssh'
-               ;; could not be found in $PATH.  Define this variable to
-               ;; placate Open MPI without adding a dependency on OpenSSH (the
-               ;; agent isn't used anyway.)
-               (setenv "OMPI_MCA_plm_rsh_agent" (which "cat"))
-               #t))))))
+           (add-before 'check 'mpi-setup
+            ,%openmpi-setup)))))
     (synopsis "Parallel solvers and preconditioners for linear equations")
     (description
      "HYPRE is a software library of high performance preconditioners and
@@ -3932,6 +3899,8 @@ exclusion algorithms are typical examples of such systems.")
                            "-DCMAKE_INSTALL_LIBDIR=lib"
                            "-DGFORTRAN_LIB=gfortran")
        #:phases (modify-phases %standard-phases
+                 (add-before 'check 'mpi-setup
+                   ,%openmpi-setup)
                   (add-before 'check 'setup-tests
                     (lambda _
                       ;; Parallelism is done at the MPI layer.
@@ -3978,7 +3947,7 @@ toolset supports analysis and automatic verification, linearisation, simulation,
 state-space exploration and generation, and tools to optimise and analyse
 specifications.  Also, state spaces can be manipulated, visualised and
 analysed.")
-    (home-page "http://mcrl2.org")
+    (home-page "https://mcrl2.org")
     (license license:boost1.0)))
 
 (define-public r-subplex
@@ -4052,3 +4021,70 @@ terminal do calculations simply and quickly.  The formula to be calculated can
 be fed to @command{tcalc} through the command line.")
   (home-page "https://sites.google.com/site/mohammedisam2000/tcalc")
   (license license:gpl3+)))
+
+(define-public sundials
+  (package
+    (name "sundials")
+    (version "3.1.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "https://computation.llnl.gov/projects/sundials/download/"
+                           "sundials-" version ".tar.gz"))
+       (sha256
+        (base32
+         "090s8ymhd0g1s1d44fa73r5yi32hb4biwahhbfi327zd64yn8kd2"))))
+    (build-system cmake-build-system)
+    (native-inputs
+     `(("python" ,python-2)))    ;for tests; syntax incompatible with python 3
+    (inputs
+     `(("fortran" ,gfortran)            ;for fcmix
+       ("blas" ,openblas)
+       ("suitesparse" ,suitesparse)))   ;TODO: Add hypre
+    (arguments
+     `(#:configure-flags `("-DEXAMPLES_ENABLE_C:BOOL=ON"
+                           "-DEXAMPLES_ENABLE_CXX:BOOL=ON"
+                           "-DEXAMPLES_ENABLE_F77:BOOL=ON"
+                           "-DEXAMPLES_ENABLE_F90:BOOL=ON"
+                           "-DEXAMPLES_INSTALL:BOOL=OFF"
+
+                           "-DFCMIX_ENABLE:BOOL=ON"
+
+                           "-DKLU_ENABLE:BOOL=ON"
+                           ,(string-append "-DKLU_INCLUDE_DIR="
+                                           (assoc-ref %build-inputs "suitesparse")
+                                           "/include")
+                           ,(string-append "-DKLU_LIBRARY_DIR="
+                                           (assoc-ref %build-inputs "suitesparse")
+                                           "/lib"))))
+    (home-page "https://computation.llnl.gov/projects/sundials")
+    (synopsis "Suite of nonlinear and differential/algebraic equation solvers")
+    (description "SUNDIALS is a family of software packages implemented with
+the goal of providing robust time integrators and nonlinear solvers that can
+easily be incorporated into existing simulation codes.")
+    (license license:bsd-3)))
+
+(define-public sundials-openmpi
+  (package (inherit sundials)
+    (name "sundials-openmpi")
+    (inputs
+     `(("mpi" ,openmpi)
+       ("petsc" ,petsc-openmpi)         ;support in SUNDIALS requires MPI
+       ,@(package-inputs sundials)))
+    (arguments
+     (substitute-keyword-arguments (package-arguments sundials)
+       ((#:configure-flags flags '())
+        `(cons* "-DMPI_ENABLE:BOOL=ON"
+                "-DPETSC_ENABLE:BOOL=ON"
+                (string-append "-DPETSC_INCLUDE_DIR="
+                               (assoc-ref %build-inputs "petsc")
+                               "/include")
+                (string-append "-DPETSC_LIBRARY_DIR="
+                               (assoc-ref %build-inputs "petsc")
+                               "/lib")
+                ,flags))
+       ((#:phases phases '%standard-phases)
+        `(modify-phases ,phases
+           (add-before 'check 'mpi-setup
+            ,%openmpi-setup)))))
+    (synopsis "SUNDIALS with OpenMPI support")))