Commit | Line | Data |
---|---|---|
233e7676 | 1 | ;;; GNU Guix --- Functional package management for GNU |
c67ccedd | 2 | ;;; Copyright © 2012, 2013, 2014 Andreas Enge <andreas@enge.fr> |
4e6b699d | 3 | ;;; Copyright © 2013 Ludovic Courtès <ludo@gnu.org> |
e2ca23c5 | 4 | ;;; Copyright © 2014 Mark H Weaver <mhw@netris.org> |
2ed139c4 | 5 | ;;; |
233e7676 | 6 | ;;; This file is part of GNU Guix. |
2ed139c4 | 7 | ;;; |
233e7676 | 8 | ;;; GNU Guix is free software; you can redistribute it and/or modify it |
2ed139c4 AE |
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 | ;;; | |
233e7676 | 13 | ;;; GNU Guix is distributed in the hope that it will be useful, but |
2ed139c4 AE |
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 | |
233e7676 | 19 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. |
2ed139c4 | 20 | |
1ffa7090 | 21 | (define-module (gnu packages algebra) |
59a43334 | 22 | #:use-module (gnu packages) |
1ffa7090 | 23 | #:use-module (gnu packages multiprecision) |
0fc54d4b | 24 | #:use-module (gnu packages mpi) |
1ffa7090 LC |
25 | #:use-module (gnu packages perl) |
26 | #:use-module (gnu packages readline) | |
27 | #:use-module (gnu packages flex) | |
2ed139c4 AE |
28 | #:use-module (guix licenses) |
29 | #:use-module (guix packages) | |
30 | #:use-module (guix download) | |
7569c5cb EB |
31 | #:use-module (guix build-system gnu) |
32 | #:use-module (guix utils)) | |
2ed139c4 AE |
33 | |
34 | ||
35 | (define-public mpfrcx | |
36 | (package | |
37 | (name "mpfrcx") | |
9c68798d | 38 | (version "0.4.2") |
2ed139c4 AE |
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 | |
9c68798d | 46 | "0grw66b255r574lvll1bqccm5myj2m8ajzsjaygcyq9zjnnbnhhy")))) |
2ed139c4 AE |
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 | ||
2ed139c4 AE |
63 | (define-public fplll |
64 | (package | |
65 | (name "fplll") | |
5a15ed50 | 66 | (version "4.0.4") |
2ed139c4 AE |
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 | |
5a15ed50 | 73 | "1cbiby7ykis4z84swclpysrljmqhfcllpkcbll1m08rzskgb1a6b")))) |
2ed139c4 AE |
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/"))) | |
4e6b699d | 83 | |
90a6d47c AE |
84 | (define-public pari-gp |
85 | (package | |
86 | (name "pari-gp") | |
5383fb5b | 87 | (version "2.7.1") |
90a6d47c AE |
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 | |
5383fb5b | 94 | "1gj1rddi22hinzwy7r6hljgbi252wwwyd6gapg4hvcn0ycc7jqyc")))) |
90a6d47c AE |
95 | (build-system gnu-build-system) |
96 | (inputs `(("gmp" ,gmp) | |
97 | ("perl" ,perl) | |
98 | ("readline" ,readline))) | |
99 | (arguments | |
12abb19d LC |
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 | |
ee172b1a AE |
107 | (lambda* (#:key outputs #:allow-other-keys) |
108 | (let ((out (assoc-ref outputs "out"))) | |
12abb19d | 109 | (zero? |
ee172b1a | 110 | (system* "./Configure" (string-append "--prefix=" out))))) |
12abb19d | 111 | %standard-phases))) |
90a6d47c AE |
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/"))) | |
ed9f9a77 | 123 | |
f854a8c1 AE |
124 | (define-public gp2c |
125 | (package | |
126 | (name "gp2c") | |
99fa3024 | 127 | (version "0.0.9pl1") |
f854a8c1 AE |
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 | |
99fa3024 | 134 | "1p36060vwhn38j77r4c3jqyaslvhvgm6fdw2486k7krxk5ai7ph5")))) |
f854a8c1 | 135 | (build-system gnu-build-system) |
c67ccedd | 136 | (native-inputs `(("perl" ,perl))) |
f854a8c1 AE |
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 | ||
ed9f9a77 LC |
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) | |
c4c4cc05 JD |
168 | (inputs `(("readline" ,readline))) |
169 | (native-inputs `(("flex" ,flex))) | |
ed9f9a77 LC |
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? | |
e2ca23c5 MW |
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"))))) | |
ed9f9a77 LC |
187 | %standard-phases))) |
188 | (home-page "http://www.gnu.org/software/bc/") | |
f50d2669 | 189 | (synopsis "Arbitrary precision numeric processing language") |
ed9f9a77 | 190 | (description |
a22dc0c4 LC |
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.") | |
ed9f9a77 | 195 | (license gpl2+))) |
37e6cdcd LC |
196 | |
197 | (define-public fftw | |
198 | (package | |
199 | (name "fftw") | |
2cf287df | 200 | (version "3.3.4") |
37e6cdcd LC |
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 | |
2cf287df | 207 | "10h9mzjxnwlsjziah4lri85scc05rlajz39nqf3mbh4vja8dw34g")))) |
37e6cdcd LC |
208 | (build-system gnu-build-system) |
209 | (arguments | |
e5c66f8c | 210 | '(#:configure-flags '("--enable-shared" "--enable-openmp") |
37e6cdcd LC |
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+))) | |
7569c5cb EB |
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.")))) | |
e5c66f8c EB |
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.")))) |