gnu: libtasn1: Remove obsolete patch.
[jackhill/guix/guix.git] / gnu / packages / maths.scm
index 913a403..1689650 100644 (file)
@@ -1,14 +1,14 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2013, 2014, 2015, 2016 Andreas Enge <andreas@enge.fr>
 ;;; Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org>
-;;; Copyright © 2014, 2016 John Darrington <jmd@gnu.org>
+;;; Copyright © 2014, 2016, 2017 John Darrington <jmd@gnu.org>
 ;;; Copyright © 2014, 2015, 2016 Eric Bavier <bavier@member.fsf.org>
 ;;; Copyright © 2014 Federico Beffa <beffa@fbengineering.ch>
 ;;; Copyright © 2014 Mathieu Lirzin <mathieu.lirzin@openmailbox.org>
 ;;; Copyright © 2015, 2016 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com>
 ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
-;;; Copyright © 2015, 2016 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2015, 2016, 2017 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2015 Fabian Harfert <fhmgufs@web.de>
 ;;; Copyright © 2016 Roel Janssen <roel@gnu.org>
 ;;; Copyright © 2016 Kei Kebreau <kei@openmailbox.org>
@@ -17,6 +17,7 @@
 ;;; Copyright © 2016 Thomas Danckaert <post@thomasdanckaert.be>
 ;;; Copyright © 2017 Paul Garlick <pgarlick@tourbillion-technology.com>
 ;;; Copyright © 2017 ng0 <contact.ng0@cryptolab.net>
+;;; Copyright © 2017 Ben Woodcroft <donttrustben@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -44,6 +45,7 @@
   #:use-module (guix build utils)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu)
+  #:use-module (guix build-system ocaml)
   #:use-module (guix build-system r)
   #:use-module (gnu packages algebra)
   #:use-module (gnu packages bison)
   #:use-module (gnu packages less)
   #:use-module (gnu packages lisp)
   #:use-module (gnu packages logging)
+  #:use-module (gnu packages lua)
   #:use-module (gnu packages gnome)
   #:use-module (gnu packages guile)
   #:use-module (gnu packages xorg)
   #:use-module (gnu packages gl)
+  #:use-module (gnu packages imagemagick)
   #:use-module (gnu packages m4)
   #: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)
@@ -83,6 +88,7 @@
   #:use-module (gnu packages python)
   #:use-module (gnu packages readline)
   #:use-module (gnu packages tbb)
+  #:use-module (gnu packages scheme)
   #:use-module (gnu packages shells)
   #:use-module (gnu packages tcl)
   #:use-module (gnu packages texinfo)
@@ -114,7 +120,7 @@ rules, Aris also supports references to older proofs.  Its use of standard
 logical symbols and its natural deduction interface make it easy to use for
 beginners.")
     (license license:gpl3+)
