gnu: livemedia-utils: Update to 2019.03.06.
[jackhill/guix/guix.git] / gnu / packages / maths.scm
index 0eee39f..cc7459f 100644 (file)
@@ -8,7 +8,7 @@
 ;;; 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, 2016, 2017, 2018, 2019 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 Leo Famulari <leo@famulari.name>
 ;;; Copyright © 2016, 2017 Thomas Danckaert <post@thomasdanckaert.be>
 ;;; Copyright © 2017, 2018 Paul Garlick <pgarlick@tourbillion-technology.com>
-;;; Copyright © 2017 Nils Gillmann <ng0@n0.is>
+;;; Copyright © 2017 ng0 <ng0@n0.is>
 ;;; Copyright © 2017 Ben Woodcroft <donttrustben@gmail.com>
 ;;; Copyright © 2017 Theodoros Foradis <theodoros@foradis.org>
 ;;; Copyright © 2017, 2019 Arun Isaac <arunisaac@systemreboot.net>
-;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright © 2017, 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2017 Dave Love <me@fx@gnu.org>
 ;;; Copyright © 2018 Jan Nieuwenhuizen <janneke@gnu.org>
 ;;; Copyright © 2018 Joshua Sierles, Nextjournal <joshua@nextjournal.com>
@@ -148,19 +148,19 @@ beginners.")
 (define-public c-graph
   (package
    (name "c-graph")
-   (version "2.0")
+   (version "2.0.1")
    (source (origin
             (method url-fetch)
             (uri (string-append "mirror://gnu/c-graph/c-graph-" version
                                 ".tar.gz"))
             (sha256 (base32
-                     "1hlvpzrh7hzzf533diyfiabzskddi8zx92av9hwkjw3l46z7qv01"))))
+                     "092412jzxy6wdvpk96pfj499hpmaww8xllavbvlqspfpr7ips9id"))))
    (build-system gnu-build-system)
    (inputs
-     `(("fortran" ,gfortran)))
+    `(("fortran" ,gfortran)))
    (synopsis "Visualizing and demonstrating convolution")
    (description
-     "GNU C-Graph is a tool for demonstrating the theory of convolution.
+    "GNU C-Graph is a tool for demonstrating the theory of convolution.
 Thus, it can serve as an excellent aid to students of signal and systems
 theory in visualizing the convolution process.  Rather than forcing the
 student to write code, the program offers an intuitive interface with
@@ -611,15 +611,14 @@ singular value problems.")
 (define-public gnuplot
   (package
     (name "gnuplot")
-    (version "5.2.4")
+    (version "5.2.6")
     (source (origin
               (method url-fetch)
               (uri (string-append "mirror://sourceforge/gnuplot/gnuplot/"
                                   version "/gnuplot-"
                                   version ".tar.gz"))
        (sha256
-        (base32
-         "1jvh8xmd2cvrhlsg88kxwh55wkwx31sg50v1n59slfippl0g058m"))))
+        (base32 "1vllgap08nhvdmc03idmkdnk9cfl2bp81hps50q1pqrr640qzp9m"))))
     (build-system gnu-build-system)
     (inputs `(("readline" ,readline)
               ("cairo" ,cairo)
@@ -887,121 +886,130 @@ extremely large and complex data collections.")
 
 (define-public hdf-java
   (package
-   (name "hdf-java")
-   (version "3.3.2")
-   (source
-    (origin
-      (method url-fetch)
-      (uri (string-append
-            "http://www.hdfgroup.org/ftp/HDF5/releases/HDF-JAVA/hdfjni-"
-            version "/src/CMake-hdfjava-" version ".tar.gz"))
-      (sha256
-       (base32 "0m1gp2aspcblqzmpqbdpfp6giskws85ds6p5gz8sx7asyp7wznpr"))
-      (modules '((guix build utils)))
-      (snippet ; Make sure we don't use the bundled sources and binaries.
-       `(begin
-          (for-each delete-file
-                    (list "SZip.tar.gz" "ZLib.tar.gz" "JPEG8d.tar.gz"
-                          "HDF4.tar.gz" "HDF5.tar.gz"))
-          (delete-file-recursively ,(string-append "hdfjava-" version "/lib"))
-          #t))))
-   (build-system gnu-build-system)
-   (native-inputs
-    `(("jdk" ,icedtea "jdk")
-      ("automake" ,automake) ; For up to date 'config.guess' and 'config.sub'.
-      ;; For tests:
-      ("hamcrest-core" ,java-hamcrest-core)
-      ("junit" ,java-junit)
-      ("slf4j-simple" ,java-slf4j-simple)))
-   (inputs
-    `(("hdf4" ,hdf4)
-      ("hdf5" ,hdf5)
-      ("zlib" ,zlib)
-      ("libjpeg" ,libjpeg)
-      ("slf4j-api" ,java-slf4j-api)))
-   (arguments
-    `(#:configure-flags
-      (list (string-append "--target=" ,(or (%current-target-system) (%current-system)))
-            (string-append "--with-jdk=" (assoc-ref %build-inputs "jdk") "/include,"
-                           (assoc-ref %build-inputs "jdk") "/lib" )
-            (string-append "--with-hdf4=" (assoc-ref %build-inputs "hdf4") "/lib")
-            (string-append "--with-hdf5=" (assoc-ref %build-inputs "hdf5") "/lib"))
-
-      #:make-flags
-      (list (string-append "HDFLIB=" (assoc-ref %build-inputs "hdf4") "/lib")
-            (string-append "HDF5LIB=" (assoc-ref %build-inputs "hdf5") "/lib")
-            (string-append "ZLIB=" (assoc-ref %build-inputs "zlib") "/lib/libz.so")
-            (string-append "JPEGLIB="
-                           (assoc-ref %build-inputs "libjpeg") "/lib/libjpeg.so")
-            "LLEXT=so")
-
-      #:phases
-      (modify-phases %standard-phases
-        (add-before 'configure 'chdir-to-source
-          (lambda _ (chdir ,(string-append "hdfjava-" version))))
-        (add-before 'configure 'patch-build
-          (lambda* (#:key inputs outputs #:allow-other-keys)
-            (substitute* "configure"
-              (("COPT=\"") "COPT=\"-O2 ") ; CFLAGS is ignored in Makefiles
-              (("/bin/cat") (which "cat")))
-            ;; Set classpath for compilation
-            (substitute* '("hdf/hdf5lib/Makefile.in"
-                           "hdf/hdf5lib/exceptions/Makefile.in"
-                           "hdf/hdflib/Makefile.in")
-              (("\\$\\(TOP\\)/lib/slf4j-api-1\\.7\\.5\\.jar")
-               (string-append (assoc-ref inputs "slf4j-api")
-                              "/share/java/slf4j-api.jar")))
-            ;; Replace outdated config.sub and config.guess:
-            (with-directory-excursion "config"
-              (for-each (lambda (file)
-                          (copy-file
-                           (string-append (assoc-ref inputs "automake")
-                                          "/share/automake-1.15/" file) file))
-                        '("config.sub" "config.guess")))
-            (mkdir-p (string-append (assoc-ref outputs "out")))
-            ;; Set classpath for tests
-            (let* ((build-dir (getcwd))
-                   (lib (string-append build-dir "/lib"))
-                   (jhdf (string-append lib "/jhdf.jar"))
-                   (jhdf5 (string-append lib "/jhdf5.jar"))
-                   (testjars
-                    (map (lambda (i)
-                           (string-append (assoc-ref inputs i)
-                                          "/share/java/" i ".jar"))
-                         '("junit" "hamcrest-core" "slf4j-api" "slf4j-simple")))
-                   (class-path
-                    (string-join `("." ,build-dir ,jhdf ,jhdf5 ,@testjars) ":")))
-
-              (substitute* '("test/hdf5lib/Makefile.in"
-                             "test/hdf5lib/junit.sh.in"
-                             "examples/runExample.sh.in")
-                (("/usr/bin/test")
-                 (string-append (assoc-ref inputs "coreutils")
-                                "/bin/test"))
-                (("/usr/bin/uname")
-                 (string-append (assoc-ref inputs "coreutils")
-                                "/bin/uname"))
-                (("CLASSPATH=[^\n]*")
-                 (string-append "CLASSPATH=" class-path)))
-              (setenv "CLASSPATH" class-path))
-            #t))
-        (add-before 'check 'build-examples
-          (lambda _
-            (zero? (apply system* `("javac"
-                                    ,@(find-files "examples" ".*\\.java")))))))
+    (name "hdf-java")
+    (version "3.3.2")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append
+             "http://www.hdfgroup.org/ftp/HDF5/releases/HDF-JAVA/hdfjni-"
+             version "/src/CMake-hdfjava-" version ".tar.gz"))
+       (sha256
+        (base32 "0m1gp2aspcblqzmpqbdpfp6giskws85ds6p5gz8sx7asyp7wznpr"))
+       (modules '((guix build utils)))
+       (snippet     ; Make sure we don't use the bundled sources and binaries.
+        `(begin
+           (for-each delete-file
+                     (list "SZip.tar.gz" "ZLib.tar.gz" "JPEG8d.tar.gz"
+                           "HDF4.tar.gz" "HDF5.tar.gz"))
+           (delete-file-recursively ,(string-append "hdfjava-" version "/lib"))
+           #t))))
+    (build-system gnu-build-system)
+    (native-inputs
+     `(("jdk" ,icedtea "jdk")
+       ("automake" ,automake) ; For up to date 'config.guess' and 'config.sub'.
+       ;; For tests:
+       ("hamcrest-core" ,java-hamcrest-core)
+       ("junit" ,java-junit)
+       ("slf4j-simple" ,java-slf4j-simple)))
+    (inputs
+     `(("hdf4" ,hdf4)
+       ("hdf5" ,hdf5)
+       ("zlib" ,zlib)
+       ("libjpeg" ,libjpeg)
+       ("slf4j-api" ,java-slf4j-api)))
+    (arguments
+     `(#:configure-flags
+       (list (string-append "--target=" ,(or (%current-target-system) (%current-system)))
+             (string-append "--with-jdk=" (assoc-ref %build-inputs "jdk") "/include,"
+                            (assoc-ref %build-inputs "jdk") "/lib" )
+             (string-append "--with-hdf4=" (assoc-ref %build-inputs "hdf4") "/lib")
+             (string-append "--with-hdf5=" (assoc-ref %build-inputs "hdf5") "/lib"))
 
-      #:parallel-build? #f
+       #:make-flags
+       (list (string-append "HDFLIB=" (assoc-ref %build-inputs "hdf4") "/lib")
+             (string-append "HDF5LIB=" (assoc-ref %build-inputs "hdf5") "/lib")
+             (string-append "ZLIB=" (assoc-ref %build-inputs "zlib") "/lib/libz.so")
+             (string-append "JPEGLIB="
+                            (assoc-ref %build-inputs "libjpeg") "/lib/libjpeg.so")
+             "LLEXT=so")
 
-      #:parallel-tests? #f ))
-   (home-page "https://support.hdfgroup.org/products/java")
-   (synopsis "Java interface for the HDF4 and HDF5 libraries")
-   (description "Java HDF Interface (JHI) and Java HDF5 Interface (JHI5) use
+       #:phases
+       (modify-phases %standard-phases
+         (add-before 'configure 'chdir-to-source
+           (lambda _ (chdir ,(string-append "hdfjava-" version)) #t))
+         (add-before 'configure 'patch-build
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (substitute* "configure"
+               (("COPT=\"") "COPT=\"-O2 ") ; CFLAGS is ignored in Makefiles
+               (("/bin/cat") (which "cat")))
+             ;; Set classpath for compilation
+             (substitute* '("hdf/hdf5lib/Makefile.in"
+                            "hdf/hdf5lib/exceptions/Makefile.in"
+                            "hdf/hdflib/Makefile.in")
+               (("\\$\\(TOP\\)/lib/slf4j-api-1\\.7\\.5\\.jar")
+                (string-append (assoc-ref inputs "slf4j-api")
+                               "/share/java/slf4j-api.jar")))
+             ;; Replace outdated config.sub and config.guess:
+             (with-directory-excursion "config"
+               (for-each (lambda (file)
+                           (install-file
+                            (string-append (assoc-ref inputs "automake")
+                                           "/share/automake-"
+                                           ,(version-major+minor (package-version automake))
+                                           "/" file) "."))
+                         '("config.sub" "config.guess")))
+
+             ;; Fix embedded version number
+             (let ((hdf5version (list ,@(string-split (package-version hdf5) #\.))))
+               (substitute* "hdf/hdf5lib/H5.java"
+                 (("1, 8, 19")
+                  (string-join hdf5version ", "))))
+
+             (mkdir-p (string-append (assoc-ref outputs "out")))
+             ;; Set classpath for tests
+             (let* ((build-dir (getcwd))
+                    (lib (string-append build-dir "/lib"))
+                    (jhdf (string-append lib "/jhdf.jar"))
+                    (jhdf5 (string-append lib "/jhdf5.jar"))
+                    (testjars
+                     (map (lambda (i)
+                            (string-append (assoc-ref inputs i)
+                                           "/share/java/" i ".jar"))
+                          '("junit" "hamcrest-core" "slf4j-api" "slf4j-simple")))
+                    (class-path
+                     (string-join `("." ,build-dir ,jhdf ,jhdf5 ,@testjars) ":")))
+
+               (substitute* '("test/hdf5lib/Makefile.in"
+                              "test/hdf5lib/junit.sh.in"
+                              "examples/runExample.sh.in")
+                 (("/usr/bin/test")
+                  (string-append (assoc-ref inputs "coreutils")
+                                 "/bin/test"))
+                 (("/usr/bin/uname")
+                  (string-append (assoc-ref inputs "coreutils")
+                                 "/bin/uname"))
+                 (("CLASSPATH=[^\n]*")
+                  (string-append "CLASSPATH=" class-path)))
+               (setenv "CLASSPATH" class-path))
+             #t))
+         (add-before 'check 'build-examples
+           (lambda _
+             (apply invoke `("javac"
+                             ,@(find-files "examples" ".*\\.java"))))))
+
+       #:parallel-build? #f
+
+       #:parallel-tests? #f ))
+    (home-page "https://support.hdfgroup.org/products/java")
+    (synopsis "Java interface for the HDF4 and HDF5 libraries")
+    (description "Java HDF Interface (JHI) and Java HDF5 Interface (JHI5) use
 the Java Native Interface to wrap the HDF4 and HDF5 libraries, which are
 implemented in C.")
 
-   ;; BSD-style license:
-   (license (license:x11-style
-             "https://support.hdfgroup.org/ftp/HDF5/hdf-java\
+    ;; BSD-style license:
+    (license (license:x11-style
+              "https://support.hdfgroup.org/ftp/HDF5/hdf-java\
 /current/src/unpacked/COPYING"))))
 
 (define-public hdf-eos2
@@ -1298,7 +1306,7 @@ online as well as original implementations of various other algorithms.")
 (define-public ipopt
   (package
     (name "ipopt")
-    (version "3.12.5")
+    (version "3.12.12")
     (source (origin
               (method url-fetch)
               (uri (string-append
@@ -1306,7 +1314,7 @@ online as well as original implementations of various other algorithms.")
                     version".tgz"))
               (sha256
                (base32
-                "09bk2hqy2vgi4yi76xng9zxakddwqy3wij9nx7wf2vfbxxpazrsk"))
+                "07yn9rzdswjk8n246qq6ci9ssf2bcplkifcpsfz9j6cdxw9vgbkv"))
               (modules '((guix build utils)))
               (snippet
                ;; Make sure we don't use the bundled software.
@@ -1638,7 +1646,7 @@ September 2004}")
 (define-public petsc
   (package
     (name "petsc")
-    (version "3.10.3")
+    (version "3.10.4")
     (source
      (origin
       (method url-fetch)
@@ -1646,9 +1654,9 @@ September 2004}")
       (uri (string-append "http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/"
                           "petsc-lite-" version ".tar.gz"))
       (sha256
-       (base32 "10p9ap1rp6k8k2g8zdc505kdlsc3976fjymyp393sccjapm50dph"))))
-    (outputs '("out"                    ;libraries and headers
-               "examples"))             ;~30MiB of examples
+       (base32 "0fk16944zh3473ra198kdkxdn08rq7b6ap838hxy1mh1i0hb488r"))))
+    (outputs '("out"                    ; libraries and headers
+               "examples"))             ; ~30MiB of examples
     (build-system gnu-build-system)
     (native-inputs
      `(("python" ,python-2)))
@@ -1661,7 +1669,7 @@ September 2004}")
        ))
     (arguments
      `(#:test-target "test"
-       #:parallel-build? #f             ;build is parallel by default
+       #:parallel-build? #f             ; build is parallel by default
        #:configure-flags
        `("--with-mpi=0"
          "--with-openmp=1"
@@ -3356,7 +3364,7 @@ Failure to do so will result in a library with poor performance.")
 (define-public glm
   (package
     (name "glm")
-    (version "0.9.9.3")
+    (version "0.9.9.4")
     (source
      (origin
        (method url-fetch)
@@ -3364,7 +3372,7 @@ Failure to do so will result in a library with poor performance.")
                            version  "/glm-" version ".zip"))
        (sha256
         (base32
-         "0yqk5r3qh60d4r2iab5q7wq0fryn8p3pz6s28y1i7amqj1aqavj9"))))
+         "17vxbqzy4pxciq5i39bgpxz54f7ifqqmcqwwq7m6xfgikwqqqawp"))))
     (build-system cmake-build-system)
     (native-inputs
      `(("unzip" ,unzip)))
@@ -4819,3 +4827,54 @@ implemented as callable objects, and bases of finite element spaces.")
 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))))
+
+(define-public mlucas
+  (package
+    (name "mlucas")
+    (version "18")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append
+             "https://mersenneforum.org/mayer/src/C/mlucas_v" version ".txz"))
+       (sha256
+        (base32
+         "1ax12qj9lyvnx4vs3gx7l8r3wx5gjbsdswp5f00ik9z0wz7xf297"))))
+    (build-system gnu-build-system)
+    (inputs
+     `(("python2" ,python-2)))
+    (arguments
+     `(#:tests? #f ; no tests
+       #:phases
+       (modify-phases %standard-phases
+         (replace 'configure
+           (lambda _
+             (chdir "src")
+             (call-with-output-file "Makefile"
+               (lambda (port)
+                 (format port "CC = gcc
+CFLAGS = -O3 ~a -DUSE_THREADS
+LDLIBS = -lm -lpthread -lrt
+Mlucas: $(addsuffix .o,$(basename $(wildcard *.c)))
+"
+                         ,(let ((system (or (%current-target-system)
+                                            (%current-system))))
+                            (cond
+                             ((string-prefix? "x86_64" system) "-DUSE_SSE2")
+                             (else ""))))))
+             #t))
+         (replace 'install
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
+               (install-file "Mlucas" bin)
+               (install-file "primenet.py" bin))
+             #t)))))
+    (home-page "https://www.mersenne.org")
+    (synopsis "Great Internet Mersenne Prime Search (GIMPS) distributed computing client")
+    (description "Mlucas performs Lucas-Lehmer primality testing of Mersenne
+numbers in search of a world-record prime.  You may use it to test any
+suitable number as you wish, but it is preferable that you do so in a
+coordinated fashion, as part of the Great Internet Mersenne Prime
+Search (GIMPS).  Mlucas also includes a simple Python script for assignment
+management via the GIMPS project's Primenet server.")
+    (license license:gpl2+)))