superlu-dist: Upgrade to 6.1.0.
[jackhill/guix/guix.git] / gnu / packages / maths.scm
index 50de120..e2f3d84 100644 (file)
@@ -5,21 +5,21 @@
 ;;; Copyright © 2014, 2015, 2016, 2017, 2018 Eric Bavier <bavier@member.fsf.org>
 ;;; Copyright © 2014 Federico Beffa <beffa@fbengineering.ch>
 ;;; Copyright © 2014 Mathieu Lirzin <mathieu.lirzin@openmailbox.org>
-;;; Copyright © 2015, 2016, 2017, 2018 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2015, 2016, 2017, 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com>
 ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
 ;;; Copyright © 2015, 2016, 2017, 2018 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2015 Fabian Harfert <fhmgufs@web.de>
 ;;; Copyright © 2016 Roel Janssen <roel@gnu.org>
 ;;; Copyright © 2016, 2018 Kei Kebreau <kkebreau@posteo.net>
-;;; Copyright © 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2016, 2017, 2018, 2019 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>
-;;; Copyright © 2017 Arun Isaac <arunisaac@systemreboot.net>
+;;; Copyright © 2017, 2019 Arun Isaac <arunisaac@systemreboot.net>
 ;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2017 Dave Love <me@fx@gnu.org>
 ;;; Copyright © 2018 Jan Nieuwenhuizen <janneke@gnu.org>
@@ -27,6 +27,9 @@
 ;;; 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>
+;;; Copyright © 2018 Julien Lepiller <julien@lepiller.eu>
+;;; Copyright © 2018 Amin Bandali <bandali@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
 
 (define-module (gnu packages maths)
   #:use-module (ice-9 regex)
+  #:use-module (ice-9 match)
   #:use-module (gnu packages)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix download)
   #:use-module (guix git-download)
   #:use-module (guix utils)
-  #:use-module (guix build utils)
+  #:use-module ((guix build utils) #:select (alist-replace))
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu)
-  #:use-module (guix build-system ocaml)
   #:use-module (guix build-system python)
   #:use-module (guix build-system r)
   #:use-module (guix build-system ruby)
   #:use-module (gnu packages algebra)
   #:use-module (gnu packages audio)
   #:use-module (gnu packages autotools)
+  #:use-module (gnu packages base)
   #:use-module (gnu packages bison)
   #:use-module (gnu packages boost)
   #:use-module (gnu packages check)
@@ -95,7 +99,6 @@
   #:use-module (gnu packages mpi)
   #:use-module (gnu packages multiprecision)
   #:use-module (gnu packages netpbm)
-  #:use-module (gnu packages ocaml)
   #:use-module (gnu packages pcre)
   #:use-module (gnu packages popt)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
   #:use-module (gnu packages python-web)
+  #:use-module (gnu packages python-xyz)
   #:use-module (gnu packages qt)
   #:use-module (gnu packages readline)
   #:use-module (gnu packages ruby)