-    (home-page "http://www.gnu.org/software/aris/")))
+    (home-page "https://www.gnu.org/software/aris/")))
 
 (define-public c-graph
   (package
@@ -137,7 +143,7 @@ theory in visualizing the convolution process.  Rather than forcing the
 student to write code, the program offers an intuitive interface with
 interactive dialogs to guide them.")
    (license license:gpl3+)
-   (home-page "http://www.gnu.org/software/c-graph/")))
+   (home-page "https://www.gnu.org/software/c-graph/")))
 
 (define-public coda
   (package
@@ -183,13 +189,13 @@ programming languages.")
 (define-public units
   (package
    (name "units")
-   (version "2.13")
+   (version "2.14")
    (source (origin
             (method url-fetch)
             (uri (string-append "mirror://gnu/units/units-" version
                                 ".tar.gz"))
             (sha256 (base32
-                     "1awhjw9zjlfb8s5g3yyx63f7ddfcr1sanlbxpqifmrgq24ql198b"))))
+                     "1s421bxm36akjsy3qzg6da1d1g20gh094ac2slqxipgkh8yqjcwx"))))
    (build-system gnu-build-system)
    (synopsis "Conversion between thousands of scales")
    (description
@@ -199,7 +205,7 @@ prefixes (micro-, kilo-, etc.).  It can also handle nonlinear
 conversions such as Fahrenheit to Celsius.  Its interpreter is powerful
 enough to be used effectively as a scientific calculator.")
    (license license:gpl3+)
-   (home-page "http://www.gnu.org/software/units/")))
+   (home-page "https://www.gnu.org/software/units/")))
 
 (define-public double-conversion
   (package
@@ -248,7 +254,7 @@ searched using a simple command-line tool, choosing from three databases:
 universal constants, atomic numbers, and constants related to
 semiconductors.")
     (license license:gpl3+)
-    (home-page "http://www.gnu.org/software/dionysus/")))
+    (home-page "https://www.gnu.org/software/dionysus/")))
 
 (define-public gsl
   (package
@@ -264,8 +270,14 @@ semiconductors.")
               (patches (search-patches "gsl-test-i686.patch"))))
     (build-system gnu-build-system)
     (arguments
-     `(#:parallel-tests? #f))
-    (home-page "http://www.gnu.org/software/gsl/")
+     `(#:parallel-tests? #f
+       ;; Currently there are numerous tests that fail on "exotic"
+       ;; architectures such as aarch64 and ppc64le.
+       ,@(if (string-prefix? "aarch64-linux"
+                             (or (%current-target-system) (%current-system)))
+           '(#:tests? #f)
+           '())))
+    (home-page "https://www.gnu.org/software/gsl/")
     (synopsis "Numerical library for C and C++")
     (description
      "The GNU Scientific Library is a library for numerical analysis in C
@@ -275,6 +287,33 @@ 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")
@@ -453,7 +492,7 @@ singular value problems.")
 (define-public gnuplot
   (package
     (name "gnuplot")
-    (version "5.0.5")
+    (version "5.0.6")
     (source (origin
               (method url-fetch)
               (uri (string-append "mirror://sourceforge/gnuplot/gnuplot/"
@@ -461,12 +500,13 @@ singular value problems.")
                                   version ".tar.gz"))
        (sha256
         (base32
-         "0lr065qdlgss8lmy31l7hkmnk9fp4lvqq9qgb1f1209f36zy1wr5"))))
+         "0q5lr6nala3ln6f3yp6g17ziymb9r9gx9zylnw1y3hjmwl9lggjv"))))
     (build-system gnu-build-system)
     (inputs `(("readline" ,readline)
               ("cairo" ,cairo)
               ("pango" ,pango)
-              ("gd" ,gd)))
+              ("gd" ,gd)
+              ("lua" ,lua)))
     (native-inputs `(("pkg-config" ,pkg-config)
                      ("texlive" ,texlive-minimal)))
     (home-page "http://www.gnuplot.info")
@@ -732,6 +772,34 @@ Swath).")
 HDF5 file is encoded according to the HDF File Format Specification.")
     (license (license:x11-style "file://COPYING"))))
 
+(define-public itpp
+  (package
+    (name "itpp")
+    (version "4.3.1")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "mirror://sourceforge/itpp/itpp/"
+                                  version "/itpp-"
+                                  version ".tar.gz"))
+       (sha256
+        (base32
+         "14ddy2xnb6sgp4hiax9v5sv4pr4l4dd4ps76nfha3nrpr1ikhcqm"))))
+    (build-system cmake-build-system)
+    (arguments `(#:tests? #f)) ; Tests require googletest *sources*
+    (inputs `(("lapack" ,lapack)
+              ("fftw" ,fftw)))
+    (native-inputs `(("texlive-minimal" ,texlive-minimal)
+                     ("doxygen" ,doxygen)))
+    (home-page "http://itpp.sourceforge.net")
+    (synopsis "C++ library of maths, signal processing and communication classes")
+    (description "IT++ is a C++ library of mathematical, signal processing and
+communication classes and functions.  Its main use is in simulation of
+communication systems and for performing research in the area of
+communications.  The kernel of the library consists of generic vector and
+matrix classes, and a set of accompanying routines.  Such a kernel makes IT++
+similar to MATLAB, GNU Octave or SciPy.")
+    (license license:gpl3+)))
+
 (define-public netcdf
   (package
     (name "netcdf")
@@ -785,6 +853,30 @@ sharing of scientific data.")
                 "--disable-shared" "--with-pic"
                 ,flags))))))
 
+(define-public netcdf-fortran
+  (package
+    (name "netcdf-fortran")
+    (version "4.4.4")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append
+                    "ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-fortran-"
+                    version ".tar.gz"))
+              (sha256
+               (base32
+                "0xaxdcg1p83zmypwml3swsnr3ccn38inwldyr1l3wa4dbwbrblxj"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:parallel-tests? #f))
+    (inputs
+     `(("netcdf" ,netcdf)))
+    (native-inputs
+     `(("gfortran" ,gfortran)))
+    (synopsis "Fortran interface for the netCDF library")
+    (description (package-description netcdf))
+    (home-page (package-home-page netcdf))
+    (license (package-license netcdf))))
+
 (define-public nlopt
   (package
     (name "nlopt")
@@ -936,6 +1028,7 @@ can solve two kinds of problems:
     (inputs
      `(("lapack" ,lapack)
        ("readline" ,readline)
+       ("gl2ps" ,gl2ps)
        ("glpk" ,glpk)
        ("fftw" ,fftw)
        ("fftwf" ,fftwf)
@@ -948,7 +1041,9 @@ can solve two kinds of problems:
        ("libxft" ,libxft)
        ("mesa" ,mesa)
        ("glu" ,glu)
-       ("zlib" ,zlib)))
+       ("zlib" ,zlib)
+       ("curl" ,curl)
+       ("graphicsmagick" ,graphicsmagick)))
     (native-inputs
      `(("lzip" ,lzip)
        ("gfortran" ,gfortran)
@@ -1079,6 +1174,30 @@ modules is done either interactively using the graphical user interface or in
 ASCII text files using Gmsh's own scripting language.")
     (license license:gpl2+)))
 
+(define-public maxflow
+  (package
+    (name "maxflow")
+    (version "3.04")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/gerddie/maxflow.git")
+                    (commit "42401fa54823d16b9da47716f04e5d9ef1605875")))
+              (file-name (string-append name "-" version "-checkout"))
+              (sha256
+               (base32
+                "0rll38whw55h0vcjrrwdnh9ascvxby0ph7n1l0d12z17cg215kkb"))))
+    (build-system cmake-build-system)
+    (home-page "http://pub.ist.ac.at/~vnk/software.html")
+    (synopsis "Library implementing Maxflow algorithm")
+    (description "An implementation of the maxflow algorithm described in
+@cite{An Experimental Comparison of Min-Cut/Max-Flow Algorithms for
+Energy Minimization in Computer Vision.\n
+Yuri Boykov and Vladimir Kolmogorov.\n
+In IEEE Transactions on Pattern Analysis and Machine Intelligence,\n
+September 2004}")
+    (license license:gpl3+)))
+
 (define-public petsc
   (package
     (name "petsc")
@@ -1492,12 +1611,12 @@ programming problems.")
 (define-public r-pracma
   (package
     (name "r-pracma")
-    (version "1.9.5")
+    (version "2.0.4")
     (source (origin
       (method url-fetch)
       (uri (cran-uri "pracma" version))
       (sha256
-        (base32 "19nr2jlkbcdgvw3gx5hry12av565lmvqd5q4h7zlch3q13avwwl2"))))
+        (base32 "1z3i90mkzwvp9di17caf4934z2xlb2imm3hwxllcrbwvmnmhrwyc"))))
     (build-system r-build-system)
     (propagated-inputs
      `(("r-quadprog" ,r-quadprog)))
