gnu: Remove unneeded uses of 'libiconv'.
[jackhill/guix/guix.git] / gnu / packages / maths.scm
index 3ed766c..1683f88 100644 (file)
@@ -2,7 +2,7 @@
 ;;; Copyright © 2013, 2014, 2015, 2016, 2019, 2020 Andreas Enge <andreas@enge.fr>
 ;;; Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org>
 ;;; Copyright © 2014, 2016, 2017 John Darrington <jmd@gnu.org>
-;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Eric Bavier <bavier@posteo.net>
+;;; Copyright © 2014-2022 Eric Bavier <bavier@posteo.net>
 ;;; Copyright © 2014 Federico Beffa <beffa@fbengineering.ch>
 ;;; Copyright © 2014 Mathieu Lirzin <mathieu.lirzin@openmailbox.org>
 ;;; Copyright © 2015–2021 Ricardo Wurmus <rekado@elephly.net>
@@ -12,7 +12,7 @@
 ;;; Copyright © 2015 Fabian Harfert <fhmgufs@web.de>
 ;;; Copyright © 2016 Roel Janssen <roel@gnu.org>
 ;;; Copyright © 2016, 2018, 2020, 2021 Kei Kebreau <kkebreau@posteo.net>
-;;; Copyright © 2016, 2017, 2018, 2019, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2016-2022 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
 ;;; Copyright © 2016, 2017 Thomas Danckaert <post@thomasdanckaert.be>
 ;;; Copyright © 2017, 2018, 2019, 2020, 2021 Paul Garlick <pgarlick@tourbillion-technology.com>
 ;;; Copyright © 2018 Eric Brown <brown@fastmail.com>
 ;;; Copyright © 2018, 2021 Julien Lepiller <julien@lepiller.eu>
 ;;; Copyright © 2018 Amin Bandali <bandali@gnu.org>
-;;; Copyright © 2019, 2021 Nicolas Goaziou <mail@nicolasgoaziou.fr>
+;;; Copyright © 2019, 2021, 2022 Nicolas Goaziou <mail@nicolasgoaziou.fr>
 ;;; Copyright © 2019 Steve Sprang <scs@stevesprang.com>
 ;;; Copyright © 2019 Robert Smith <robertsmith@posteo.net>
 ;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
-;;; Copyright © 2020, 2021 Felix Gruber <felgru@posteo.net>
+;;; Copyright © 2020–2022 Felix Gruber <felgru@posteo.net>
 ;;; Copyright © 2020 R Veera Kumar <vkor@vkten.in>
 ;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
 ;;; Copyright © 2020 Nicolò Balzarotti <nicolo@nixo.xyz>
