Commit | Line | Data |
---|---|---|
233e7676 | 1 | ;;; GNU Guix --- Functional package management for GNU |
21abf092 | 2 | ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017 Andreas Enge <andreas@enge.fr> |
7355634d | 3 | ;;; Copyright © 2013, 2015, 2017 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> |
f0bacad6 | 7 | ;;; Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr> |
2ed139c4 | 8 | ;;; |
233e7676 | 9 | ;;; This file is part of GNU Guix. |
2ed139c4 | 10 | ;;; |
233e7676 | 11 | ;;; GNU Guix is free software; you can redistribute it and/or modify it |
2ed139c4 AE |
12 | ;;; under the terms of the GNU General Public License as published by |
13 | ;;; the Free Software Foundation; either version 3 of the License, or (at | |
14 | ;;; your option) any later version. | |
15 | ;;; | |
233e7676 | 16 | ;;; GNU Guix is distributed in the hope that it will be useful, but |
2ed139c4 AE |
17 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of |
18 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
19 | ;;; GNU General Public License for more details. | |
20 | ;;; | |
21 | ;;; You should have received a copy of the GNU General Public License | |
233e7676 | 22 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. |
2ed139c4 | 23 | |
1ffa7090 | 24 | (define-module (gnu packages algebra) |
59a43334 | 25 | #:use-module (gnu packages) |
14e6520e | 26 | #:use-module (gnu packages autotools) |
10b1f688 | 27 | #:use-module (gnu packages compression) |
99828fa7 | 28 | #:use-module (gnu packages documentation) |
5894b604 | 29 | #:use-module (gnu packages flex) |
57497c57 NG |
30 | #:use-module (gnu packages fltk) |
31 | #:use-module (gnu packages gl) | |
aae03c48 | 32 | #:use-module (gnu packages graphviz) |
57497c57 | 33 | #:use-module (gnu packages image) |
aae03c48 | 34 | #:use-module (gnu packages maths) |
0fc54d4b | 35 | #:use-module (gnu packages mpi) |
5894b604 | 36 | #:use-module (gnu packages multiprecision) |
1ffa7090 | 37 | #:use-module (gnu packages perl) |
aae03c48 | 38 | #:use-module (gnu packages python) |
5894b604 | 39 | #:use-module (gnu packages readline) |
b7194849 | 40 | #:use-module (gnu packages shells) |
8f9ac901 | 41 | #:use-module (gnu packages tex) |
57497c57 | 42 | #:use-module (gnu packages xiph) |
fb8d1be8 | 43 | #:use-module (gnu packages xorg) |
7569c5cb | 44 | #:use-module (guix build-system gnu) |
8f4b1dfb | 45 | #:use-module (guix build-system cmake) |
5894b604 TGR |
46 | #:use-module (guix download) |
47 | #:use-module ((guix licenses) #:prefix license:) | |
48 | #:use-module (guix packages) | |
7569c5cb | 49 | #:use-module (guix utils)) |
2ed139c4 AE |
50 | |
51 | ||
52 | (define-public mpfrcx | |
53 | (package | |
54 | (name "mpfrcx") | |
9c68798d | 55 | (version "0.4.2") |
2ed139c4 AE |
56 | (source (origin |
57 | (method url-fetch) | |
58 | (uri (string-append | |
59 | "http://www.multiprecision.org/mpfrcx/download/mpfrcx-" | |
60 | version ".tar.gz")) | |
61 | (sha256 | |
62 | (base32 | |
9c68798d | 63 | "0grw66b255r574lvll1bqccm5myj2m8ajzsjaygcyq9zjnnbnhhy")))) |
2ed139c4 | 64 | (build-system gnu-build-system) |
878c8f3f AE |
65 | (propagated-inputs |
66 | `(("gmp" ,gmp) | |
67 | ("mpfr" ,mpfr) | |
68 | ("mpc" ,mpc))) ; Header files are included by mpfrcx.h. | |
35b9e423 | 69 | (synopsis "Arithmetic of polynomials over arbitrary precision numbers") |
2ed139c4 | 70 | (description |
35b9e423 | 71 | "Mpfrcx is a library for the arithmetic of univariate polynomials over |
2ed139c4 | 72 | arbitrary precision real (mpfr) or complex (mpc) numbers, without control |
35b9e423 | 73 | on the rounding. For the time being, only the few functions needed to |
2ed139c4 | 74 | implement the floating point approach to complex multiplication are |
35b9e423 | 75 | implemented. On the other hand, these comprise asymptotically fast |
e881752c | 76 | multiplication routines such as Toom–Cook and the FFT.") |
9f51293c | 77 | (license license:lgpl2.1+) |
2ed139c4 AE |
78 | (home-page "http://mpfrcx.multiprecision.org/"))) |
79 | ||
10b1f688 AE |
80 | (define-public cm |
81 | (package | |
82 | (name "cm") | |
81b55bf7 | 83 | (version "0.3") |
10b1f688 AE |
84 | (source (origin |
85 | (method url-fetch) | |
86 | (uri (string-append | |
87 | "http://www.multiprecision.org/cm/download/cm-" | |
88 | version ".tar.gz")) | |
89 | (sha256 | |
90 | (base32 | |
81b55bf7 | 91 | "1nf5kr0nqmhbzrsrinky18z0ighjpsmb5cr8zyg8jf04bfbyrfmc")))) |
10b1f688 AE |
92 | (build-system gnu-build-system) |
93 | (propagated-inputs | |
94 | `(("mpfrcx" ,mpfrcx) | |
95 | ("zlib" ,zlib))) ; Header files included from cm_common.h. | |
96 | (inputs | |
97 | `(("pari-gp" ,pari-gp))) | |
98 | (synopsis "CM constructions for elliptic curves") | |
99 | (description | |
100 | "The CM software implements the construction of ring class fields of | |
101 | imaginary quadratic number fields and of elliptic curves with complex | |
102 | multiplication via floating point approximations. It consists of libraries | |
103 | that can be called from within a C program and of executable command | |
104 | line applications.") | |
81b55bf7 | 105 | (license license:gpl3+) |
10b1f688 AE |
106 | (home-page "http://cm.multiprecision.org/"))) |
107 | ||
2ed139c4 AE |
108 | (define-public fplll |
109 | (package | |
110 | (name "fplll") | |
5a15ed50 | 111 | (version "4.0.4") |
2ed139c4 AE |
112 | (source (origin |
113 | (method url-fetch) | |
114 | (uri (string-append | |
115 | "http://perso.ens-lyon.fr/damien.stehle/fplll/libfplll-" | |
116 | version ".tar.gz")) | |
117 | (sha256 (base32 | |
5a15ed50 | 118 | "1cbiby7ykis4z84swclpysrljmqhfcllpkcbll1m08rzskgb1a6b")))) |
2ed139c4 AE |
119 | (build-system gnu-build-system) |
120 | (inputs `(("gmp" ,gmp) | |
121 | ("mpfr" ,mpfr))) | |
35b9e423 | 122 | (synopsis "Library for LLL-reduction of euclidean lattices") |
2ed139c4 | 123 | (description |
35b9e423 | 124 | "fplll LLL-reduces euclidean lattices. Since version 3, it can also |
2ed139c4 | 125 | solve the shortest vector problem.") |
9f51293c | 126 | (license license:lgpl2.1+) |
2ed139c4 | 127 | (home-page "http://perso.ens-lyon.fr/damien.stehle/fplll/"))) |
4e6b699d | 128 | |
90a6d47c AE |
129 | (define-public pari-gp |
130 | (package | |
131 | (name "pari-gp") | |
aada6f37 | 132 | (version "2.9.1") |
90a6d47c AE |
133 | (source (origin |
134 | (method url-fetch) | |
135 | (uri (string-append | |
136 | "http://pari.math.u-bordeaux.fr/pub/pari/unix/pari-" | |
137 | version ".tar.gz")) | |
f78c66aa AE |
138 | (sha256 |
139 | (base32 | |
aada6f37 | 140 | "0rq7wz9df1xs4acdzzb5dapx8vs6m5py39n2wynw2qv4d2b0ylfw")))) |
90a6d47c | 141 | (build-system gnu-build-system) |
9bd9486d | 142 | (native-inputs `(("texlive" ,texlive-minimal))) |
90a6d47c | 143 | (inputs `(("gmp" ,gmp) |
fb8d1be8 | 144 | ("libx11" ,libx11) |
90a6d47c AE |
145 | ("perl" ,perl) |
146 | ("readline" ,readline))) | |
147 | (arguments | |
9bd9486d | 148 | '(#:make-flags '("all") |
12abb19d | 149 | #:test-target "dobench" |
08595262 AE |
150 | #:phases (modify-phases %standard-phases |
151 | (replace 'configure | |
152 | (lambda* (#:key outputs #:allow-other-keys) | |
153 | (let ((out (assoc-ref outputs "out"))) | |
154 | (zero? | |
155 | (system* "./Configure" | |
156 | (string-append "--prefix=" out))))))))) | |
90a6d47c AE |
157 | (synopsis "PARI/GP, a computer algebra system for number theory") |
158 | (description | |
159 | "PARI/GP is a widely used computer algebra system designed for fast | |
160 | computations in number theory (factorisations, algebraic number theory, | |
161 | elliptic curves...), but it also contains a large number of other useful | |
162 | functions to compute with mathematical entities such as matrices, | |
163 | polynomials, power series, algebraic numbers, etc., and a lot of | |
164 | transcendental functions. | |
165 | PARI is also available as a C library to allow for faster computations.") | |
9f51293c | 166 | (license license:gpl2+) |
90a6d47c | 167 | (home-page "http://pari.math.u-bordeaux.fr/"))) |
ed9f9a77 | 168 | |
f854a8c1 AE |
169 | (define-public gp2c |
170 | (package | |
171 | (name "gp2c") | |
0a77fdf4 | 172 | (version "0.0.10") |
f854a8c1 AE |
173 | (source (origin |
174 | (method url-fetch) | |
175 | (uri (string-append | |
176 | "http://pari.math.u-bordeaux.fr/pub/pari/GP2C/gp2c-" | |
177 | version ".tar.gz")) | |
324bdcd8 AE |
178 | (sha256 |
179 | (base32 | |
0a77fdf4 | 180 | "1xhpz5p81iw261ay1kip283ggr0ir8ydz8qx3v24z8jfms1r3y70")))) |
f854a8c1 | 181 | (build-system gnu-build-system) |
c67ccedd | 182 | (native-inputs `(("perl" ,perl))) |
f854a8c1 AE |
183 | (inputs `(("pari-gp" ,pari-gp))) |
184 | (arguments | |
185 | '(#:configure-flags | |
186 | (list (string-append "--with-paricfg=" | |
187 | (assoc-ref %build-inputs "pari-gp") | |
188 | "/lib/pari/pari.cfg")))) | |
189 | (synopsis "PARI/GP, a computer algebra system for number theory") | |
190 | (description | |
191 | "PARI/GP is a widely used computer algebra system designed for fast | |
192 | computations in number theory (factorisations, algebraic number theory, | |
193 | elliptic curves...), but it also contains a large number of other useful | |
194 | functions to compute with mathematical entities such as matrices, | |
195 | polynomials, power series, algebraic numbers, etc., and a lot of | |
196 | transcendental functions. | |
197 | PARI is also available as a C library to allow for faster computations. | |
198 | ||
199 | GP2C, the GP to C compiler, translates GP scripts to PARI programs.") | |
9f51293c | 200 | (license license:gpl2) |
f854a8c1 AE |
201 | (home-page "http://pari.math.u-bordeaux.fr/"))) |
202 | ||
57497c57 NG |
203 | (define-public giac-xcas |
204 | (package | |
205 | (name "giac-xcas") | |
5f8ca95e | 206 | (version "1.2.3-25") |
57497c57 NG |
207 | (source (origin |
208 | (method url-fetch) | |
209 | ;; "~parisse/giac" is not used because the maintainer regularly | |
210 | ;; overwrites the release tarball there, introducing a checksum | |
211 | ;; mismatch every time. See | |
212 | ;; <https://www-fourier.ujf-grenoble.fr/~parisse/debian/dists/stable/main/source/README> | |
213 | (uri (string-append "https://www-fourier.ujf-grenoble.fr/" | |
214 | "~parisse/debian/dists/stable/main/" | |
215 | "source/giac_" version ".tar.gz")) | |
216 | (sha256 | |
217 | (base32 | |
5f8ca95e | 218 | "0d6a42p8111raf7k16yvjajnpj22abiqndy3yzkrb4b8l071r24d")))) |
57497c57 NG |
219 | (build-system gnu-build-system) |
220 | (arguments | |
221 | `(#:phases | |
222 | (modify-phases %standard-phases | |
223 | (add-after 'unpack 'patch-bin-cp | |
224 | (lambda _ | |
225 | ;; Some Makefiles contain hard-coded "/bin/cp". | |
226 | (substitute* (find-files "doc" "^Makefile") | |
227 | (("/bin/cp") (which "cp"))) | |
228 | #t)) | |
229 | (add-after 'unpack 'disable-broken-test | |
230 | (lambda _ | |
231 | ;; Disable failing test. Actually, the results are correct but | |
232 | ;; a sorting discrepancy prevents the test from being validated. | |
233 | (substitute* "check/Makefile.in" | |
234 | (("chk_fhan16") "")) | |
235 | #t))))) | |
236 | (inputs | |
237 | `(("fltk" ,fltk) | |
238 | ("gmp" ,gmp) | |
239 | ("gsl" ,gsl) | |
240 | ("lapack" ,lapack) | |
241 | ("libao" ,ao) | |
242 | ("libjpeg" ,libjpeg) | |
243 | ("libpng" ,libpng) | |
244 | ("libx11" ,libx11) | |
99a00446 | 245 | ("libxinerama" ,libxinerama) |
57497c57 NG |
246 | ("libxft" ,libxft) |
247 | ("libxt" ,libxt) | |
248 | ("mesa" ,mesa) | |
249 | ("mpfi" ,mpfi) | |
250 | ("mpfr" ,mpfr) | |
251 | ("ntl" ,ntl) | |
252 | ("perl" ,perl) | |
253 | ("pari-gp" ,pari-gp) | |
254 | ("tcsh" ,tcsh) | |
255 | ("texlive" ,texlive-minimal))) | |
256 | (native-inputs `(("readline" ,readline))) | |
257 | (home-page "https://www-fourier.ujf-grenoble.fr/~parisse/giac.html") | |
258 | (synopsis "Computer algebra system") | |
259 | (description | |
260 | "Giac/Xcas is a computer algebra system. It has a compatibility mode for | |
261 | maple, mupad and the TI89. It is available as a standalone program (graphic | |
262 | or text interfaces) or as a C++ library.") | |
263 | (license license:gpl3+))) | |
264 | ||
d7ab698a AE |
265 | (define-public flint |
266 | (package | |
267 | (name "flint") | |
6c591c8e | 268 | (version "2.5.2") |
d7ab698a AE |
269 | (source (origin |
270 | (method url-fetch) | |
271 | (uri (string-append | |
272 | "http://flintlib.org/flint-" | |
273 | version ".tar.gz")) | |
274 | (sha256 (base32 | |
6c591c8e | 275 | "11syazv1a8rrnac3wj3hnyhhflpqcmq02q8pqk2m6g2k6h0gxwfb")) |
fc1adab1 | 276 | (patches (search-patches "flint-ldconfig.patch")))) |
d7ab698a | 277 | (build-system gnu-build-system) |
df15d17d | 278 | (propagated-inputs |
d7ab698a | 279 | `(("gmp" ,gmp) |
df15d17d | 280 | ("mpfr" ,mpfr))) ; header files from both are included by flint/arith.h |
d7ab698a | 281 | (arguments |
ad11974e AE |
282 | `(#:parallel-tests? #f ; seems to be necessary on arm |
283 | #:phases | |
91430de6 AE |
284 | (modify-phases %standard-phases |
285 | (replace 'configure | |
286 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
287 | (let ((out (assoc-ref outputs "out")) | |
288 | (gmp (assoc-ref inputs "gmp")) | |
289 | (mpfr (assoc-ref inputs "mpfr"))) | |
91430de6 AE |
290 | ;; do not pass "--enable-fast-install", which makes the |
291 | ;; homebrew configure process fail | |
292 | (zero? (system* | |
293 | "./configure" | |
294 | (string-append "--prefix=" out) | |
295 | (string-append "--with-gmp=" gmp) | |
296 | (string-append "--with-mpfr=" mpfr))))))))) | |
d7ab698a AE |
297 | (synopsis "Fast library for number theory") |
298 | (description | |
299 | "FLINT is a C library for number theory. It supports arithmetic | |
300 | with numbers, polynomials, power series and matrices over many base | |
301 | rings, including multiprecision integers and rationals, integers | |
302 | modulo n, p-adic numbers, finite fields (prime and non-prime order) | |
303 | and real and complex numbers (via the Arb extension library). | |
304 | ||
305 | Operations that can be performed include conversions, arithmetic, | |
306 | GCDs, factoring, solving linear systems, and evaluating special | |
307 | functions. In addition, FLINT provides various low-level routines for | |
308 | fast arithmetic.") | |
9f51293c | 309 | (license license:gpl2+) |
d7ab698a AE |
310 | (home-page "http://flintlib.org/"))) |
311 | ||
6b8e8285 AE |
312 | (define-public arb |
313 | (package | |
314 | (name "arb") | |
21abf092 | 315 | (version "2.10.0") |
6b8e8285 AE |
316 | (source (origin |
317 | (method url-fetch) | |
318 | (uri (string-append | |
319 | "https://github.com/fredrik-johansson/arb/archive/" | |
320 | version ".tar.gz")) | |
f586c877 | 321 | (file-name (string-append name "-" version ".tar.gz")) |
424ce93d AE |
322 | (sha256 |
323 | (base32 | |
21abf092 | 324 | "0jwcv9ssvi8axb1y7m2h4ykgyl015cl6g28gfl92l4dgnag585ak")))) |
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") | |
b28187cd | 471 | (version "1.06") |
ed9f9a77 LC |
472 | (source (origin |
473 | (method url-fetch) | |
474 | (uri (string-append "mirror://gnu/bc/bc-" version ".tar.gz")) | |
475 | (sha256 | |
476 | (base32 | |
b28187cd | 477 | "0cqf5jkwx6awgd2xc2a0mkpxilzcfmhncdcfg7c9439wgkqxkxjf")))) |
ed9f9a77 | 478 | (build-system gnu-build-system) |
b28187cd TGR |
479 | (inputs `(("readline" ,readline))) |
480 | (native-inputs `(("flex" ,flex))) | |
ed9f9a77 | 481 | (arguments |
b28187cd TGR |
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? | |
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"))))) | |
498 | %standard-phases) | |
499 | #:configure-flags | |
f0bacad6 | 500 | (list "--with-readline"))) |
6fd52309 | 501 | (home-page "https://www.gnu.org/software/bc/") |
f50d2669 | 502 | (synopsis "Arbitrary precision numeric processing language") |
ed9f9a77 | 503 | (description |
a22dc0c4 LC |
504 | "bc is an arbitrary precision numeric processing language. It includes |
505 | an interactive environment for evaluating mathematical statements. Its | |
506 | syntax is similar to that of C, so basic usage is familiar. It also includes | |
507 | \"dc\", a reverse-polish calculator.") | |
9f51293c | 508 | (license license:gpl2+))) |
37e6cdcd | 509 | |
2a9b10c7 RW |
510 | ;; The original kiss-fft does not have a complete build system and does not |
511 | ;; build any shared libraries. This is a fork used by Extempore. | |
512 | (define-public kiss-fft-for-extempore | |
513 | (package | |
514 | (name "kiss-fft-for-extempore") | |
515 | (version "1.3.0") | |
516 | (source (origin | |
517 | (method url-fetch) | |
518 | (uri (string-append "https://github.com/extemporelang/kiss_fft/archive/" | |
519 | version ".tar.gz")) | |
520 | (file-name (string-append name "-" version ".tar.gz")) | |
521 | (sha256 | |
522 | (base32 | |
523 | "0hkp9l6l4c92fb1l2sh6a6zv1hynpvb2s4d03vd8vxyvybc0l4pv")))) | |
524 | (build-system cmake-build-system) | |
525 | (arguments `(#:tests? #f)) ; no tests included | |
39162ee4 RW |
526 | ;; Extempore refuses to build on architectures other than x86_64 |
527 | (supported-systems '("x86_64-linux")) | |
2a9b10c7 RW |
528 | (home-page "https://github.com/extemporelang/kiss_fft") |
529 | (synopsis "Mixed-radix Fast Fourier Transform") | |
530 | (description | |
531 | "Kiss FFT attempts to be a reasonably efficient, moderately useful FFT | |
532 | that can use fixed or floating data types and can easily be incorporated into | |
533 | a C program.") | |
534 | (license license:bsd-3))) | |
535 | ||
37e6cdcd LC |
536 | (define-public fftw |
537 | (package | |
538 | (name "fftw") | |
1ebb9a27 | 539 | (version "3.3.5") |
37e6cdcd LC |
540 | (source (origin |
541 | (method url-fetch) | |
542 | (uri (string-append "ftp://ftp.fftw.org/pub/fftw/fftw-" | |
543 | version".tar.gz")) | |
544 | (sha256 | |
545 | (base32 | |
1ebb9a27 | 546 | "1kwbx92ps0r7s2mqy7lxbxanslxdzj7dp7r7gmdkzv1j8yqf3kwf")))) |
37e6cdcd LC |
547 | (build-system gnu-build-system) |
548 | (arguments | |
86f4e9d7 RW |
549 | '(#:configure-flags |
550 | '("--enable-shared" "--enable-openmp" "--enable-threads") | |
37e6cdcd LC |
551 | #:phases (alist-cons-before |
552 | 'build 'no-native | |
553 | (lambda _ | |
554 | ;; By default '-mtune=native' is used. However, that may | |
555 | ;; cause the use of ISA extensions (SSE2, etc.) that are | |
556 | ;; not necessarily available on the user's machine when | |
557 | ;; that package is built on a different machine. | |
558 | (substitute* (find-files "." "Makefile$") | |
559 | (("-mtune=native") ""))) | |
560 | %standard-phases))) | |
561 | (native-inputs `(("perl" ,perl))) | |
562 | (home-page "http://fftw.org") | |
563 | (synopsis "Computing the discrete Fourier transform") | |
564 | (description | |
565 | "FFTW is a C subroutine library for computing the discrete Fourier | |
566 | transform (DFT) in one or more dimensions, of arbitrary input size, and of | |
567 | both real and complex data (as well as of even/odd data---i.e. the discrete | |
568 | cosine/ sine transforms or DCT/DST).") | |
9f51293c | 569 | (license license:gpl2+))) |
7569c5cb EB |
570 | |
571 | (define-public fftwf | |
572 | (package (inherit fftw) | |
573 | (name "fftwf") | |
574 | (arguments | |
575 | (substitute-keyword-arguments (package-arguments fftw) | |
576 | ((#:configure-flags cf) | |
577 | `(cons "--enable-float" ,cf)))) | |
578 | (description | |
579 | (string-append (package-description fftw) | |
580 | " Single-precision version.")))) | |
e5c66f8c EB |
581 | |
582 | (define-public fftw-openmpi | |
583 | (package (inherit fftw) | |
584 | (name "fftw-openmpi") | |
585 | (inputs | |
586 | `(("openmpi" ,openmpi) | |
587 | ,@(package-inputs fftw))) | |
588 | (arguments | |
589 | (substitute-keyword-arguments (package-arguments fftw) | |
590 | ((#:configure-flags cf) | |
591 | `(cons "--enable-mpi" ,cf)))) | |
592 | (description | |
593 | (string-append (package-description fftw) | |
594 | " With OpenMPI parallelism support.")))) | |
8f4b1dfb LC |
595 | |
596 | (define-public eigen | |
597 | (package | |
598 | (name "eigen") | |
89fa2219 | 599 | (version "3.2.9") |
8f4b1dfb LC |
600 | (source (origin |
601 | (method url-fetch) | |
602 | (uri (string-append "https://bitbucket.org/eigen/eigen/get/" | |
9b268f12 | 603 | version ".tar.bz2")) |
8f4b1dfb LC |
604 | (sha256 |
605 | (base32 | |
89fa2219 | 606 | "1zs5b210mq7nyanky07li6456rrd0xv2nxf6sl2lhkzdq5p067jd")) |
2abcc935 | 607 | (file-name (string-append name "-" version ".tar.bz2")) |
8f4b1dfb LC |
608 | (modules '((guix build utils))) |
609 | (snippet | |
610 | ;; There are 3 test failures in the "unsupported" directory, | |
611 | ;; but maintainers say it's a known issue and it's unsupported | |
612 | ;; anyway, so just skip them. | |
613 | '(substitute* "CMakeLists.txt" | |
614 | (("add_subdirectory\\(unsupported\\)") | |
a4eb83b7 LC |
615 | "# Do not build the tests for unsupported features.\n") |
616 | ;; Work around | |
617 | ;; <http://eigen.tuxfamily.org/bz/show_bug.cgi?id=1114>. | |
618 | (("\"include/eigen3\"") | |
619 | "\"${CMAKE_INSTALL_PREFIX}/include/eigen3\""))))) | |
8f4b1dfb LC |
620 | (build-system cmake-build-system) |
621 | (arguments | |
622 | '(;; Turn off debugging symbols to save space. | |
623 | #:build-type "Release" | |
624 | ||
354f4fe2 | 625 | #:phases (modify-phases %standard-phases |
ef8742ea | 626 | (replace 'check |
354f4fe2 | 627 | (lambda _ |
354f4fe2 LC |
628 | (let* ((cores (parallel-job-count)) |
629 | (dash-j (format #f "-j~a" cores))) | |
ef8742ea LC |
630 | ;; First build the tests, in parallel. See |
631 | ;; <http://eigen.tuxfamily.org/index.php?title=Tests>. | |
632 | (and (zero? (system* "make" "buildtests" dash-j)) | |
8f4b1dfb | 633 | |
ef8742ea LC |
634 | ;; Then run 'CTest' with -V so we get more |
635 | ;; details upon failure. | |
636 | (zero? (system* "ctest" "-V" dash-j))))))))) | |
8f4b1dfb LC |
637 | (home-page "http://eigen.tuxfamily.org") |
638 | (synopsis "C++ template library for linear algebra") | |
639 | (description | |
640 | "Eigen is a C++ template library for linear algebra: matrices, vectors, | |
641 | numerical solvers, and related algorithms. It provides an elegant API based | |
642 | on \"expression templates\". It is versatile: it supports all matrix sizes, | |
643 | all standard numeric types, various matrix decompositions and geometry | |
644 | features, and more.") | |
645 | ||
646 | ;; Most of the code is MPLv2, with a few files under LGPLv2.1+ or BSD-3. | |
647 | ;; See 'COPYING.README' for details. | |
9f51293c | 648 | (license license:mpl2.0))) |