Commit | Line | Data |
---|---|---|
233e7676 | 1 | ;;; GNU Guix --- Functional package management for GNU |
eea7cd75 | 2 | ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018 Andreas Enge <andreas@enge.fr> |
4b0bf990 | 3 | ;;; Copyright © 2013, 2015, 2017, 2018 Ludovic Courtès <ludo@gnu.org> |
47fefe98 | 4 | ;;; Copyright © 2016, 2017, 2018 Nicolas Goaziou <mail@nicolasgoaziou.fr> |
69d5909e | 5 | ;;; Copyright © 2014, 2018 Mark H Weaver <mhw@netris.org> |
c8d99608 | 6 | ;;; Copyright © 2016, 2018 Ricardo Wurmus <rekado@elephly.net> |
ecc5bc33 | 7 | ;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il> |
a0d4d2d8 | 8 | ;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr> |
f71f29ca | 9 | ;;; Copyright © 2017 Marius Bakke <mbakke@fastmail.com> |
1137d85b | 10 | ;;; Copyright © 2017 Eric Bavier <bavier@member.fsf.org> |
2ed139c4 | 11 | ;;; |
233e7676 | 12 | ;;; This file is part of GNU Guix. |
2ed139c4 | 13 | ;;; |
233e7676 | 14 | ;;; GNU Guix is free software; you can redistribute it and/or modify it |
2ed139c4 AE |
15 | ;;; under the terms of the GNU General Public License as published by |
16 | ;;; the Free Software Foundation; either version 3 of the License, or (at | |
17 | ;;; your option) any later version. | |
18 | ;;; | |
233e7676 | 19 | ;;; GNU Guix is distributed in the hope that it will be useful, but |
2ed139c4 AE |
20 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of |
21 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
22 | ;;; GNU General Public License for more details. | |
23 | ;;; | |
24 | ;;; You should have received a copy of the GNU General Public License | |
233e7676 | 25 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. |
2ed139c4 | 26 | |
1ffa7090 | 27 | (define-module (gnu packages algebra) |
59a43334 | 28 | #:use-module (gnu packages) |
14e6520e | 29 | #:use-module (gnu packages autotools) |
70770b93 | 30 | #:use-module (gnu packages check) |
10b1f688 | 31 | #:use-module (gnu packages compression) |
70770b93 | 32 | #:use-module (gnu packages cpp) |
99828fa7 | 33 | #:use-module (gnu packages documentation) |
f71f29ca | 34 | #:use-module (gnu packages ed) |
5894b604 | 35 | #:use-module (gnu packages flex) |
57497c57 NG |
36 | #:use-module (gnu packages fltk) |
37 | #:use-module (gnu packages gl) | |
aae03c48 | 38 | #:use-module (gnu packages graphviz) |
57497c57 | 39 | #:use-module (gnu packages image) |
c8d99608 | 40 | #:use-module (gnu packages java) |
aae03c48 | 41 | #:use-module (gnu packages maths) |
0fc54d4b | 42 | #:use-module (gnu packages mpi) |
5894b604 | 43 | #:use-module (gnu packages multiprecision) |
1ffa7090 | 44 | #:use-module (gnu packages perl) |
aae03c48 | 45 | #:use-module (gnu packages python) |
5894b604 | 46 | #:use-module (gnu packages readline) |
b7194849 | 47 | #:use-module (gnu packages shells) |
8f9ac901 | 48 | #:use-module (gnu packages tex) |
f71f29ca | 49 | #:use-module (gnu packages texinfo) |
57497c57 | 50 | #:use-module (gnu packages xiph) |
fb8d1be8 | 51 | #:use-module (gnu packages xorg) |
c8d99608 | 52 | #:use-module (guix build-system ant) |
7569c5cb | 53 | #:use-module (guix build-system gnu) |
8f4b1dfb | 54 | #:use-module (guix build-system cmake) |
5894b604 | 55 | #:use-module (guix download) |
c8d99608 | 56 | #:use-module (guix git-download) |
5894b604 TGR |
57 | #:use-module ((guix licenses) #:prefix license:) |
58 | #:use-module (guix packages) | |
7569c5cb | 59 | #:use-module (guix utils)) |
2ed139c4 AE |
60 | |
61 | ||
62 | (define-public mpfrcx | |
63 | (package | |
64 | (name "mpfrcx") | |
43a776e2 | 65 | (version "0.5") |
2ed139c4 AE |
66 | (source (origin |
67 | (method url-fetch) | |
68 | (uri (string-append | |
43a776e2 | 69 | "http://www.multiprecision.org/downloads/mpfrcx-" |
2ed139c4 AE |
70 | version ".tar.gz")) |
71 | (sha256 | |
72 | (base32 | |
43a776e2 | 73 | "1s968480ymv6w0rnvfp9mxvx98hvi29fkvw8nk4ggzc6azxgwybs")))) |
2ed139c4 | 74 | (build-system gnu-build-system) |
878c8f3f AE |
75 | (propagated-inputs |
76 | `(("gmp" ,gmp) | |
77 | ("mpfr" ,mpfr) | |
78 | ("mpc" ,mpc))) ; Header files are included by mpfrcx.h. | |
35b9e423 | 79 | (synopsis "Arithmetic of polynomials over arbitrary precision numbers") |
2ed139c4 | 80 | (description |
35b9e423 | 81 | "Mpfrcx is a library for the arithmetic of univariate polynomials over |
2ed139c4 | 82 | arbitrary precision real (mpfr) or complex (mpc) numbers, without control |
35b9e423 | 83 | on the rounding. For the time being, only the few functions needed to |
2ed139c4 | 84 | implement the floating point approach to complex multiplication are |
35b9e423 | 85 | implemented. On the other hand, these comprise asymptotically fast |
e881752c | 86 | multiplication routines such as Toom–Cook and the FFT.") |
43a776e2 | 87 | (license license:lgpl3+) |
2ed139c4 AE |
88 | (home-page "http://mpfrcx.multiprecision.org/"))) |
89 | ||
10b1f688 AE |
90 | (define-public cm |
91 | (package | |
92 | (name "cm") | |
81b55bf7 | 93 | (version "0.3") |
10b1f688 AE |
94 | (source (origin |
95 | (method url-fetch) | |
96 | (uri (string-append | |
97 | "http://www.multiprecision.org/cm/download/cm-" | |
98 | version ".tar.gz")) | |
99 | (sha256 | |
100 | (base32 | |
81b55bf7 | 101 | "1nf5kr0nqmhbzrsrinky18z0ighjpsmb5cr8zyg8jf04bfbyrfmc")))) |
10b1f688 AE |
102 | (build-system gnu-build-system) |
103 | (propagated-inputs | |
104 | `(("mpfrcx" ,mpfrcx) | |
105 | ("zlib" ,zlib))) ; Header files included from cm_common.h. | |
106 | (inputs | |
107 | `(("pari-gp" ,pari-gp))) | |
108 | (synopsis "CM constructions for elliptic curves") | |
109 | (description | |
110 | "The CM software implements the construction of ring class fields of | |
111 | imaginary quadratic number fields and of elliptic curves with complex | |
112 | multiplication via floating point approximations. It consists of libraries | |
113 | that can be called from within a C program and of executable command | |
114 | line applications.") | |
81b55bf7 | 115 | (license license:gpl3+) |
10b1f688 AE |
116 | (home-page "http://cm.multiprecision.org/"))) |
117 | ||
2ed139c4 AE |
118 | (define-public fplll |
119 | (package | |
120 | (name "fplll") | |
5a15ed50 | 121 | (version "4.0.4") |
2ed139c4 AE |
122 | (source (origin |
123 | (method url-fetch) | |
124 | (uri (string-append | |
125 | "http://perso.ens-lyon.fr/damien.stehle/fplll/libfplll-" | |
126 | version ".tar.gz")) | |
127 | (sha256 (base32 | |
5a15ed50 | 128 | "1cbiby7ykis4z84swclpysrljmqhfcllpkcbll1m08rzskgb1a6b")))) |
2ed139c4 AE |
129 | (build-system gnu-build-system) |
130 | (inputs `(("gmp" ,gmp) | |
131 | ("mpfr" ,mpfr))) | |
35b9e423 | 132 | (synopsis "Library for LLL-reduction of euclidean lattices") |
2ed139c4 | 133 | (description |
35b9e423 | 134 | "fplll LLL-reduces euclidean lattices. Since version 3, it can also |
2ed139c4 | 135 | solve the shortest vector problem.") |
9f51293c | 136 | (license license:lgpl2.1+) |
2ed139c4 | 137 | (home-page "http://perso.ens-lyon.fr/damien.stehle/fplll/"))) |
4e6b699d | 138 | |
90a6d47c AE |
139 | (define-public pari-gp |
140 | (package | |
141 | (name "pari-gp") | |
03d5f73e | 142 | (version "2.11.0") |
90a6d47c AE |
143 | (source (origin |
144 | (method url-fetch) | |
145 | (uri (string-append | |
eeb8b0e6 | 146 | "https://pari.math.u-bordeaux.fr/pub/pari/unix/pari-" |
90a6d47c | 147 | version ".tar.gz")) |
f78c66aa AE |
148 | (sha256 |
149 | (base32 | |
03d5f73e | 150 | "18f9yj8ffn3dxignbxj1x36771zbxy4js0r18mv6831ymb6cld9q")))) |
90a6d47c | 151 | (build-system gnu-build-system) |
a8b0948b | 152 | (native-inputs `(("texlive" ,texlive-tiny))) |
90a6d47c | 153 | (inputs `(("gmp" ,gmp) |
fb8d1be8 | 154 | ("libx11" ,libx11) |
90a6d47c AE |
155 | ("perl" ,perl) |
156 | ("readline" ,readline))) | |
157 | (arguments | |
9bd9486d | 158 | '(#:make-flags '("all") |
12abb19d | 159 | #:test-target "dobench" |
08595262 AE |
160 | #:phases (modify-phases %standard-phases |
161 | (replace 'configure | |
162 | (lambda* (#:key outputs #:allow-other-keys) | |
163 | (let ((out (assoc-ref outputs "out"))) | |
164 | (zero? | |
165 | (system* "./Configure" | |
166 | (string-append "--prefix=" out))))))))) | |
90a6d47c AE |
167 | (synopsis "PARI/GP, a computer algebra system for number theory") |
168 | (description | |
169 | "PARI/GP is a widely used computer algebra system designed for fast | |
170 | computations in number theory (factorisations, algebraic number theory, | |
171 | elliptic curves...), but it also contains a large number of other useful | |
172 | functions to compute with mathematical entities such as matrices, | |
173 | polynomials, power series, algebraic numbers, etc., and a lot of | |
174 | transcendental functions. | |
175 | PARI is also available as a C library to allow for faster computations.") | |
9f51293c | 176 | (license license:gpl2+) |
eeb8b0e6 | 177 | (home-page "https://pari.math.u-bordeaux.fr/"))) |
ed9f9a77 | 178 | |
f854a8c1 AE |
179 | (define-public gp2c |
180 | (package | |
181 | (name "gp2c") | |
44ff80fc | 182 | (version "0.0.11pl1") |
f854a8c1 AE |
183 | (source (origin |
184 | (method url-fetch) | |
185 | (uri (string-append | |
eeb8b0e6 | 186 | "https://pari.math.u-bordeaux.fr/pub/pari/GP2C/gp2c-" |
f854a8c1 | 187 | version ".tar.gz")) |
324bdcd8 AE |
188 | (sha256 |
189 | (base32 | |
44ff80fc | 190 | "1c6f6vmncw032kfzrfyr8bynw6yd3faxpy2285r009fmr0zxfs5s")))) |
f854a8c1 | 191 | (build-system gnu-build-system) |
c67ccedd | 192 | (native-inputs `(("perl" ,perl))) |
f854a8c1 AE |
193 | (inputs `(("pari-gp" ,pari-gp))) |
194 | (arguments | |
195 | '(#:configure-flags | |
196 | (list (string-append "--with-paricfg=" | |
197 | (assoc-ref %build-inputs "pari-gp") | |
198 | "/lib/pari/pari.cfg")))) | |
199 | (synopsis "PARI/GP, a computer algebra system for number theory") | |
200 | (description | |
201 | "PARI/GP is a widely used computer algebra system designed for fast | |
202 | computations in number theory (factorisations, algebraic number theory, | |
203 | elliptic curves...), but it also contains a large number of other useful | |
204 | functions to compute with mathematical entities such as matrices, | |
205 | polynomials, power series, algebraic numbers, etc., and a lot of | |
206 | transcendental functions. | |
207 | PARI is also available as a C library to allow for faster computations. | |
208 | ||
209 | GP2C, the GP to C compiler, translates GP scripts to PARI programs.") | |
9f51293c | 210 | (license license:gpl2) |
eeb8b0e6 | 211 | (home-page "https://pari.math.u-bordeaux.fr/"))) |
f854a8c1 | 212 | |
eea7cd75 AE |
213 | (define-public cmh |
214 | (package | |
215 | (name "cmh") | |
216 | (version "1.0") | |
217 | (source (origin | |
218 | (method url-fetch) | |
219 | (uri (string-append | |
220 | "https://gforge.inria.fr/frs/download.php/33497/cmh-" | |
221 | version ".tar.gz")) | |
222 | (sha256 | |
223 | (base32 | |
224 | "1a28xr9bs0igms0ik99x0w8lnb0jyfcmvyi26pbyh9ggcdivd33p")))) | |
225 | (build-system gnu-build-system) | |
226 | (inputs | |
227 | `(("gmp" ,gmp) | |
228 | ("mpfr" ,mpfr) | |
229 | ("mpc" ,mpc) | |
230 | ("mpfrcx" ,mpfrcx) | |
231 | ("fplll" ,fplll) | |
232 | ("pari-gp" ,pari-gp))) | |
233 | (synopsis "Igusa class polynomial computations") | |
234 | (description | |
235 | "The CMH software computes Igusa (genus 2) class polynomials, which | |
236 | parameterize the CM points in the moduli space of 2-dimensional abelian | |
237 | varieties, i.e. Jacobians of hyperelliptic curves. | |
238 | It can also be used to compute theta constants at arbitrary | |
239 | precision.") | |
240 | (license license:gpl3+) | |
241 | (home-page "http://cmh.gforge.inria.fr/"))) | |
242 | ||
57497c57 NG |
243 | (define-public giac-xcas |
244 | (package | |
245 | (name "giac-xcas") | |
90d5ec55 | 246 | (version "1.5.0-19") |
57497c57 NG |
247 | (source (origin |
248 | (method url-fetch) | |
249 | ;; "~parisse/giac" is not used because the maintainer regularly | |
250 | ;; overwrites the release tarball there, introducing a checksum | |
251 | ;; mismatch every time. See | |
252 | ;; <https://www-fourier.ujf-grenoble.fr/~parisse/debian/dists/stable/main/source/README> | |
253 | (uri (string-append "https://www-fourier.ujf-grenoble.fr/" | |
254 | "~parisse/debian/dists/stable/main/" | |
255 | "source/giac_" version ".tar.gz")) | |
256 | (sha256 | |
257 | (base32 | |
90d5ec55 | 258 | "0ds1zh712sr20qh0fih8jnm4nlv90andllp8n263qs7rlhblz551")))) |
57497c57 | 259 | (build-system gnu-build-system) |
af90cc45 | 260 | (outputs '("out" "doc")) ;77MiB of documentation |
57497c57 | 261 | (arguments |
af90cc45 NG |
262 | `(#:modules ((ice-9 ftw) |
263 | (guix build utils) | |
264 | (guix build gnu-build-system)) | |
265 | #:phases | |
57497c57 NG |
266 | (modify-phases %standard-phases |
267 | (add-after 'unpack 'patch-bin-cp | |
90d5ec55 | 268 | ;; Some Makefiles contain hard-coded "/bin/cp". |
57497c57 | 269 | (lambda _ |
57497c57 NG |
270 | (substitute* (find-files "doc" "^Makefile") |
271 | (("/bin/cp") (which "cp"))) | |
90d5ec55 NG |
272 | #t)) |
273 | (add-after 'unpack 'disable-failing-test | |
274 | ;; FIXME: Test failing. Not sure why. | |
275 | (lambda _ | |
276 | (substitute* "check/Makefile.in" | |
277 | (("chk_fhan11") "")) | |
af90cc45 NG |
278 | #t)) |
279 | (add-after 'install 'install-doc | |
280 | ;; Setting --docdir to "doc" output isn't sufficient as | |
281 | ;; documentation and examples are scattered throughout the source. | |
282 | (lambda* (#:key outputs #:allow-other-keys) | |
283 | (let* ((out (assoc-ref outputs "out")) | |
284 | (doc (assoc-ref outputs "doc")) | |
285 | (docdir (string-append doc | |
286 | "/share/doc/" | |
287 | (string-append ,name "-" ,version)))) | |
288 | ;; For some reason, the install process moves | |
289 | ;; "share/giac/examples" instead of "share/giac/doc" to | |
290 | ;; "$(docdir)". Clean up the mess and start over. | |
291 | (delete-file-recursively (string-append doc "/share")) | |
292 | (mkdir-p docdir) | |
293 | (with-directory-excursion out | |
294 | (for-each (lambda (f) | |
295 | (unless (member f '("." "..")) | |
296 | (copy-recursively (string-append "share/giac/" f) | |
297 | (string-append docdir "/" f)))) | |
298 | (scandir "share/giac")) | |
299 | (delete-file-recursively "share/giac"))) | |
57497c57 NG |
300 | #t))))) |
301 | (inputs | |
302 | `(("fltk" ,fltk) | |
303 | ("gmp" ,gmp) | |
304 | ("gsl" ,gsl) | |
305 | ("lapack" ,lapack) | |
306 | ("libao" ,ao) | |
307 | ("libjpeg" ,libjpeg) | |
308 | ("libpng" ,libpng) | |
309 | ("libx11" ,libx11) | |
99a00446 | 310 | ("libxinerama" ,libxinerama) |
57497c57 NG |
311 | ("libxft" ,libxft) |
312 | ("libxt" ,libxt) | |
313 | ("mesa" ,mesa) | |
314 | ("mpfi" ,mpfi) | |
315 | ("mpfr" ,mpfr) | |
316 | ("ntl" ,ntl) | |
317 | ("perl" ,perl) | |
318 | ("pari-gp" ,pari-gp) | |
319 | ("tcsh" ,tcsh) | |
a023ec6e | 320 | ("texlive" ,texlive-tiny))) |
57497c57 NG |
321 | (native-inputs `(("readline" ,readline))) |
322 | (home-page "https://www-fourier.ujf-grenoble.fr/~parisse/giac.html") | |
323 | (synopsis "Computer algebra system") | |
324 | (description | |
325 | "Giac/Xcas is a computer algebra system. It has a compatibility mode for | |
326 | maple, mupad and the TI89. It is available as a standalone program (graphic | |
327 | or text interfaces) or as a C++ library.") | |
328 | (license license:gpl3+))) | |
329 | ||
d7ab698a AE |
330 | (define-public flint |
331 | (package | |
332 | (name "flint") | |
6c591c8e | 333 | (version "2.5.2") |
d7ab698a AE |
334 | (source (origin |
335 | (method url-fetch) | |
336 | (uri (string-append | |
337 | "http://flintlib.org/flint-" | |
338 | version ".tar.gz")) | |
339 | (sha256 (base32 | |
6c591c8e | 340 | "11syazv1a8rrnac3wj3hnyhhflpqcmq02q8pqk2m6g2k6h0gxwfb")) |
fc1adab1 | 341 | (patches (search-patches "flint-ldconfig.patch")))) |
d7ab698a | 342 | (build-system gnu-build-system) |
df15d17d | 343 | (propagated-inputs |
d7ab698a | 344 | `(("gmp" ,gmp) |
df15d17d | 345 | ("mpfr" ,mpfr))) ; header files from both are included by flint/arith.h |
d7ab698a | 346 | (arguments |
ad11974e AE |
347 | `(#:parallel-tests? #f ; seems to be necessary on arm |
348 | #:phases | |
91430de6 AE |
349 | (modify-phases %standard-phases |
350 | (replace 'configure | |
351 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
352 | (let ((out (assoc-ref outputs "out")) | |
353 | (gmp (assoc-ref inputs "gmp")) | |
354 | (mpfr (assoc-ref inputs "mpfr"))) | |
91430de6 AE |
355 | ;; do not pass "--enable-fast-install", which makes the |
356 | ;; homebrew configure process fail | |
357 | (zero? (system* | |
358 | "./configure" | |
359 | (string-append "--prefix=" out) | |
360 | (string-append "--with-gmp=" gmp) | |
361 | (string-append "--with-mpfr=" mpfr))))))))) | |
d7ab698a AE |
362 | (synopsis "Fast library for number theory") |
363 | (description | |
364 | "FLINT is a C library for number theory. It supports arithmetic | |
365 | with numbers, polynomials, power series and matrices over many base | |
366 | rings, including multiprecision integers and rationals, integers | |
367 | modulo n, p-adic numbers, finite fields (prime and non-prime order) | |
368 | and real and complex numbers (via the Arb extension library). | |
369 | ||
370 | Operations that can be performed include conversions, arithmetic, | |
371 | GCDs, factoring, solving linear systems, and evaluating special | |
372 | functions. In addition, FLINT provides various low-level routines for | |
373 | fast arithmetic.") | |
9f51293c | 374 | (license license:gpl2+) |
d7ab698a AE |
375 | (home-page "http://flintlib.org/"))) |
376 | ||
6b8e8285 AE |
377 | (define-public arb |
378 | (package | |
379 | (name "arb") | |
2cdb257e | 380 | (version "2.14.0") |
6b8e8285 AE |
381 | (source (origin |
382 | (method url-fetch) | |
383 | (uri (string-append | |
384 | "https://github.com/fredrik-johansson/arb/archive/" | |
385 | version ".tar.gz")) | |
f586c877 | 386 | (file-name (string-append name "-" version ".tar.gz")) |
424ce93d AE |
387 | (sha256 |
388 | (base32 | |
2cdb257e | 389 | "0ncr27nd20xxi18nj30cvpa6r52v59nq7gbi34x3l4xym3p8mlmx")))) |
6b8e8285 | 390 | (build-system gnu-build-system) |
480d19e6 AE |
391 | (propagated-inputs |
392 | `(("flint" ,flint))) ; flint.h is included by arf.h | |
6b8e8285 | 393 | (inputs |
480d19e6 | 394 | `(("gmp" ,gmp) |
6b8e8285 AE |
395 | ("mpfr" ,mpfr))) |
396 | (arguments | |
397 | `(#:phases | |
dc1d3cde KK |
398 | (modify-phases %standard-phases |
399 | (replace 'configure | |
400 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
401 | (let ((out (assoc-ref outputs "out")) | |
402 | (flint (assoc-ref inputs "flint")) | |
403 | (gmp (assoc-ref inputs "gmp")) | |
404 | (mpfr (assoc-ref inputs "mpfr"))) | |
405 | ;; do not pass "--enable-fast-install", which makes the | |
406 | ;; homebrew configure process fail | |
2cdb257e | 407 | (invoke "./configure" |
dc1d3cde KK |
408 | (string-append "--prefix=" out) |
409 | (string-append "--with-flint=" flint) | |
410 | (string-append "--with-gmp=" gmp) | |
2cdb257e | 411 | (string-append "--with-mpfr=" mpfr)))))))) |
6b8e8285 AE |
412 | (synopsis "Arbitrary precision floating-point ball arithmetic") |
413 | (description | |
414 | "Arb is a C library for arbitrary-precision floating-point ball | |
415 | arithmetic. It supports efficient high-precision computation with | |
416 | polynomials, power series, matrices and special functions over the | |
417 | real and complex numbers, with automatic, rigorous error control.") | |
2cdb257e | 418 | (license license:lgpl2.1+) |
6b8e8285 AE |
419 | (home-page "http://fredrikj.net/arb/"))) |
420 | ||
14e6520e AE |
421 | (define-public ntl |
422 | (package | |
423 | (name "ntl") | |
424 | (version "9.7.0") | |
425 | (source (origin | |
426 | (method url-fetch) | |
427 | (uri (string-append "http://shoup.net/ntl/ntl-" | |
428 | version ".tar.gz")) | |
429 | (sha256 (base32 | |
430 | "115frp5flyvw9wghz4zph1b3llmr5nbxk1skgsggckr81fh3gmxq")))) | |
431 | (build-system gnu-build-system) | |
432 | (native-inputs | |
433 | `(("libtool" ,libtool) | |
434 | ("perl" ,perl))) ; for configuration | |
435 | ;; FIXME: Add optional input gf2x once available; then also add | |
436 | ;; configure flag "NTL_GF2X_LIB=on". | |
437 | (inputs | |
438 | `(("gmp" ,gmp))) | |
439 | (arguments | |
440 | `(#:phases | |
441 | (modify-phases %standard-phases | |
442 | (replace 'configure | |
443 | (lambda* (#:key outputs #:allow-other-keys) | |
444 | (chdir "src") | |
445 | (system* "./configure" | |
446 | (string-append "PREFIX=" (assoc-ref outputs "out")) | |
447 | ;; Do not build especially for the build machine. | |
448 | "NATIVE=off" | |
449 | ;; Also do not tune to the build machine. | |
450 | "WIZARD=off" | |
451 | "SHARED=on") | |
452 | #t))))) | |
453 | (synopsis "C++ library for number theory") | |
454 | (description | |
455 | "NTL is a C++ library providing data structures and algorithms | |
456 | for manipulating signed, arbitrary length integers, and for vectors, | |
457 | matrices, and polynomials over the integers and over finite fields.") | |
458 | (license license:gpl2+) | |
459 | (home-page "http://shoup.net/ntl/"))) | |
460 | ||
aae03c48 AE |
461 | (define-public singular |
462 | (package | |
463 | (name "singular") | |
f35c3bbb KK |
464 | (version "4.1.1p3") |
465 | (source | |
466 | (origin | |
467 | (method url-fetch) | |
468 | (uri | |
469 | (string-append "http://www.mathematik.uni-kl.de/ftp/pub/Math/" | |
470 | "Singular/SOURCES/" | |
471 | (string-join | |
472 | (string-split | |
473 | (string-trim-right version #\p | |
474 | 0 (1- (string-length version))) | |
475 | #\.) "-") | |
476 | "/singular-" version ".tar.gz")) | |
477 | (sha256 (base32 | |
478 | "1qqj9bm9pkzm0iyycpvm8x6s79wws3nq60lz25h8x1q61h3426sm")))) | |
aae03c48 AE |
479 | (build-system gnu-build-system) |
480 | (native-inputs | |
481 | `(("doxygen" ,doxygen) | |
482 | ("graphviz" ,graphviz) | |
483 | ("perl" ,perl))) | |
484 | (inputs | |
485 | `(("cddlib" ,cddlib) | |
486 | ("gmp" ,gmp) | |
487 | ("flint" ,flint) | |
488 | ("mpfr" ,mpfr) | |
489 | ("ntl" ,ntl) | |
490 | ("python" ,python-2) | |
491 | ("readline" ,readline))) | |
492 | (arguments | |
493 | `(#:configure-flags | |
494 | (list (string-append "--with-ntl=" | |
495 | (assoc-ref %build-inputs "ntl"))))) | |
496 | (synopsis "Computer algebra system for polynomial computations") | |
497 | (description | |
498 | "Singular is a computer algebra system for polynomial computations, | |
499 | with special emphasis on commutative and non-commutative algebra, algebraic | |
500 | geometry and singularity theory.") | |
501 | ;; Singular itself is dual licensed gpl2 or gpl3, but some of the | |
502 | ;; libraries with which it links are licensed under lgpl3+, so the | |
503 | ;; combined work becomes gpl3. See COPYING in the source code. | |
504 | (license license:gpl3) | |
505 | (home-page "http://www.singular.uni-kl.de/index.php"))) | |
506 | ||
57c9c349 AE |
507 | (define-public gmp-ecm |
508 | (package | |
509 | (name "gmp-ecm") | |
7d15cf17 | 510 | (version "7.0.4") |
57c9c349 | 511 | (source (origin |
7d15cf17 TGR |
512 | (method url-fetch) |
513 | ;; Use the ‘Latest version’ link for a stable URI across releases. | |
514 | (uri (string-append "https://gforge.inria.fr/frs/download.php/" | |
515 | "latestfile/160/ecm-" version ".tar.gz")) | |
516 | (sha256 (base32 | |
517 | "0hxs24c2m3mh0nq1zz63z3sb7dhy1rilg2s1igwwcb26x3pb7xqc")))) | |
57c9c349 AE |
518 | (build-system gnu-build-system) |
519 | (inputs | |
520 | `(("gmp" ,gmp))) | |
521 | (arguments | |
522 | `(#:configure-flags '("--enable-shared" | |
523 | ;; Disable specific assembly routines, which depend | |
524 | ;; on the subarchitecture of the build machine, | |
525 | ;; and use gmp instead. | |
526 | "--disable-asm-redc"))) | |
527 | (synopsis "Integer factorization library using the elliptic curve method") | |
528 | (description | |
529 | "GMP-ECM factors integers using the elliptic curve method (ECM) as well | |
530 | as the P-1 and P+1 algorithms. It provides a library and a stand-alone | |
531 | binary.") | |
532 | ;; Most files are under lgpl3+, but some are under gpl3+ or gpl2+, | |
533 | ;; so the combined work is under gpl3+. | |
534 | (license license:gpl3+) | |
535 | (home-page "http://ecm.gforge.inria.fr/"))) | |
536 | ||
ed9f9a77 LC |
537 | (define-public bc |
538 | (package | |
539 | (name "bc") | |
f71f29ca | 540 | (version "1.07.1") |
ed9f9a77 LC |
541 | (source (origin |
542 | (method url-fetch) | |
543 | (uri (string-append "mirror://gnu/bc/bc-" version ".tar.gz")) | |
544 | (sha256 | |
545 | (base32 | |
f71f29ca | 546 | "0amh9ik44jfg66csyvf4zz1l878c4755kjndq9j0270akflgrbb2")))) |
ed9f9a77 | 547 | (build-system gnu-build-system) |
f71f29ca MB |
548 | (native-inputs |
549 | `(("ed" ,ed) | |
550 | ("flex" ,flex) | |
551 | ("texinfo" ,texinfo))) | |
ed9f9a77 | 552 | (arguments |
f71f29ca | 553 | '(#:configure-flags |
f0bacad6 | 554 | (list "--with-readline"))) |
6fd52309 | 555 | (home-page "https://www.gnu.org/software/bc/") |
f50d2669 | 556 | (synopsis "Arbitrary precision numeric processing language") |
ed9f9a77 | 557 | (description |
a22dc0c4 LC |
558 | "bc is an arbitrary precision numeric processing language. It includes |
559 | an interactive environment for evaluating mathematical statements. Its | |
560 | syntax is similar to that of C, so basic usage is familiar. It also includes | |
561 | \"dc\", a reverse-polish calculator.") | |
9f51293c | 562 | (license license:gpl2+))) |
37e6cdcd | 563 | |
2a9b10c7 RW |
564 | ;; The original kiss-fft does not have a complete build system and does not |
565 | ;; build any shared libraries. This is a fork used by Extempore. | |
566 | (define-public kiss-fft-for-extempore | |
567 | (package | |
568 | (name "kiss-fft-for-extempore") | |
569 | (version "1.3.0") | |
570 | (source (origin | |
571 | (method url-fetch) | |
572 | (uri (string-append "https://github.com/extemporelang/kiss_fft/archive/" | |
573 | version ".tar.gz")) | |
574 | (file-name (string-append name "-" version ".tar.gz")) | |
575 | (sha256 | |
576 | (base32 | |
577 | "0hkp9l6l4c92fb1l2sh6a6zv1hynpvb2s4d03vd8vxyvybc0l4pv")))) | |
578 | (build-system cmake-build-system) | |
579 | (arguments `(#:tests? #f)) ; no tests included | |
39162ee4 RW |
580 | ;; Extempore refuses to build on architectures other than x86_64 |
581 | (supported-systems '("x86_64-linux")) | |
2a9b10c7 RW |
582 | (home-page "https://github.com/extemporelang/kiss_fft") |
583 | (synopsis "Mixed-radix Fast Fourier Transform") | |
584 | (description | |
585 | "Kiss FFT attempts to be a reasonably efficient, moderately useful FFT | |
586 | that can use fixed or floating data types and can easily be incorporated into | |
587 | a C program.") | |
588 | (license license:bsd-3))) | |
589 | ||
37e6cdcd LC |
590 | (define-public fftw |
591 | (package | |
592 | (name "fftw") | |
a0d4d2d8 | 593 | (version "3.3.7") |
37e6cdcd LC |
594 | (source (origin |
595 | (method url-fetch) | |
596 | (uri (string-append "ftp://ftp.fftw.org/pub/fftw/fftw-" | |
597 | version".tar.gz")) | |
598 | (sha256 | |
599 | (base32 | |
a0d4d2d8 | 600 | "0wsms8narnbhfsa8chdflv2j9hzspvflblnqdn7hw8x5xdzrnq1v")))) |
37e6cdcd LC |
601 | (build-system gnu-build-system) |
602 | (arguments | |
65bb2279 | 603 | `(#:configure-flags |
69d5909e MW |
604 | '("--enable-shared" "--enable-openmp" "--enable-threads" |
605 | ,@(let ((system (or (%current-target-system) (%current-system)))) | |
606 | ;; Enable SIMD extensions for codelets. See details at: | |
607 | ;; <http://fftw.org/fftw3_doc/Installation-on-Unix.html>. | |
608 | (cond | |
609 | ((string-prefix? "x86_64" system) | |
610 | '("--enable-sse2" "--enable-avx" "--enable-avx2" | |
611 | "--enable-avx512" "--enable-avx-128-fma")) | |
612 | ((string-prefix? "i686" system) | |
613 | '("--enable-sse2")) | |
614 | ((string-prefix? "aarch64" system) | |
615 | ;; Note that fftw supports NEON on 32-bit ARM only when | |
616 | ;; compiled for single-precision. | |
617 | '("--enable-neon")) | |
618 | (else | |
619 | '()))) | |
65bb2279 EB |
620 | ;; By default '-mtune=native' is used. However, that may cause the |
621 | ;; use of ISA extensions (e.g. AVX) that are not necessarily | |
622 | ;; available on the user's machine when that package is built on a | |
623 | ;; different machine. | |
624 | "ax_cv_c_flags__mtune_native=no"))) | |
37e6cdcd LC |
625 | (native-inputs `(("perl" ,perl))) |
626 | (home-page "http://fftw.org") | |
627 | (synopsis "Computing the discrete Fourier transform") | |
628 | (description | |
629 | "FFTW is a C subroutine library for computing the discrete Fourier | |
630 | transform (DFT) in one or more dimensions, of arbitrary input size, and of | |
631 | both real and complex data (as well as of even/odd data---i.e. the discrete | |
632 | cosine/ sine transforms or DCT/DST).") | |
9f51293c | 633 | (license license:gpl2+))) |
7569c5cb EB |
634 | |
635 | (define-public fftwf | |
636 | (package (inherit fftw) | |
637 | (name "fftwf") | |
638 | (arguments | |
639 | (substitute-keyword-arguments (package-arguments fftw) | |
69d5909e MW |
640 | ((#:configure-flags fftw-configure-flags) |
641 | `(cons* "--enable-single" | |
642 | ,@(if (string-prefix? "arm" (or (%current-target-system) | |
643 | (%current-system))) | |
644 | ;; fftw supports NEON on 32-bit ARM only when compiled | |
645 | ;; for single-precision, so add it here. | |
646 | '("--enable-neon") | |
647 | '()) | |
648 | ,fftw-configure-flags)))) | |
7569c5cb EB |
649 | (description |
650 | (string-append (package-description fftw) | |
651 | " Single-precision version.")))) | |
e5c66f8c EB |
652 | |
653 | (define-public fftw-openmpi | |
654 | (package (inherit fftw) | |
655 | (name "fftw-openmpi") | |
656 | (inputs | |
657 | `(("openmpi" ,openmpi) | |
658 | ,@(package-inputs fftw))) | |
659 | (arguments | |
660 | (substitute-keyword-arguments (package-arguments fftw) | |
661 | ((#:configure-flags cf) | |
662 | `(cons "--enable-mpi" ,cf)))) | |
663 | (description | |
664 | (string-append (package-description fftw) | |
665 | " With OpenMPI parallelism support.")))) | |
8f4b1dfb | 666 | |
c8d99608 RW |
667 | (define-public java-la4j |
668 | (package | |
669 | (name "java-la4j") | |
670 | (version "0.6.0") | |
671 | (source (origin | |
672 | (method git-fetch) | |
673 | (uri (git-reference | |
674 | (url "https://github.com/vkostyukov/la4j.git") | |
675 | (commit version))) | |
676 | (file-name (string-append name "-" version "-checkout")) | |
677 | (sha256 | |
678 | (base32 | |
679 | "1qir8dr978cfvz9k12m2kbdwpyf6cqdf1d0ilb7lnkhbgq5i53w3")))) | |
680 | (build-system ant-build-system) | |
681 | (arguments | |
682 | `(#:jar-name "la4j.jar" | |
683 | #:jdk ,icedtea-8 | |
684 | #:test-exclude (list "**/Abstract*.java" | |
685 | "**/MatrixTest.java" | |
686 | "**/DenseMatrixTest.java" | |
687 | "**/SparseMatrixTest.java" | |
688 | "**/VectorTest.java" | |
689 | "**/SparseVectorTest.java" | |
690 | "**/DenseVectorTest.java"))) | |
691 | (native-inputs | |
692 | `(("java-junit" ,java-junit) | |
693 | ("java-hamcrest-core" ,java-hamcrest-core))) | |
694 | (home-page "http://la4j.org/") | |
695 | (synopsis "Java library that provides Linear Algebra primitives and algorithms") | |
696 | (description "The la4j library is a Java library that provides Linear | |
697 | Algebra primitives (matrices and vectors) and algorithms. The key features of | |
698 | the la4j library are: | |
699 | ||
700 | @itemize | |
701 | @item No dependencies and tiny size | |
702 | @item Fluent object-oriented/functional API | |
703 | @item Sparse (CRS, CCS) and dense (1D/2D arrays) matrices | |
704 | @item Linear systems solving (Gaussian, Jacobi, Zeidel, Square Root, Sweep and other) | |
705 | @item Matrices decomposition (Eigenvalues/Eigenvectors, SVD, QR, LU, Cholesky and other) | |
706 | @item MatrixMarket/CSV IO formats support for matrices and vectors | |
707 | @end itemize\n") | |
708 | (license license:asl2.0))) | |
709 | ||
24074b0b RW |
710 | (define-public java-jlargearrays |
711 | (package | |
712 | (name "java-jlargearrays") | |
713 | (version "1.6") | |
714 | (source (origin | |
715 | (method url-fetch) | |
716 | (uri (string-append "http://search.maven.org/remotecontent?" | |
717 | "filepath=pl/edu/icm/JLargeArrays/" | |
718 | version "/JLargeArrays-" version | |
719 | "-sources.jar")) | |
720 | (file-name (string-append name "-" version ".jar")) | |
721 | (sha256 | |
722 | (base32 | |
723 | "0v05iphpxbjnd7f4jf1rlqq3m8hslhcm0imdbsgxr20pi3xkaf2a")))) | |
724 | (build-system ant-build-system) | |
725 | (arguments | |
726 | `(#:jar-name "jlargearrays.jar" | |
727 | #:tests? #f ; tests are not included in the release archive | |
728 | #:jdk ,icedtea-8)) | |
729 | (propagated-inputs | |
730 | `(("java-commons-math3" ,java-commons-math3))) | |
731 | (home-page "https://gitlab.com/ICM-VisLab/JLargeArrays") | |
732 | (synopsis "Library of one-dimensional arrays that can store up to 263 elements") | |
733 | (description "JLargeArrays is a Java library of one-dimensional arrays | |
734 | that can store up to 263 elements.") | |
735 | (license license:bsd-2))) | |
736 | ||
4e92911c RW |
737 | (define-public java-jtransforms |
738 | (package | |
739 | (name "java-jtransforms") | |
740 | (version "3.1") | |
741 | (source (origin | |
742 | (method url-fetch) | |
743 | (uri (string-append "http://search.maven.org/remotecontent?" | |
744 | "filepath=com/github/wendykierp/JTransforms/" | |
745 | version "/JTransforms-" version "-sources.jar")) | |
746 | (sha256 | |
747 | (base32 | |
748 | "1haw5m8shv5srgcpwkl853dz8bv6h90bzlhcps6mdpb4cixjirsg")))) | |
749 | (build-system ant-build-system) | |
750 | (arguments | |
751 | `(#:jar-name "jtransforms.jar" | |
752 | #:tests? #f ; tests are not included in the release archive | |
753 | #:jdk ,icedtea-8)) | |
754 | (propagated-inputs | |
755 | `(("java-commons-math3" ,java-commons-math3) | |
756 | ("java-jlargearrays" ,java-jlargearrays))) | |
757 | (home-page "https://github.com/wendykierp/JTransforms") | |
758 | (synopsis "Multithreaded FFT library written in pure Java") | |
759 | (description "JTransforms is a multithreaded FFT library written in pure | |
760 | Java. Currently, four types of transforms are available: @dfn{Discrete | |
761 | Fourier Transform} (DFT), @dfn{Discrete Cosine Transform} (DCT), @dfn{Discrete | |
762 | Sine Transform} (DST) and @dfn{Discrete Hartley Transform} (DHT).") | |
763 | (license license:bsd-2))) | |
764 | ||
8f4b1dfb LC |
765 | (define-public eigen |
766 | (package | |
767 | (name "eigen") | |
8cd80a4b | 768 | (version "3.3.5") |
8f4b1dfb LC |
769 | (source (origin |
770 | (method url-fetch) | |
771 | (uri (string-append "https://bitbucket.org/eigen/eigen/get/" | |
9b268f12 | 772 | version ".tar.bz2")) |
8f4b1dfb LC |
773 | (sha256 |
774 | (base32 | |
8cd80a4b | 775 | "1qh3yrwn78ms5yhwbpl5wvblk4gbz02cacdygxylr7i9xbrvylkk")) |
2abcc935 | 776 | (file-name (string-append name "-" version ".tar.bz2")) |
8f4b1dfb LC |
777 | (modules '((guix build utils))) |
778 | (snippet | |
779 | ;; There are 3 test failures in the "unsupported" directory, | |
780 | ;; but maintainers say it's a known issue and it's unsupported | |
781 | ;; anyway, so just skip them. | |
1137d85b | 782 | '(begin |
44884a9d RW |
783 | (substitute* "unsupported/CMakeLists.txt" |
784 | (("add_subdirectory\\(test.*") | |
785 | "# Do not build the tests for unsupported features.\n")) | |
6cbee49d | 786 | #t)))) |
8f4b1dfb LC |
787 | (build-system cmake-build-system) |
788 | (arguments | |
789 | '(;; Turn off debugging symbols to save space. | |
790 | #:build-type "Release" | |
791 | ||
354f4fe2 | 792 | #:phases (modify-phases %standard-phases |
ef8742ea | 793 | (replace 'check |
354f4fe2 | 794 | (lambda _ |
354f4fe2 LC |
795 | (let* ((cores (parallel-job-count)) |
796 | (dash-j (format #f "-j~a" cores))) | |
1137d85b | 797 | (setenv "EIGEN_SEED" "1") ;for reproducibility |
ef8742ea LC |
798 | ;; First build the tests, in parallel. See |
799 | ;; <http://eigen.tuxfamily.org/index.php?title=Tests>. | |
fbe9c80f | 800 | (invoke "make" "buildtests" dash-j) |
8f4b1dfb | 801 | |
fbe9c80f TGR |
802 | ;; Then run 'CTest' with -V so we get more |
803 | ;; details upon failure. | |
804 | (invoke "ctest" "-V" dash-j))))))) | |
eeb8b0e6 | 805 | (home-page "https://eigen.tuxfamily.org") |
8f4b1dfb LC |
806 | (synopsis "C++ template library for linear algebra") |
807 | (description | |
808 | "Eigen is a C++ template library for linear algebra: matrices, vectors, | |
809 | numerical solvers, and related algorithms. It provides an elegant API based | |
810 | on \"expression templates\". It is versatile: it supports all matrix sizes, | |
811 | all standard numeric types, various matrix decompositions and geometry | |
812 | features, and more.") | |
813 | ||
814 | ;; Most of the code is MPLv2, with a few files under LGPLv2.1+ or BSD-3. | |
815 | ;; See 'COPYING.README' for details. | |
9f51293c | 816 | (license license:mpl2.0))) |
70770b93 FT |
817 | |
818 | (define-public xtensor | |
819 | (package | |
820 | (name "xtensor") | |
e1ecaa83 | 821 | (version "0.17.1") |
70770b93 | 822 | (source (origin |
e1ecaa83 KK |
823 | (method git-fetch) |
824 | (uri (git-reference | |
825 | (url "https://github.com/QuantStack/xtensor.git") | |
826 | (commit version))) | |
70770b93 FT |
827 | (sha256 |
828 | (base32 | |
e1ecaa83 KK |
829 | "0w40v5lp0hp8ihf8nnvak373sb5xx0768pxgiqh3nzn57wf8px4r")) |
830 | (file-name (git-file-name name version)))) | |
70770b93 FT |
831 | (build-system cmake-build-system) |
832 | (native-inputs | |
833 | `(("googletest" ,googletest) | |
834 | ("xtl" ,xtl))) | |
835 | (arguments | |
836 | `(#:configure-flags | |
837 | '("-DBUILD_TESTS=ON") | |
838 | #:test-target "xtest")) | |
839 | (home-page "http://quantstack.net/xtensor") | |
840 | (synopsis "C++ tensors with broadcasting and lazy computing") | |
841 | (description "xtensor is a C++ library meant for numerical analysis with | |
842 | multi-dimensional array expressions. | |
843 | ||
844 | xtensor provides: | |
845 | @itemize | |
846 | @item an extensible expression system enabling lazy broadcasting. | |
847 | @item an API following the idioms of the C++ standard library. | |
848 | @item tools to manipulate array expressions and build upon xtensor. | |
849 | @end itemize") | |
850 | (license license:bsd-3))) |