@@ -319,7 +319,7 @@ triangulations.")
 (define-public python-cvxopt
   (package
     (name "python-cvxopt")
-    (version "1.2.3")
+    (version "1.2.7")
     (source (origin
               (method git-fetch)
               (uri (git-reference
@@ -328,7 +328,7 @@ triangulations.")
               (file-name (git-file-name name version))
               (sha256
                (base32
-                "1kiy2m62xgs2d5id6dnnwy4vap85cd70p7pgkb9nh23qf9xnak7b"))))
+                "114z34wwx1bsv4q6xj9p5q99dffgnj9s4i4arx10g191xq9q8i5y"))))
     (build-system python-build-system)
     (arguments
      `(#:phases
@@ -357,9 +357,6 @@ 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")
@@ -579,6 +576,10 @@ and C++.  It includes a wide range of mathematical routines, with over 1000
 functions in total.  Subject areas covered by the library include:
 differential equations, linear algebra, Fast Fourier Transforms and random
 numbers.")
+
+    ;; Linear algebra routines should benefit from SIMD optimizations.
+    (properties `((tunable? . #t)))
+
     (license license:gpl3+)))
 
 ;; TODO: Merge back into the gsl package as a separate output.
@@ -2433,7 +2434,7 @@ satisfiability checking (SAT).")
 (define-public ceres
   (package
     (name "ceres-solver")
-    (version "1.14.0")
+    (version "2.0.0")
     (home-page "http://ceres-solver.org/")
     (source (origin
               (method url-fetch)
@@ -2441,7 +2442,7 @@ satisfiability checking (SAT).")
                                   version ".tar.gz"))
               (sha256
                (base32
-                "13lfxy8x58w8vprr0nkbzziaijlh0vvqshgahvcgw0mrqdgh0i27"))))
+                "00vng9vnmdb1qga01m0why90m0041w7bn6kxa2h4m26aflfqla8h"))))
     (build-system cmake-build-system)
     (arguments
      ;; TODO: Build HTML user documentation and install separately.
@@ -2460,11 +2461,11 @@ satisfiability checking (SAT).")
     (propagated-inputs
      (list glog))                           ;for #include <glog/glog.h>
     (inputs
-     `(("eigen" ,eigen)
-       ("blas" ,openblas)
-       ("lapack" ,lapack)
-       ("suitesparse" ,suitesparse)
-       ("gflags" ,gflags)))
+     (list eigen
+           openblas
+           lapack
+           suitesparse
+           gflags))
     (synopsis "C++ library for solving large optimization problems")
     (description
      "Ceres Solver is a C++ library for modeling and solving large,
@@ -2475,7 +2476,56 @@ can solve two kinds of problems:
 @item non-linear least squares problems with bounds constraints;
 @item general unconstrained optimization problems.
 @end enumerate\n")
-    (license license:bsd-3)))
+    (license license:bsd-3)
+
+    ;; Mark as tunable to take advantage of SIMD code in Eigen.
+    (properties `((tunable? . #t)))))
+
+(define-public ceres-solver-benchmarks
+  (package
+    (inherit ceres)
+    (name "ceres-solver-benchmarks")
+    (arguments
+     '(#:modules ((ice-9 popen)
+                  (ice-9 rdelim)
+                  (guix build utils)
+                  (guix build cmake-build-system))
+
+       #:phases (modify-phases %standard-phases
+                  (delete 'configure)
+                  (replace 'build
+                    (lambda* (#:key outputs #:allow-other-keys)
+                      (let* ((out (assoc-ref outputs "out"))
+                             (bin (string-append out "/bin")))
+                        (define flags
+                          (string-tokenize
+                           (read-line (open-pipe* OPEN_READ
+                                                  "pkg-config" "eigen3"
+                                                  "--cflags"))))
+
+                        (define (compile-file top-dir)
+                          (lambda (file)
+                            (let ((source (string-append file ".cc")))
+                              (format #t "building '~a'...~%" file)
+                              (apply invoke "c++" "-fopenmp" "-O2" "-g" "-DNDEBUG"
+                                     source "-lceres" "-lbenchmark" "-lglog"
+                                     "-pthread"
+                                     "-o" (string-append bin "/" file)
+                                     "-I" top-dir flags))))
+
+                        (mkdir-p bin)
+                        (with-directory-excursion "internal/ceres"
+                          (for-each (compile-file "..")
+                                    '("schur_eliminator_benchmark"
+                                      "small_blas_gemm_benchmark"
+                                      "small_blas_gemv_benchmark"))
+                          (with-directory-excursion "autodiff_benchmarks"
+                            ((compile-file "../..") "autodiff_benchmarks"))))))
+                  (delete 'check)
+                  (delete 'install))))
+    (inputs (modify-inputs (package-inputs ceres)
+              (prepend googlebenchmark ceres)))
+    (synopsis "Benchmarks of the Ceres optimization problem solver")))
 
 ;; For a fully featured Octave, users are strongly recommended also to install
 ;; the following packages: less, ghostscript, gnuplot.
@@ -2658,7 +2708,7 @@ Open CASCADE library.")
 (define-public opencascade-occt
   (package
     (name "opencascade-occt")
-    (version "7.3.0p3")
+    (version "7.6.0")
     (source
       (origin
         (method git-fetch)
@@ -2670,7 +2720,7 @@ Open CASCADE library.")
                                           version)))))
         (file-name (git-file-name name version))
         (sha256
-         (base32 "0bdywwxb6mk0ykbiajlvsb37295akqjp0a60y672qjfa67k0ljv4"))
+         (base32 "1rcwm9fkx0j4wrsyikb6g7qd611kpry7dand5dzdjvs5vzd13zvd"))
         (modules '((guix build utils)))
         (snippet
          '(begin
@@ -2707,6 +2757,7 @@ Open CASCADE library.")
               "-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON"
               "-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON"
               "-UCMAKE_INSTALL_LIBDIR")))
+    (native-inputs (list fontconfig))
     (inputs
      (list doxygen
            ;("freeimage" ,freeimage)
@@ -3481,12 +3532,12 @@ language understood by many solvers.")
                                 "mumps-shared-pord.patch"))))
     (build-system gnu-build-system)
     (inputs
-     `(("fortran" ,gfortran)
-       ;; These are required for linking against mumps, but we let the user
-       ;; declare the dependency.
-       ("blas" ,openblas)
-       ("metis" ,metis)
-       ("scotch" ,scotch)))
+     (list gfortran
+           ;; These are required for linking against mumps, but we let the user
+           ;; declare the dependency.
+           openblas
+           metis
+           scotch))
     (arguments
      `(#:modules ((ice-9 match)
                   (ice-9 popen)
@@ -3543,8 +3594,9 @@ ORDERINGSC   = $(ORDERINGSF)
 LORDERINGS   = $(LPORD) $(LMETIS) $(LSCOTCH) $(LIBSEQ)
 IORDERINGSF  = $(ISCOTCH)
 IORDERINGSC  = $(IPORD) $(IMETIS) $(ISCOTCH)"
-                        (assoc-ref inputs "mpi")
-                        (assoc-ref inputs "blas")
+                        (->bool (which "mpicc"))  ;MPI support enabled?
+                        (dirname
+                         (dirname (search-input-file inputs "/include/cblas.h")))
                         (assoc-ref inputs "scalapack")
                         (assoc-ref inputs "metis")
                         (match (list (assoc-ref inputs "pt-scotch")
@@ -3555,7 +3607,7 @@ IORDERINGSC  = $(IPORD) $(IMETIS) $(ISCOTCH)"
                            `((,scotch "" "-Dscotch")))
                           ((ptscotch _)
                            `((,ptscotch
-                              "-lptesmumps -lptscotch -lptscotcherr "
+                              "-lesmumps -lptscotch -lptscotcherr "
                               "-Dptscotch")))))))))
          (replace 'build
           ;; By default only the d-precision library is built.  Make with "all"
@@ -3605,19 +3657,20 @@ sparse system of linear equations A x = b using Gaussian elimination.")
     (license license:cecill-c)))
 
 (define-public mumps-metis
-  (package (inherit mumps)
+  (package
+    (inherit mumps)
     (name "mumps-metis")
-    (inputs
-     (alist-delete "scotch" (package-inputs mumps)))))
+    (inputs (modify-inputs (package-inputs mumps)
+              (delete "scotch")))))
 
 (define-public mumps-openmpi
-  (package (inherit mumps)
+  (package
+    (inherit mumps)
     (name "mumps-openmpi")
     (inputs
-     `(("mpi" ,openmpi)
-       ("scalapack" ,scalapack)
-       ("pt-scotch" ,pt-scotch)
-       ,@(alist-delete "scotch" (package-inputs mumps))))
+     (modify-inputs (package-inputs mumps)
+       (delete "scotch")
+       (prepend openmpi scalapack pt-scotch)))
     (arguments
      (substitute-keyword-arguments (package-arguments mumps)
        ((#:phases phases)
@@ -3631,10 +3684,11 @@ sparse system of linear equations A x = b using Gaussian elimination.")
     (synopsis "Multifrontal sparse direct solver (with MPI)")))
 
 (define-public mumps-metis-openmpi
-  (package (inherit mumps-openmpi)
+  (package
+    (inherit mumps-openmpi)
     (name "mumps-metis-openmpi")
-    (inputs
-     (alist-delete "pt-scotch" (package-inputs mumps-openmpi)))))
+    (inputs (modify-inputs (package-inputs mumps-openmpi)
+              (delete "pt-scotch")))))
 
 (define-public ruby-asciimath
   (package
@@ -3660,14 +3714,14 @@ easy-to-write markup language for mathematics.")
 (define-public superlu
   (package
     (name "superlu")
-    (version "5.2.2")
+    (version "5.3.0")
     (source
      (origin
        (method url-fetch)
        (uri (string-append "https://portal.nersc.gov/project/sparse/superlu/"
-                           "superlu_" version ".tar.gz"))
+                           "superlu-" version ".tar.gz"))
        (sha256
-        (base32 "13520vk6fqspyl22cq4ak2jh3rlmhja4czq56j75fdx65fkk80s7"))
+        (base32 "0xvib7nk2rlbsiv1iwkwl9kxppkalkciv628bsyiiv0pv754n48q"))
        (modules '((guix build utils)))
        (snippet
         ;; Replace the non-free implementation of MC64 with a stub adapted
@@ -3818,91 +3872,43 @@ implemented in ANSI C, and MPI for communications.")
 (define-public scotch
   (package
     (name "scotch")
-    (version "6.1.1")
+    (version "7.0.1")
     (source
      (origin
-      (method url-fetch)
-      (uri (string-append "https://gforge.inria.fr/frs/download.php/"
-                          "latestfile/298/scotch_" version ".tar.gz"))
-      (sha256
-       (base32 "04dkz24a2g20wq703fnyi4440ac4mwycy9gwrrllljj7zxcjy19r"))
-      (patches (search-patches "scotch-build-parallelism.patch"
-                               "scotch-integer-declarations.patch"))))
-    (build-system gnu-build-system)
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://gitlab.inria.fr/scotch/scotch")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "1fvgxd3ipl5xswswyadvxvlcgv6an8c229ispnlksgnlwphg10ig"))))
+    (build-system cmake-build-system)
     (inputs
      (list zlib))
     (native-inputs
      (list flex bison gfortran))
     (outputs '("out" "metis"))
     (arguments
-     `(#:make-flags (list (string-append "prefix=" %output))
+     `(#:configure-flags '("-DBUILD_SHARED_LIBS=YES"
+                           "-DBUILD_PTSCOTCH=OFF")
        #:phases
        (modify-phases %standard-phases
-         (add-after
-          'unpack 'chdir-to-src
-          (lambda _ (chdir "src") #t))
-         (replace
-          'configure
-          (lambda _
-            (call-with-output-file "Makefile.inc"
-              (lambda (port)
-                (format port "
-EXE =
-LIB = .a
-OBJ = .o
-MAKE = make
-AR = ar
-ARFLAGS = -ruv
-CAT = cat
-CCS = gcc
-CCP = mpicc
-CCD = gcc
-FC = gfortran
-CPPFLAGS =~{ -D~a~}
-CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
-LDFLAGS = -lz -lm -lrt -lpthread
-CP = cp
-LEX = flex -Pscotchyy -olex.yy.c
-LN = ln
-MKDIR = mkdir
-MV = mv
-RANLIB = ranlib
-YACC = bison -pscotchyy -y -b y
-"
-                        '("COMMON_FILE_COMPRESS_GZ"
-                          "COMMON_PTHREAD"
-                          "COMMON_RANDOM_FIXED_SEED"
-                          "INTSIZE64"             ;use 'int64_t'
-                          ;; Prevents symbol clashes with libesmumps
-                          "SCOTCH_RENAME"
-                          ;; XXX: Causes invalid frees in superlu-dist tests
-                          ;; "SCOTCH_PTHREAD"
-                          ;; "SCOTCH_PTHREAD_NUMBER=2"
-                          "restrict=__restrict"))))
-            #t))
-         (add-after 'build 'build-esmumps
-          (lambda _
-            (invoke "make"
-                    (format #f "-j~a" (parallel-job-count))
-                    "esmumps")))
-         (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))))))
+             (let* ((out    (assoc-ref outputs "out"))
+                    (metis  (assoc-ref outputs "metis"))
+                    (prefix (string-length out)))
+               (for-each (lambda (file)
+                           (let ((target (string-append
+                                          metis
+                                          (string-drop file prefix))))
+                             (mkdir-p (dirname target))
+                             (rename-file file target)))
+                         (find-files out "metis"))))))))
     (home-page "https://www.labri.fr/perso/pelegrin/scotch/")
     (properties
-     `((release-monitoring-url . "https://gforge.inria.fr/frs/?group_id=248")))
+     `((release-monitoring-url
+        . "https://gitlab.inria.fr/scotch/scotch/-/releases")))
     (synopsis "Programs and libraries for graph algorithms")
     (description "SCOTCH is a set of programs and libraries which implement
 the static mapping and sparse matrix reordering algorithms developed within
@@ -3917,176 +3923,57 @@ bio-chemistry.")
 (define-public scotch32
   ;; This is the 'INTSIZE32' variant, which uses 32-bit integers, as needed by
   ;; some applications.
-  (package (inherit scotch)
+  (package
+    (inherit scotch)
     (name "scotch32")
     (arguments
      (substitute-keyword-arguments (package-arguments scotch)
-       ((#:phases scotch-phases)
-        `(modify-phases ,scotch-phases
-          (replace
-           'configure
-           (lambda _
-             (call-with-output-file "Makefile.inc"
-               (lambda (port)
-                 (format port "
-EXE =
-LIB = .a
-OBJ = .o
-MAKE = make
-AR = ar
-ARFLAGS = -ruv
-CAT = cat
-CCS = gcc
-CCP = mpicc
-CCD = gcc
-FC = gfortran
-CPPFLAGS =~{ -D~a~}
-CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
-LDFLAGS = -lz -lm -lrt -lpthread
-CP = cp
-LEX = flex -Pscotchyy -olex.yy.c
-LN = ln
-MKDIR = mkdir
-MV = mv
-RANLIB = ranlib
-YACC = bison -pscotchyy -y -b y
-"
-                        '("COMMON_FILE_COMPRESS_GZ"
-                          "COMMON_PTHREAD"
-                          "COMMON_RANDOM_FIXED_SEED"
-                          "INTSIZE32"   ;use 32-bit integers.  See INSTALL.txt
-                          ;; Prevents symbolc clashes with libesmumps
-                          "SCOTCH_RENAME"
-                          ;; XXX: Causes invalid frees in superlu-dist tests
-                          ;; "SCOTCH_PTHREAD"
-                          ;; "SCOTCH_PTHREAD_NUMBER=2"
-                          "restrict=__restrict"))))))))))
+       ((#:configure-flags flags ''())
+        ''("-DBUILD_SHARED_LIBS=YES" "-DBUILD_PTSCOTCH=OFF"
+           "-DCMAKE_C_FLAGS=-DINTSIZE32=1"))))
     (synopsis
      "Programs and libraries for graph algorithms (32-bit integers)")))
 
