Merge branch 'master' into core-updates-frozen
[jackhill/guix/guix.git] / gnu / packages / algebra.scm
index ed35a68..97bc7c9 100644 (file)
@@ -1,18 +1,19 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019 Andreas Enge <andreas@enge.fr>
-;;; Copyright © 2013, 2015, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
-;;; Copyright © 2016, 2017, 2018, 2019, 2020 Nicolas Goaziou <mail@nicolasgoaziou.fr>
+;;; Copyright © 2013, 2015, 2017, 2018, 2021 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2016, 2017, 2018, 2019, 2020, 2021 Nicolas Goaziou <mail@nicolasgoaziou.fr>
 ;;; Copyright © 2014, 2018 Mark H Weaver <mhw@netris.org>
-;;; Copyright © 2016, 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
-;;; Copyright © 2017, 2020 Efraim Flashner <efraim@flashner.co.il>
-;;; Copyright © 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright © 2016, 2018, 2019, 2021 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2017, 2020, 2021 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2017–2021 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2017 Marius Bakke <mbakke@fastmail.com>
-;;; Copyright © 2017, 2019 Eric Bavier <bavier@member.fsf.org>
+;;; Copyright © 2017, 2019, 2021 Eric Bavier <bavier@posteo.net>
 ;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
 ;;; Copyright © 2020 Björn Höfling <bjoern.hoefling@bjoernhoefling.de>
 ;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
 ;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
 ;;; Copyright © 2020 Vinicius Monego <monego@posteo.net>
+;;; Copyright © 2021 Lars-Dominik Braun <ldb@leibniz-psychology.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -33,6 +34,7 @@
   #:use-module (gnu packages)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages bison)
+  #:use-module (gnu packages boost)
   #:use-module (gnu packages check)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages cpp)
@@ -44,7 +46,6 @@
   #:use-module (gnu packages graphviz)
   #:use-module (gnu packages image)
   #:use-module (gnu packages java)
-  #:use-module (gnu packages llvm)
   #:use-module (gnu packages maths)
   #:use-module (gnu packages mpi)
   #:use-module (gnu packages multiprecision)
   #:use-module (gnu packages tex)
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages xiph)
+  #:use-module (gnu packages xml)
   #:use-module (gnu packages xorg)
   #:use-module (guix build-system ant)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system python)
+  #:use-module (guix build-system r)
   #:use-module (guix download)
   #:use-module (guix git-download)
   #:use-module (guix hg-download)
