1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
3 ;;; Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org>
5 ;;; This file is part of GNU Guix.
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.
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.
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/>.
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 #:use-module (gnu packages gcc)
32 #:use-module (gnu packages gtk)
33 #:use-module (gnu packages multiprecision)
34 #:use-module (gnu packages perl)
35 #:use-module (gnu packages pkg-config)
36 #:use-module (gnu packages python)
37 #:use-module (gnu packages readline)
38 #:use-module (gnu packages xml))
46 (uri (string-append "mirror://gnu/units/units-" version
49 "16jfji9g1zc99agd5dcinajinhcxr4dgq2lrbc9md69ir5qgld1b"))))
50 (build-system gnu-build-system)
51 (synopsis "Conversion between thousands of scales")
53 "GNU Units converts between measured quantities between units of
54 measure. It can handle scale changes through adaptive usage of standard
55 scale prefixes (micro-, kilo-, etc.). It can also handle nonlinear
56 conversions such as Fahrenheit to Celsius. Its interpreter is powerful
57 enough to be used effectively as a scientific calculator.")
58 (license license:gpl3+)
59 (home-page "http://www.gnu.org/software/units/")))
68 (uri (string-append "mirror://gnu/gsl/gsl-"
72 "0lrgipi0z6559jqh82yx8n4xgnxkhzj46v96dl77hahdp58jzg3k"))))
73 (build-system gnu-build-system)
75 `(#:parallel-tests? #f
79 (lambda* (#:key target system outputs #:allow-other-keys #:rest args)
80 (let ((configure (assoc-ref %standard-phases 'configure)))
81 ;; disable numerically unstable test on i686, see thread at
82 ;; http://lists.gnu.org/archive/html/bug-gsl/2011-11/msg00019.html
83 (if (string=? (or target system) "i686-linux")
84 (substitute* "ode-initval2/Makefile.in"
85 (("TESTS = \\$\\(check_PROGRAMS\\)") "TESTS =")))
86 (apply configure args)))
88 (home-page "http://www.gnu.org/software/gsl/")
89 (synopsis "Numerical library for C and C++")
91 "The GNU Scientific Library is a library for numerical analysis in C
92 and C++. It includes a wide range of mathematical routines, with over 1000
93 functions in total. Subject areas covered by the library include:
94 differential equations, linear algebra, Fast Fourier Transforms and random
96 (license license:gpl3+)))
105 (uri (string-append "mirror://gnu/glpk/glpk-"
109 "0nz9ngmx23c8gbjr8l8ygnfaanxj2mwbl8awpg630bgrkxdnhc9j"))))
110 (build-system gnu-build-system)
114 `(#:configure-flags '("--with-gmp")))
115 (home-page "http://www.gnu.org/software/glpk/")
116 (synopsis "GNU Linear Programming Kit, supporting the MathProg language")
118 "GLPK is a C library for solving large-scale linear programming (LP),
119 mixed integer programming (MIP), and other related problems. It supports the
120 GNU MathProg modeling language, a subset of the AMPL language, and features a
121 translator for the language. In addition to the C library, a stand-alone
122 LP/MIP solver is included in the package.")
123 (license license:gpl3+)))
132 (uri (string-append "mirror://gnu/pspp/pspp-"
136 "0qhxsdbwxd3cn1shc13wxvx2lg32lp4z6sz24kv3jz7p5xfi8j7x"))
137 (patches (list (search-patch "pspp-tests.patch")))))
138 (build-system gnu-build-system)
141 ("fontconfig" ,fontconfig)
142 ("gettext" ,gnu-gettext)
146 ("readline" ,readline)
148 ("gtksourceview" ,gtksourceview)
152 ("pkg-config" ,pkg-config)))
153 (home-page "http://www.gnu.org/software/pspp/")
154 (synopsis "Statistical analysis")
156 "GNU PSPP is a statistical analysis program. It can perform
157 descriptive statistics, T-tests, linear regression and non-parametric tests.
158 It features both a graphical interface as well as command-line input. PSPP is
159 designed to interoperate with Gnumeric, LibreOffice and OpenOffice. Data can
160 be imported from spreadsheets, text files and database sources and it can be
161 output in text, PostScript, PDF or HTML.")
162 (license license:gpl3+)))
164 (define-public lapack
171 (uri (string-append "http://www.netlib.org/lapack/lapack-"
175 "1w7sf8888m7fi2kyx1fzgbm22193l8c2d53m8q1ibhvfy6m5v9k0"))
177 ;; Remove non-free files.
178 ;; See <http://icl.cs.utk.edu/lapack-forum/archives/lapack/msg01383.html>.
179 '(for-each (lambda (file)
180 (format #t "removing '~a'~%" file)
182 '("lapacke/example/example_DGESV_rowmajor.c"
183 "lapacke/example/example_ZGESV_rowmajor.c"
184 "DOCS/psfig.tex")))))
185 (build-system cmake-build-system)
186 (home-page "http://www.netlib.org/lapack/")
187 (inputs `(("fortran" ,gfortran-4.8)
188 ("python" ,python-2)))
190 `(#:modules ((guix build cmake-build-system)
193 #:phases (alist-cons-before
195 (lambda* (#:key inputs #:allow-other-keys)
196 (let ((python (assoc-ref inputs "python")))
197 (substitute* "lapack_testing.py"
198 (("/usr/bin/env python") python))))
200 (synopsis "Library for numerical linear algebra")
202 "LAPACK is a Fortran 90 library for solving the most commonly occurring
203 problems in numerical linear algebra.")
204 (license (license:bsd-style "file://LICENSE"
205 "See LICENSE in the distribution."))))