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 ;;; Copyright © 2014 John Darrington <jmd@gnu.org>
6 ;;; This file is part of GNU Guix.
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.
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.
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/>.
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)
27 #:use-module (guix build-system cmake)
28 #:use-module (guix build-system gnu)
29 #:use-module (gnu packages compression)
30 #:use-module (gnu packages curl)
31 #:use-module (gnu packages fltk)
32 #:use-module (gnu packages fontutils)
33 #:use-module (gnu packages gettext)
34 #:use-module (gnu packages gcc)
35 #:use-module (gnu packages gd)
36 #:use-module (gnu packages ghostscript)
37 #:use-module (gnu packages gtk)
38 #:use-module (gnu packages less)
39 #:use-module (gnu packages xorg)
40 #:use-module (gnu packages gl)
41 #:use-module (gnu packages multiprecision)
42 #:use-module (gnu packages pcre)
43 #:use-module (gnu packages perl)
44 #:use-module (gnu packages pkg-config)
45 #:use-module (gnu packages python)
46 #:use-module (gnu packages readline)
47 #:use-module (gnu packages texinfo)
48 #:use-module (gnu packages texlive)
49 #:use-module (gnu packages xml))
57 (uri (string-append "mirror://gnu/units/units-" version
60 "1gjs3wc212aaiq4r76hx9nl1h3fa39n0ljwl9420d6ixl3rdmdjk"))))
61 (build-system gnu-build-system)
62 (synopsis "Conversion between thousands of scales")
64 "GNU Units converts numeric quantities between units of measure. It
65 can handle scale changes through adaptive usage of standard scale prefixes
66 (micro-, kilo-, etc.). It can also handle nonlinear conversions such as
67 Fahrenheit to Celsius. Its interpreter is powerful enough to be used
68 effectively as a scientific calculator.")
69 (license license:gpl3+)
70 (home-page "http://www.gnu.org/software/units/")))
79 (uri (string-append "mirror://gnu/gsl/gsl-"
83 "0lrgipi0z6559jqh82yx8n4xgnxkhzj46v96dl77hahdp58jzg3k"))))
84 (build-system gnu-build-system)
86 `(#:parallel-tests? #f
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)))
99 (home-page "http://www.gnu.org/software/gsl/")
100 (synopsis "Numerical library for C and C++")
102 "The GNU Scientific Library is a library for numerical analysis in C
103 and C++. It includes a wide range of mathematical routines, with over 1000
104 functions in total. Subject areas covered by the library include:
105 differential equations, linear algebra, Fast Fourier Transforms and random
107 (license license:gpl3+)))
116 (uri (string-append "mirror://gnu/glpk/glpk-"
120 "18gr2anv8gyps6j9f22k7li6w07glvww666sdqblvlq2hh3whwmb"))))
121 (build-system gnu-build-system)
125 `(#:configure-flags '("--with-gmp")))
126 (home-page "http://www.gnu.org/software/glpk/")
127 (synopsis "GNU Linear Programming Kit, supporting the MathProg language")
129 "GLPK is a C library for solving large-scale linear programming (LP),
130 mixed integer programming (MIP), and other related problems. It supports the
131 GNU MathProg modeling language, a subset of the AMPL language, and features a
132 translator for the language. In addition to the C library, a stand-alone
133 LP/MIP solver is included in the package.")
134 (license license:gpl3+)))
143 (uri (string-append "mirror://gnu/pspp/pspp-"
147 "1w7h3dglgx0jlq1wb605b8pgfsk2vr1q2q2rj7bsajh9ihbcsixr"))))
148 (build-system gnu-build-system)
151 ("fontconfig" ,fontconfig)
152 ("gettext" ,gnu-gettext)
156 ("readline" ,readline)
158 ("gtksourceview" ,gtksourceview)
162 ("pkg-config" ,pkg-config)))
163 (home-page "http://www.gnu.org/software/pspp/")
164 (synopsis "Statistical analysis")
166 "GNU PSPP is a statistical analysis program. It can perform
167 descriptive statistics, T-tests, linear regression and non-parametric tests.
168 It features both a graphical interface as well as command-line input. PSPP is
169 designed to interoperate with Gnumeric, LibreOffice and OpenOffice. Data can
170 be imported from spreadsheets, text files and database sources and it can be
171 output in text, PostScript, PDF or HTML.")
172 (license license:gpl3+)))
174 (define-public lapack
181 (uri (string-append "http://www.netlib.org/lapack/lapack-"
185 "0lk3f97i9imqascnlf6wr5mjpyxqcdj73pgj97dj2mgvyg9z1n4s"))))
186 (build-system cmake-build-system)
187 (home-page "http://www.netlib.org/lapack/")
188 (inputs `(("fortran" ,gfortran-4.8)
189 ("python" ,python-2)))
191 `(#:modules ((guix build cmake-build-system)
194 #:configure-flags '("-DBUILD_SHARED_LIBS:BOOL=YES")
195 #:phases (alist-cons-before
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))))
202 (synopsis "Library for numerical linear algebra")
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."))))
209 (define-public gnuplot
216 (uri (string-append "mirror://sourceforge/gnuplot/gnuplot/"
217 version "/gnuplot-" version ".tar.gz"))
220 "1xd7gqdhlk7k1p9yyqf9vkk811nadc7m4si0q3nb6cpv4pxglpyz"))))
221 (build-system gnu-build-system)
222 (inputs `(("readline" ,readline)
226 (native-inputs `(("texlive" ,texlive)
227 ("pkg-config" ,pkg-config)))
228 (home-page "http://www.gnuplot.info")
229 (synopsis "Command-line driven graphing utility")
230 (description "Gnuplot is a portable command-line driven graphing
231 utility. It was originally created to allow scientists and students to
232 visualize mathematical functions and data interactively, but has grown to
233 support many non-interactive uses such as web scripting. It is also used as a
234 plotting engine by third-party applications like Octave.")
235 ;; X11 Style with the additional restriction that derived works may only be
236 ;; distributed as patches to the original.
237 (license (license:fsf-free
238 "http://gnuplot.cvs.sourceforge.net/gnuplot/gnuplot/Copyright"))))
247 (uri (string-append "http://www.hdfgroup.org/ftp/HDF5/current/src/hdf5-"
250 (base32 "0f9n0v3p3lwc7564791a39c6cn1d3dbrn7d1j3ikqsi27a8hy23d"))))
251 (build-system gnu-build-system)
255 'configure 'patch-configure
257 (substitute* "configure"
260 (outputs '("out" "bin" "lib" "include"))
261 (home-page "http://www.hdfgroup.org")
262 (synopsis "Management suite for extremely large and complex data")
263 (description "HDF5 is a suite that makes possible the management of
264 extremely large and complex data collections.")
265 (license (license:x11-style
266 "http://www.hdfgroup.org/ftp/HDF5/current/src/unpacked/COPYING"))))
269 ;; For a fully featured Octave, users are strongly recommended also to install
270 ;; the following packages: texinfo, less, ghostscript, gnuplot.
271 (define-public octave
278 (uri (string-append "mirror://gnu/octave/octave-"
282 "0ks9pr154syw0vb3jn6xsnrkkrbvf9y7i7gaxa28rz6ngxbxvq9l"))))
283 (build-system gnu-build-system)
286 ("readline" ,readline)
291 ("fontconfig" ,fontconfig)
292 ("freetype" ,freetype)
293 ("hdf5-lib" ,hdf5 "lib")
294 ("hdf5-include" ,hdf5 "include")
299 `(("gfortran" ,gfortran-4.8)
300 ("pkg-config" ,pkg-config)
302 ;; The following inputs are not actually used in the build process. However, the
303 ;; ./configure gratuitously tests for their existence and assumes that programs not
304 ;; present at build time are also not, and can never be, available at run time!
305 ;; If these inputs are therefore not present, support for them will be built out.
306 ;; However, Octave will still run without them, albeit without the features they
310 ("ghostscript" ,ghostscript)
311 ("gnuplot" ,gnuplot)))
313 `(#:configure-flags (list (string-append "--with-shell="
314 (assoc-ref %build-inputs "bash")
316 (home-page "http://www.gnu.org/software/octave/")
317 (synopsis "High-level language for numerical computation")
318 (description "GNU Octave is a high-level interpreted language that is specialized
319 for numerical computations. It can be used for both linear and non-linear
320 applications and it provides great support for visualizing results. Work may
321 be performed both at the interactive command-line as well as via script
323 (license license:gpl3+)))