-(define-public scotch-shared
-  (package (inherit scotch)
-    (name "scotch-shared")
-    (native-inputs
-     (list gcc flex bison))
-    (arguments
-     (substitute-keyword-arguments (package-arguments scotch)
-       ((#:phases scotch-shared-phases)
-        `(modify-phases ,scotch-shared-phases
-           (replace
-            'configure
-           (lambda _
-             ;; Otherwise, the RUNPATH will lack the final path component.
-             (setenv "RPATHFLAGS" (string-append "-Wl,-rpath="
-                                              (assoc-ref %outputs "out") "/lib"))
-            (call-with-output-file "Makefile.inc"
-              (lambda (port)
-                (format port "
-EXE =
-LIB = .so
-OBJ = .o
-MAKE = make
-AR = gcc
-ARFLAGS = -shared -o
-CAT = cat
-CCS = gcc
-CCP = mpicc
-CCD = gcc
-FC = gfortran
-CPPFLAGS =~{ -D~a~}
-CFLAGS = -O2 -g -fPIC $(CPPFLAGS) $(RPATHFLAGS)
-CLIBFLAGS = -shared -fPIC
-LDFLAGS = -lz -lm -lrt -lpthread -Xlinker --no-as-needed
-CP = cp
-LEX = flex -Pscotchyy -olex.yy.c
-LN = ln
-MKDIR = mkdir
-MV = mv
-RANLIB = echo
-YACC = bison -pscotchyy -y -b y
-"
-                        '("COMMON_FILE_COMPRESS_GZ"
-                          "COMMON_PTHREAD"
-                          "COMMON_RANDOM_FIXED_SEED"
-                          "INTSIZE64"             ;use 'int64_t'
-                          ;; Prevents symbolc clashes with libesmumps
-                          "SCOTCH_RENAME"
-                          ;; XXX: Causes invalid frees in superlu-dist tests
-                          ;; "SCOTCH_PTHREAD"
-                          ;; "SCOTCH_PTHREAD_NUMBER=2"
-                          "restrict=__restrict"
-                          ))))#t))
-           (delete 'check)))))
-     (synopsis
-      "Programs and libraries for graph algorithms (shared libraries version)")))
-
 (define-public pt-scotch
-  (package (inherit scotch)
+  (package
+    (inherit scotch)
     (name "pt-scotch")
     (propagated-inputs
-     (list openmpi))           ;Headers include MPI headers
+     (list openmpi))                              ;headers include MPI headers
     (arguments
      (substitute-keyword-arguments (package-arguments scotch)
-       ((#:phases scotch-phases)
-        `(modify-phases ,scotch-phases
-           (replace
-            'build
-            (lambda _
-              (invoke "make" (format #f "-j~a" (parallel-job-count))
-                      "ptscotch" "ptesmumps")
-
-              ;; Install the serial metis compatibility library
-              (invoke "make" "-C" "libscotchmetis" "install")))
+       ((#:configure-flags flags ''())
+        ''("-DBUILD_SHARED_LIBS=YES" "-DBUILD_PTSCOTCH=ON"))
+       ((#:phases phases '%standard-phases)
+        `(modify-phases ,phases
            (add-before 'check 'mpi-setup
-            ,%openmpi-setup)
-           (replace 'check
-             (lambda _
-               (invoke "make" "ptcheck")))))))
+             ,%openmpi-setup)))))
     (synopsis "Programs and libraries for graph algorithms (with MPI)")))
 
 (define-public pt-scotch32
-  (package (inherit scotch32)
+  (package
+    (inherit pt-scotch)
     (name "pt-scotch32")
     (propagated-inputs
      (list openmpi))                     ;headers include MPI headers
     (arguments
-     (substitute-keyword-arguments (package-arguments scotch32)
-       ((#:phases scotch32-phases)
-        `(modify-phases ,scotch32-phases
-           (replace 'build
-             (lambda _
-               (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")))))))
+     (substitute-keyword-arguments (package-arguments pt-scotch)
+       ((#:configure-flags flags ''())
+        ''("-DBUILD_SHARED_LIBS=YES" "-DBUILD_PTSCOTCH=ON"
+           "-DCMAKE_C_FLAGS=-DINTSIZE32=1"))))
     (synopsis
      "Programs and libraries for graph algorithms (with MPI and 32-bit integers)")))
 
-(define-public pt-scotch-shared
-  (package (inherit scotch-shared)
-    (name "pt-scotch-shared")
-    (propagated-inputs
-     (list openmpi))           ;Headers include MPI headers
-    (arguments
-     (substitute-keyword-arguments (package-arguments scotch-shared)
-       ((#:phases scotch-shared-phases)
-        `(modify-phases ,scotch-shared-phases
-           (replace
-            'build
-            (lambda _
-              (invoke "make" (format #f "-j~a" (parallel-job-count))
-                      "ptscotch" "ptesmumps")
+(define-public scotch-shared
+  ;; There used to be separate shared library variants while the default would
+  ;; provide .a files including PIC objects.  With the switch to CMake, .a
+  ;; files contain non-PIC objects, which breaks some users, and switching to
+  ;; shared libraries by default seems to make more sense, as discussed here:
+  ;; <https://issues.guix.gnu.org/47619#2>.
+  (deprecated-package "scotch-shared" scotch))
 
-              ;; Install the serial metis compatibility library
-              (invoke "make" "-C" "libscotchmetis" "install")))
-           (add-before 'check 'mpi-setup
-             ,%openmpi-setup)))))
-    (synopsis "Graph algorithms (shared libraries version, with MPI)")))
+(define-public pt-scotch-shared
+  (deprecated-package "pt-scotch-shared" pt-scotch))
 
 
 (define-public metis
@@ -4504,6 +4391,8 @@ parts of it.")
                   ;; Failed to detect CPU.
                   ((string-prefix? "armhf" system)
                    '("TARGET=ARMV7"))
+                  ((string-prefix? "riscv64" system)
+                   '("TARGET=RISCV64_GENERIC"))
                   (else '()))))
        ;; no configure script
        #:phases
@@ -5218,14 +5107,16 @@ A unique design feature of Trilinos is its focus on packages.")
 (define-public dealii
   (package
     (name "dealii")
-    (version "9.3.1")
+    (version "9.3.2")
     (source
      (origin
        (method url-fetch)
        (uri (string-append "https://github.com/dealii/dealii/releases/"
                            "download/v" version "/dealii-" version ".tar.gz"))
        (sha256
-        (base32 "1f0sqvlxvl0myqcn0q6xrn1vnp5pgx143lai4a4jkh1dmdv4cbx6"))
+        (base32 "1s0kawnljg24jj6nibwrif5gxdgg2daqfylhqqpl1lvmzmmxfhak"))
+       (patches (search-patches "dealii-fix-compiliation-with-boost-1.78.patch"
+                                "dealii-fix-sundials.patch"))
        (modules '((guix build utils)))
        (snippet
         '(begin
@@ -5236,16 +5127,14 @@ A unique design feature of Trilinos is its focus on packages.")
     (outputs '("out" "doc"))
     (native-inputs
      ;; Required to build the documentation.
-     `(("dot" ,graphviz)
-       ("doxygen" ,doxygen)
-       ("perl" ,perl)))
+      (list graphviz doxygen perl))
     (inputs
-     `(("arpack" ,arpack-ng)
-       ("blas" ,openblas)
-       ("gfortran" ,gfortran)
-       ("lapack" ,lapack)
-       ("muparser" ,muparser)
-       ("zlib" ,zlib)))
+      (list arpack-ng
+            openblas
+            gfortran
+            lapack
+            muparser
+            zlib))
     (propagated-inputs
      ;; Some scripts are installed into share/deal.II/scripts that require
      ;; perl and python, but they are not executable (and some are missing the
@@ -5490,6 +5379,7 @@ set.")
        ("texlive" ,(texlive-updmap.cfg (list texlive-adjustbox
                                              texlive-amsfonts
                                              texlive-bibtex
+                                             texlive-capt-of
                                              texlive-caption
                                              texlive-cm
                                              texlive-etoolbox
@@ -5500,8 +5390,6 @@ set.")
                                              texlive-xcolor
                                              texlive-xypic
                                              texlive-generic-listofitems
-                                             texlive-generic-ulem
-                                             texlive-latex-capt-of
                                              texlive-latex-cmap
                                              texlive-latex-colortbl
                                              texlive-latex-etoc
@@ -5524,6 +5412,7 @@ set.")
                                              texlive-latex-tocloft
                                              texlive-latex-upquote
                                              texlive-latex-varwidth
+                                             texlive-ulem
                                              texlive-wasysym
                                              texlive-latex-wrapfig)))))
     (inputs
@@ -5739,15 +5628,14 @@ Longest Commons Subsequence of a set of strings.")
 (define-public jacal
   (package
     (name "jacal")
-    (version "1c4")
+    (version "1c7")
     (source (origin
               (method url-fetch)
               (uri (string-append
                     "http://groups.csail.mit.edu/mac/ftpdir/scm/jacal-"
                     version ".zip"))
-              (sha256 (base32
-                       "055zrn12a1dmy0dqkwrkq3fklbhg3yir6vn0lacp4mvbg8573a3q"))
-              (patches (search-patches "jacal-fix-texinfo.patch"))))
+              (sha256
+               (base32 "06a5sx9ikd62bpnd898g3yk818b020b1a27mk7dbfla2zizib4xz"))))
     (build-system gnu-build-system)
     (arguments
      `(#:phases
@@ -5773,7 +5661,7 @@ Longest Commons Subsequence of a set of strings.")
                         (chmod wrapper #o555))))
          (replace 'configure
            (lambda* (#:key outputs #:allow-other-keys)
-             (invoke "./configure"
+             (invoke "sh" "configure"
                      (string-append "--prefix="
                                     (assoc-ref outputs "out"))))))))
     (inputs (list scm))
@@ -6312,7 +6200,7 @@ linear algebra primitives specifically targeting graph analytics.")
 (define-public dune-common
   (package
     (name "dune-common")
-    (version "2.7.0")
+    (version "2.7.1")
     (source
      (origin
        (method url-fetch)
@@ -6320,14 +6208,18 @@ linear algebra primitives specifically targeting graph analytics.")
                            version "/dune-common-" version ".tar.gz"))
        (sha256
         (base32
-         "140q1zh44cr5yrjwg4b5ga803rkqv55vk30l2cqm29aklj1wb0rw"))))
+         "0sidwdkyrrqjkqhpvrlc991pzi5xzlvxk91s2n7qk3widwy7fch2"))))
     (build-system cmake-build-system)
     (arguments
      `(#:phases
        (modify-phases %standard-phases
          (add-after 'build 'build-tests
-           (lambda* (#:key make-flags #:allow-other-keys)
-             (apply invoke "make" "build_tests" make-flags))))))
+           (lambda* (#:key make-flags parallel-build? #:allow-other-keys)
+             (apply invoke "make" "build_tests"
+                    `(,@(if parallel-build?
+                            `("-j" ,(number->string (parallel-job-count)))
+                            '())
+                      ,@make-flags)))))))
     (inputs
      (list gmp metis openblas python superlu))
     (native-inputs
@@ -6345,7 +6237,7 @@ Differences} (FD).")
 (define-public dune-geometry
   (package
     (name "dune-geometry")
-    (version "2.7.0")
+    (version "2.7.1")
     (source
      (origin
        (method url-fetch)
@@ -6353,14 +6245,18 @@ Differences} (FD).")
                            version "/dune-geometry-" version ".tar.gz"))
        (sha256
         (base32
-         "1cicvlwbyyw76npicnblxckyvhbfn3ip8isydiv3hlrlz8zcg5nr"))))
+         "068mh3fd110xl27rwxqlqy4d9cpqw2vqm2pzfrripiaqscb3byfy"))))
     (build-system cmake-build-system)
     (arguments
      `(#:phases
        (modify-phases %standard-phases
          (add-after 'build 'build-tests
-           (lambda* (#:key make-flags #:allow-other-keys)
-             (apply invoke "make" "build_tests" make-flags))))))
+           (lambda* (#:key make-flags parallel-build? #:allow-other-keys)
+             (apply invoke "make" "build_tests"
+                    `(,@(if parallel-build?
+                            `("-j" ,(number->string (parallel-job-count)))
+                            '())
+                      ,@make-flags)))))))
     (inputs
      (list dune-common
            ;; Optional
@@ -6382,7 +6278,7 @@ This package contains the basic DUNE geometry classes.")
 (define-public dune-uggrid
   (package
     (name "dune-uggrid")
-    (version "2.7.0")
+    (version "2.7.1")
     (source
      (origin
        (method git-fetch)
@@ -6392,14 +6288,18 @@ This package contains the basic DUNE geometry classes.")
        (file-name (git-file-name name version))
        (sha256
         (base32
-         "192miqgmfj6jwk969gydzpbv9ki7jg5nky3ydnrwa2nq29b5xkh0"))))
+         "11qz52g9d5k96fqik2lyi80xryw174rnny074pj70ardl6zzz83p"))))
     (build-system cmake-build-system)
     (arguments
      `(#:phases
        (modify-phases %standard-phases
          (add-after 'build 'build-tests
-           (lambda* (#:key make-flags #:allow-other-keys)
-             (apply invoke "make" "build_tests" make-flags))))))
+           (lambda* (#:key make-flags parallel-build? #:allow-other-keys)
+             (apply invoke "make" "build_tests"
+                    `(,@(if parallel-build?
+                            `("-j" ,(number->string (parallel-job-count)))
+                            '())
+                      ,@make-flags)))))))
     (inputs
      (list dune-common))
     (native-inputs
@@ -6418,7 +6318,7 @@ This package contains the DUNE UG grid classes.")
 (define-public dune-grid
   (package
     (name "dune-grid")
-    (version "2.7.0")
+    (version "2.7.1")
     (source
      (origin
        (method url-fetch)
@@ -6426,14 +6326,18 @@ This package contains the DUNE UG grid classes.")
                            version "/dune-grid-" version ".tar.gz"))
        (sha256
         (base32
-         "17fjz30qazjgl11sryyxnw9klai4yz1ji4bs68013xcxc5hdv27s"))))
+         "15iws03hkbmr4a4rqqb0rriz1m8szl96wdr7gw0jmrcnlzbdbbx5"))))
     (build-system cmake-build-system)
     (arguments
      `(#:phases
        (modify-phases %standard-phases
          (add-after 'build 'build-tests
-           (lambda* (#:key make-flags #:allow-other-keys)
-             (apply invoke "make" "build_tests" make-flags))))))
+           (lambda* (#:key make-flags parallel-build? #:allow-other-keys)
+             (apply invoke "make" "build_tests"
+                    `(,@(if parallel-build?
+                            `("-j" ,(number->string (parallel-job-count)))
+                            '())
+                      ,@make-flags)))))))
     (inputs
      (list dune-common
            dune-geometry
@@ -6460,7 +6364,7 @@ This package contains the basic DUNE grid classes.")
 (define-public dune-istl
   (package
     (name "dune-istl")
-    (version "2.7.0")
+    (version "2.7.1")
     (source
      (origin
        (method url-fetch)
@@ -6468,8 +6372,7 @@ This package contains the basic DUNE grid classes.")
                            version "/dune-istl-" version ".tar.gz"))
        (sha256
         (base32
-         "0gl3wgz5rs6sb4m83440ny45sbx7z7lnbi3gx6r9nm3rvy5j33f9"))
-       (patches (search-patches "dune-istl-2.7-fix-non-mpi-tests.patch"))))
+         "1cy69s1266hvnh8blznlvvkrf8i2g640rc3mf7kp872wgvdz4nb9"))))
     (build-system cmake-build-system)
     (arguments
      `(#:phases
@@ -6487,8 +6390,12 @@ This package contains the basic DUNE grid classes.")
                         ":"))
                #t)))
          (add-after 'build 'build-tests
-           (lambda* (#:key make-flags #:allow-other-keys)
-             (apply invoke "make" "build_tests" make-flags))))))
+           (lambda* (#:key make-flags parallel-build? #:allow-other-keys)
+             (apply invoke "make" "build_tests"
+                    `(,@(if parallel-build?
+                            `("-j" ,(number->string (parallel-job-count)))
+                            '())
+                      ,@make-flags)))))))
     (inputs
      (list dune-common
            ;; Optional
@@ -6518,7 +6425,7 @@ aggregation-based algebraic multigrid.")
 (define-public dune-localfunctions
   (package
     (name "dune-localfunctions")
-    (version "2.7.0")
+    (version "2.7.1")
     (source
      (origin
        (method url-fetch)
@@ -6526,7 +6433,7 @@ aggregation-based algebraic multigrid.")
                            version "/dune-localfunctions-" version ".tar.gz"))
        (sha256
         (base32
-         "1yih59h6vngii696bx1c2vil02lriij4kz0nc583mjn9kiaqxfqd"))))
+         "031i42anrhi0ngpvp42rdjbkic7v3008fwild9xg7flffwvnpshg"))))
     (build-system cmake-build-system)
     (arguments
      `(#:phases
@@ -6544,8 +6451,12 @@ aggregation-based algebraic multigrid.")
                         ":"))
                #t)))
          (add-after 'build 'build-tests
-           (lambda* (#:key make-flags #:allow-other-keys)
-             (apply invoke "make" "build_tests" make-flags))))))
+           (lambda* (#:key make-flags parallel-build? #:allow-other-keys)
+             (apply invoke "make" "build_tests"
+                    `(,@(if parallel-build?
+                            `("-j" ,(number->string (parallel-job-count)))
+                            '())
+                      ,@make-flags)))))))
     (inputs
      (list dune-common
            dune-geometry
@@ -6570,97 +6481,111 @@ assemble global function spaces on finite-element grids.")
     (license license:gpl2)))
 
 (define-public dune-alugrid
-  (package
-    (name "dune-alugrid")
-    (version "2.7.0-git-81d35682")
-    (source
-     (origin
-       (method git-fetch)
-       (uri (git-reference
-             (url "https://gitlab.dune-project.org/extensions/dune-alugrid.git")
-             (commit "81d356827c84454b971937db02c02b90bbcd7fe5")))
-       (file-name (git-file-name name version))
-       (sha256
-        (base32
-         "0z54lwfp53prcrs94k8gwh047l9z642jll3l56xlyfr69z0b2zz1"))))
-    (build-system cmake-build-system)
-    (arguments
-     `(#:phases
-       (modify-phases %standard-phases
-         (add-after 'unpack 'patch-include
-           (lambda _
-             (substitute* "dune/alugrid/test/test-alugrid.cc"
-               (("doc/grids/gridfactory/testgrids")
-                "doc/dune-grid/grids/gridfactory/testgrids"))
-             #t))
-         (add-after 'build 'build-tests
-           (lambda* (#:key inputs make-flags #:allow-other-keys)
-             (setenv "CPLUS_INCLUDE_PATH"
-                     (string-append (assoc-ref inputs "dune-grid") "/share"))
-             (apply invoke "make" "build_tests" make-flags))))))
-    (inputs
-     (list dune-common
-           dune-geometry
-           dune-grid
-           ;; Optional
-           metis
-           openblas
-           python
-           superlu
-           gmp
-           zlib))
-    (native-inputs
-     (list gfortran pkg-config))
-    (home-page "https://dune-project.org/")
-    (synopsis "Distributed and Unified Numerics Environment")
-    (description "ALUGrid is an adaptive, loadbalancing, unstructured
+  ;; This was the last commit on the releases/2.7 branch as of 2021-12-17,
+  ;; unfortunately there was no tag for any 2.7 release.
+  (let ((commit "51bde29a2dfa7cfac4fb73d40ffd42b9c1eb1d3d"))
+    (package
+      (name "dune-alugrid")
+      (version (git-version "2.7.1" "0" commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://gitlab.dune-project.org/extensions/dune-alugrid.git")
+               (commit commit)))
+         (file-name (git-file-name name version))
+         (sha256
+          (base32
+           "0z16wg6llzxs7vjg2yilg31vwnkz8k050j6bspg3blbym0razy15"))))
+      (build-system cmake-build-system)
+      (arguments
+       `(#:phases
+         (modify-phases %standard-phases
+           (add-after 'unpack 'patch-include
+             (lambda _
+               (substitute* "dune/alugrid/test/test-alugrid.cc"
+                 (("doc/grids/gridfactory/testgrids")
+                  "doc/dune-grid/grids/gridfactory/testgrids"))
+               #t))
+           (add-after 'build 'build-tests
+             (lambda* (#:key make-flags parallel-build? #:allow-other-keys)
+               (setenv "CPLUS_INCLUDE_PATH"
+                       (string-append (assoc-ref inputs "dune-grid") "/share"))
+               (apply invoke "make" "build_tests"
+                      `(,@(if parallel-build?
+                              `("-j" ,(number->string (parallel-job-count)))
+                              '())
+                        ,@make-flags)))))))
+      (inputs
+       (list dune-common
+             dune-geometry
+             dune-grid
+             ;; Optional
+             metis
+             openblas
+             python
+             superlu
+             gmp
+             zlib))
+      (native-inputs
+       (list gfortran pkg-config))
+      (home-page "https://dune-project.org/")
+      (synopsis "Distributed and Unified Numerics Environment")
+      (description "ALUGrid is an adaptive, loadbalancing, unstructured
 implementation of the DUNE grid interface supporting either simplices or
 cubes.")
-    (license license:gpl2+)))
+      (license license:gpl2+))))
 
 (define-public dune-subgrid
-  (package
-    (name "dune-subgrid")
-    (version "2.7.0-git-2103a363")
-    (source
-     (origin
-       (method git-fetch)
-       (uri (git-reference
-         (url "https://git.imp.fu-berlin.de/agnumpde/dune-subgrid")
-         (commit "2103a363f32e8d7b60e66eee7ddecf969f6cf762")))
-       (file-name (git-file-name name version))
-       (sha256
-        (base32
-          "1wsjlypd3835c3arqjkw836cxx5q67zy447wa65q634lf6f6v9ia"))))
-    (build-system cmake-build-system)
-    (arguments
-     `(#:phases
-       (modify-phases %standard-phases
-         (add-after 'build 'build-tests
-           (lambda* (#:key make-flags #:allow-other-keys)
-             (apply invoke "make" "build_tests" make-flags))))))
-    (inputs
-     (list dune-common
-           dune-geometry
-           dune-grid
-           ;; Optional
-           metis
-           openblas
-           gmp))
-    (native-inputs
-     (list gfortran pkg-config))
-    (home-page "http://numerik.mi.fu-berlin.de/dune-subgrid/index.php")
-    (synopsis "Distributed and Unified Numerics Environment")
-    (description "The dune-subgrid module marks elements of
+  ;; This was the last commit on the releases/2.7 branch as of 2021-12-17.
+  ;; Unfortunately the dune-subgrid repository contains no release tags.
+  (let ((commit "45d1ee9f3f711e209695deee97912f4954f7f280"))
+    (package
+      (name "dune-subgrid")
+      (version (git-version "2.7.1" "0" commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+           (url "https://git.imp.fu-berlin.de/agnumpde/dune-subgrid")
+           (commit commit)))
+         (file-name (git-file-name name version))
+         (sha256
+          (base32
+            "0xjf7865wil7kzym608kv3nc3ff3m3nlqich4k9wjyvy3lz6panh"))))
+      (build-system cmake-build-system)
+      (arguments
+       `(#:phases
+         (modify-phases %standard-phases
+           (add-after 'build 'build-tests
+             (lambda* (#:key make-flags parallel-build? #:allow-other-keys)
+               (apply invoke "make" "build_tests"
+                      `(,@(if parallel-build?
+                              `("-j" ,(number->string (parallel-job-count)))
+                              '())
+                        ,@make-flags)))))))
+      (inputs
+       (list dune-common
+             dune-geometry
+             dune-grid
+             ;; Optional
+             metis
+             openblas
+             gmp))
+      (native-inputs
+       (list gfortran pkg-config))
+      (home-page "http://numerik.mi.fu-berlin.de/dune-subgrid/index.php")
+      (synopsis "Distributed and Unified Numerics Environment")
+      (description "The dune-subgrid module marks elements of
 another hierarchical dune grid.  The set of marked elements can then be
 accessed as a hierarchical dune grid in its own right.  Dune-Subgrid
 provides the full grid interface including adaptive mesh refinement.")
-    (license license:gpl2+)))
+      (license license:gpl2+))))
 
 (define-public dune-typetree
   (package
     (name "dune-typetree")
-    (version "2.7.0")
+    (version "2.7.1")
     (source
      (origin
        (method git-fetch)
@@ -6670,14 +6595,18 @@ provides the full grid interface including adaptive mesh refinement.")
        (file-name (git-file-name name version))
        (sha256
         (base32
-         "1rhv25yg0q1hw50c8wlfqhgwrjl4mh62zq9v14ilwgzbfgxmpiy7"))))
+         "1kx9k8i7pdw6l6ny6nq85v5p1nd6yxldzaj8k3nizaz3q1j407pv"))))
     (build-system cmake-build-system)
     (arguments
      `(#:phases
        (modify-phases %standard-phases
          (add-after 'build 'build-tests
-           (lambda* (#:key make-flags #:allow-other-keys)
-             (apply invoke "make" "build_tests" make-flags))))))
+           (lambda* (#:key make-flags parallel-build? #:allow-other-keys)
+             (apply invoke "make" "build_tests"
+                    `(,@(if parallel-build?
+                            `("-j" ,(number->string (parallel-job-count)))
+                            '())
+                      ,@make-flags)))))))
     (inputs
      (list dune-common
            ;; Optional
@@ -6698,7 +6627,7 @@ operating on statically typed trees of objects.")
 (define-public dune-functions
   (package
     (name "dune-functions")
-    (version "2.7.0")
+    (version "2.7.1")
     (source
      (origin
        (method git-fetch)
@@ -6708,7 +6637,7 @@ operating on statically typed trees of objects.")
        (file-name (git-file-name name version))
        (sha256
         (base32
-         "1na4gcih0kin37ksj2xj07ds04v7zx53pjdhm1hzy55jjfqdjk8h"))))
+         "04dhr4asnl38bf1gp8hrk31maav33m7q71lhl2n5yk1q1x6i77nw"))))
     (build-system cmake-build-system)
     (arguments
      `(#:phases
@@ -6720,8 +6649,12 @@ operating on statically typed trees of objects.")
                      "--exclude-regex gridviewfunctionspacebasistest")
             #t))
          (add-after 'build 'build-tests
-           (lambda* (#:key make-flags #:allow-other-keys)
-             (apply invoke "make" "build_tests" make-flags))))))
+           (lambda* (#:key make-flags parallel-build? #:allow-other-keys)
+             (apply invoke "make" "build_tests"
+                    `(,@(if parallel-build?
+                            `("-j" ,(number->string (parallel-job-count)))
+                            '())
+                      ,@make-flags)))))))
     (inputs
      (list dune-common
            dune-istl
@@ -6745,44 +6678,47 @@ implemented as callable objects, and bases of finite element spaces.")
     (license (list license:lgpl3+ license:gpl2))))
 
 (define-public dune-pdelab
-  (package
-    (name "dune-pdelab")
-    (version "2.7.0-git-476fe437")
-    (source
-     (origin
-       (method git-fetch)
-       (uri (git-reference
-             (url "https://gitlab.dune-project.org/pdelab/dune-pdelab")
-             (commit "476fe43763fa6f459c5e4658e2a2b4b5582db834")))
-       (file-name (git-file-name name version))
-       (sha256
-        (base32
-         "0cs36piqzn6rq0j2ih3ab3q3q9yg199wk72k5qi86pkzh7i7fdn1"))))
-    (build-system cmake-build-system)
-    (arguments '(#:tests? #f)) ; XXX: the tests cannot be compiled
-    (inputs
-     (list dune-common
-           dune-istl
-           dune-localfunctions
-           dune-geometry
-           dune-grid
-           dune-typetree
-           dune-functions
-           ;; Optional
-           openblas
-           eigen
-           metis
-           python
-           superlu
-           gmp))
-    (native-inputs
-     (list gfortran pkg-config))
-    (home-page "https://dune-project.org/")
-    (synopsis "Differential equations solver toolbox")
-    (description "PDELab is a partial differential equations solver toolbox
+  ;; This was the last commit on the releases/2.7 branch as of 2021-12-17,
+  ;; unfortunately there was no tag for any 2.7 release.
+  (let ((commit "09aef74d95661d18a7789d2f517ae77797eec738"))
+    (package
+      (name "dune-pdelab")
+      (version (git-version "2.7.1" "0" commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://gitlab.dune-project.org/pdelab/dune-pdelab")
+               (commit commit)))
+         (file-name (git-file-name name version))
+         (sha256
+          (base32
+           "0nv69ayr4gln9m1s94z9zkrxqi8nzar3z6awnvgqz595nmjf82ac"))))
+      (build-system cmake-build-system)
+      (arguments '(#:tests? #f)) ; XXX: the tests cannot be compiled
+      (inputs
+       (list dune-common
+             dune-istl
+             dune-localfunctions
+             dune-geometry
+             dune-grid
+             dune-typetree
+             dune-functions
+             ;; Optional
+             openblas
+             eigen
+             metis
+             python
+             superlu
+             gmp))
+      (native-inputs
+       (list gfortran pkg-config))
+      (home-page "https://dune-project.org/")
+      (synopsis "Differential equations solver toolbox")
+      (description "PDELab is a partial differential equations solver toolbox
 built on top of DUNE, the Distributed and Unified Numerics Environment.")
-    ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
-    (license (list license:lgpl3+ license:gpl2))))
+      ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
+      (license (list license:lgpl3+ license:gpl2)))))
 
 (define add-openmpi-to-dune-package
   (let ((dune-package?
@@ -6792,8 +6728,8 @@ built on top of DUNE, the Distributed and Unified Numerics Environment.")
         (if (dune-package? p)
             (package (inherit p)
               (name (string-append (package-name p) "-openmpi"))
-              (inputs `(,@(package-inputs p)
-                        ("openmpi" ,openmpi)))
+              (inputs (modify-inputs (package-inputs p)
+                        (append openmpi)))
               (arguments
                (substitute-keyword-arguments (package-arguments p)
                  ((#:phases phases '%standard-phases)
@@ -7099,8 +7035,7 @@ researchers and developers alike to get started on SAT.")
            curl
            icu4c
            gnuplot
-           readline
-           libiconv))
+           readline))
     (arguments
      `(#:phases
        (modify-phases %standard-phases