gnu: texlive: Fix bug recently introduced in d4bf49b.
[jackhill/guix/guix.git] / gnu / packages / maths.scm
CommitLineData
8f8b2451
AE
1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
da95c817 3;;; Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org>
668c06ac 4;;; Copyright © 2014 John Darrington <jmd@gnu.org>
8f8b2451
AE
5;;;
6;;; This file is part of GNU Guix.
7;;;
8;;; GNU Guix is free software; you can redistribute it and/or modify it
9;;; under the terms of the GNU General Public License as published by
10;;; the Free Software Foundation; either version 3 of the License, or (at
11;;; your option) any later version.
12;;;
13;;; GNU Guix is distributed in the hope that it will be useful, but
14;;; WITHOUT ANY WARRANTY; without even the implied warranty of
15;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16;;; GNU General Public License for more details.
17;;;
18;;; You should have received a copy of the GNU General Public License
19;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
20
21(define-module (gnu packages maths)
22 #:use-module (gnu packages)
23 #:use-module ((guix licenses)
24 #:renamer (symbol-prefix-proc 'license:))
25 #:use-module (guix packages)
26 #:use-module (guix download)
da95c817 27 #:use-module (guix build-system cmake)
c9dfa3c7 28 #:use-module (guix build-system gnu)
c9dfa3c7 29 #:use-module (gnu packages compression)
668c06ac
JD
30 #:use-module (gnu packages curl)
31 #:use-module (gnu packages fltk)
f3929800 32 #:use-module (gnu packages fontutils)
1dba6407 33 #:use-module (gnu packages gettext)
da95c817 34 #:use-module (gnu packages gcc)
73fed4f8 35 #:use-module (gnu packages gd)
668c06ac 36 #:use-module (gnu packages ghostscript)
f3929800 37 #:use-module (gnu packages gtk)
668c06ac
JD
38 #:use-module (gnu packages less)
39 #:use-module (gnu packages xorg)
40 #:use-module (gnu packages gl)
b92eee75 41 #:use-module (gnu packages multiprecision)
668c06ac 42 #:use-module (gnu packages pcre)
c9dfa3c7
AE
43 #:use-module (gnu packages perl)
44 #:use-module (gnu packages pkg-config)
da95c817 45 #:use-module (gnu packages python)
c9dfa3c7 46 #:use-module (gnu packages readline)
668c06ac 47 #:use-module (gnu packages texinfo)
73fed4f8 48 #:use-module (gnu packages texlive)
c9dfa3c7 49 #:use-module (gnu packages xml))
8f8b2451
AE
50
51(define-public units
52 (package
53 (name "units")
d6f10ca3 54 (version "2.02")
8f8b2451
AE
55 (source (origin
56 (method url-fetch)
57 (uri (string-append "mirror://gnu/units/units-" version
58 ".tar.gz"))
59 (sha256 (base32
d6f10ca3 60 "16jfji9g1zc99agd5dcinajinhcxr4dgq2lrbc9md69ir5qgld1b"))))
8f8b2451
AE
61 (build-system gnu-build-system)
62 (synopsis "Conversion between thousands of scales")
63 (description
79c311b8 64 "GNU Units converts between measured quantities between units of
a22dc0c4 65measure. It can handle scale changes through adaptive usage of standard
79c311b8
LC
66scale prefixes (micro-, kilo-, etc.). It can also handle nonlinear
67conversions such as Fahrenheit to Celsius. Its interpreter is powerful
a22dc0c4 68enough to be used effectively as a scientific calculator.")
8f8b2451
AE
69 (license license:gpl3+)
70 (home-page "http://www.gnu.org/software/units/")))
c9dfa3c7 71
88bd1804
AE
72(define-public gsl
73 (package
74 (name "gsl")
487da565 75 (version "1.16")
88bd1804
AE
76 (source
77 (origin
78 (method url-fetch)
79 (uri (string-append "mirror://gnu/gsl/gsl-"
80 version ".tar.gz"))
81 (sha256
82 (base32
487da565 83 "0lrgipi0z6559jqh82yx8n4xgnxkhzj46v96dl77hahdp58jzg3k"))))
88bd1804 84 (build-system gnu-build-system)
71e0f288 85 (arguments
487da565
AE
86 `(#:parallel-tests? #f
87 #:phases
71e0f288
AE
88 (alist-replace
89 'configure
90 (lambda* (#:key target system outputs #:allow-other-keys #:rest args)
91 (let ((configure (assoc-ref %standard-phases 'configure)))
92 ;; disable numerically unstable test on i686, see thread at
93 ;; http://lists.gnu.org/archive/html/bug-gsl/2011-11/msg00019.html
94 (if (string=? (or target system) "i686-linux")
95 (substitute* "ode-initval2/Makefile.in"
96 (("TESTS = \\$\\(check_PROGRAMS\\)") "TESTS =")))
97 (apply configure args)))
98 %standard-phases)))
88bd1804
AE
99 (home-page "http://www.gnu.org/software/gsl/")
100 (synopsis "Numerical library for C and C++")
101 (description
a22dc0c4
LC
102 "The GNU Scientific Library is a library for numerical analysis in C
103and C++. It includes a wide range of mathematical routines, with over 1000
104functions in total. Subject areas covered by the library include:
105differential equations, linear algebra, Fast Fourier Transforms and random
106numbers.")
88bd1804
AE
107 (license license:gpl3+)))
108
b92eee75
AE
109(define-public glpk
110 (package
111 (name "glpk")
112 (version "4.52.1")
113 (source
114 (origin
115 (method url-fetch)
116 (uri (string-append "mirror://gnu/glpk/glpk-"
117 version ".tar.gz"))
118 (sha256
119 (base32
120 "0nz9ngmx23c8gbjr8l8ygnfaanxj2mwbl8awpg630bgrkxdnhc9j"))))
121 (build-system gnu-build-system)
122 (inputs
123 `(("gmp" ,gmp)))
124 (arguments
125 `(#:configure-flags '("--with-gmp")))
126 (home-page "http://www.gnu.org/software/glpk/")
79c311b8 127 (synopsis "GNU Linear Programming Kit, supporting the MathProg language")
b92eee75
AE
128 (description
129 "GLPK is a C library for solving large-scale linear programming (LP),
130mixed integer programming (MIP), and other related problems. It supports the
131GNU MathProg modeling language, a subset of the AMPL language, and features a
132translator for the language. In addition to the C library, a stand-alone
133LP/MIP solver is included in the package.")
134 (license license:gpl3+)))
135
c9dfa3c7
AE
136(define-public pspp
137 (package
138 (name "pspp")
e7d6f7bf 139 (version "0.8.2")
c9dfa3c7
AE
140 (source
141 (origin
142 (method url-fetch)
143 (uri (string-append "mirror://gnu/pspp/pspp-"
144 version ".tar.gz"))
145 (sha256
146 (base32
e7d6f7bf 147 "1w7h3dglgx0jlq1wb605b8pgfsk2vr1q2q2rj7bsajh9ihbcsixr"))))
c9dfa3c7
AE
148 (build-system gnu-build-system)
149 (inputs
f3929800
AE
150 `(("cairo" ,cairo)
151 ("fontconfig" ,fontconfig)
1dba6407 152 ("gettext" ,gnu-gettext)
c9dfa3c7
AE
153 ("gsl" ,gsl)
154 ("libxml2" ,libxml2)
f3929800 155 ("pango" ,pango)
c9dfa3c7 156 ("readline" ,readline)
e6a5ce8e
JD
157 ("gtk" ,gtk+-2)
158 ("gtksourceview" ,gtksourceview)
c9dfa3c7
AE
159 ("zlib" ,zlib)))
160 (native-inputs
161 `(("perl" ,perl)
162 ("pkg-config" ,pkg-config)))
c9dfa3c7
AE
163 (home-page "http://www.gnu.org/software/pspp/")
164 (synopsis "Statistical analysis")
165 (description
79c311b8
LC
166 "GNU PSPP is a statistical analysis program. It can perform
167descriptive statistics, T-tests, linear regression and non-parametric tests.
168It features both a graphical interface as well as command-line input. PSPP is
169designed to interoperate with Gnumeric, LibreOffice and OpenOffice. Data can
170be imported from spreadsheets, text files and database sources and it can be
171output in text, PostScript, PDF or HTML.")
c9dfa3c7 172 (license license:gpl3+)))
da95c817
NK
173
174(define-public lapack
175 (package
176 (name "lapack")
566146ab 177 (version "3.5.0")
da95c817
NK
178 (source
179 (origin
180 (method url-fetch)
181 (uri (string-append "http://www.netlib.org/lapack/lapack-"
182 version ".tgz"))
183 (sha256
184 (base32
566146ab 185 "0lk3f97i9imqascnlf6wr5mjpyxqcdj73pgj97dj2mgvyg9z1n4s"))))
da95c817
NK
186 (build-system cmake-build-system)
187 (home-page "http://www.netlib.org/lapack/")
188 (inputs `(("fortran" ,gfortran-4.8)
189 ("python" ,python-2)))
190 (arguments
191 `(#:modules ((guix build cmake-build-system)
192 (guix build utils)
193 (srfi srfi-1))
194 #:phases (alist-cons-before
6a995754
LC
195 'check 'patch-python
196 (lambda* (#:key inputs #:allow-other-keys)
197 (let ((python (assoc-ref inputs "python")))
198 (substitute* "lapack_testing.py"
199 (("/usr/bin/env python") python))))
200 %standard-phases)))
da95c817
NK
201 (synopsis "Library for numerical linear algebra")
202 (description
203 "LAPACK is a Fortran 90 library for solving the most commonly occurring
204problems in numerical linear algebra.")
205 (license (license:bsd-style "file://LICENSE"
206 "See LICENSE in the distribution."))))
73fed4f8
JD
207
208(define-public gnuplot
209 (package
210 (name "gnuplot")
211 (version "4.6.3")
212 (source
213 (origin
214 (method url-fetch)
215 (uri (string-append "mirror://sourceforge/gnuplot/gnuplot/"
216 version "/gnuplot-" version ".tar.gz"))
217 (sha256
218 (base32
219 "1xd7gqdhlk7k1p9yyqf9vkk811nadc7m4si0q3nb6cpv4pxglpyz"))))
220 (build-system gnu-build-system)
221 (inputs `(("readline" ,readline)
222 ("cairo" ,cairo)
223 ("pango" ,pango)
224 ("gd" ,gd)))
225 (native-inputs `(("texlive" ,texlive)
226 ("pkg-config" ,pkg-config)))
227 (home-page "http://www.gnuplot.info")
228 (synopsis "Command-line driven graphing utility")
229 (description "Gnuplot is a portable command-line driven graphing
230utility. It was originally created to allow scientists and students to
231visualize mathematical functions and data interactively, but has grown to
232support many non-interactive uses such as web scripting. It is also used as a
233plotting engine by third-party applications like Octave.")
234 ;; X11 Style with the additional restriction that derived works may only be
235 ;; distributed as patches to the original.
236 (license (license:fsf-free
668c06ac
JD
237 "http://gnuplot.cvs.sourceforge.net/gnuplot/gnuplot/Copyright"))))
238
7ee3f1a2
JD
239(define-public hdf5
240 (package
241 (name "hdf5")
242 (version "1.8.12")
243 (source
244 (origin
245 (method url-fetch)
246 (uri (string-append "http://www.hdfgroup.org/ftp/HDF5/current/src/hdf5-"
247 version ".tar.bz2"))
248 (sha256
249 (base32 "0f9n0v3p3lwc7564791a39c6cn1d3dbrn7d1j3ikqsi27a8hy23d"))))
250 (build-system gnu-build-system)
251 (arguments
252 `(#:phases
d4bf49b1
EB
253 (alist-cons-before
254 'configure 'patch-configure
255 (lambda _
256 (substitute* "configure"
257 (("/bin/mv") "mv")))
7ee3f1a2
JD
258 %standard-phases)))
259 (outputs '("out" "bin" "lib" "include"))
260 (home-page "http://www.hdfgroup.org")
261 (synopsis "Management suite for extremely large and complex data")
262 (description "HDF5 is a suite that makes possible the management of
263extremely large and complex data collections.")
d4bf49b1
EB
264 (license (license:x11-style
265 "http://www.hdfgroup.org/ftp/HDF5/current/src/unpacked/COPYING"))))
7ee3f1a2
JD
266
267
668c06ac
JD
268;; For a fully featured Octave, users are strongly recommended also to install
269;; the following packages: texinfo, less, ghostscript, gnuplot.
270(define-public octave
271 (package
272 (name "octave")
273 (version "3.8.0")
274 (source
275 (origin
276 (method url-fetch)
277 (uri (string-append "mirror://gnu/octave/octave-"
278 version ".tar.gz"))
279 (sha256
280 (base32
281 "0ks9pr154syw0vb3jn6xsnrkkrbvf9y7i7gaxa28rz6ngxbxvq9l"))))
282 (build-system gnu-build-system)
283 (inputs
284 `(("lapack" ,lapack)
285 ("readline" ,readline)
286 ("glpk" ,glpk)
287 ("curl" ,curl)
288 ("pcre" ,pcre)
289 ("fltk" ,fltk)
290 ("fontconfig" ,fontconfig)
291 ("freetype" ,freetype)
7ee3f1a2
JD
292 ("hdf5-lib" ,hdf5 "lib")
293 ("hdf5-include" ,hdf5 "include")
668c06ac
JD
294 ("libxft" ,libxft)
295 ("mesa" ,mesa)
296 ("zlib" ,zlib)))
297 (native-inputs
298 `(("gfortran" ,gfortran-4.8)
299 ("pkg-config" ,pkg-config)
300 ("perl" ,perl)
301 ;; The following inputs are not actually used in the build process. However, the
302 ;; ./configure gratuitously tests for their existence and assumes that programs not
303 ;; present at build time are also not, and can never be, available at run time!
304 ;; If these inputs are therefore not present, support for them will be built out.
305 ;; However, Octave will still run without them, albeit without the features they
306 ;; provide.
307 ("less" ,less)
308 ("texinfo" ,texinfo)
309 ("ghostscript" ,ghostscript)
310 ("gnuplot" ,gnuplot)))
311 (arguments
312 `(#:configure-flags (list (string-append "--with-shell="
313 (assoc-ref %build-inputs "bash")
314 "/bin/sh"))))
315 (home-page "http://www.gnu.org/software/octave/")
316 (synopsis "High-level language for numerical computation")
317 (description "GNU Octave is a high-level interpreted language that is specialized
318for numerical computations. It can be used for both linear and non-linear
319applications and it provides great support for visualizing results. Work may
320be performed both at the interactive command-line as well as via script
321files.")
322 (license license:gpl3+)))