@@ -1915,7 +2034,7 @@ processor cores.")
        ("popt" ,popt)))
     (native-inputs
      `(("pkg-config" ,pkg-config)))
-    (home-page "http://www.gnu.org/software/gsegrafix/")
+    (home-page "https://www.gnu.org/software/gsegrafix/")
     (synopsis "GNOME application to create scientific and engineering plots")
     (description  "GSEGrafix is an application which produces high-quality graphical
 plots for science and engineering.  Plots are specified via simple ASCII
@@ -2068,14 +2187,14 @@ full text searching.")
 (define-public armadillo
   (package
     (name "armadillo")
-    (version "7.600.2")
+    (version "7.800.2")
     (source (origin
               (method url-fetch)
               (uri (string-append "mirror://sourceforge/arma/armadillo-"
                                   version ".tar.xz"))
               (sha256
                (base32
-                "0bac9y46m61zxinj51l82w06v01ra9vw7a9j6rrwdjhznkkdb437"))))
+                "1qqzy7dp891j9v7062mv1599hdwr97vqzrd3j2fl8c3gmc00dmzg"))))
     (build-system cmake-build-system)
     (arguments `(#:tests? #f)) ;no test target
     (inputs
@@ -2092,18 +2211,7 @@ environments.  It can be used for machine learning, pattern recognition,
 signal processing, bioinformatics, statistics, econometrics, etc.  The library
 provides efficient classes for vectors, matrices and cubes, as well as 150+
 associated functions (eg. contiguous and non-contiguous submatrix views).")
-    (license license:mpl2.0)))
-
-(define-public armadillo-for-rcpparmadillo
-  (package (inherit armadillo)
-    (version "7.600.1")
-    (source (origin
-              (method url-fetch)
-              (uri (string-append "mirror://sourceforge/arma/armadillo-"
-                                  version ".tar.xz"))
-              (sha256
-               (base32
-                "1dxgfd2r9lbh24nszvqm2lag439s0srxaf1l86f6ww6waqm5r8zk"))))))
+    (license license:asl2.0)))
 
 (define-public muparser
   ;; When switching download sites, muparser re-issued a 2.2.5 release with a
@@ -2160,7 +2268,8 @@ parts of it.")
         ,(let ((system (or (%current-target-system) (%current-system))))
            (or (string-prefix? "x86_64" system)
                (string-prefix? "i686" system)
-               (string-prefix? "mips" system)))
+               (string-prefix? "mips" system)
+               (string-prefix? "aarch64" system)))
        #:make-flags
        (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
              "SHELL=bash"
@@ -2180,6 +2289,9 @@ parts of it.")
                   ;; for Loongson cores are used.
                   ((string-prefix? "mips" system)
                    '("TARGET=SICORTEX"))
+                  ;; On aarch64 force the generic 'armv8-a' target
+                  ((string-prefix? "aarch64" system)
+                   '("TARGET=ARMV8"))
                   (else '()))))
        ;; no configure script
        #:phases (alist-delete 'configure %standard-phases)))
@@ -2635,6 +2747,8 @@ in finite element programs.")
           (base32
             "022w8hph7bli5zbpnk3z1qh1c2sl5hm8fw2ccim651ynn0hr7fyz"))))
     (build-system cmake-build-system)
+    (outputs '("out"
+               "octave"))                  ;46 MiB .mex file that pulls Octave
     (native-inputs
      `(("unzip" ,unzip)))
     (inputs
@@ -2652,6 +2766,14 @@ in finite element programs.")
        ;; Save 12 MiB by not installing .a files.  Passing
        ;; '-DBUILD_STATIC_LIBS=OFF' has no effect.
        #:phases (modify-phases %standard-phases
+                  (add-before 'configure 'set-octave-directory
+                    (lambda* (#:key outputs #:allow-other-keys)
+                      ;; Install the .mex file in the "octave" output.
+                      (let ((out (assoc-ref outputs "octave")))
+                        (substitute* "src/matlab/CMakeLists.txt"
+                          (("share/flann/octave")
+                           (string-append out "/share/flann/octave")))
+                        #t)))
                   (add-after 'install 'remove-static-libraries
                     (lambda* (#:key outputs #:allow-other-keys)
                       (let* ((out (assoc-ref outputs "out"))
@@ -2724,7 +2846,7 @@ patterns and allows you to zoom in and out of them infinitely in a fluid,
 continuous manner.  It also includes tutorials that help to explain how fractals
 are built.  It can generate many different fractal types such as the Mandelbrot
 set.")
-    (home-page "http://www.gnu.org/software/xaos/")
+    (home-page "https://www.gnu.org/software/xaos/")
     (license license:gpl2+)))
 
 (define-public hypre
@@ -2908,7 +3030,7 @@ compilers and compiler versions as well as portability between different vector
 instruction sets.  Thus, an application written with Vc can be compiled for:
 @enumerate
 @item AVX and AVX2
-@item SSE2 upto SSE4.2 or SSE4a
+@item SSE2 up to SSE4.2 or SSE4a
 @item Scalar
 @item MIC
 @item NEON (in development)
@@ -2958,3 +3080,54 @@ algorithm for LCS.  It is a fast program to compute the approximate
 Longest Commons Subsequence of a set of strings.")
       (home-page "https://github.com/gdv/Reduce-Expand-for-LCS")
       (license license:gpl3+))))
+
+(define-public jacal
+  (package
+    (name "jacal")
+    (version "1c4")
+    (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"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-before 'build 'pre-build
+                     ;; Don't use upstream's script - it really doesn't fit into
+                     ;; Guix's functional paradigm.
+                     (lambda* (#:key inputs outputs #:allow-other-keys)
+                       (substitute* "Makefile"
+                         (("^install: install-script") "install: "))))
+         (add-after 'install 'post-install
+                    ;; Instead, we provide our own simplified script.
+                    (lambda* (#:key inputs outputs #:allow-other-keys)
+                      (let ((wrapper (string-append (assoc-ref outputs "out")
+                                                    "/bin/jacal")))
+                        (format (open wrapper (logior O_WRONLY O_CREAT))
+                                (string-append "#!~a\nexec ~a/bin/scm -ip1 "
+                                "-e '(slib:load \"~a/lib/jacal/math\") "
+                                "(math)' \"$@\"\n")
+                                (which  "bash")
+                                (assoc-ref inputs "scm")
+                                (assoc-ref outputs "out"))
+                        (chmod wrapper #o555))))
+         (replace 'configure
+                  (lambda* (#:key inputs outputs #:allow-other-keys)
+                    (zero? (system* "./configure"
+                                    (string-append "--prefix="
+                                                   (assoc-ref outputs "out")))))))))
+    (inputs `(("scm" ,scm)))
+    (native-inputs `(("unzip" ,unzip)
+                     ("texinfo" ,texinfo)))
+    (synopsis "Symbolic mathematics system")
+    (description "GNU JACAL is an interactive symbolic mathematics program based on
+Scheme.  It manipulate and simplify a range of mathematical expressions such
+as equations, scalars, vectors, and matrices.")
+    (home-page "https://www.gnu.org/software/jacal/")
+    (license license:gpl3+)))
+