gnu: qemu: Remove dependency on Samba.
[jackhill/guix/guix.git] / gnu / packages / algebra.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013, 2014 Andreas Enge <andreas@enge.fr>
3 ;;; Copyright © 2013 Ludovic Courtès <ludo@gnu.org>
4 ;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
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 algebra)
22 #:use-module (gnu packages)
23 #:use-module (gnu packages multiprecision)
24 #:use-module (gnu packages mpi)
25 #:use-module (gnu packages perl)
26 #:use-module (gnu packages readline)
27 #:use-module (gnu packages flex)
28 #:use-module (guix licenses)
29 #:use-module (guix packages)
30 #:use-module (guix download)
31 #:use-module (guix build-system gnu)
32 #:use-module (guix utils))
33
34
35 (define-public mpfrcx
36 (package
37 (name "mpfrcx")
38 (version "0.4.2")
39 (source (origin
40 (method url-fetch)
41 (uri (string-append
42 "http://www.multiprecision.org/mpfrcx/download/mpfrcx-"
43 version ".tar.gz"))
44 (sha256
45 (base32
46 "0grw66b255r574lvll1bqccm5myj2m8ajzsjaygcyq9zjnnbnhhy"))))
47 (build-system gnu-build-system)
48 (inputs `(("gmp" ,gmp)
49 ("mpfr" ,mpfr)
50 ("mpc" ,mpc)))
51 (synopsis "mpfrcx, a library for the arithmetic of univariate polynomials
52 over arbitrary precision real or complex numbers")
53 (description
54 "mpfrcx is a library for the arithmetic of univariate polynomials over
55 arbitrary precision real (mpfr) or complex (mpc) numbers, without control
56 on the rounding. For the time being, only the few functions needed to
57 implement the floating point approach to complex multiplication are
58 implemented. On the other hand, these comprise asymptotically fast
59 multiplication routines such as Toom–Cook and the FFT. ")
60 (license lgpl2.1+)
61 (home-page "http://mpfrcx.multiprecision.org/")))
62
63 (define-public fplll
64 (package
65 (name "fplll")
66 (version "4.0.4")
67 (source (origin
68 (method url-fetch)
69 (uri (string-append
70 "http://perso.ens-lyon.fr/damien.stehle/fplll/libfplll-"
71 version ".tar.gz"))
72 (sha256 (base32
73 "1cbiby7ykis4z84swclpysrljmqhfcllpkcbll1m08rzskgb1a6b"))))
74 (build-system gnu-build-system)
75 (inputs `(("gmp" ,gmp)
76 ("mpfr" ,mpfr)))
77 (synopsis "fplll, a library for LLL-reduction of euclidean lattices")
78 (description
79 "fplll LLL-reduces euclidean lattices. Since version 3, it can also
80 solve the shortest vector problem.")
81 (license lgpl2.1+)
82 (home-page "http://perso.ens-lyon.fr/damien.stehle/fplll/")))
83
84 (define-public pari-gp
85 (package
86 (name "pari-gp")
87 (version "2.7.0")
88 (source (origin
89 (method url-fetch)
90 (uri (string-append
91 "http://pari.math.u-bordeaux.fr/pub/pari/unix/pari-"
92 version ".tar.gz"))
93 (sha256 (base32
94 "1hk7lmq09crr9jvia8nxzhvbwf8mw62xk456i96jg8dljh0r9sgz"))))
95 (build-system gnu-build-system)
96 (inputs `(("gmp" ,gmp)
97 ("perl" ,perl)
98 ("readline" ,readline)))
99 (arguments
100 '(#:make-flags '("gp")
101 ;; FIXME: building the documentation requires tex; once this is available,
102 ;; replace "gp" by "all"
103 #:test-target "dobench"
104 #:phases
105 (alist-replace
106 'configure
107 (lambda* (#:key outputs #:allow-other-keys)
108 (let ((out (assoc-ref outputs "out")))
109 (zero?
110 (system* "./Configure" (string-append "--prefix=" out)))))
111 %standard-phases)))
112 (synopsis "PARI/GP, a computer algebra system for number theory")
113 (description
114 "PARI/GP is a widely used computer algebra system designed for fast
115 computations in number theory (factorisations, algebraic number theory,
116 elliptic curves...), but it also contains a large number of other useful
117 functions to compute with mathematical entities such as matrices,
118 polynomials, power series, algebraic numbers, etc., and a lot of
119 transcendental functions.
120 PARI is also available as a C library to allow for faster computations.")
121 (license gpl2+)
122 (home-page "http://pari.math.u-bordeaux.fr/")))
123
124 (define-public gp2c
125 (package
126 (name "gp2c")
127 (version "0.0.9pl1")
128 (source (origin
129 (method url-fetch)
130 (uri (string-append
131 "http://pari.math.u-bordeaux.fr/pub/pari/GP2C/gp2c-"
132 version ".tar.gz"))
133 (sha256 (base32
134 "1p36060vwhn38j77r4c3jqyaslvhvgm6fdw2486k7krxk5ai7ph5"))))
135 (build-system gnu-build-system)
136 (native-inputs `(("perl" ,perl)))
137 (inputs `(("pari-gp" ,pari-gp)))
138 (arguments
139 '(#:configure-flags
140 (list (string-append "--with-paricfg="
141 (assoc-ref %build-inputs "pari-gp")
142 "/lib/pari/pari.cfg"))))
143 (synopsis "PARI/GP, a computer algebra system for number theory")
144 (description
145 "PARI/GP is a widely used computer algebra system designed for fast
146 computations in number theory (factorisations, algebraic number theory,
147 elliptic curves...), but it also contains a large number of other useful
148 functions to compute with mathematical entities such as matrices,
149 polynomials, power series, algebraic numbers, etc., and a lot of
150 transcendental functions.
151 PARI is also available as a C library to allow for faster computations.
152
153 GP2C, the GP to C compiler, translates GP scripts to PARI programs.")
154 (license gpl2)
155 (home-page "http://pari.math.u-bordeaux.fr/")))
156
157 (define-public bc
158 (package
159 (name "bc")
160 (version "1.06")
161 (source (origin
162 (method url-fetch)
163 (uri (string-append "mirror://gnu/bc/bc-" version ".tar.gz"))
164 (sha256
165 (base32
166 "0cqf5jkwx6awgd2xc2a0mkpxilzcfmhncdcfg7c9439wgkqxkxjf"))))
167 (build-system gnu-build-system)
168 (inputs `(("readline" ,readline)))
169 (native-inputs `(("flex" ,flex)))
170 (arguments
171 '(#:phases
172 (alist-replace 'configure
173 (lambda* (#:key outputs #:allow-other-keys)
174 ;; This old `configure' script doesn't support
175 ;; variables passed as arguments.
176 (let ((out (assoc-ref outputs "out")))
177 (setenv "CONFIG_SHELL" (which "bash"))
178 (zero?
179 (system*
180 "./configure"
181 (string-append "--prefix=" out)
182 ;; By default, man and info pages are put in
183 ;; PREFIX/{man,info}, but we want them in
184 ;; PREFIX/share/{man,info}.
185 (string-append "--mandir=" out "/share/man")
186 (string-append "--infodir=" out "/share/info")))))
187 %standard-phases)))
188 (home-page "http://www.gnu.org/software/bc/")
189 (synopsis "Arbitrary precision numeric processing language")
190 (description
191 "bc is an arbitrary precision numeric processing language. It includes
192 an interactive environment for evaluating mathematical statements. Its
193 syntax is similar to that of C, so basic usage is familiar. It also includes
194 \"dc\", a reverse-polish calculator.")
195 (license gpl2+)))
196
197 (define-public fftw
198 (package
199 (name "fftw")
200 (version "3.3.4")
201 (source (origin
202 (method url-fetch)
203 (uri (string-append "ftp://ftp.fftw.org/pub/fftw/fftw-"
204 version".tar.gz"))
205 (sha256
206 (base32
207 "10h9mzjxnwlsjziah4lri85scc05rlajz39nqf3mbh4vja8dw34g"))))
208 (build-system gnu-build-system)
209 (arguments
210 '(#:configure-flags '("--enable-shared" "--enable-openmp")
211 #:phases (alist-cons-before
212 'build 'no-native
213 (lambda _
214 ;; By default '-mtune=native' is used. However, that may
215 ;; cause the use of ISA extensions (SSE2, etc.) that are
216 ;; not necessarily available on the user's machine when
217 ;; that package is built on a different machine.
218 (substitute* (find-files "." "Makefile$")
219 (("-mtune=native") "")))
220 %standard-phases)))
221 (native-inputs `(("perl" ,perl)))
222 (home-page "http://fftw.org")
223 (synopsis "Computing the discrete Fourier transform")
224 (description
225 "FFTW is a C subroutine library for computing the discrete Fourier
226 transform (DFT) in one or more dimensions, of arbitrary input size, and of
227 both real and complex data (as well as of even/odd data---i.e. the discrete
228 cosine/ sine transforms or DCT/DST).")
229 (license gpl2+)))
230
231 (define-public fftwf
232 (package (inherit fftw)
233 (name "fftwf")
234 (arguments
235 (substitute-keyword-arguments (package-arguments fftw)
236 ((#:configure-flags cf)
237 `(cons "--enable-float" ,cf))))
238 (description
239 (string-append (package-description fftw)
240 " Single-precision version."))))
241
242 (define-public fftw-openmpi
243 (package (inherit fftw)
244 (name "fftw-openmpi")
245 (inputs
246 `(("openmpi" ,openmpi)
247 ,@(package-inputs fftw)))
248 (arguments
249 (substitute-keyword-arguments (package-arguments fftw)
250 ((#:configure-flags cf)
251 `(cons "--enable-mpi" ,cf))))
252 (description
253 (string-append (package-description fftw)
254 " With OpenMPI parallelism support."))))