Commit | Line | Data |
---|---|---|
233e7676 | 1 | ;;; GNU Guix --- Functional package management for GNU |
4879d2ff | 2 | ;;; Copyright © 2012, 2013, 2014, 2015, 2016 Andreas Enge <andreas@enge.fr> |
8f4b1dfb | 3 | ;;; Copyright © 2013, 2015 Ludovic Courtès <ludo@gnu.org> |
57497c57 | 4 | ;;; Copyright © 2016 Nicolas Goaziou <mail@nicolasgoaziou.fr> |
e2ca23c5 | 5 | ;;; Copyright © 2014 Mark H Weaver <mhw@netris.org> |
3b13c3c0 | 6 | ;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net> |
2ed139c4 | 7 | ;;; |
233e7676 | 8 | ;;; This file is part of GNU Guix. |
2ed139c4 | 9 | ;;; |
233e7676 | 10 | ;;; GNU Guix is free software; you can redistribute it and/or modify it |
2ed139c4 AE |
11 | ;;; under the terms of the GNU General Public License as published by |
12 | ;;; the Free Software Foundation; either version 3 of the License, or (at | |
13 | ;;; your option) any later version. | |
14 | ;;; | |
233e7676 | 15 | ;;; GNU Guix is distributed in the hope that it will be useful, but |
2ed139c4 AE |
16 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 | ;;; GNU General Public License for more details. | |
19 | ;;; | |
20 | ;;; You should have received a copy of the GNU General Public License | |
233e7676 | 21 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. |
2ed139c4 | 22 | |
1ffa7090 | 23 | (define-module (gnu packages algebra) |
59a43334 | 24 | #:use-module (gnu packages) |
14e6520e | 25 | #:use-module (gnu packages autotools) |
10b1f688 | 26 | #:use-module (gnu packages compression) |
99828fa7 | 27 | #:use-module (gnu packages documentation) |
57497c57 NG |
28 | #:use-module (gnu packages fltk) |
29 | #:use-module (gnu packages gl) | |
aae03c48 | 30 | #:use-module (gnu packages graphviz) |
57497c57 | 31 | #:use-module (gnu packages image) |
1ffa7090 | 32 | #:use-module (gnu packages multiprecision) |
aae03c48 | 33 | #:use-module (gnu packages maths) |
0fc54d4b | 34 | #:use-module (gnu packages mpi) |
1ffa7090 LC |
35 | #:use-module (gnu packages perl) |
36 | #:use-module (gnu packages readline) | |
37 | #:use-module (gnu packages flex) | |
aae03c48 | 38 | #:use-module (gnu packages python) |
b7194849 | 39 | #:use-module (gnu packages shells) |
8f9ac901 | 40 | #:use-module (gnu packages tex) |
57497c57 | 41 | #:use-module (gnu packages xiph) |
fb8d1be8 | 42 | #:use-module (gnu packages xorg) |
9f51293c | 43 | #:use-module ((guix licenses) #:prefix license:) |
2ed139c4 AE |
44 | #:use-module (guix packages) |
45 | #:use-module (guix download) | |
7569c5cb | 46 | #:use-module (guix build-system gnu) |
8f4b1dfb | 47 | #:use-module (guix build-system cmake) |
7569c5cb | 48 | #:use-module (guix utils)) |
2ed139c4 AE |
49 | |
50 | ||
51 | (define-public mpfrcx | |
52 | (package | |
53 | (name "mpfrcx") | |
9c68798d | 54 | (version "0.4.2") |
2ed139c4 AE |
55 | (source (origin |
56 | (method url-fetch) | |
57 | (uri (string-append | |
58 | "http://www.multiprecision.org/mpfrcx/download/mpfrcx-" | |
59 | version ".tar.gz")) | |
60 | (sha256 | |
61 | (base32 | |
9c68798d | 62 | "0grw66b255r574lvll1bqccm5myj2m8ajzsjaygcyq9zjnnbnhhy")))) |
2ed139c4 | 63 | (build-system gnu-build-system) |
878c8f3f AE |
64 | (propagated-inputs |
65 | `(("gmp" ,gmp) | |
66 | ("mpfr" ,mpfr) | |
67 | ("mpc" ,mpc))) ; Header files are included by mpfrcx.h. | |
35b9e423 | 68 | (synopsis "Arithmetic of polynomials over arbitrary precision numbers") |
2ed139c4 | 69 | (description |
35b9e423 | 70 | "Mpfrcx is a library for the arithmetic of univariate polynomials over |
2ed139c4 | 71 | arbitrary precision real (mpfr) or complex (mpc) numbers, without control |
35b9e423 | 72 | on the rounding. For the time being, only the few functions needed to |
2ed139c4 | 73 | implement the floating point approach to complex multiplication are |
35b9e423 | 74 | implemented. On the other hand, these comprise asymptotically fast |
e881752c | 75 | multiplication routines such as Toom–Cook and the FFT.") |
9f51293c | 76 | (license license:lgpl2.1+) |
2ed139c4 AE |
77 | (home-page "http://mpfrcx.multiprecision.org/"))) |
78 | ||
10b1f688 AE |
79 | (define-public cm |
80 | (package | |
81 | (name "cm") | |
81b55bf7 | 82 | (version "0.3") |
10b1f688 AE |
83 | (source (origin |
84 | (method url-fetch) | |
85 | (uri (string-append | |
86 | "http://www.multiprecision.org/cm/download/cm-" | |
87 | version ".tar.gz")) | |
88 | (sha256 | |
89 | (base32 | |
81b55bf7 | 90 | "1nf5kr0nqmhbzrsrinky18z0ighjpsmb5cr8zyg8jf04bfbyrfmc")))) |
10b1f688 AE |
91 | (build-system gnu-build-system) |
92 | (propagated-inputs | |
93 | `(("mpfrcx" ,mpfrcx) | |
94 | ("zlib" ,zlib))) ; Header files included from cm_common.h. | |
95 | (inputs | |
96 | `(("pari-gp" ,pari-gp))) | |
97 | (synopsis "CM constructions for elliptic curves") | |
98 | (description | |
99 | "The CM software implements the construction of ring class fields of | |
100 | imaginary quadratic number fields and of elliptic curves with complex | |
101 | multiplication via floating point approximations. It consists of libraries | |
102 | that can be called from within a C program and of executable command | |
103 | line applications.") | |
81b55bf7 | 104 | (license license:gpl3+) |
10b1f688 AE |
105 | (home-page "http://cm.multiprecision.org/"))) |
106 | ||
2ed139c4 AE |
107 | (define-public fplll |
108 | (package | |
109 | (name "fplll") | |
5a15ed50 | 110 | (version "4.0.4") |
2ed139c4 AE |
111 | (source (origin |
112 | (method url-fetch) | |
113 | (uri (string-append | |
114 | "http://perso.ens-lyon.fr/damien.stehle/fplll/libfplll-" | |
115 | version ".tar.gz")) | |
116 | (sha256 (base32 | |
5a15ed50 | 117 | "1cbiby7ykis4z84swclpysrljmqhfcllpkcbll1m08rzskgb1a6b")))) |
2ed139c4 AE |
118 | (build-system gnu-build-system) |
119 | (inputs `(("gmp" ,gmp) | |
120 | ("mpfr" ,mpfr))) | |
35b9e423 | 121 | (synopsis "Library for LLL-reduction of euclidean lattices") |
2ed139c4 | 122 | (description |
35b9e423 | 123 | "fplll LLL-reduces euclidean lattices. Since version 3, it can also |
2ed139c4 | 124 | solve the shortest vector problem.") |
9f51293c | 125 | (license license:lgpl2.1+) |
2ed139c4 | 126 | (home-page "http://perso.ens-lyon.fr/damien.stehle/fplll/"))) |
4e6b699d | 127 | |
90a6d47c AE |
128 | (define-public pari-gp |
129 | (package | |
130 | (name "pari-gp") | |
c19a61bb | 131 | (version "2.7.6") |
90a6d47c AE |
132 | (source (origin |
133 | (method url-fetch) | |
134 | (uri (string-append | |
135 | "http://pari.math.u-bordeaux.fr/pub/pari/unix/pari-" | |
136 | version ".tar.gz")) | |
f78c66aa AE |
137 | (sha256 |
138 | (base32 | |
c19a61bb | 139 | "04dqi697czd8mmw8aiwzrkgbvkjassqagg6lfy3lkf1k5qi9g9rr")))) |
90a6d47c | 140 | (build-system gnu-build-system) |
9bd9486d | 141 | (native-inputs `(("texlive" ,texlive-minimal))) |
90a6d47c | 142 | (inputs `(("gmp" ,gmp) |
fb8d1be8 | 143 | ("libx11" ,libx11) |
90a6d47c AE |
144 | ("perl" ,perl) |
145 | ("readline" ,readline))) | |
146 | (arguments | |
9bd9486d | 147 | '(#:make-flags '("all") |
12abb19d | 148 | #:test-target "dobench" |
08595262 AE |
149 | #:phases (modify-phases %standard-phases |
150 | (replace 'configure | |
151 | (lambda* (#:key outputs #:allow-other-keys) | |
152 | (let ((out (assoc-ref outputs "out"))) | |
153 | (zero? | |
154 | (system* "./Configure" | |
155 | (string-append "--prefix=" out))))))))) | |
90a6d47c AE |
156 | (synopsis "PARI/GP, a computer algebra system for number theory") |
157 | (description | |
158 | "PARI/GP is a widely used computer algebra system designed for fast | |
159 | computations in number theory (factorisations, algebraic number theory, | |
160 | elliptic curves...), but it also contains a large number of other useful | |
161 | functions to compute with mathematical entities such as matrices, | |
162 | polynomials, power series, algebraic numbers, etc., and a lot of | |
163 | transcendental functions. | |
164 | PARI is also available as a C library to allow for faster computations.") | |
9f51293c | 165 | (license license:gpl2+) |
90a6d47c | 166 | (home-page "http://pari.math.u-bordeaux.fr/"))) |
ed9f9a77 | 167 | |
f854a8c1 AE |
168 | (define-public gp2c |
169 | (package | |
170 | (name "gp2c") | |
4879d2ff | 171 | (version "0.0.9pl5") |
f854a8c1 AE |
172 | (source (origin |
173 | (method url-fetch) | |
174 | (uri (string-append | |
175 | "http://pari.math.u-bordeaux.fr/pub/pari/GP2C/gp2c-" | |
176 | version ".tar.gz")) | |
324bdcd8 AE |
177 | (sha256 |
178 | (base32 | |
4879d2ff | 179 | "1q003mkagc5ib6lqb2xfay7j4ffkwv7xlnznp6wdrq2sbqq4vyak")))) |
f854a8c1 | 180 | (build-system gnu-build-system) |
c67ccedd | 181 | (native-inputs `(("perl" ,perl))) |
f854a8c1 AE |
182 | (inputs `(("pari-gp" ,pari-gp))) |
183 | (arguments | |
184 | '(#:configure-flags | |
185 | (list (string-append "--with-paricfg=" | |
186 | (assoc-ref %build-inputs "pari-gp") | |
187 | "/lib/pari/pari.cfg")))) | |
188 | (synopsis "PARI/GP, a computer algebra system for number theory") | |
189 | (description | |
190 | "PARI/GP is a widely used computer algebra system designed for fast | |
191 | computations in number theory (factorisations, algebraic number theory, | |
192 | elliptic curves...), but it also contains a large number of other useful | |
193 | functions to compute with mathematical entities such as matrices, | |
194 | polynomials, power series, algebraic numbers, etc., and a lot of | |
195 | transcendental functions. | |
196 | PARI is also available as a C library to allow for faster computations. | |
197 | ||
198 | GP2C, the GP to C compiler, translates GP scripts to PARI programs.") | |
9f51293c | 199 | (license license:gpl2) |
f854a8c1 AE |
200 | (home-page "http://pari.math.u-bordeaux.fr/"))) |
201 | ||
57497c57 NG |
202 | (define-public giac-xcas |
203 | (package | |
204 | (name "giac-xcas") | |
a2d469af | 205 | (version "1.2.2-75") |
57497c57 NG |
206 | (source (origin |
207 | (method url-fetch) | |
208 | ;; "~parisse/giac" is not used because the maintainer regularly | |
209 | ;; overwrites the release tarball there, introducing a checksum | |
210 | ;; mismatch every time. See | |
211 | ;; <https://www-fourier.ujf-grenoble.fr/~parisse/debian/dists/stable/main/source/README> | |
212 | (uri (string-append "https://www-fourier.ujf-grenoble.fr/" | |
213 | "~parisse/debian/dists/stable/main/" | |
214 | "source/giac_" version ".tar.gz")) | |
215 | (sha256 | |
216 | (base32 | |
a2d469af | 217 | "0vs111fkd900wkm7yypaxmplc8i8j63d9shc3fbdhddn7cdj70b1")))) |
57497c57 NG |
218 | (build-system gnu-build-system) |
219 | (arguments | |
220 | `(#:phases | |
221 | (modify-phases %standard-phases | |
222 | (add-after 'unpack 'patch-bin-cp | |
223 | (lambda _ | |
224 | ;; Some Makefiles contain hard-coded "/bin/cp". | |
225 | (substitute* (find-files "doc" "^Makefile") | |
226 | (("/bin/cp") (which "cp"))) | |
227 | #t)) | |
228 | (add-after 'unpack 'disable-broken-test | |
229 | (lambda _ | |
230 | ;; Disable failing test. Actually, the results are correct but | |
231 | ;; a sorting discrepancy prevents the test from being validated. | |
232 | (substitute* "check/Makefile.in" | |
233 | (("chk_fhan16") "")) | |
234 | #t))))) | |
235 | (inputs | |
236 | `(("fltk" ,fltk) | |
237 | ("gmp" ,gmp) | |
238 | ("gsl" ,gsl) | |
239 | ("lapack" ,lapack) | |
240 | ("libao" ,ao) | |
241 | ("libjpeg" ,libjpeg) | |
242 | ("libpng" ,libpng) | |
243 | ("libx11" ,libx11) | |
99a00446 | 244 | ("libxinerama" ,libxinerama) |
57497c57 NG |
245 | ("libxft" ,libxft) |
246 | ("libxt" ,libxt) | |
247 | ("mesa" ,mesa) | |
248 | ("mpfi" ,mpfi) | |
249 | ("mpfr" ,mpfr) | |
250 | ("ntl" ,ntl) | |
251 | ("perl" ,perl) | |
252 | ("pari-gp" ,pari-gp) | |
253 | ("tcsh" ,tcsh) | |
254 | ("texlive" ,texlive-minimal))) | |
255 | (native-inputs `(("readline" ,readline))) | |
256 | (home-page "https://www-fourier.ujf-grenoble.fr/~parisse/giac.html") | |
257 | (synopsis "Computer algebra system") | |
258 | (description | |
259 | "Giac/Xcas is a computer algebra system. It has a compatibility mode for | |
260 | maple, mupad and the TI89. It is available as a standalone program (graphic | |
261 | or text interfaces) or as a C++ library.") | |
262 | (license license:gpl3+))) | |
263 | ||
d7ab698a AE |
264 | (define-public flint |
265 | (package | |
266 | (name "flint") | |
6c591c8e | 267 | (version "2.5.2") |
d7ab698a AE |
268 | (source (origin |
269 | (method url-fetch) | |
270 | (uri (string-append | |
271 | "http://flintlib.org/flint-" | |
272 | version ".tar.gz")) | |
273 | (sha256 (base32 | |
6c591c8e | 274 | "11syazv1a8rrnac3wj3hnyhhflpqcmq02q8pqk2m6g2k6h0gxwfb")) |
fc1adab1 | 275 | (patches (search-patches "flint-ldconfig.patch")))) |
d7ab698a | 276 | (build-system gnu-build-system) |
df15d17d | 277 | (propagated-inputs |
d7ab698a | 278 | `(("gmp" ,gmp) |
df15d17d | 279 | ("mpfr" ,mpfr))) ; header files from both are included by flint/arith.h |
d7ab698a | 280 | (arguments |
ad11974e AE |
281 | `(#:parallel-tests? #f ; seems to be necessary on arm |
282 | #:phases | |
91430de6 AE |
283 | (modify-phases %standard-phases |
284 | (replace 'configure | |
285 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
286 | (let ((out (assoc-ref outputs "out")) | |
287 | (gmp (assoc-ref inputs "gmp")) | |
288 | (mpfr (assoc-ref inputs "mpfr"))) | |
91430de6 AE |
289 | ;; do not pass "--enable-fast-install", which makes the |
290 | ;; homebrew configure process fail | |
291 | (zero? (system* | |
292 | "./configure" | |
293 | (string-append "--prefix=" out) | |
294 | (string-append "--with-gmp=" gmp) | |
295 | (string-append "--with-mpfr=" mpfr))))))))) | |
d7ab698a AE |
296 | (synopsis "Fast library for number theory") |
297 | (description | |
298 | "FLINT is a C library for number theory. It supports arithmetic | |
299 | with numbers, polynomials, power series and matrices over many base | |
300 | rings, including multiprecision integers and rationals, integers | |
301 | modulo n, p-adic numbers, finite fields (prime and non-prime order) | |
302 | and real and complex numbers (via the Arb extension library). | |
303 | ||
304 | Operations that can be performed include conversions, arithmetic, | |
305 | GCDs, factoring, solving linear systems, and evaluating special | |
306 | functions. In addition, FLINT provides various low-level routines for | |
307 | fast arithmetic.") | |
9f51293c | 308 | (license license:gpl2+) |
d7ab698a AE |
309 | (home-page "http://flintlib.org/"))) |
310 | ||
6b8e8285 AE |
311 | (define-public arb |
312 | (package | |
313 | (name "arb") | |
ffc8f345 | 314 | (version "2.8.1") |
6b8e8285 AE |
315 | (source (origin |
316 | (method url-fetch) | |
317 | (uri (string-append | |
318 | "https://github.com/fredrik-johansson/arb/archive/" | |
319 | version ".tar.gz")) | |
f586c877 | 320 | (file-name (string-append name "-" version ".tar.gz")) |
424ce93d AE |
321 | (sha256 |
322 | (base32 | |
ffc8f345 | 323 | "04hhcpshfkcq9fr4hixbhpps50yf9drk62xgkvlcaj5kb4nyrx7l")) |
fc1adab1 | 324 | (patches (search-patches "arb-ldconfig.patch")))) |
6b8e8285 | 325 | (build-system gnu-build-system) |
480d19e6 AE |
326 | (propagated-inputs |
327 | `(("flint" ,flint))) ; flint.h is included by arf.h | |
6b8e8285 | 328 | (inputs |
480d19e6 | 329 | `(("gmp" ,gmp) |
6b8e8285 AE |
330 | ("mpfr" ,mpfr))) |
331 | (arguments | |
332 | `(#:phases | |
333 | (alist-replace | |
334 | 'configure | |
335 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
336 | (let ((out (assoc-ref outputs "out")) | |
337 | (flint (assoc-ref inputs "flint")) | |
338 | (gmp (assoc-ref inputs "gmp")) | |
339 | (mpfr (assoc-ref inputs "mpfr"))) | |
340 | ;; do not pass "--enable-fast-install", which makes the | |
341 | ;; homebrew configure process fail | |
342 | (zero? (system* | |
343 | "./configure" | |
344 | (string-append "--prefix=" out) | |
345 | (string-append "--with-flint=" flint) | |
346 | (string-append "--with-gmp=" gmp) | |
347 | (string-append "--with-mpfr=" mpfr))))) | |
348 | %standard-phases))) | |
349 | (synopsis "Arbitrary precision floating-point ball arithmetic") | |
350 | (description | |
351 | "Arb is a C library for arbitrary-precision floating-point ball | |
352 | arithmetic. It supports efficient high-precision computation with | |
353 | polynomials, power series, matrices and special functions over the | |
354 | real and complex numbers, with automatic, rigorous error control.") | |
9f51293c | 355 | (license license:gpl2+) |
6b8e8285 AE |
356 | (home-page "http://fredrikj.net/arb/"))) |
357 | ||
14e6520e AE |
358 | (define-public ntl |
359 | (package | |
360 | (name "ntl") | |
361 | (version "9.7.0") | |
362 | (source (origin | |
363 | (method url-fetch) | |
364 | (uri (string-append "http://shoup.net/ntl/ntl-" | |
365 | version ".tar.gz")) | |
366 | (sha256 (base32 | |
367 | "115frp5flyvw9wghz4zph1b3llmr5nbxk1skgsggckr81fh3gmxq")))) | |
368 | (build-system gnu-build-system) | |
369 | (native-inputs | |
370 | `(("libtool" ,libtool) | |
371 | ("perl" ,perl))) ; for configuration | |
372 | ;; FIXME: Add optional input gf2x once available; then also add | |
373 | ;; configure flag "NTL_GF2X_LIB=on". | |
374 | (inputs | |
375 | `(("gmp" ,gmp))) | |
376 | (arguments | |
377 | `(#:phases | |
378 | (modify-phases %standard-phases | |
379 | (replace 'configure | |
380 | (lambda* (#:key outputs #:allow-other-keys) | |
381 | (chdir "src") | |
382 | (system* "./configure" | |
383 | (string-append "PREFIX=" (assoc-ref outputs "out")) | |
384 | ;; Do not build especially for the build machine. | |
385 | "NATIVE=off" | |
386 | ;; Also do not tune to the build machine. | |
387 | "WIZARD=off" | |
388 | "SHARED=on") | |
389 | #t))))) | |
390 | (synopsis "C++ library for number theory") | |
391 | (description | |
392 | "NTL is a C++ library providing data structures and algorithms | |
393 | for manipulating signed, arbitrary length integers, and for vectors, | |
394 | matrices, and polynomials over the integers and over finite fields.") | |
395 | (license license:gpl2+) | |
396 | (home-page "http://shoup.net/ntl/"))) | |
397 | ||
aae03c48 AE |
398 | (define-public singular |
399 | (package | |
400 | (name "singular") | |
401 | (version "4.0.3") | |
402 | (source (origin | |
403 | (method url-fetch) | |
404 | (uri (string-append "http://www.mathematik.uni-kl.de/ftp/pub/" | |
405 | "Math/Singular/SOURCES/" | |
406 | (string-join (string-split version #\.) "-") | |
407 | "/singular-" version ".tar.gz")) | |
408 | (sha256 (base32 | |
7d4c6ee8 | 409 | "0viidy2fz62rln9p0s9qfs7fnm55c6fw1agydd1py26gxylp1ksc")))) |
aae03c48 AE |
410 | (build-system gnu-build-system) |
411 | (native-inputs | |
412 | `(("doxygen" ,doxygen) | |
413 | ("graphviz" ,graphviz) | |
414 | ("perl" ,perl))) | |
415 | (inputs | |
416 | `(("cddlib" ,cddlib) | |
417 | ("gmp" ,gmp) | |
418 | ("flint" ,flint) | |
419 | ("mpfr" ,mpfr) | |
420 | ("ntl" ,ntl) | |
421 | ("python" ,python-2) | |
422 | ("readline" ,readline))) | |
423 | (arguments | |
424 | `(#:configure-flags | |
425 | (list (string-append "--with-ntl=" | |
426 | (assoc-ref %build-inputs "ntl"))))) | |
427 | (synopsis "Computer algebra system for polynomial computations") | |
428 | (description | |
429 | "Singular is a computer algebra system for polynomial computations, | |
430 | with special emphasis on commutative and non-commutative algebra, algebraic | |
431 | geometry and singularity theory.") | |
432 | ;; Singular itself is dual licensed gpl2 or gpl3, but some of the | |
433 | ;; libraries with which it links are licensed under lgpl3+, so the | |
434 | ;; combined work becomes gpl3. See COPYING in the source code. | |
435 | (license license:gpl3) | |
436 | (home-page "http://www.singular.uni-kl.de/index.php"))) | |
437 | ||
57c9c349 AE |
438 | (define-public gmp-ecm |
439 | (package | |
440 | (name "gmp-ecm") | |
441 | (version "7.0") | |
442 | (source (origin | |
443 | (method url-fetch) | |
444 | (uri (string-append "https://gforge.inria.fr/frs/download.php/" | |
445 | "file/35642/ecm-" | |
446 | version ".tar.gz")) | |
447 | (sha256 (base32 | |
448 | "00jzzwqp49m01vwsr9z1w7bvm8lb69l3f62x7qr8sfz0xiczxnpm")))) | |
449 | (build-system gnu-build-system) | |
450 | (inputs | |
451 | `(("gmp" ,gmp))) | |
452 | (arguments | |
453 | `(#:configure-flags '("--enable-shared" | |
454 | ;; Disable specific assembly routines, which depend | |
455 | ;; on the subarchitecture of the build machine, | |
456 | ;; and use gmp instead. | |
457 | "--disable-asm-redc"))) | |
458 | (synopsis "Integer factorization library using the elliptic curve method") | |
459 | (description | |
460 | "GMP-ECM factors integers using the elliptic curve method (ECM) as well | |
461 | as the P-1 and P+1 algorithms. It provides a library and a stand-alone | |
462 | binary.") | |
463 | ;; Most files are under lgpl3+, but some are under gpl3+ or gpl2+, | |
464 | ;; so the combined work is under gpl3+. | |
465 | (license license:gpl3+) | |
466 | (home-page "http://ecm.gforge.inria.fr/"))) | |
467 | ||
ed9f9a77 LC |
468 | (define-public bc |
469 | (package | |
470 | (name "bc") | |
471 | (version "1.06") | |
472 | (source (origin | |
473 | (method url-fetch) | |
474 | (uri (string-append "mirror://gnu/bc/bc-" version ".tar.gz")) | |
475 | (sha256 | |
476 | (base32 | |
477 | "0cqf5jkwx6awgd2xc2a0mkpxilzcfmhncdcfg7c9439wgkqxkxjf")))) | |
478 | (build-system gnu-build-system) | |
c4c4cc05 JD |
479 | (inputs `(("readline" ,readline))) |
480 | (native-inputs `(("flex" ,flex))) | |
ed9f9a77 LC |
481 | (arguments |
482 | '(#:phases | |
483 | (alist-replace 'configure | |
484 | (lambda* (#:key outputs #:allow-other-keys) | |
485 | ;; This old `configure' script doesn't support | |
486 | ;; variables passed as arguments. | |
487 | (let ((out (assoc-ref outputs "out"))) | |
488 | (setenv "CONFIG_SHELL" (which "bash")) | |
489 | (zero? | |
e2ca23c5 MW |
490 | (system* |
491 | "./configure" | |
492 | (string-append "--prefix=" out) | |
493 | ;; By default, man and info pages are put in | |
494 | ;; PREFIX/{man,info}, but we want them in | |
495 | ;; PREFIX/share/{man,info}. | |
496 | (string-append "--mandir=" out "/share/man") | |
497 | (string-append "--infodir=" out "/share/info"))))) | |
ed9f9a77 LC |
498 | %standard-phases))) |
499 | (home-page "http://www.gnu.org/software/bc/") | |
f50d2669 | 500 | (synopsis "Arbitrary precision numeric processing language") |
ed9f9a77 | 501 | (description |
a22dc0c4 LC |
502 | "bc is an arbitrary precision numeric processing language. It includes |
503 | an interactive environment for evaluating mathematical statements. Its | |
504 | syntax is similar to that of C, so basic usage is familiar. It also includes | |
505 | \"dc\", a reverse-polish calculator.") | |
9f51293c | 506 | (license license:gpl2+))) |
37e6cdcd LC |
507 | |
508 | (define-public fftw | |
509 | (package | |
510 | (name "fftw") | |
2cf287df | 511 | (version "3.3.4") |
37e6cdcd LC |
512 | (source (origin |
513 | (method url-fetch) | |
514 | (uri (string-append "ftp://ftp.fftw.org/pub/fftw/fftw-" | |
515 | version".tar.gz")) | |
516 | (sha256 | |
517 | (base32 | |
2cf287df | 518 | "10h9mzjxnwlsjziah4lri85scc05rlajz39nqf3mbh4vja8dw34g")))) |
37e6cdcd LC |
519 | (build-system gnu-build-system) |
520 | (arguments | |
e5c66f8c | 521 | '(#:configure-flags '("--enable-shared" "--enable-openmp") |
37e6cdcd LC |
522 | #:phases (alist-cons-before |
523 | 'build 'no-native | |
524 | (lambda _ | |
525 | ;; By default '-mtune=native' is used. However, that may | |
526 | ;; cause the use of ISA extensions (SSE2, etc.) that are | |
527 | ;; not necessarily available on the user's machine when | |
528 | ;; that package is built on a different machine. | |
529 | (substitute* (find-files "." "Makefile$") | |
530 | (("-mtune=native") ""))) | |
531 | %standard-phases))) | |
532 | (native-inputs `(("perl" ,perl))) | |
533 | (home-page "http://fftw.org") | |
534 | (synopsis "Computing the discrete Fourier transform") | |
535 | (description | |
536 | "FFTW is a C subroutine library for computing the discrete Fourier | |
537 | transform (DFT) in one or more dimensions, of arbitrary input size, and of | |
538 | both real and complex data (as well as of even/odd data---i.e. the discrete | |
539 | cosine/ sine transforms or DCT/DST).") | |
9f51293c | 540 | (license license:gpl2+))) |
7569c5cb EB |
541 | |
542 | (define-public fftwf | |
543 | (package (inherit fftw) | |
544 | (name "fftwf") | |
545 | (arguments | |
546 | (substitute-keyword-arguments (package-arguments fftw) | |
547 | ((#:configure-flags cf) | |
548 | `(cons "--enable-float" ,cf)))) | |
549 | (description | |
550 | (string-append (package-description fftw) | |
551 | " Single-precision version.")))) | |
e5c66f8c EB |
552 | |
553 | (define-public fftw-openmpi | |
554 | (package (inherit fftw) | |
555 | (name "fftw-openmpi") | |
556 | (inputs | |
557 | `(("openmpi" ,openmpi) | |
558 | ,@(package-inputs fftw))) | |
559 | (arguments | |
560 | (substitute-keyword-arguments (package-arguments fftw) | |
561 | ((#:configure-flags cf) | |
562 | `(cons "--enable-mpi" ,cf)))) | |
563 | (description | |
564 | (string-append (package-description fftw) | |
565 | " With OpenMPI parallelism support.")))) | |
8f4b1dfb LC |
566 | |
567 | (define-public eigen | |
568 | (package | |
569 | (name "eigen") | |
3b13c3c0 | 570 | (version "3.2.8") |
8f4b1dfb LC |
571 | (source (origin |
572 | (method url-fetch) | |
573 | (uri (string-append "https://bitbucket.org/eigen/eigen/get/" | |
9b268f12 | 574 | version ".tar.bz2")) |
8f4b1dfb LC |
575 | (sha256 |
576 | (base32 | |
3b13c3c0 | 577 | "0mby6my1djsg8681fcvlaq0i4kd17fja9qn5f713j3xpfbb66akj")) |
2abcc935 | 578 | (file-name (string-append name "-" version ".tar.bz2")) |
8f4b1dfb LC |
579 | (modules '((guix build utils))) |
580 | (snippet | |
581 | ;; There are 3 test failures in the "unsupported" directory, | |
582 | ;; but maintainers say it's a known issue and it's unsupported | |
583 | ;; anyway, so just skip them. | |
584 | '(substitute* "CMakeLists.txt" | |
585 | (("add_subdirectory\\(unsupported\\)") | |
a4eb83b7 LC |
586 | "# Do not build the tests for unsupported features.\n") |
587 | ;; Work around | |
588 | ;; <http://eigen.tuxfamily.org/bz/show_bug.cgi?id=1114>. | |
589 | (("\"include/eigen3\"") | |
590 | "\"${CMAKE_INSTALL_PREFIX}/include/eigen3\""))))) | |
8f4b1dfb LC |
591 | (build-system cmake-build-system) |
592 | (arguments | |
593 | '(;; Turn off debugging symbols to save space. | |
594 | #:build-type "Release" | |
595 | ||
354f4fe2 | 596 | #:phases (modify-phases %standard-phases |
ef8742ea | 597 | (replace 'check |
354f4fe2 | 598 | (lambda _ |
354f4fe2 LC |
599 | (let* ((cores (parallel-job-count)) |
600 | (dash-j (format #f "-j~a" cores))) | |
ef8742ea LC |
601 | ;; First build the tests, in parallel. See |
602 | ;; <http://eigen.tuxfamily.org/index.php?title=Tests>. | |
603 | (and (zero? (system* "make" "buildtests" dash-j)) | |
8f4b1dfb | 604 | |
ef8742ea LC |
605 | ;; Then run 'CTest' with -V so we get more |
606 | ;; details upon failure. | |
607 | (zero? (system* "ctest" "-V" dash-j))))))))) | |
8f4b1dfb LC |
608 | (home-page "http://eigen.tuxfamily.org") |
609 | (synopsis "C++ template library for linear algebra") | |
610 | (description | |
611 | "Eigen is a C++ template library for linear algebra: matrices, vectors, | |
612 | numerical solvers, and related algorithms. It provides an elegant API based | |
613 | on \"expression templates\". It is versatile: it supports all matrix sizes, | |
614 | all standard numeric types, various matrix decompositions and geometry | |
615 | features, and more.") | |
616 | ||
617 | ;; Most of the code is MPLv2, with a few files under LGPLv2.1+ or BSD-3. | |
618 | ;; See 'COPYING.README' for details. | |
9f51293c | 619 | (license license:mpl2.0))) |