@@ -167,14 +171,14 @@ interactive dialogs to guide them.")
 (define-public coda
   (package
     (name "coda")
-    (version "2.18.3")
+    (version "2.19")
     (source
      (origin
        (method url-fetch)
        (uri (string-append "https://github.com/stcorp/coda/releases/download/"
                            version "/coda-" version ".tar.gz"))
        (sha256
-        (base32 "1zlzgcvwmmjm8mw8w4rg2rqy0pjilz7kyyxm0y4p8cbljbbjxxz0"))
+        (base32 "1fbxd2afm7dshd92p10yy8dwbr9gc1h1fmnnnmr7d0c5lnw80245"))
        (patches (search-patches "coda-use-system-libs.patch"))
        (modules '((guix build utils)))
        (snippet
@@ -238,16 +242,60 @@ triangulations.")
     (license (license:non-copyleft "file://COPYING.txt"
                                    "See COPYING in the distribution."))))
 
+(define-public python-cvxopt
+  (package
+    (name "python-cvxopt")
+    (version "1.2.1")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/cvxopt/cvxopt.git")
+                    (commit version)))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "05mnjil9palaa48xafdfh4f5pr4z7aqjr995rwl08qfyxs8y0crf"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'find-libraries
+           (lambda* (#:key inputs #:allow-other-keys)
+             (setenv "CVXOPT_BLAS_LIB" "openblas")
+             (setenv "CVXOPT_BUILD_FFTW" "1")
+             (setenv "CVXOPT_BUILD_GLPK" "1")
+             (setenv "CVXOPT_BUILD_GSL" "1")
+             #t)))))
+    (inputs
+     `(("fftw" ,fftw)
+       ("glpk" ,glpk)
+       ("gsl" ,gsl)
+       ("lapack" ,lapack)
+       ("openblas" ,openblas)
+       ("suitesparse" ,suitesparse)))
+    (home-page "https://www.cvxopt.org")
+    (synopsis "Python library for convex optimization")
+    (description
+     "CVXOPT is a package for convex optimization based on the Python
+programming language.  Its main purpose is to make the development of software
+for convex optimization applications straightforward by building on Python’s
+extensive standard library and on the strengths of Python as a high-level
+programming language.")
+    (license license:gpl3+)))
+
+(define-public python2-cvxopt
+  (package-with-python2 python-cvxopt))
+
 (define-public units
   (package
    (name "units")
-   (version "2.17")
+   (version "2.18")
    (source (origin
             (method url-fetch)
             (uri (string-append "mirror://gnu/units/units-" version
                                 ".tar.gz"))
             (sha256 (base32
-                     "1n2xzpnxfn475zkd8rzs5gg58xszjbr4bdbgvk6hryzimvwwj0qz"))))
+                     "0y26kj349i048y4z3xrk90bvciw2j6ds3rka7r7yn3183hirr5b4"))))
    (build-system gnu-build-system)
    (inputs
     `(("readline" ,readline)
@@ -276,15 +324,15 @@ enough to be used effectively as a scientific calculator.")
 (define-public double-conversion
   (package
     (name "double-conversion")
-    (version "3.0.0")
+    (version "3.1.0")
     (home-page "https://github.com/google/double-conversion")
     (source (origin
-              (method url-fetch)
-              (uri (string-append home-page "/archive/v" version ".tar.gz"))
-              (file-name (string-append name "-" version ".tar.gz"))
+              (method git-fetch)
+              (uri (git-reference (url home-page) (commit version)))
+              (file-name (git-file-name name version))
               (sha256
                (base32
-                "059r1czs28ljjd388pn6l3njg1ghbf1cv3q9nkxv3dj2a8siabqm"))))
+                "123rb2p4snqagrybw66vnapchqdwn2rfpr1wcq0ya9gwbyl7xccx"))))
     (build-system cmake-build-system)
     (arguments
      '(#:test-target "test"
@@ -350,33 +398,6 @@ differential equations, linear algebra, Fast Fourier Transforms and random
 numbers.")
     (license license:gpl3+)))
 
-(define-public ocaml-gsl
-  (package
-    (name "ocaml-gsl")
-    (version "1.19.3")
-    (source
-     (origin
-       (method url-fetch)
-       (uri
-        (string-append
-         "https://github.com/mmottl/gsl-ocaml/releases/download/v"
-         version"/gsl-ocaml-" version ".tar.gz"))
-       (sha256
-        (base32
-         "0nzp43hp8pbjqkrxnwp5lgjrabxayf61h18fjaydi0s5faq6f3xh"))))
-    (build-system ocaml-build-system)
-    (inputs
-     `(("gsl" ,gsl)))
-    (home-page "https://mmottl.github.io/gsl-ocaml")
-    (synopsis "Bindings to the GNU Scientific Library")
-    (description
-     "GSL-OCaml is an interface to the @dfn{GNU scientific library} (GSL) for
-the OCaml language.")
-    (license license:gpl3+)))
-
-(define-public ocaml4.01-gsl
-  (package-with-ocaml4.01 ocaml-gsl))
-
 (define-public glpk
   (package
     (name "glpk")
@@ -434,7 +455,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)
@@ -442,7 +463,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)))
@@ -459,22 +480,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)
@@ -513,7 +528,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
@@ -574,14 +593,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
@@ -595,7 +608,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/"
@@ -603,7 +616,7 @@ singular value problems.")
                                   version ".tar.gz"))
        (sha256
         (base32
-         "18diyy7aib9mn098x07g25c7jij1x7wbfpicz0z8gwxx08px45m4"))))
+         "1jvh8xmd2cvrhlsg88kxwh55wkwx31sg50v1n59slfippl0g058m"))))
     (build-system gnu-build-system)
     (inputs `(("readline" ,readline)
               ("cairo" ,cairo)
@@ -821,8 +834,11 @@ incompatible with HDF5.")
                 (mkdir-p flib)
                 (mkdir-p finc)
                 (mkdir-p fex)
-                (rename-file (string-append bin "/h5fc")
-                             (string-append fbin "/h5fc"))
+                ;; Note: When built with --enable-parallel, the 'h5fc' file
+                ;; doesn't exist, hence this condition.
+                (when (file-exists? (string-append bin "/h5fc"))
+                  (rename-file (string-append bin "/h5fc")
+                               (string-append fbin "/h5fc")))
                 (for-each (lambda (file)
                             (rename-file file
                                          (string-append flib "/" (basename file))))
@@ -844,6 +860,25 @@ extremely large and complex data collections.")
     (license (license:x11-style
               "http://www.hdfgroup.org/ftp/HDF5/current/src/unpacked/COPYING"))))
 
+(define-public hdf5-1.10
+  (package (inherit hdf5)
+    (version "1.10.4")
+    (source
+     (origin
+      (method url-fetch)
+      (uri (list (string-append "https://support.hdfgroup.org/ftp/HDF5/releases/"
+                                "hdf5-" (version-major+minor version)
+                                "/hdf5-" version "/src/hdf5-"
+                                version ".tar.bz2")
+                 (string-append "https://support.hdfgroup.org/ftp/HDF5/"
+                                "current"
+                                (apply string-append
+                                       (take (string-split version #\.) 2))
+                                "/src/hdf5-" version ".tar.bz2")))
+      (sha256
+       (base32 "1pr85fa1sh2ky6ai2hs3f21lp252grl2cq3wbyi4rh7dm83gyrqj"))
+      (patches (list (search-patch "hdf5-config-date.patch")))))))
+
 (define-public hdf-java
   (package
    (name "hdf-java")
@@ -1041,10 +1076,13 @@ Swath).")
      `(("mpi" ,openmpi)
        ,@(package-inputs hdf5)))
     (arguments
-     (substitute-keyword-arguments `(#:configure-flags '("--enable-parallel")
-                                     ,@(package-arguments hdf5))
+     (substitute-keyword-arguments (package-arguments hdf5)
+       ((#:configure-flags flags)
+        ``("--enable-parallel" ,@(delete "--enable-cxx" ,flags)))
        ((#:phases phases)
         `(modify-phases ,phases
+           (add-after 'build 'mpi-setup
+             ,%openmpi-setup)
            (add-before 'check 'patch-tests
              (lambda _
                ;; OpenMPI's mpirun will exit with non-zero status if it
@@ -1348,12 +1386,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
+(define-public octave-cli
   (package
-    (name "octave")
-    (version "4.4.0")
+    (name "octave-cli")
+    (version "4.4.1")
     (source
      (origin
       (method url-fetch)
@@ -1361,7 +1399,7 @@ can solve two kinds of problems:
                           version ".tar.lz"))
       (sha256
        (base32
-        "0nm766737gbkq9wqry54a026k3dg7rb1065kngfpwgjz8b544xbp"))))
+        "0jsdgizlv02an2ppfjwk5qf209zpwi3317yb7jvlsjzxnir3lvhy"))))
     (build-system gnu-build-system)
     (inputs
      `(("lapack" ,lapack)
@@ -1403,6 +1441,13 @@ can solve two kinds of problems:
        ("less" ,less)
        ("ghostscript" ,ghostscript)
        ("gnuplot" ,gnuplot)))
+    ;; Octave code uses this variable to detect directories holding multiple CA
+    ;; certificates to verify peers with.  This is required for the networking
+    ;; functions that require encryption to work properly.
+    (native-search-paths
+     (list (search-path-specification
+            (variable "CURLOPT_CAPATH")
+            (files '("etc/ssl/certs")))))
     (arguments
      `(#:configure-flags
        (list (string-append "--with-shell="
@@ -1412,11 +1457,10 @@ can solve two kinds of problems:
        (modify-phases %standard-phases
          (add-after 'configure 'configure-makeinfo
            (lambda* (#:key inputs #:allow-other-keys)
-             (substitute* "libinterp/corefcn/help.cc"
-               (("Vmakeinfo_program = \"makeinfo\"")
-                (string-append "Vmakeinfo_program = \""
-                               (assoc-ref inputs "texinfo")
-                               "/bin/makeinfo\"")))
+             (substitute* "libinterp/corefcn/help.h"
+               (("\"makeinfo\"")
+                (string-append
+                 "\"" (assoc-ref inputs "texinfo") "/bin/makeinfo\"")))
              #t)))))
     (home-page "https://www.gnu.org/software/octave/")
     (synopsis "High-level language for numerical computation")
@@ -1427,24 +1471,21 @@ Work may be performed both at the interactive command-line as well as via
 script files.")
     (license license:gpl3+)))
 
-(define-public qtoctave
-  (package (inherit octave)
-    (name "qtoctave")
+(define-public octave
+  (package (inherit octave-cli)
+    (name "octave")
     (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-cli))))
     (inputs
      `(("qscintilla" ,qscintilla)
        ("qt" ,qtbase)
-       ,@(package-inputs octave)))
+       ,@(package-inputs octave-cli)))
     (native-inputs
      `(("qttools" , qttools) ;for lrelease
        ("texlive" ,texlive) ;for texi2dvi
-       ,@(package-native-inputs octave)))
+       ,@(package-native-inputs octave-cli)))
     (arguments
-     (substitute-keyword-arguments (package-arguments octave)
+     (substitute-keyword-arguments (package-arguments octave-cli)
        ((#:phases phases)
         `(modify-phases ,phases
            (add-before 'configure 'patch-qscintilla-library-name
@@ -1458,6 +1499,9 @@ script files.")
                   "qscintilla2_qt5"))
                #t))))))))
 
+(define-public qtoctave
+  (deprecated-package "qtoctave" octave))
+
 (define-public opencascade-oce
   (package
     (name "opencascade-oce")
@@ -1588,7 +1632,7 @@ September 2004}")
 (define-public petsc
   (package
     (name "petsc")
-    (version "3.8.0")
+    (version "3.10.2")
     (source
      (origin
       (method url-fetch)
@@ -1596,7 +1640,9 @@ September 2004}")
       (uri (string-append "http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/"
                           "petsc-lite-" version ".tar.gz"))
       (sha256
-       (base32 "1lajbk3c29hnh83v6cbmm3a8wv6bdykh0p70kwrr4vrnizalk88s"))))
+       (base32 "0bl64pydak3rblnjffi482r8bin4xim9sb37ksl2jkcxf0i0irsi"))))
+    (outputs '("out"                    ;libraries and headers
+               "examples"))             ;~30MiB of examples
     (build-system gnu-build-system)
     (native-inputs
      `(("python" ,python-2)))
@@ -1613,11 +1659,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.
@@ -1670,6 +1712,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")
@@ -1692,16 +1743,35 @@ scientific applications modeled by partial differential equations.")
   (package (inherit petsc)
     (name "petsc-openmpi")
     (inputs
-     `(("openmpi" ,openmpi)
+     `(("hdf5" ,hdf5-parallel-openmpi)
+       ("hypre" ,hypre-openmpi)
+       ("metis" ,metis)
+       ("mumps" ,mumps-openmpi)
+       ("openmpi" ,openmpi)
+       ("scalapack" ,scalapack)
+       ("scotch" ,pt-scotch32)
        ,@(package-inputs petsc)))
     (arguments
      (substitute-keyword-arguments (package-arguments petsc)
        ((#:configure-flags cf)
-        ``("--with-mpiexec=mpirun"
+        ``("--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"))
-           ,@(delete "--with-mpi=0" ,cf)))))
-    (synopsis "Library to solve PDEs (with MPI support)")))
+           ,(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 'configure 'mpi-setup
+             ,%openmpi-setup)))))
+    (synopsis "Library to solve PDEs (with MUMPS and MPI support)")))
 
 (define-public petsc-complex-openmpi
   (package (inherit petsc-complex)
@@ -1718,6 +1788,40 @@ scientific applications modeled by partial differential equations.")
            ,@(delete "--with-mpi=0" ,cf)))))
     (synopsis "Library to solve PDEs (with complex scalars and MPI support)")))
 
+(define-public python-petsc4py
+  (package
+    (name "python-petsc4py")
+    (version "3.10.0")
+    (source
+      (origin
+        (method url-fetch)
+        (uri (pypi-uri "petsc4py" version))
+        (sha256
+          (base32
+            "0ch3g6dsvxl7qi984fcssv7cxfbif4bw04gkvxl2l1b8wrmvrm25"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-before 'build 'pre-build
+           (lambda _
+             ;; Define path to PETSc installation.
+             (setenv "PETSC_DIR" (assoc-ref %build-inputs "petsc"))
+             #t))
+         (add-before 'check 'mpi-setup
+           ,%openmpi-setup))))
+    (inputs
+     `(("petsc" ,petsc-openmpi)
+       ("python-numpy" ,python-numpy)))
+    (home-page "https://bitbucket.org/petsc/petsc4py/")
+    (synopsis "Python bindings for PETSc")
+    (description "PETSc, the Portable, Extensible Toolkit for
+Scientific Computation, is a suite of data structures and routines for
+the scalable (parallel) solution of scientific applications modeled by
+partial differential equations.  It employs the MPI standard for all
+message-passing communication.  @code{petsc4py} provides Python
+bindings to almost all functions of PETSc.")
+    (license license:bsd-3)))
 
 (define-public python-kiwisolver
   (package
@@ -1746,7 +1850,7 @@ savings are consistently > 5x.")
 (define-public slepc
   (package
     (name "slepc")
-    (version "3.8.2")
+    (version "3.10.1")
     (source
      (origin
        (method url-fetch)
@@ -1754,7 +1858,7 @@ savings are consistently > 5x.")
                            version ".tar.gz"))
        (sha256
         (base32
-         "04zd48p43rnvg68p6cp28zll0px5whglc5v0sc3s6vdj1v920z8y"))))
+         "188j1a133q91h8pivpnzwcf78kz8dvz2nzf6ndnjygdbqb48fizn"))))
     (build-system gnu-build-system)
     (native-inputs
      `(("python" ,python-2)))
@@ -1831,14 +1935,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)
@@ -1856,6 +1954,43 @@ arising after the discretization of partial differential equations.")
        ,@(alist-delete "petsc" (package-propagated-inputs slepc-openmpi))))
     (synopsis "Scalable library for eigenproblems (with complex scalars and MPI support)")))
 
+(define-public python-slepc4py
+  (package
+    (name "python-slepc4py")
+    (version "3.10.0")
+    (source
+      (origin
+        (method url-fetch)
+        (uri (pypi-uri "slepc4py" version))
+        (sha256
+          (base32
+            "0x049dyc8frgh79fvvavf4vlbqp4mgm61nsaivzdav4316vvlv1j"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-before 'build 'pre-build
+           (lambda _
+             ;; Define path to PETSc installation.
+             (setenv "PETSC_DIR" (assoc-ref %build-inputs "petsc"))
+             ;; Define path to SLEPc installation.
+             (setenv "SLEPC_DIR" (assoc-ref %build-inputs "slepc"))
+             #t))
+         (add-before 'check 'mpi-setup
+           ,%openmpi-setup))))
+    (inputs
+     `(("python-numpy" ,python-numpy)
+       ("python-petsc4py" ,python-petsc4py)
+       ("slepc" ,slepc-openmpi)))
+    (home-page "https://bitbucket.org/slepc/slepc4py/")
+    (synopsis "Python bindings for SLEPc")
+    (description "SLEPc, the Scalable Library for Eigenvalue Problem
+Computations, is based on PETSc, the Portable, Extensible Toolkit for
+Scientific Computation.  It employs the MPI standard for all
+message-passing communication.  @code{slepc4py} provides Python
+bindings to almost all functions of SLEPc.")
+    (license license:bsd-3)))
+
 (define-public mumps
   (package
     (name "mumps")
@@ -2008,14 +2143,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)
@@ -2052,16 +2181,14 @@ programming problems.")
 (define-public r-pracma
   (package
     (name "r-pracma")
-    (version "2.1.4")
+    (version "2.2.2")
     (source (origin
       (method url-fetch)
       (uri (cran-uri "pracma" version))
       (sha256
-        (base32 "1ygm81i7mqvh229dp9935djjyb120p3bqvaf4k572sa4q63fzjhc"))))
+        (base32 "18zhni05gwnxbphl6bmjjxmsgg5wwnnkwlb4g971cqyw3dsd83ki"))))
     (build-system r-build-system)
-    (propagated-inputs
-     `(("r-quadprog" ,r-quadprog)))
-    (home-page "https://cran.r-project.org/web/packages/pracma")
+    (home-page "https://cran.r-project.org/web/packages/pracma/")
     (synopsis "Practical numerical math functions")
     (description "This package provides functions for numerical analysis and
 linear algebra, numerical optimization, differential equations, plus some
@@ -2090,7 +2217,8 @@ porting.")
            (lambda _
              (substitute* "spec/parser_spec.rb"
                (("\\\\\"")
-                "\"")))))))
+                "\""))
+             #t)))))
     (native-inputs
      `(("bundler" ,bundler)
        ("ruby-rspec" ,ruby-rspec)))
@@ -2170,20 +2298,18 @@ also provides threshold-based ILU factorization preconditioners.")
 (define-public superlu-dist
   (package
     (name "superlu-dist")
-    (version "5.3.0")
+    (version "6.1.0")
     (source
      (origin
        (method url-fetch)
        (uri (string-append "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/"
                            "superlu_dist_" version ".tar.gz"))
        (sha256
-        (base32 "0ja5ihqivkda1wd58y4lmzvmwssm9g91f70c5q0fzwhng6580h6y"))
+        (base32 "0pqgcgh1yxhfzs99fas3mggajzd5wca3nbyp878rziy74gfk03dl"))
        (modules '((guix build utils)))
        (snippet
         ;; Replace the non-free implementation of MC64 with a stub
         '(begin
-           (use-modules (ice-9 regex)
-                        (ice-9 rdelim))
            (call-with-output-file "SRC/mc64ad_dist.c"
              (lambda (port)
                (display "
@@ -2199,95 +2325,57 @@ void mc64ad_dist (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
   abort ();
 }\n" port)))
            (substitute* "SRC/util.c"    ;adjust default algorithm
-             (("RowPerm[[:blank:]]*=[[:blank:]]*LargeDiag")
-              "RowPerm = NOROWPERM"))
+             (("RowPerm[[:blank:]]*=[[:blank:]]*LargeDiag_MC64;")
+              ;; TODO: set to "LargeDiag_AWPM" once combinatorial-blas has
+              ;; general (i.e. non-square) processor-grid support.
+              "RowPerm = NOROWPERM;"))
            #t))
-       (patches (search-patches "superlu-dist-scotchmetis.patch"))))
-    (build-system gnu-build-system)
+       (patches (search-patches "superlu-dist-scotchmetis.patch"
+                                "superlu-dist-awpm-grid.patch"))))
+    (build-system cmake-build-system)
     (native-inputs
      `(("tcsh" ,tcsh)))
     (inputs
-     `(("gfortran" ,gfortran)))
+     `(("gfortran" ,gfortran)
+       ("blas" ,openblas)
+       ("lapack" ,lapack)
+       ("combblas" ,combinatorial-blas)))
     (propagated-inputs
-     `(("openmpi" ,openmpi)             ;headers include MPI heades
-       ("lapack" ,lapack)               ;required to link with output library
-       ("pt-scotch" ,pt-scotch)))       ;same
+     `(("mpi" ,openmpi)                 ;headers include MPI heades
+       ("parmetis" ,pt-scotch32 "metis")
+       ("pt-scotch" ,pt-scotch32)))
     (arguments
-     `(#:parallel-build? #f             ;race conditions using ar
+     `(#:parallel-tests? #f             ;tests use MPI and OpenMP
+       #:configure-flags (list "-DBUILD_SHARED_LIBS:BOOL=YES"
+                               "-DTPL_ENABLE_COMBBLASLIB=YES"
+                               "-DTPL_BLAS_LIBRARIES=-lopenblas"
+                               "-DTPL_LAPACK_LIBRARIES=-llapack"
+                               (string-append "-DTPL_PARMETIS_LIBRARIES="
+                                              (string-join
+                                               '("ptscotchparmetis" "ptscotch" "ptscotcherr"
+                                                 "scotchmetis" "scotch" "scotcherr")
+                                               ";"))
+                               (string-append "-DTPL_PARMETIS_INCLUDE_DIRS="
+                                              (assoc-ref %build-inputs "parmetis")
+                                              "/include")
+                               "-DTPL_ENABLE_COMBBLASLIB=ON"
+                               (string-append "-DTPL_COMBBLAS_INCLUDE_DIRS="
+                                              (assoc-ref %build-inputs "combblas")
+                                              "/include/CombBLAS;"
+                                              (assoc-ref %build-inputs "combblas")
+                                              "/include/BipartiteMatchings")
+                               "-DTPL_COMBBLAS_LIBRARIES=CombBLAS")
        #:phases
        (modify-phases %standard-phases
-         (replace 'configure
-           (lambda* (#:key inputs outputs #:allow-other-keys)
-             (call-with-output-file "make.inc"
-               (lambda (port)
-                 (format port "
-PLAT        =
-DSuperLUroot = ~a
-DSUPERLULIB  = ~a/lib/libsuperlu_dist.a
-BLASDEF     = -DUSE_VENDOR_BLAS
-BLASLIB     = -L~a/lib -lblas
-PARMETISLIB = -L~a/lib \
-              -lptscotchparmetis -lptscotch -lptscotcherr -lptscotcherrexit \
-              -lscotch -lscotcherr -lscotcherrexit
-METISLIB    = -L~:*~a/lib \
-              -lscotchmetis -lscotch -lscotcherr -lscotcherrexit
-LIBS        = $(DSUPERLULIB) $(PARMETISLIB) $(METISLIB) $(BLASLIB)
-ARCH        = ar
-ARCHFLAGS   = cr
-RANLIB      = ranlib
-CC          = mpicc
-PIC         = -fPIC
-CFLAGS      = -O3 -g -DPRNTlevel=0 $(PIC)
-NOOPTS      = -O0 -g $(PIC)
-FORTRAN     = mpifort
-FFLAGS      = -O2 -g $(PIC)
-LOADER      = $(CC)
-CDEFS       = -DAdd_"
-                         (getcwd)
-                         (assoc-ref outputs "out")
-                         (assoc-ref inputs "lapack")
-                         (assoc-ref inputs "pt-scotch"))))
-             #t))
-         (add-after 'unpack 'remove-broken-symlinks
-           (lambda _
-             (for-each delete-file
-                       (find-files "MAKE_INC" "\\.#make\\..*"))
-             #t))
-         (add-before 'build 'create-install-directories
-           (lambda* (#:key outputs #:allow-other-keys)
-             (for-each
-              (lambda (dir)
-                (mkdir-p (string-append (assoc-ref outputs "out")
-                                        "/" dir)))
-              '("lib" "include"))
-             #t))
-         (replace 'check
+         (add-before 'configure 'set-c++-standard
            (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")
-               (invoke "mpirun" "-n" "2"
-                       "./pzdrive" "-r" "1" "-c" "2" "cg20.cua"))
-             #t))
-         (replace 'install
-           (lambda* (#:key outputs #:allow-other-keys)
-             ;; Library is placed in lib during the build phase.  Copy over
-             ;; headers to include.
-             (let* ((out    (assoc-ref outputs "out"))
-                    (incdir (string-append out "/include")))
-               (for-each (lambda (file)
-                           (let ((base (basename file)))
-                             (format #t "installing `~a' to `~a'~%"
-                                     base incdir)
-                             (copy-file file
-                                        (string-append incdir "/" base))))
-                         (find-files "SRC" ".*\\.h$")))
-             #t)))))
+             (substitute* "CMakeLists.txt"
+               ;; AWPM headers require C++14
+               (("CMAKE_CXX_STANDARD 11") "CMAKE_CXX_STANDARD 14"))))
+        (add-before 'check 'mpi-setup
+          ,%openmpi-setup)
+         (add-before 'check 'omp-setup
+           (lambda _ (setenv "OMP_NUM_THREADS" "1") #t)))))
     (home-page (package-home-page superlu))
     (synopsis "Parallel supernodal direct solver")
     (description
@@ -2299,25 +2387,25 @@ implemented in ANSI C, and MPI for communications.")
 (define-public scotch
   (package
     (name "scotch")
-    (version "6.0.5a")
+    (version "6.0.6")
     (source
      (origin
       (method url-fetch)
       (uri (string-append "https://gforge.inria.fr/frs/download.php/"
                           "latestfile/298/scotch_" version ".tar.gz"))
       (sha256
-       (base32 "0vsmgjz8qv80di3ljmc7hbdsizxxxwy2b9rgd2fl1mdc6dgbj8av"))
-      (patches (search-patches "scotch-test-threading.patch"
-                               "scotch-build-parallelism.patch"
-                               "scotch-graph-induce-type-64.patch"
-                               "scotch-graph-diam-64.patch"))))
+       (base32 "1ky4k9r6jvajhqaqnnx6h8fkmds2yxgp70dpr1qzwcyhi2nhqvv8"))
+      (patches (search-patches "scotch-build-parallelism.patch"
+                               "scotch-integer-declarations.patch"))))
     (build-system gnu-build-system)
     (inputs
      `(("zlib" ,zlib)
        ("flex" ,flex)
        ("bison" ,bison)))
+    (outputs '("out" "metis"))
     (arguments
-     `(#:phases
+     `(#:make-flags (list (string-append "prefix=" %output))
+       #:phases
        (modify-phases %standard-phases
          (add-after
           'unpack 'chdir-to-src
@@ -2352,7 +2440,7 @@ YACC = bison -pscotchyy -y -b y
                         '("COMMON_FILE_COMPRESS_GZ"
                           "COMMON_PTHREAD"
                           "COMMON_RANDOM_FIXED_SEED"
-                          "INTSIZE64"             ;use 'long' instead of 'int'
+                          "INTSIZE64"             ;use 'int64_t'
                           ;; Prevents symbolc clashes with libesmumps
                           "SCOTCH_RENAME"
                           ;; XXX: Causes invalid frees in superlu-dist tests
@@ -2360,34 +2448,26 @@ 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")))
-         (replace
-          'install
-          (lambda* (#:key outputs #:allow-other-keys)
-            (let ((out (assoc-ref outputs "out")))
-              (mkdir out)
-              (invoke "make"
-                      (string-append "prefix=" out)
-                      "install")
-              ;; esmumps files are not installed with the above
-              (for-each (lambda (f)
-                          (copy-file f (string-append out "/include/" f)))
-                        (find-files "../include" ".*esmumps.h$"))
-              (for-each (lambda (f)
-                          (copy-file f (string-append out "/lib/" f)))
-                        (find-files "../lib" "^lib.*esmumps.*"))
-              #t))))))
+         (add-before 'install 'make-install-dirs
+           (lambda* (#:key outputs #:allow-other-keys)
+             (mkdir (assoc-ref outputs "out"))))
+         (add-after 'install 'install-metis
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((out (assoc-ref outputs "metis")))
+               (mkdir out)
+               ;; metis files are not installed with 'make install'
+               (for-each (lambda (f)
+                           (install-file f (string-append out "/include")))
+                         (find-files "../include/" ".*metis\\.h"))
+               (for-each (lambda (f)
+                           (install-file f (string-append out "/lib")))
+                         (find-files "../lib/" ".*metis\\..*"))
+               #t))))))
     (home-page "http://www.labri.fr/perso/pelegrin/scotch/")
     (synopsis "Programs and libraries for graph algorithms")
     (description "SCOTCH is a set of programs and libraries which implement
@@ -2461,15 +2541,16 @@ YACC = bison -pscotchyy -y -b y
            (replace
             'build
             (lambda _
-              (and
-               (zero? (system* "make"
-                               (format #f "-j~a" (parallel-job-count))
-                               "ptscotch" "ptesmumps"))
-               ;; Install the serial metis compatibility library
-               (zero? (system* "make" "-C" "libscotchmetis" "install")))))
-           (replace
-            'check
-            (lambda _ (zero? (system* "make" "ptcheck"))))))))
+              (invoke "make" (format #f "-j~a" (parallel-job-count))
+                      "ptscotch" "ptesmumps")
+
+              ;; Install the serial metis compatibility library
+              (invoke "make" "-C" "libscotchmetis" "install")))
+           (add-before 'check 'mpi-setup
+            ,%openmpi-setup)
+           (replace 'check
+             (lambda _
+               (invoke "make" "ptcheck")))))))
     (synopsis "Programs and libraries for graph algorithms (with MPI)")))
 
 (define-public pt-scotch32
@@ -2483,15 +2564,15 @@ YACC = bison -pscotchyy -y -b y
         `(modify-phases ,scotch32-phases
            (replace 'build
              (lambda _
-               (and
-                (zero? (system* "make"
-                                (format #f "-j~a" (parallel-job-count))
-                                "ptscotch" "ptesmumps"))
-                ;; Install the serial metis compatibility library
-                (zero? (system* "make" "-C" "libscotchmetis" "install")))))
+               (invoke "make" (format #f "-j~a" (parallel-job-count))
+                       "ptscotch" "ptesmumps")
+               ;; Install the serial metis compatibility library
+               (invoke "make" "-C" "libscotchmetis" "install")))
+           (add-before 'check 'mpi-setup
+            ,%openmpi-setup)
            (replace 'check
              (lambda _
-               (zero? (system* "make" "ptcheck"))))))))
+               (invoke "make" "ptcheck")))))))
     (synopsis
      "Programs and libraries for graph algorithms (with MPI and 32-bit integers)")))
 
@@ -2551,14 +2632,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
@@ -2616,7 +2691,7 @@ to BMP, JPEG or PNG image formats.")
 (define-public maxima
   (package
     (name "maxima")
-    (version "5.41.0")
+    (version "5.42.1")
     (source
      (origin
        (method url-fetch)
@@ -2624,7 +2699,7 @@ to BMP, JPEG or PNG image formats.")
                            version "-source/" name "-" version ".tar.gz"))
        (sha256
         (base32
-         "0x0n81z0s4pl8nwpf7ivlsbvsdphm9w42250g7qdkizl0132by6s"))
+         "1ka0xf70a55ndgmyrq7p5xxbd78pq7bfkqhgxsivaqdw6gn5lmcg"))
        (patches (search-patches "maxima-defsystem-mkdir.patch"))))
     (build-system gnu-build-system)
     (inputs
@@ -2656,6 +2731,18 @@ to BMP, JPEG or PNG image formats.")
            (lambda _
              (chmod "src/maxima" #o555)
              #t))
+         (replace 'check
+           (lambda _
+             ;; This is derived from the testing code in the "debian/rules" file
+             ;; of Debian's Maxima package.
+             ;; If Maxima can successfully run this, the binary to be installed
+             ;; should be fine.
+             (zero?
+              (system
+               (string-append "./maxima-local "
+                              "--lisp=gcl "
+                              "--batch-string=\"run_testsuite();\" "
+                              "| grep -q \"No unexpected errors found\"")))))
          ;; Make sure the doc and emacs files are found in the
          ;; standard location.  Also configure maxima to find gnuplot
          ;; without having it on the PATH.
@@ -2703,18 +2790,17 @@ point numbers.")
 (define-public wxmaxima
   (package
     (name "wxmaxima")
-    (version "18.02.0")
+    (version "18.11.4")
     (source
      (origin
-       (method url-fetch)
-       (uri (string-append "https://github.com/andrejv/" name "/archive"
-                           "/Version-" version ".tar.gz"))
-       (file-name (string-append name "-" version ".tar.gz"))
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/wxMaxima-developers/wxmaxima.git")
+             (commit (string-append "Version-" version))))
+       (file-name (git-file-name name version))
        (sha256
         (base32
-         "03kr2rgfp4hcf3is8m8d8f9hj660c3xgrc50vrrfpixx4syh6wvj"))
-       (patches
-        (search-patches "wxmaxima-do-not-use-old-gnuplot-parameters.patch"))))
+         "1sz8n9v23q442l7yjj67pjh0dk78rl4cbcc3j8m1bm88anlfxl9r"))))
     (build-system cmake-build-system)
     (native-inputs
      `(("gettext" ,gettext-minimal)))
@@ -2767,16 +2853,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)
@@ -2828,16 +2914,16 @@ parts of it.")
 (define-public openblas
   (package
     (name "openblas")
-    (version "0.3.2")
+    (version "0.3.3")
     (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
-         "0b20km2jv7m6qiylrlvhq2vnmkmilb633mr8rhqmgbn1wqrp58jq"))))
+         "0cvlixnpc3cdvvn3f30phfvsgnqljqix6wn72ps9rj7xdhvw06jg"))))
     (build-system gnu-build-system)
     (arguments
      `(#:test-target "test"
@@ -2895,6 +2981,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.)
@@ -3239,7 +3337,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.3")
     (source
      (origin
        (method url-fetch)
@@ -3247,7 +3345,7 @@ Failure to do so will result in a library with poor performance.")
                            version  "/glm-" version ".zip"))
        (sha256
         (base32
-         "0ihjadp2sb8w312a276skfjsljm3y41bjscbxf79wn23gi00giz1"))))
+         "0yqk5r3qh60d4r2iab5q7wq0fryn8p3pz6s28y1i7amqj1aqavj9"))))
     (build-system cmake-build-system)
     (native-inputs
      `(("unzip" ,unzip)))
@@ -3421,7 +3519,7 @@ in finite element programs.")
      `(("unzip" ,unzip)))
     (inputs
      `(("hdf5" ,hdf5)
-       ("octave" ,octave)
+       ("octave" ,octave-cli)
        ("python" ,python-2) ; print syntax
        ;; ("python2-numpy" ,python2-numpy) ; only required for the tests
        ("zlib" ,zlib)))
@@ -3520,7 +3618,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/"
@@ -3528,7 +3626,7 @@ set.")
               (file-name (string-append name "-" version ".tar.gz"))
               (sha256
                (base32
-                "0q69ia0jivzcr8p049dn3mg8yjpn6nwq4sw9iqac8vr63vi54l6m"))
+                "0v515i73bvaz378h5465b1dy9v2gf924zy2q94cpq4qqarawvkqh"))
               (modules '((guix build utils)))
               (snippet
                '(begin
@@ -3536,7 +3634,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
@@ -3545,7 +3643,13 @@ set.")
      `(("doc++" ,doc++)
        ("netpbm" ,netpbm)
        ("perl" ,perl)                   ;needed to run 'ppmquant' during tests
-       ("texlive" ,texlive)             ;full package required for fonts
+       ("texlive" ,(texlive-union (list texlive-generic-xypic
+                                        texlive-fonts-xypic
+                                        texlive-latex-hyperref
+                                        texlive-latex-oberdiek
+                                        texlive-generic-ifxetex
+                                        texlive-latex-url
+                                        texlive-bibtex)))
        ("ghostscript" ,ghostscript)))
     (inputs
      `(("blas" ,openblas)
@@ -3562,6 +3666,12 @@ 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
@@ -3576,7 +3686,7 @@ set.")
                                           configure-flags)))))))
          (add-after 'build 'build-docs
            (lambda _
-             (zero? (system* "make" "-Cdocs" "pdf" "html"))))
+             (invoke "make" "-Cdocs" "pdf" "html")))
          (replace 'check
            (lambda _
              (setenv "LD_LIBRARY_PATH" (string-append (getcwd) "/hypre/lib"))
@@ -3625,14 +3735,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
@@ -3797,29 +3901,41 @@ as equations, scalars, vectors, and matrices.")
 (define-public z3
   (package
     (name "z3")
-    (version "4.5.0")
+    (version "4.8.4")
+    (home-page "https://github.com/Z3Prover/z3")
     (source (origin
-              (method url-fetch)
-              (uri (string-append
-                    "https://github.com/Z3Prover/z3/archive/z3-"
-                    version ".tar.gz"))
+              (method git-fetch)
+              (uri (git-reference (url home-page)
+                                  (commit (string-append "z3-" version))))
+              (file-name (git-file-name name version))
               (sha256
                (base32
-                "032a5lvji2liwmc25jv52bdrhimqflvqbpg77ccaq1jykhiivbmf"))))
-    (build-system cmake-build-system)
+                "014igqm5vwswz0yhz0cdxsj3a6dh7i79hvhgc3jmmmz3z0xm1gyn"))))
+    (build-system gnu-build-system)
     (arguments
-     `(#:configure-flags
-       (list "-DBUILD_PYTHON_BINDINGS=true"
-             "-DINSTALL_PYTHON_BINDINGS=true"
-             (string-append "-DCMAKE_INSTALL_PYTHON_PKG_DIR="
-                            %output
-                            "/lib/python2.7/site-packages"))
-       #:phases
+     `(#:phases
        (modify-phases %standard-phases
+         (add-after 'unpack 'fix-compatability
+           ;; Versions after 4.8.3 have immintrin.h IFDEFed for Windows only.
+           (lambda _
+             (substitute* "src/util/mpz.cpp"
+               (("#include <immintrin.h>") ""))
+             #t))
          (add-before 'configure 'bootstrap
            (lambda _
              (zero?
-              (system* "python" "contrib/cmake/bootstrap.py" "create"))))
+              (system* "python" "scripts/mk_make.py"))))
+         ;; work around gnu-build-system's setting --enable-fast-install
+         ;; (z3's `configure' is a wrapper around the above python file,
+         ;; which fails when passed --enable-fast-install)
+         (replace 'configure
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (invoke "./configure"
+                     (string-append "--prefix=" (assoc-ref outputs "out")))))
+         (add-after 'configure 'change-directory
+           (lambda _
+             (chdir "build")
+             #t))
          (add-before 'check 'make-test-z3
            (lambda _
              ;; Build the test suite executable.
@@ -3830,68 +3946,26 @@ as equations, scalars, vectors, and matrices.")
              ;; Run all the tests that don't require arguments.
              (zero? (system* "./test-z3" "/a")))))))
     (native-inputs
-     `(("python" ,python-2)))
+     `(("which" ,which)
+       ("python" ,python-wrapper)))
     (synopsis "Theorem prover")
     (description "Z3 is a theorem prover and @dfn{satisfiability modulo
 theories} (SMT) solver.  It provides a C/C++ API, as well as Python bindings.")
