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