gnu: packages: Use 'search-patches' everywhere.
[jackhill/guix/guix.git] / gnu / packages / maths.scm
index b9ce7fe..d009905 100644 (file)
@@ -1,8 +1,8 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2013, 2014, 2015 Andreas Enge <andreas@enge.fr>
+;;; Copyright © 2013, 2014, 2015, 2016 Andreas Enge <andreas@enge.fr>
 ;;; Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org>
-;;; Copyright © 2014 John Darrington <jmd@gnu.org>
-;;; Copyright © 2014, 2015 Eric Bavier <bavier@member.fsf.org>
+;;; Copyright © 2014, 2016 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 Ricardo Wurmus <rekado@elephly.net>
@@ -10,6 +10,7 @@
 ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
 ;;; Copyright © 2015, 2016 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2015 Fabian Harfert <fhmgufs@web.de>
+;;; Copyright © 2016 Roel Janssen <roel@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -37,6 +38,7 @@
   #:use-module (guix build utils)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu)
+  #:use-module (guix build-system r)
   #:use-module (gnu packages algebra)
   #:use-module (gnu packages bison)
   #:use-module (gnu packages boost)
@@ -52,7 +54,6 @@
   #:use-module (gnu packages gcc)
   #:use-module (gnu packages gd)
   #:use-module (gnu packages ghostscript)
-  #:use-module (gnu packages glib)
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages image)
   #:use-module (gnu packages less)
   #:use-module (gnu packages zip)
   #:use-module (srfi srfi-1))
 
+(define-public c-graph
+  (package
+   (name "c-graph")
+   (version "2.0")
+   (source (origin
+            (method url-fetch)
+            (uri (string-append "mirror://gnu/c-graph/c-graph-" version
+                                ".tar.gz"))
+            (sha256 (base32
+                     "1hlvpzrh7hzzf533diyfiabzskddi8zx92av9hwkjw3l46z7qv01"))))
+   (build-system gnu-build-system)
+   (inputs
+     `(("fortran" ,gfortran)))
+   (synopsis "Visualize and analyze convolution operations")
+   (description
+    "GNU C-Graph demonstrates the theory of convolution underlying
+engineering systems and signal analysis.")
+   (license license:gpl3+)
+   (home-page "http://www.gnu.org/software/c-graph/")))
+
 (define-public units
   (package
    (name "units")
@@ -177,7 +198,7 @@ numbers.")
 (define-public glpk
   (package
     (name "glpk")
-    (version "4.59")
+    (version "4.60")
     (source
      (origin
       (method url-fetch)
@@ -185,7 +206,7 @@ numbers.")
                           version ".tar.gz"))
       (sha256
        (base32
-        "1bpbp5z0378kaj5bqmc5m2j5h9c7553p0s2j6a28badqghpbx673"))))
+        "15z2ymzqhxwss6wgdj5f7vkyqlqdsjgrvm0x871kmlx0n0664mhk"))))
     (build-system gnu-build-system)
     (inputs
      `(("gmp" ,gmp)))
@@ -201,45 +222,57 @@ translator for the language.  In addition to the C library, a stand-alone
 LP/MIP solver is included in the package.")
     (license license:gpl3+)))
 
-(define-public pspp
+(define-public 4ti2
   (package
-    (name "pspp")
-    (version "0.8.5")
+    (name "4ti2")
+    (version "1.6.7")
     (source
      (origin
       (method url-fetch)
-      (uri (string-append "mirror://gnu/pspp/pspp-"
-                          version ".tar.gz"))
+      (uri (string-append "http://www.4ti2.de/version_" version
+                          "/4ti2-" version ".tar.gz"))
       (sha256
        (base32
-        "0c8326yykidi94xi7jn27j8iqxc38vc07d4wf5zyk0l8lpzx5vz7"))))
+        "1frix3rnm9ffr93alqzw4cavxbfpf524l8rfbmcpyhwd3n1km0yl"))))
     (build-system gnu-build-system)