@@ -75,7 +78,7 @@
 (define-public mpfrcx
   (package
    (name "mpfrcx")
-   (version "0.6")
+   (version "0.6.3")
    (source (origin
             (method url-fetch)
             (uri (string-append
@@ -83,7 +86,7 @@
                   version ".tar.gz"))
             (sha256
              (base32
-              "0gz5rma9al2jrifpknqkcnd9dkf8l05jcxy3s4ghwhd4y3h5dwia"))))
+              "1545vgizpypqi2rrriad0ybqv0qwbn9zr0ibxpk00gha9ihv7acx"))))
    (build-system gnu-build-system)
    (propagated-inputs
      `(("gmp" ,gmp)
@@ -234,7 +237,7 @@ the real span of the lattice.")
 (define-public pari-gp
   (package
     (name "pari-gp")
-    (version "2.13.0")
+    (version "2.13.2")
     (source (origin
               (method url-fetch)
               (uri (string-append
@@ -242,10 +245,10 @@ the real span of the lattice.")
                     version ".tar.gz"))
               (sha256
                (base32
-                "14xs90wrw8mbdx08hxlbhiahp6kgjq6yh27zjw7fvhfjx5nr84f8"))))
+                "095s7vdlsxmxa0n0l1a082m6gjaypqfqkaj99z8j7dx0ji89hy8n"))))
     (build-system gnu-build-system)
     (native-inputs
-     `(("texlive" ,(texlive-union
+     `(("texlive" ,(texlive-updmap.cfg
                     (list texlive-amsfonts)))))
     (inputs `(("gmp" ,gmp)
               ("libx11" ,libx11)
@@ -276,7 +279,7 @@ PARI is also available as a C library to allow for faster computations.")
 (define-public gp2c
   (package
    (name "gp2c")
-   (version "0.0.11pl4")
+   (version "0.0.12")
    (source (origin
             (method url-fetch)
             (uri (string-append
@@ -284,7 +287,7 @@ PARI is also available as a C library to allow for faster computations.")
                   version ".tar.gz"))
             (sha256
               (base32
-                "1cnnh7diqc97q76q5pyhpbljbhc0sz8mlrbqgiwi0sjkgh8iqsj0"))))
+                "039ip7qkwwv46wrcdrz7y12m30kazzkjr44kqbc0h137g4wzd7zf"))))
    (build-system gnu-build-system)
    (native-inputs `(("perl" ,perl)))
    (inputs `(("pari-gp" ,pari-gp)))
@@ -307,39 +310,25 @@ GP2C, the GP to C compiler, translates GP scripts to PARI programs.")
    (license license:gpl2)
    (home-page "https://pari.math.u-bordeaux.fr/")))
 
-(define fplll-4-cmh
-  (package
-    (inherit fplll)
-    (name "fplll")
-    (version "4.0.4")
-    (source
-     (origin
-       (method url-fetch)
-       (uri (string-append
-             "http://perso.ens-lyon.fr/damien.stehle/fplll/libfplll-"
-             version ".tar.gz"))
-       (sha256
-        (base32 "1cbiby7ykis4z84swclpysrljmqhfcllpkcbll1m08rzskgb1a6b"))))))
-
 (define-public cmh
   (package
    (name "cmh")
-   (version "1.0")
+   (version "1.1.0")
    (source (origin
             (method url-fetch)
-            (uri (string-append
-                  "https://gforge.inria.fr/frs/download.php/33497/cmh-"
-                  version ".tar.gz"))
+            ;; Git repo at <https://gitlab.inria.fr/cmh/cmh>.
+            (uri (string-append "http://www.multiprecision.org/downloads/cmh-"
+                                version ".tar.gz"))
             (sha256
              (base32
-              "1a28xr9bs0igms0ik99x0w8lnb0jyfcmvyi26pbyh9ggcdivd33p"))))
+              "1ws2yhzxmm2l5xqqqcjcimmg40f9qq5l9i6d4i5434an9v9s8531"))))
    (build-system gnu-build-system)
    (inputs
      `(("gmp" ,gmp)
        ("mpfr" ,mpfr)
        ("mpc" ,mpc)
        ("mpfrcx" ,mpfrcx)
-       ("fplll" ,fplll-4-cmh)
+       ("fplll" ,fplll)
        ("pari-gp"  ,pari-gp)))
    (synopsis "Igusa class polynomial computations")
    (description
@@ -349,13 +338,12 @@ varieties, i.e. Jacobians of hyperelliptic curves.
 It can also be used to compute theta constants at arbitrary
 precision.")
    (license license:gpl3+)
-   (home-page
-     "https://gitlab.inria.fr/cmh/cmh#cmh-computation-of-genus-2-class-polynomials")))
+   (home-page "http://www.multiprecision.org/cmh/home.html")))
 
 (define-public giac
   (package
     (name "giac")
-    (version "1.6.0-31")
+    (version "1.7.0-31")
     (source
      (origin
        (method url-fetch)
@@ -367,7 +355,7 @@ precision.")
                            "~parisse/debian/dists/stable/main/source/"
                            "giac_" version ".tar.gz"))
        (sha256
-        (base32 "1dr1y88sx2gzldn0zl6p8b1ngjjcmh89iv4kzyhi2cf74j3yw85m"))))
+        (base32 "19vjyijlm3hb758h6nk70k41zw9wrbg6vwfx4r4rgvrb1myy5kpl"))))
     (build-system gnu-build-system)
     (arguments
      `(#:modules ((ice-9 ftw)
@@ -380,14 +368,12 @@ precision.")
            (lambda _
              (substitute* (cons "micropython-1.12/xcas/Makefile"
                                 (find-files "doc" "^Makefile"))
-               (("/bin/cp") (which "cp")))
-             #t))
+               (("/bin/cp") (which "cp")))))
          (add-after 'unpack 'disable-failing-test
            ;; FIXME: Test failing.  Not sure why.
            (lambda _
              (substitute* "check/Makefile.in"
-               (("chk_fhan11") ""))
-             #t))
+               (("chk_fhan11") ""))))
          (add-after 'install 'fix-doc
            (lambda* (#:key outputs #:allow-other-keys)
              (let ((out (assoc-ref outputs "out")))
@@ -400,17 +386,15 @@ precision.")
                ;; Remove duplicate documentation in
                ;; "%out/share/doc/giac/", where Xcas does not expect
                ;; to find it.
-               (delete-file-recursively (string-append out "/share/doc/giac"))
-               #t)))
+               (delete-file-recursively (string-append out "/share/doc/giac")))))
          (add-after 'install 'remove-unnecessary-executable
            (lambda* (#:key outputs #:allow-other-keys)
              (let ((out (assoc-ref outputs "out")))
-               (delete-file (string-append out "/bin/xcasnew"))
-               #t))))))
+               (delete-file (string-append out "/bin/xcasnew"))))))))
     (inputs
      ;; TODO: Add libnauty, unbundle "libmicropython.a".
      `(("fltk" ,fltk)
-       ("glpk" ,glpk)
+       ("glpk" ,glpk-4)
        ("gmp" ,gmp)
        ("gsl" ,gsl)
        ("lapack" ,lapack)
@@ -533,14 +517,14 @@ fast arithmetic.")
                        (string-append "--with-flint=" flint)
                        (string-append "--with-gmp=" gmp)
                        (string-append "--with-mpfr=" mpfr))))))))
+    (home-page "https://arblib.org")
     (synopsis "Arbitrary precision floating-point ball arithmetic")
     (description
      "Arb is a C library for arbitrary-precision floating-point ball
 arithmetic.  It supports efficient high-precision computation with
 polynomials, power series, matrices and special functions over the
 real and complex numbers, with automatic, rigorous error control.")
-    (license license:lgpl2.1+)
-    (home-page "http://arblib.org")))
+    (license license:lgpl2.1+)))
 
 (define-public python-flint
   (package
@@ -572,19 +556,19 @@ arithmetic).  It supports integers, rationals, modular integers,
 real and complex ball arithmetic, polynomials and matrices over all
 these types and other mathematical functions.")
     (license license:expat)
-    (home-page "http://fredrikj.net/python-flint/")))
+    (home-page "https://fredrikj.net/python-flint/")))
 
 (define-public ntl
   (package
    (name "ntl")
-   (version "11.4.3")
+   (version "11.4.4")
    (source (origin
             (method url-fetch)
             (uri (string-append "https://shoup.net/ntl/ntl-"
                                 version ".tar.gz"))
             (sha256
              (base32
-              "1lisp3064rch3jaa2wrhy1s9kll7i3ka3d0y6lj6l3l4ckfcrhdp"))
+              "1nr1h27j2gdz6badzz9lk2pknxhdijqdxqhd3haryh0sw616wzwx"))
             (modules '((guix build utils)))
             (snippet
              '(begin
@@ -666,7 +650,7 @@ geometry and singularity theory.")
    ;; libraries with which it links are licensed under lgpl3+, so the
    ;; combined work becomes gpl3. See COPYING in the source code.
    (license license:gpl3)
-   (home-page "http://www.singular.uni-kl.de/index.php")))
+   (home-page "https://www.singular.uni-kl.de/index.php")))
 
 (define-public gmp-ecm
   (package
@@ -674,9 +658,11 @@ geometry and singularity theory.")
    (version "7.0.4")
    (source (origin
              (method url-fetch)
-             ;; Use the ‘Latest version’ link for a stable URI across releases.
-             (uri (string-append "https://gforge.inria.fr/frs/download.php/"
-                                 "latestfile/160/ecm-" version ".tar.gz"))
+             (uri
+               (let ((hash "00c4c691a1ef8605b65bdf794a71539d"))
+                    (string-append "https://gitlab.inria.fr/zimmerma/ecm/"
+                                   "uploads/" hash "/ecm-" version
+                                   ".tar.gz")))
              (sha256 (base32
                       "0hxs24c2m3mh0nq1zz63z3sb7dhy1rilg2s1igwwcb26x3pb7xqc"))))
    (build-system gnu-build-system)
@@ -716,12 +702,14 @@ binary.")
        ("ed" ,ed)
        ("flex" ,flex)
        ("texinfo" ,texinfo)))
+    (inputs
+     `(("readline" ,readline)))
     (arguments
      '(#:configure-flags
        (list "--with-readline")
        #:phases
        (modify-phases %standard-phases
-         (add-after 'unpack 'autogen
+         (replace 'bootstrap
            (lambda _
              (invoke "autoreconf" "-vif"))))))
     (home-page "https://www.gnu.org/software/bc/")
