gnu: pspp: Enabled build of the gui
[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 #: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))
39
40 (define-public units
41 (package
42 (name "units")
43 (version "2.02")
44 (source (origin
45 (method url-fetch)
46 (uri (string-append "mirror://gnu/units/units-" version
47 ".tar.gz"))
48 (sha256 (base32
49 "16jfji9g1zc99agd5dcinajinhcxr4dgq2lrbc9md69ir5qgld1b"))))
50 (build-system gnu-build-system)
51 (synopsis "Conversion between thousands of scales")
52 (description
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/")))
60
61 (define-public gsl
62 (package
63 (name "gsl")
64 (version "1.16")
65 (source
66 (origin
67 (method url-fetch)
68 (uri (string-append "mirror://gnu/gsl/gsl-"
69 version ".tar.gz"))
70 (sha256
71 (base32
72 "0lrgipi0z6559jqh82yx8n4xgnxkhzj46v96dl77hahdp58jzg3k"))))
73 (build-system gnu-build-system)
74 (arguments
75 `(#:parallel-tests? #f
76 #:phases
77 (alist-replace
78 'configure
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)))
87 %standard-phases)))
88 (home-page "http://www.gnu.org/software/gsl/")
89 (synopsis "Numerical library for C and C++")
90 (description
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
95 numbers.")
96 (license license:gpl3+)))
97
98 (define-public glpk
99 (package
100 (name "glpk")
101 (version "4.52.1")
102 (source
103 (origin
104 (method url-fetch)
105 (uri (string-append "mirror://gnu/glpk/glpk-"
106 version ".tar.gz"))
107 (sha256
108 (base32
109 "0nz9ngmx23c8gbjr8l8ygnfaanxj2mwbl8awpg630bgrkxdnhc9j"))))
110 (build-system gnu-build-system)
111 (inputs
112 `(("gmp" ,gmp)))
113 (arguments
114 `(#:configure-flags '("--with-gmp")))
115 (home-page "http://www.gnu.org/software/glpk/")
116 (synopsis "GNU Linear Programming Kit, supporting the MathProg language")
117 (description
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+)))
124
125 (define-public pspp
126 (package
127 (name "pspp")
128 (version "0.8.1")
129 (source
130 (origin
131 (method url-fetch)
132 (uri (string-append "mirror://gnu/pspp/pspp-"
133 version ".tar.gz"))
134 (sha256
135 (base32
136 "0qhxsdbwxd3cn1shc13wxvx2lg32lp4z6sz24kv3jz7p5xfi8j7x"))
137 (patches (list (search-patch "pspp-tests.patch")))))
138 (build-system gnu-build-system)
139 (inputs
140 `(("cairo" ,cairo)
141 ("fontconfig" ,fontconfig)
142 ("gettext" ,gnu-gettext)
143 ("gsl" ,gsl)
144 ("libxml2" ,libxml2)
145 ("pango" ,pango)
146 ("readline" ,readline)
147 ("gtk" ,gtk+-2)
148 ("gtksourceview" ,gtksourceview)
149 ("zlib" ,zlib)))
150 (native-inputs
151 `(("perl" ,perl)
152 ("pkg-config" ,pkg-config)))
153 (home-page "http://www.gnu.org/software/pspp/")
154 (synopsis "Statistical analysis")
155 (description
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+)))
163
164 (define-public lapack
165 (package
166 (name "lapack")
167 (version "3.4.2")
168 (source
169 (origin
170 (method url-fetch)
171 (uri (string-append "http://www.netlib.org/lapack/lapack-"
172 version ".tgz"))
173 (sha256
174 (base32
175 "1w7sf8888m7fi2kyx1fzgbm22193l8c2d53m8q1ibhvfy6m5v9k0"))
176 (snippet
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)
181 (delete-file 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)))
189 (arguments
190 `(#:modules ((guix build cmake-build-system)
191 (guix build utils)
192 (srfi srfi-1))
193 #:phases (alist-cons-before
194 'check 'patch-python
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))))
199 %standard-phases)))
200 (synopsis "Library for numerical linear algebra")
201 (description
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."))))