gnu: pspp: Add input cairo.
[jackhill/guix/guix.git] / gnu / packages / maths.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
3 ;;; Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org>
4 ;;;
5 ;;; This file is part of GNU Guix.
6 ;;;
7 ;;; GNU Guix is free software; you can redistribute it and/or modify it
8 ;;; under the terms of the GNU General Public License as published by
9 ;;; the Free Software Foundation; either version 3 of the License, or (at
10 ;;; your option) any later version.
11 ;;;
12 ;;; GNU Guix is distributed in the hope that it will be useful, but
13 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
14 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ;;; GNU General Public License for more details.
16 ;;;
17 ;;; You should have received a copy of the GNU General Public License
18 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
19
20 (define-module (gnu packages maths)
21 #:use-module (gnu packages)
22 #:use-module ((guix licenses)
23 #:renamer (symbol-prefix-proc 'license:))
24 #:use-module (guix packages)
25 #:use-module (guix download)
26 #:use-module (guix build-system cmake)
27 #:use-module (guix build-system gnu)
28 #:use-module (gnu packages compression)
29 #:use-module (gnu packages fontutils)
30 #:use-module ((gnu packages gettext)
31 #:renamer (symbol-prefix-proc 'gnu:))
32 #:use-module (gnu packages gcc)
33 #:use-module (gnu packages gtk)
34 #:use-module (gnu packages multiprecision)
35 #:use-module (gnu packages perl)
36 #:use-module (gnu packages pkg-config)
37 #:use-module (gnu packages python)
38 #:use-module (gnu packages readline)
39 #:use-module (gnu packages xml))
40
41 (define-public units
42 (package
43 (name "units")
44 (version "2.02")
45 (source (origin
46 (method url-fetch)
47 (uri (string-append "mirror://gnu/units/units-" version
48 ".tar.gz"))
49 (sha256 (base32
50 "16jfji9g1zc99agd5dcinajinhcxr4dgq2lrbc9md69ir5qgld1b"))))
51 (build-system gnu-build-system)
52 (synopsis "Conversion between thousands of scales")
53 (description
54 "Units is a program for converting measured quantities between units of
55 measure. It can handle scale changes through adaptive usage of standard
56 scale prefixes (i.e. micro-, kilo-, etc.). It can also handle nonlinear
57 conversions such as Fahrenheit to Celcius. Its interpreter is powerful
58 enough to be used effectively as a scientific calculator.")
59 (license license:gpl3+)
60 (home-page "http://www.gnu.org/software/units/")))
61
62 (define-public gsl
63 (package
64 (name "gsl")
65 (version "1.16")
66 (source
67 (origin
68 (method url-fetch)
69 (uri (string-append "mirror://gnu/gsl/gsl-"
70 version ".tar.gz"))
71 (sha256
72 (base32
73 "0lrgipi0z6559jqh82yx8n4xgnxkhzj46v96dl77hahdp58jzg3k"))))
74 (build-system gnu-build-system)
75 (arguments
76 `(#:parallel-tests? #f
77 #:phases
78 (alist-replace
79 'configure
80 (lambda* (#:key target system outputs #:allow-other-keys #:rest args)
81 (let ((configure (assoc-ref %standard-phases 'configure)))
82 ;; disable numerically unstable test on i686, see thread at
83 ;; http://lists.gnu.org/archive/html/bug-gsl/2011-11/msg00019.html
84 (if (string=? (or target system) "i686-linux")
85 (substitute* "ode-initval2/Makefile.in"
86 (("TESTS = \\$\\(check_PROGRAMS\\)") "TESTS =")))
87 (apply configure args)))
88 %standard-phases)))
89 (home-page "http://www.gnu.org/software/gsl/")
90 (synopsis "Numerical library for C and C++")
91 (description
92 "The GNU Scientific Library is a library for numerical analysis in C
93 and C++. It includes a wide range of mathematical routines, with over 1000
94 functions in total. Subject areas covered by the library include:
95 differential equations, linear algebra, Fast Fourier Transforms and random
96 numbers.")
97 (license license:gpl3+)))
98
99 (define-public glpk
100 (package
101 (name "glpk")
102 (version "4.52.1")
103 (source
104 (origin
105 (method url-fetch)
106 (uri (string-append "mirror://gnu/glpk/glpk-"
107 version ".tar.gz"))
108 (sha256
109 (base32
110 "0nz9ngmx23c8gbjr8l8ygnfaanxj2mwbl8awpg630bgrkxdnhc9j"))))
111 (build-system gnu-build-system)
112 (inputs
113 `(("gmp" ,gmp)))
114 (arguments
115 `(#:configure-flags '("--with-gmp")))
116 (home-page "http://www.gnu.org/software/glpk/")
117 (synopsis "NU Linear Programming Kit, supporting the MathProg language")
118 (description
119 "GLPK is a C library for solving large-scale linear programming (LP),
120 mixed integer programming (MIP), and other related problems. It supports the
121 GNU MathProg modeling language, a subset of the AMPL language, and features a
122 translator for the language. In addition to the C library, a stand-alone
123 LP/MIP solver is included in the package.")
124 (license license:gpl3+)))
125
126 (define-public pspp
127 (package
128 (name "pspp")
129 (version "0.8.1")
130 (source
131 (origin
132 (method url-fetch)
133 (uri (string-append "mirror://gnu/pspp/pspp-"
134 version ".tar.gz"))
135 (sha256
136 (base32
137 "0qhxsdbwxd3cn1shc13wxvx2lg32lp4z6sz24kv3jz7p5xfi8j7x"))
138 (patches (list (search-patch "pspp-tests.patch")))))
139 (build-system gnu-build-system)
140 (inputs
141 `(("cairo" ,cairo)
142 ("fontconfig" ,fontconfig)
143 ("gettext" ,gnu:gettext)
144 ("gsl" ,gsl)
145 ("libxml2" ,libxml2)
146 ("pango" ,pango)
147 ("readline" ,readline)
148 ("zlib" ,zlib)))
149 (native-inputs
150 `(("perl" ,perl)
151 ("pkg-config" ,pkg-config)))
152 (arguments
153 `(#:configure-flags
154 `("--without-gui"))) ; FIXME: package missing dependencies
155 (home-page "http://www.gnu.org/software/pspp/")
156 (synopsis "Statistical analysis")
157 (description
158 "PSPP is a statistical analysis program. It can perform descriptive
159 statistics, T-tests, linear regression and non-parametric tests. It features
160 both a graphical interface as well as command-line input. PSPP is designed to
161 interoperate with Gnumeric, LibreOffice and OpenOffice. Data can be imported
162 from spreadsheets, text files and database sources and it can be output in
163 text, Postscript, PDF or HTML.")
164 (license license:gpl3+)))
165
166 (define-public lapack
167 (package
168 (name "lapack")
169 (version "3.4.2")
170 (source
171 (origin
172 (method url-fetch)
173 (uri (string-append "http://www.netlib.org/lapack/lapack-"
174 version ".tgz"))
175 (sha256
176 (base32
177 "1w7sf8888m7fi2kyx1fzgbm22193l8c2d53m8q1ibhvfy6m5v9k0"))
178 (snippet
179 ;; Remove non-free files.
180 ;; See <http://icl.cs.utk.edu/lapack-forum/archives/lapack/msg01383.html>.
181 '(for-each (lambda (file)
182 (format #t "removing '~a'~%" file)
183 (delete-file file))
184 '("lapacke/example/example_DGESV_rowmajor.c"
185 "lapacke/example/example_ZGESV_rowmajor.c"
186 "DOCS/psfig.tex")))))
187 (build-system cmake-build-system)
188 (home-page "http://www.netlib.org/lapack/")
189 (inputs `(("fortran" ,gfortran-4.8)
190 ("python" ,python-2)))
191 (arguments
192 `(#:modules ((guix build cmake-build-system)
193 (guix build utils)
194 (srfi srfi-1))
195 #:phases (alist-cons-before
196 'check 'patch-python
197 (lambda* (#:key inputs #:allow-other-keys)
198 (let ((python (assoc-ref inputs "python")))
199 (substitute* "lapack_testing.py"
200 (("/usr/bin/env python") python))))
201 %standard-phases)))
202 (synopsis "Library for numerical linear algebra")
203 (description
204 "LAPACK is a Fortran 90 library for solving the most commonly occurring
205 problems in numerical linear algebra.")
206 (license (license:bsd-style "file://LICENSE"
207 "See LICENSE in the distribution."))))