-    (home-page "https://github.com/Z3Prover/z3")
     (license license:expat)))
 
-(define-public cubicle
-  (package
-    (name "cubicle")
-    (version "1.1.1")
-    (source (origin
-              (method url-fetch)
-              (uri (string-append "http://cubicle.lri.fr/cubicle-"
-                                  version ".tar.gz"))
-              (sha256
-               (base32
-                "1sny9c4fm14k014pk62ibpwbrjjirkx8xmhs9jg7q1hk7y7x3q2h"))))
-    (build-system gnu-build-system)
-    (native-inputs
-     `(("ocaml" ,ocaml)
-       ("which" ,(@@ (gnu packages base) which))))
-    (propagated-inputs
-     `(("z3" ,z3)))
-    (arguments
-     `(#:configure-flags (list "--with-z3")
-       #:tests? #f
-       #:phases
-       (modify-phases %standard-phases
-         (add-before 'configure 'configure-for-release
-           (lambda _
-             (substitute* "Makefile.in"
-               (("SVNREV=") "#SVNREV="))))
-         (add-before 'configure 'fix-/bin/sh
-           (lambda _
-             (substitute* "configure"
-               (("/bin/sh") (which "sh")))))
-         (add-before 'configure 'fix-smt-z3wrapper.ml
-           (lambda _
-             (substitute* "Makefile.in"
-               (("\\\\n") "")))))))
-    (home-page "http://cubicle.lri.fr/")
-    (synopsis "Model checker for array-based systems")
-    (description "Cubicle is a model checker for verifying safety properties
-of array-based systems.  This is a syntactically restricted class of
-parametrized transition systems with states represented as arrays indexed by
-an arbitrary number of processes.  Cache coherence protocols and mutual
-exclusion algorithms are typical examples of such systems.")
-    (license license:asl2.0)))
-
 (define-public elemental
   (package
     (name "elemental")
     (version "0.87.7")
     (source (origin
-              (method url-fetch)
-              (uri (string-append "https://github.com/elemental/Elemental/"
-                                  "archive/v" version ".tar.gz"))
-              (file-name (string-append name "-" version ".tar.gz"))
+              (method git-fetch)
+              (uri (git-reference
+                     (url "https://github.com/elemental/Elemental.git")
+                     (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
               (sha256
                (base32
-                "1nfp82w22pi8x8fg9sc37z8kf84dqi1dhxp8bbk7571y4aygvv3v"))))
+                "1687xpjjzig27y2pnqv7hv09smpijyfdpz7qjgmcxf4shfajlfkc"))))
     (build-system cmake-build-system)
     (home-page "http://libelemental.org")
     (native-inputs
@@ -3915,6 +3989,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.
@@ -3925,7 +4001,7 @@ exclusion algorithms are typical examples of such systems.")
                       ;; Tests are installed, with no easy configuration
                       ;; switch to prevent this, so delete them.
                       (delete-file-recursively
-                       (string-append (assoc-ref outputs "out") "/bin"))
+                        (string-append (assoc-ref outputs "out") "/bin"))
                       #t)))))
     (synopsis "Dense and sparse-direct linear algebra and optimization")
     (description "Elemental is a modern C++ library for distributed-memory
@@ -3961,7 +4037,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
@@ -4035,3 +4111,120 @@ 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")))
+
+(define-public combinatorial-blas
+  (package
+    (name "combinatorial-blas")
+    (version "1.6.2")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "http://eecs.berkeley.edu/~aydin/CombBLAS_FILES/"
+                           "CombBLAS_beta_"
+                           (match (string-split version #\.)
+                            ((major minor patch)
+                             (string-append major minor "_" patch))) ;e.g. "16_2"
+                           ".tgz"))
+       (sha256
+        (base32
+         "1a9wbgdqyy1whhfc0yl0yqkax3amnqa6iihhq48d063gc0jwfd9a"))
+       (patches (search-patches "combinatorial-blas-awpm.patch"
+                                "combinatorial-blas-io-fix.patch"))))
+    (build-system cmake-build-system)
+    (inputs
+     `(("mpi" ,openmpi)
+       ("test-data" ,(origin
+                       (method url-fetch)
+                       (uri (string-append "https://people.eecs.berkeley.edu/~aydin/"
+                                           "CombBLAS_FILES/testdata_combblas1.6.1.tgz"))
+                       (sha256
+                        (base32
+                         "01y2781cy3fww7znmidrp85mf8zx0c905w5vzvk1mgrmhhynim87"))))))
+    (arguments
+     `(#:configure-flags '("-DBUILD_SHARED_LIBS:BOOL=YES"
+                           "-DCMAKE_CXX_FLAGS=-DUSE_FUNNEL")
+       #:parallel-tests? #f             ;tests use 'mpiexec -n4'
+       #:phases
+       (modify-phases %standard-phases
+         (add-before 'check 'mpi-setup
+           ,%openmpi-setup)
+         (add-before 'check 'test-setup
+           (lambda* (#:key inputs #:allow-other-keys)
+             (setenv "OMP_NUM_THREADS" "2")
+             (invoke "tar" "xf" (assoc-ref inputs "test-data")))))))
+    (home-page "https://people.eecs.berkeley.edu/~aydin/CombBLAS/html/")
+    (synopsis "Linear algebra primitives for graph analytics")
+    (description "The Combinatorial BLAS (CombBLAS) is an extensible
+distributed-memory parallel graph library offering a small but powerful set of
+linear algebra primitives specifically targeting graph analytics.")
+    (license (list
+              license:gpl2+             ;include/psort/(funnel|sort)*.h
+              license:x11               ;usort and psort
+              license:bsd-3))))         ;CombBLAS and MersenneTwister.h