@@ -806,7 +794,7 @@ cosine/ sine transforms or DCT/DST).")
     (license license:gpl2+)))
 
 (define-public fftwf
-  (package (inherit fftw)
+  (package/inherit fftw
     (name "fftwf")
     (arguments
      (substitute-keyword-arguments (package-arguments fftw)
@@ -824,7 +812,7 @@ cosine/ sine transforms or DCT/DST).")
                     "  Single-precision version."))))
 
 (define-public fftw-openmpi
-  (package (inherit fftw)
+  (package/inherit fftw
     (name "fftw-openmpi")
     (inputs
      `(("openmpi" ,openmpi)
@@ -984,11 +972,8 @@ algorithms from the FORTRAN library MINPACK.")
          "-DWITH_MPFR=on"
          "-DWITH_MPC=on"
          "-DINTEGER_CLASS=flint"
-         "-DWITH_LLVM=on"
          "-DWITH_SYMENGINE_THREAD_SAFE=on"
          "-DBUILD_SHARED_LIBS=on")))    ;also build libsymengine
-    (native-inputs
-     `(("llvm" ,llvm)))
     (inputs
      `(("flint" ,flint)
        ("gmp" ,gmp)
@@ -1005,7 +990,7 @@ Optional thin wrappers allow usage of the library from other languages.")
 (define-public eigen
   (package
     (name "eigen")
-    (version "3.3.7")
+    (version "3.3.8")
     (source (origin
               (method url-fetch)
               (uri (list
@@ -1015,9 +1000,10 @@ Optional thin wrappers allow usage of the library from other languages.")
                                     version ".orig.tar.bz2")))
               (sha256
                (base32
-                "1km3fyfzyqfdvmnl79drps3fjwnz3zbh0c7l34mfbqyvvs8cy4wz"))
+                "1vxrsncfnkyq6gwxpsannpryp12mk7lc8f42ybvz3saf7icwc582"))
               (file-name (string-append name "-" version ".tar.bz2"))
-              (patches (search-patches "eigen-stabilise-sparseqr-test.patch"))
+              (patches (search-patches "eigen-remove-openmp-error-counting.patch"
+                                       "eigen-stabilise-sparseqr-test.patch"))
               (modules '((guix build utils)))
               (snippet
                ;; There are 3 test failures in the "unsupported" directory,
@@ -1085,6 +1071,33 @@ features, and more.")
                        "# Do not build the tests for unsupported features.\n"))
                     #t)))))))
 
+(define-public eigen-for-tensorflow-lite
+  ;; This commit was taken from
+  ;; tensorflow/lite/tools/cmake/modules/eigen.cmake
+  (let ((commit "d10b27fe37736d2944630ecd7557cefa95cf87c9")
+        (revision "1"))
+    (package (inherit eigen)
+      (name "eigen-for-tensorflow-lite")
+      (version (git-version "3.3.7" revision commit))
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url "https://gitlab.com/libeigen/eigen")
+                      (commit commit)))
+                (sha256
+                 (base32
+                  "0v8a20cwvwmp3hw4275b37frw33v92z0mr8f4dn6y8k0rz92hrrf"))
+                (file-name (git-file-name name version))
+                (modules '((guix build utils)))
+                (snippet
+                 ;; Ther are test failures in the "unsupported" directory, but
+                 ;; maintainers say it's unsupported anyway, so just skip
+                 ;; them.
+                 '(begin
+                    (substitute* "unsupported/CMakeLists.txt"
+                      (("add_subdirectory\\(test.*")
+                       "# Do not build the tests for unsupported features.\n")))))))))
+
 (define-public xtensor
   (package
     (name "xtensor")
@@ -1258,6 +1271,47 @@ objects.")
     ;; safe side, we drop them for now.
     (license license:gpl2+)))
 
+(define-public gappa
+  (package
+   (name "gappa")
+   (version "1.3.5")
+   (source (origin
+            (method url-fetch)
+            (uri (string-append "https://gforge.inria.fr/frs/download.php/latestfile/"
+                                "2699/gappa-" version ".tar.gz"))
+            (sha256
+             (base32
+              "0q1wdiwqj6fsbifaayb1zkp20bz8a1my81sqjsail577jmzwi07w"))))
+   (build-system gnu-build-system)
+   (inputs
+    `(("boost" ,boost)
+      ("gmp" ,gmp)
+      ("mpfr" ,mpfr)))
+   (arguments
+    `(#:phases
+      (modify-phases %standard-phases
+        (add-after 'unpack 'patch-remake-shell
+          (lambda _
+            (substitute* "remake.cpp"
+             (("/bin/sh") (which "sh")))
+            #t))
+        (replace 'build
+          (lambda _ (invoke "./remake" "-s" "-d")))
+        (replace 'install
+          (lambda _ (invoke "./remake" "-s" "-d" "install")))
+        (replace 'check
+          (lambda _ (invoke "./remake" "check"))))))
+   (home-page "http://gappa.gforge.inria.fr/")
+   (synopsis "Proof generator for arithmetic properties")
+   (description "Gappa is a tool intended to help verifying and formally
+proving properties on numerical programs dealing with floating-point or
+fixed-point arithmetic.  It has been used to write robust floating-point
+filters for CGAL and it is used to certify elementary functions in CRlibm.
+While Gappa is intended to be used directly, it can also act as a backend
+prover for the Why3 software verification platform or as an automatic tactic
+for the Coq proof assistant.")
+   (license (list license:gpl3+ license:cecill-c)))) ; either/or
+
 (define-public givaro
   (package
     (name "givaro")
@@ -1600,3 +1654,69 @@ general purpose; they require that p satisfy some preconditions based on
 the dimension of the input matrix (usually p should be prime and should be
 no more than about 20 bits long).")
     (license license:bsd-3)))
+
+(define-public r-dtt
+  (package
+    (name "r-dtt")
+    (version "0.1-2")
+    (source
+      (origin
+        (method url-fetch)
+        (uri (cran-uri "dtt" version))
+        (sha256
+          (base32
+            "0n8gj5iylfagdbaqirpykb01a9difsy4zl6qq55f0ghvazxqdvmn"))))
+    (properties `((upstream-name . "dtt")))
+    (build-system r-build-system)
+    (home-page "http://www.r-project.org")
+    (synopsis "Discrete Trigonometric Transforms")
+    (description
+      "This package provides functions for 1D and 2D Discrete Cosine Transform
+(@dfn{DCT}), Discrete Sine Transform (@dfn{DST}) and Discrete Hartley Transform
+(@dfn{DHT}).")
+    (license license:gpl2+)))
+
+(define-public sollya
+  (package
+   (name "sollya")
+   (version "7.0")
+   (source (origin
+            (method url-fetch)
+            (uri (string-append "https://www.sollya.org/releases/"
+                                "sollya-" version "/sollya-" version ".tar.bz2"))
+            (sha256
+             (base32
+              "11290ivi9h665cxi8f1shlavhy10vzb8s28m57hrcgnxyxqmhx0m"))))
+   (build-system gnu-build-system)
+   (inputs
+    `(("fplll" ,fplll)
+      ("gmp" ,gmp)
+      ("gnuplot" ,gnuplot)
+      ("libxml2" ,libxml2)
+      ("mpfi" ,mpfi)
+      ("mpfr" ,mpfr)))
+   (arguments
+    `(#:configure-flags
+      (list (string-append "--docdir=${datadir}/doc/sollya-" ,version))
+      #:phases
+      (modify-phases %standard-phases
+        (add-after 'unpack 'patch-test-shebang
+          (lambda _
+            (substitute* (list "tests-tool/Makefile.in"
+                               "tests-lib/Makefile.in")
+             (("#!/bin/sh") (string-append "#!" (which "sh"))))
+            #t))
+        (add-before 'build 'patch-gnuplot-reference
+          (lambda _
+            (substitute* "general.c"
+             (("\"gnuplot\"") (string-append "\"" (which "gnuplot") "\"")))
+            #t)))))
+   (home-page "https://www.sollya.org")
+   (synopsis "Development environment for safe floating-point code")
+   (description "Sollya is a computer program whose purpose is to
+provide an environment for safe floating-point code development.  It
+is particularly targeted to the automated implementation of
+mathematical floating-point libraries (libm).  Amongst other features,
+it offers a certified infinity norm, an automatic polynomial
+implementer, and a fast Remez algorithm.")
+   (license license:cecill-c)))