-    (inputs
-     `(("cairo" ,cairo)
-       ("fontconfig" ,fontconfig)
-       ("gettext" ,gnu-gettext)
-       ("gsl" ,gsl)
-       ("libxml2" ,libxml2)
-       ("pango" ,pango)
-       ("readline" ,readline)
-       ("gtk" ,gtk+-2)
-       ("gtksourceview" ,gtksourceview-2)
-       ("zlib" ,zlib)))
     (native-inputs
-     `(("glib" ,glib "bin")             ;for glib-genmarshal
-       ("perl" ,perl)
-       ("texinfo" ,texinfo)
-       ("pkg-config" ,pkg-config)))
-    (home-page "http://www.gnu.org/software/pspp/")
-    (synopsis "Statistical analysis")
+     `(("which" ,(@ (gnu packages base) which)))) ; for the tests
+    (inputs
+     `(("glpk" ,glpk)
+       ("gmp" ,gmp)))
+    (home-page "http://www.4ti2.de/")
+    (synopsis "Mathematical tool suite for problems on linear spaces")
     (description
-     "GNU PSPP is a statistical analysis program.  It can perform
-descriptive statistics, T-tests, linear regression and non-parametric tests.
-It features both a graphical interface as well as command-line input.  PSPP
-is designed to interoperate with Gnumeric, LibreOffice and OpenOffice.  Data
-can be imported from spreadsheets, text files and database sources and it can
-be output in text, PostScript, PDF or HTML.")
-    (license license:gpl3+)))
+     "4ti2 implements algorithms for solving algebraic, geometric and
+combinatorial problems on linear spaces.  Among others, it solves systems
+of linear equations, computes extreme rays of polyhedral cones, solves
+integer programming problems and computes Markov bases for statistics.")
+    (license license:gpl2+)))
+
+(define-public cddlib
+  (package
+    (name "cddlib")
+    (version "0.94h")
+    (source
+     (origin
+      (method url-fetch)
+      (uri (string-append "ftp://ftp.ifor.math.ethz.ch/pub/fukuda/cdd/cddlib-"
+                          (string-delete #\. version) ".tar.gz"))
+      (sha256
+       (base32
+        "1dasasscwfg793q8fwzgwf64xwj7w62yfvszpr8x8g38jka08vgy"))))
+    (build-system gnu-build-system)
+    (inputs
+     `(("gmp" ,gmp)))
+    (home-page "https://www.inf.ethz.ch/personal/fukudak/cdd_home/index.html")
+    (synopsis "Library for convex hulls and extreme rays of polyhedra")
+    (description
+     "The C-library cddlib implements the Double Description Method of
+Motzkin et al. for generating all vertices (i.e. extreme points) and extreme
+rays of a general convex polyhedron given by a system of linear inequalities
+in arbitrary dimension.  It can also be used for the converse operation of
+computing convex hulls.")
+    (license license:gpl2+)))
 
 (define-public arpack-ng
   (package
@@ -565,16 +598,15 @@ ASCII text files using Gmsh's own scripting language.")
           'install 'clean-install
           ;; Try to keep installed files from leaking build directory names.
           (lambda* (#:key inputs outputs #:allow-other-keys)
-            (let ((out     (assoc-ref outputs "out"))
-                  (fortran (assoc-ref inputs  "gfortran")))
+            (let ((out     (assoc-ref outputs "out")))
               (substitute* (map (lambda (file)
                                   (string-append out "/lib/petsc/conf/" file))
                                 '("petscvariables" "PETScConfig.cmake"))
                 (((getcwd)) out))
               ;; Make compiler references point to the store
               (substitute* (string-append out "/lib/petsc/conf/petscvariables")
-                (("= g(cc|\\+\\+|fortran)" _ suffix)
-                 (string-append "= " fortran "/bin/g" suffix)))
+                (("= (gcc|g\\+\\+|gfortran)" _ compiler)
+                 (string-append "= " (which compiler))))
               ;; PETSc installs some build logs, which aren't necessary.
               (for-each (lambda (file)
                           (let ((f (string-append out "/lib/petsc/conf/" file)))
@@ -641,6 +673,7 @@ scientific applications modeled by partial differential equations.")
        (method url-fetch)
        (uri (string-append "http://slepc.upv.es/download/download.php?"
                            "filename=slepc-" version ".tar.gz"))
+       (file-name (string-append name "-" version ".tar.gz"))
        (sha256
         (base32
          "1pv5iqz2kc8sj49zsabyz4arnfpana8mjrhq31vzgk16xldk3d1a"))))
@@ -744,7 +777,7 @@ arising after the discretization of partial differential equations.")
        (sha256
         (base32
          "1820jfp3mbl7n85765v5mp6p0gzqpgr4d2lrnhwj4gl7cwp5ndah"))
-       (patches (list (search-patch "mumps-build-parallelism.patch")))))
+       (patches (search-patches "mumps-build-parallelism.patch"))))
     (build-system gnu-build-system)
     (inputs
      `(("fortran" ,gfortran)
@@ -900,6 +933,24 @@ sparse system of linear equations A x = b using Guassian elimination.")
     (inputs
      (alist-delete "pt-scotch" (package-inputs mumps-openmpi)))))
 
+(define-public r-pracma
+  (package
+    (name "r-pracma")
+    (version "1.8.8")
+    (source (origin
+      (method url-fetch)
+      (uri (cran-uri "pracma" version))
+      (sha256
+        (base32 "0ans9l5rrb7a38gyi4qx4258sd5r5668vyrk02yzjpg9k3h8l165"))))
+    (build-system r-build-system)
+    (home-page "http://cran.r-project.org/web/packages/pracma")
+    (synopsis "Practical numerical math functions")
+    (description "This package provides functions for numerical analysis and
+linear algebra, numerical optimization, differential equations, plus some
+special functions.  It uses Matlab function names where appropriate to simplify
+porting.")
+    (license license:gpl3+)))
+
 (define-public superlu
   (package
     (name "superlu")
@@ -993,7 +1044,7 @@ also provides threshold-based ILU factorization preconditioners.")
                            "superlu_dist_" version ".tar.gz"))
        (sha256
         (base32 "1hnak09yxxp026blq8zhrl7685yip16svwngh1wysqxf8z48vzfj"))
-       (patches (list (search-patch "superlu-dist-scotchmetis.patch")))))
+       (patches (search-patches "superlu-dist-scotchmetis.patch"))))
     (build-system gnu-build-system)
     (native-inputs
      `(("tcsh" ,tcsh)))
@@ -1094,8 +1145,8 @@ implemented in ANSI C, and MPI for communications.")
                           "scotch_" version ".tar.gz"))
       (sha256
        (base32 "1ir088mvrqggyqdkx9qfynmiaffqbyih5qfl5mga2nrlm1qlsgzm"))
-      (patches (list (search-patch "scotch-test-threading.patch")
-                     (search-patch "pt-scotch-build-parallelism.patch")))))
+      (patches (search-patches "scotch-test-threading.patch"
+                               "pt-scotch-build-parallelism.patch"))))
     (build-system gnu-build-system)
     (inputs
      `(("zlib" ,zlib)
@@ -1320,7 +1371,7 @@ to BMP, JPEG or PNG image formats.")
        (sha256
         (base32
          "0x1rk659sn3cq0n5c90848ilzr1gb1wf0072fl6jhkdq00qgh2s0"))
-       (patches (list (search-patch "maxima-defsystem-mkdir.patch")))))
+       (patches (search-patches "maxima-defsystem-mkdir.patch"))))
     (build-system gnu-build-system)
     (inputs
      `(("gcl" ,gcl)
@@ -1909,7 +1960,7 @@ revised simplex and the branch-and-bound methods.")
        (sha256
         (base32
          "185jych0gdnpkjwxni7pd0dda149492zwq2457xdjg76bzj78mnp"))
-       (patches (list (search-patch "dealii-p4est-interface.patch")))
+       (patches (search-patches "dealii-p4est-interface.patch"))
        (modules '((guix build utils)))
        (snippet
         ;; Remove bundled sources: UMFPACK, TBB, muParser, and boost