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> |
4b0bf990 | 3 | ;;; Copyright © 2013, 2015, 2017, 2018 Ludovic Courtès <ludo@gnu.org> |
47fefe98 | 4 | ;;; Copyright © 2016, 2017, 2018 Nicolas Goaziou <mail@nicolasgoaziou.fr> |
e2ca23c5 | 5 | ;;; Copyright © 2014 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) |
10b1f688 | 30 | #:use-module (gnu packages compression) |
99828fa7 | 31 | #:use-module (gnu packages documentation) |
f71f29ca | 32 | #:use-module (gnu packages ed) |
5894b604 | 33 | #:use-module (gnu packages flex) |
57497c57 NG |
34 | #:use-module (gnu packages fltk) |
35 | #:use-module (gnu packages gl) | |
aae03c48 | 36 | #:use-module (gnu packages graphviz) |
57497c57 | 37 | #:use-module (gnu packages image) |
c8d99608 | 38 | #:use-module (gnu packages java) |
aae03c48 | 39 | #:use-module (gnu packages maths) |
0fc54d4b | 40 | #:use-module (gnu packages mpi) |
5894b604 | 41 | #:use-module (gnu packages multiprecision) |
1ffa7090 | 42 | #:use-module (gnu packages perl) |
aae03c48 | 43 | #:use-module (gnu packages python) |
5894b604 | 44 | #:use-module (gnu packages readline) |
b7194849 | 45 | #:use-module (gnu packages shells) |
8f9ac901 | 46 | #:use-module (gnu packages tex) |
f71f29ca | 47 | #:use-module (gnu packages texinfo) |
57497c57 | 48 | #:use-module (gnu packages xiph) |
fb8d1be8 | 49 | #:use-module (gnu packages xorg) |
c8d99608 | 50 | #:use-module (guix build-system ant) |
7569c5cb | 51 | #:use-module (guix build-system gnu) |
8f4b1dfb | 52 | #:use-module (guix build-system cmake) |
5894b604 | 53 | #:use-module (guix download) |
c8d99608 | 54 | #:use-module (guix git-download) |
5894b604 TGR |
55 | #:use-module ((guix licenses) #:prefix license:) |
56 | #:use-module (guix packages) | |
7569c5cb | 57 | #:use-module (guix utils)) |
2ed139c4 AE |
58 | |
59 | ||
60 | (define-public mpfrcx | |
61 | (package | |
62 | (name "mpfrcx") | |
9c68798d | 63 | (version "0.4.2") |
2ed139c4 AE |
64 | (source (origin |
65 | (method url-fetch) | |
66 | (uri (string-append | |
67 | "http://www.multiprecision.org/mpfrcx/download/mpfrcx-" | |
68 | version ".tar.gz")) | |
69 | (sha256 | |
70 | (base32 | |
9c68798d | 71 | "0grw66b255r574lvll1bqccm5myj2m8ajzsjaygcyq9zjnnbnhhy")))) |
2ed139c4 | 72 | (build-system gnu-build-system) |
878c8f3f AE |
73 | (propagated-inputs |
74 | `(("gmp" ,gmp) | |
75 | ("mpfr" ,mpfr) | |
76 | ("mpc" ,mpc))) ; Header files are included by mpfrcx.h. | |
35b9e423 | 77 | (synopsis "Arithmetic of polynomials over arbitrary precision numbers") |
2ed139c4 | 78 | (description |
35b9e423 | 79 | "Mpfrcx is a library for the arithmetic of univariate polynomials over |
2ed139c4 | 80 | arbitrary precision real (mpfr) or complex (mpc) numbers, without control |
35b9e423 | 81 | on the rounding. For the time being, only the few functions needed to |
2ed139c4 | 82 | implement the floating point approach to complex multiplication are |
35b9e423 | 83 | implemented. On the other hand, these comprise asymptotically fast |
e881752c | 84 | multiplication routines such as Toom–Cook and the FFT.") |
9f51293c | 85 | (license license:lgpl2.1+) |
2ed139c4 AE |
86 | (home-page "http://mpfrcx.multiprecision.org/"))) |
87 | ||
10b1f688 AE |
88 | (define-public cm |
89 | (package | |
90 | (name "cm") | |
81b55bf7 | 91 | (version "0.3") |
10b1f688 AE |
92 | (source (origin |
93 | (method url-fetch) | |
94 | (uri (string-append | |
95 | "http://www.multiprecision.org/cm/download/cm-" | |
96 | version ".tar.gz")) | |
97 | (sha256 | |
98 | (base32 | |
81b55bf7 | 99 | "1nf5kr0nqmhbzrsrinky18z0ighjpsmb5cr8zyg8jf04bfbyrfmc")))) |
10b1f688 AE |
100 | (build-system gnu-build-system) |
101 | (propagated-inputs | |
102 | `(("mpfrcx" ,mpfrcx) | |
103 | ("zlib" ,zlib))) ; Header files included from cm_common.h. | |
104 | (inputs | |
105 | `(("pari-gp" ,pari-gp))) | |
106 | (synopsis "CM constructions for elliptic curves") | |
107 | (description | |
108 | "The CM software implements the construction of ring class fields of | |
109 | imaginary quadratic number fields and of elliptic curves with complex | |
110 | multiplication via floating point approximations. It consists of libraries | |
111 | that can be called from within a C program and of executable command | |
112 | line applications.") | |
81b55bf7 | 113 | (license license:gpl3+) |
10b1f688 AE |
114 | (home-page "http://cm.multiprecision.org/"))) |
115 | ||
2ed139c4 AE |
116 | (define-public fplll |
117 | (package | |
118 | (name "fplll") | |
5a15ed50 | 119 | (version "4.0.4") |
2ed139c4 AE |
120 | (source (origin |
121 | (method url-fetch) | |
122 | (uri (string-append | |
123 | "http://perso.ens-lyon.fr/damien.stehle/fplll/libfplll-" | |
124 | version ".tar.gz")) | |
125 | (sha256 (base32 | |
5a15ed50 | 126 | "1cbiby7ykis4z84swclpysrljmqhfcllpkcbll1m08rzskgb1a6b")))) |
2ed139c4 AE |
127 | (build-system gnu-build-system) |
128 | (inputs `(("gmp" ,gmp) | |
129 | ("mpfr" ,mpfr))) | |
35b9e423 | 130 | (synopsis "Library for LLL-reduction of euclidean lattices") |
2ed139c4 | 131 | (description |
35b9e423 | 132 | "fplll LLL-reduces euclidean lattices. Since version 3, it can also |
2ed139c4 | 133 | solve the shortest vector problem.") |
9f51293c | 134 | (license license:lgpl2.1+) |
2ed139c4 | 135 | (home-page "http://perso.ens-lyon.fr/damien.stehle/fplll/"))) |
4e6b699d | 136 | |
90a6d47c AE |
137 | (define-public pari-gp |
138 | (package | |
139 | (name "pari-gp") | |
9054bbfe | 140 | (version "2.9.4") |
90a6d47c AE |
141 | (source (origin |
142 | (method url-fetch) | |
143 | (uri (string-append | |
144 | "http://pari.math.u-bordeaux.fr/pub/pari/unix/pari-" | |
145 | version ".tar.gz")) | |
f78c66aa AE |
146 | (sha256 |
147 | (base32 | |
9054bbfe | 148 | "0ir6m3a8r46md5x6zk4xf159qra7aqparby9zk03k81hjrrxr72g")))) |
90a6d47c | 149 | (build-system gnu-build-system) |
a8b0948b | 150 | (native-inputs `(("texlive" ,texlive-tiny))) |
90a6d47c | 151 | (inputs `(("gmp" ,gmp) |
fb8d1be8 | 152 | ("libx11" ,libx11) |
90a6d47c AE |
153 | ("perl" ,perl) |
154 | ("readline" ,readline))) | |
155 | (arguments | |
9bd9486d | 156 | '(#:make-flags '("all") |
12abb19d | 157 | #:test-target "dobench" |
08595262 AE |
158 | #:phases (modify-phases %standard-phases |
159 | (replace 'configure | |
160 | (lambda* (#:key outputs #:allow-other-keys) | |
161 | (let ((out (assoc-ref outputs "out"))) | |
162 | (zero? | |
163 | (system* "./Configure" | |
164 | (string-append "--prefix=" out))))))))) | |
90a6d47c AE |
165 | (synopsis "PARI/GP, a computer algebra system for number theory") |
166 | (description | |
167 | "PARI/GP is a widely used computer algebra system designed for fast | |
168 | computations in number theory (factorisations, algebraic number theory, | |
169 | elliptic curves...), but it also contains a large number of other useful | |
170 | functions to compute with mathematical entities such as matrices, | |
171 | polynomials, power series, algebraic numbers, etc., and a lot of | |
172 | transcendental functions. | |
173 | PARI is also available as a C library to allow for faster computations.") | |
9f51293c | 174 | (license license:gpl2+) |
90a6d47c | 175 | (home-page "http://pari.math.u-bordeaux.fr/"))) |
ed9f9a77 | 176 | |
f854a8c1 AE |
177 | (define-public gp2c |
178 | (package | |
179 | (name "gp2c") | |
0a77fdf4 | 180 | (version "0.0.10") |
f854a8c1 AE |
181 | (source (origin |
182 | (method url-fetch) | |
183 | (uri (string-append | |
184 | "http://pari.math.u-bordeaux.fr/pub/pari/GP2C/gp2c-" | |
185 | version ".tar.gz")) | |
324bdcd8 AE |
186 | (sha256 |
187 | (base32 | |
0a77fdf4 | 188 | "1xhpz5p81iw261ay1kip283ggr0ir8ydz8qx3v24z8jfms1r3y70")))) |
f854a8c1 | 189 | (build-system gnu-build-system) |
c67ccedd | 190 | (native-inputs `(("perl" ,perl))) |
f854a8c1 AE |
191 | (inputs `(("pari-gp" ,pari-gp))) |
192 | (arguments | |
193 | '(#:configure-flags | |
194 | (list (string-append "--with-paricfg=" | |
195 | (assoc-ref %build-inputs "pari-gp") | |
196 | "/lib/pari/pari.cfg")))) | |
197 | (synopsis "PARI/GP, a computer algebra system for number theory") | |
198 | (description | |
199 | "PARI/GP is a widely used computer algebra system designed for fast | |
200 | computations in number theory (factorisations, algebraic number theory, | |
201 | elliptic curves...), but it also contains a large number of other useful | |
202 | functions to compute with mathematical entities such as matrices, | |
203 | polynomials, power series, algebraic numbers, etc., and a lot of | |
204 | transcendental functions. | |
205 | PARI is also available as a C library to allow for faster computations. | |
206 | ||
207 | GP2C, the GP to C compiler, translates GP scripts to PARI programs.") | |
9f51293c | 208 | (license license:gpl2) |
f854a8c1 AE |
209 | (home-page "http://pari.math.u-bordeaux.fr/"))) |
210 | ||
57497c57 NG |
211 | (define-public giac-xcas |
212 | (package | |
213 | (name "giac-xcas") | |
adcde217 | 214 | (version "1.4.9-59") |
57497c57 NG |
215 | (source (origin |
216 | (method url-fetch) | |
217 | ;; "~parisse/giac" is not used because the maintainer regularly | |
218 | ;; overwrites the release tarball there, introducing a checksum | |
219 | ;; mismatch every time. See | |
220 | ;; <https://www-fourier.ujf-grenoble.fr/~parisse/debian/dists/stable/main/source/README> | |
221 | (uri (string-append "https://www-fourier.ujf-grenoble.fr/" | |
222 | "~parisse/debian/dists/stable/main/" | |
223 | "source/giac_" version ".tar.gz")) | |
224 | (sha256 | |
225 | (base32 | |
adcde217 | 226 | "0dv5p5y6gkrsmz3xa7fw87rjyabwdwk09mqb09kb7gai9n9dgayk")))) |
57497c57 NG |
227 | (build-system gnu-build-system) |
228 | (arguments | |
229 | `(#:phases | |
230 | (modify-phases %standard-phases | |
231 | (add-after 'unpack 'patch-bin-cp | |
232 | (lambda _ | |
233 | ;; Some Makefiles contain hard-coded "/bin/cp". | |
234 | (substitute* (find-files "doc" "^Makefile") | |
235 | (("/bin/cp") (which "cp"))) | |
57497c57 NG |
236 | #t))))) |
237 | (inputs | |
238 | `(("fltk" ,fltk) | |
239 | ("gmp" ,gmp) | |
240 | ("gsl" ,gsl) | |
241 | ("lapack" ,lapack) | |
242 | ("libao" ,ao) | |
243 | ("libjpeg" ,libjpeg) | |
244 | ("libpng" ,libpng) | |
245 | ("libx11" ,libx11) | |
99a00446 | 246 | ("libxinerama" ,libxinerama) |
57497c57 NG |
247 | ("libxft" ,libxft) |
248 | ("libxt" ,libxt) | |
249 | ("mesa" ,mesa) | |
250 | ("mpfi" ,mpfi) | |
251 | ("mpfr" ,mpfr) | |
252 | ("ntl" ,ntl) | |
253 | ("perl" ,perl) | |
254 | ("pari-gp" ,pari-gp) | |
255 | ("tcsh" ,tcsh) | |
a023ec6e | 256 | ("texlive" ,texlive-tiny))) |
57497c57 NG |
257 | (native-inputs `(("readline" ,readline))) |
258 | (home-page "https://www-fourier.ujf-grenoble.fr/~parisse/giac.html") | |
259 | (synopsis "Computer algebra system") | |
260 | (description | |
261 | "Giac/Xcas is a computer algebra system. It has a compatibility mode for | |
262 | maple, mupad and the TI89. It is available as a standalone program (graphic | |
263 | or text interfaces) or as a C++ library.") | |
264 | (license license:gpl3+))) | |
265 | ||
d7ab698a AE |
266 | (define-public flint |
267 | (package | |
268 | (name "flint") | |
6c591c8e | 269 | (version "2.5.2") |
d7ab698a AE |
270 | (source (origin |
271 | (method url-fetch) | |
272 | (uri (string-append | |
273 | "http://flintlib.org/flint-" | |
274 | version ".tar.gz")) | |
275 | (sha256 (base32 | |
6c591c8e | 276 | "11syazv1a8rrnac3wj3hnyhhflpqcmq02q8pqk2m6g2k6h0gxwfb")) |
fc1adab1 | 277 | (patches (search-patches "flint-ldconfig.patch")))) |
d7ab698a | 278 | (build-system gnu-build-system) |
df15d17d | 279 | (propagated-inputs |
d7ab698a | 280 | `(("gmp" ,gmp) |
df15d17d | 281 | ("mpfr" ,mpfr))) ; header files from both are included by flint/arith.h |
d7ab698a | 282 | (arguments |
ad11974e AE |
283 | `(#:parallel-tests? #f ; seems to be necessary on arm |
284 | #:phases | |
91430de6 AE |
285 | (modify-phases %standard-phases |
286 | (replace 'configure | |
287 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
288 | (let ((out (assoc-ref outputs "out")) | |
289 | (gmp (assoc-ref inputs "gmp")) | |
290 | (mpfr (assoc-ref inputs "mpfr"))) | |
91430de6 AE |
291 | ;; do not pass "--enable-fast-install", which makes the |
292 | ;; homebrew configure process fail | |
293 | (zero? (system* | |
294 | "./configure" | |
295 | (string-append "--prefix=" out) | |
296 | (string-append "--with-gmp=" gmp) | |
297 | (string-append "--with-mpfr=" mpfr))))))))) | |
d7ab698a AE |
298 | (synopsis "Fast library for number theory") |
299 | (description | |
300 | "FLINT is a C library for number theory. It supports arithmetic | |
301 | with numbers, polynomials, power series and matrices over many base | |
302 | rings, including multiprecision integers and rationals, integers | |
303 | modulo n, p-adic numbers, finite fields (prime and non-prime order) | |
304 | and real and complex numbers (via the Arb extension library). | |
305 | ||
306 | Operations that can be performed include conversions, arithmetic, | |
307 | GCDs, factoring, solving linear systems, and evaluating special | |
308 | functions. In addition, FLINT provides various low-level routines for | |
309 | fast arithmetic.") | |
9f51293c | 310 | (license license:gpl2+) |
d7ab698a AE |
311 | (home-page "http://flintlib.org/"))) |
312 | ||
6b8e8285 AE |
313 | (define-public arb |
314 | (package | |
315 | (name "arb") | |
b1225dd3 | 316 | (version "2.12.0") |
6b8e8285 AE |
317 | (source (origin |
318 | (method url-fetch) | |
319 | (uri (string-append | |
320 | "https://github.com/fredrik-johansson/arb/archive/" | |
321 | version ".tar.gz")) | |
f586c877 | 322 | (file-name (string-append name "-" version ".tar.gz")) |
424ce93d AE |
323 | (sha256 |
324 | (base32 | |
b1225dd3 | 325 | "0j37xkxbqpra4sf0a96x4sqbl5fkal8d7c94bi9wdsqqj6kgcsil")))) |
6b8e8285 | 326 | (build-system gnu-build-system) |
480d19e6 AE |
327 | (propagated-inputs |
328 | `(("flint" ,flint))) ; flint.h is included by arf.h | |
6b8e8285 | 329 | (inputs |
480d19e6 | 330 | `(("gmp" ,gmp) |
6b8e8285 AE |
331 | ("mpfr" ,mpfr))) |
332 | (arguments | |
333 | `(#:phases | |
dc1d3cde KK |
334 | (modify-phases %standard-phases |
335 | (replace 'configure | |
336 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
337 | (let ((out (assoc-ref outputs "out")) | |
338 | (flint (assoc-ref inputs "flint")) | |
339 | (gmp (assoc-ref inputs "gmp")) | |
340 | (mpfr (assoc-ref inputs "mpfr"))) | |
341 | ;; do not pass "--enable-fast-install", which makes the | |
342 | ;; homebrew configure process fail | |
343 | (zero? (system* | |
344 | "./configure" | |
345 | (string-append "--prefix=" out) | |
346 | (string-append "--with-flint=" flint) | |
347 | (string-append "--with-gmp=" gmp) | |
348 | (string-append "--with-mpfr=" mpfr))))))))) | |
6b8e8285 AE |
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") | |
7d15cf17 | 441 | (version "7.0.4") |
57c9c349 | 442 | (source (origin |
7d15cf17 TGR |
443 | (method url-fetch) |
444 | ;; Use the ‘Latest version’ link for a stable URI across releases. | |
445 | (uri (string-append "https://gforge.inria.fr/frs/download.php/" | |
446 | "latestfile/160/ecm-" version ".tar.gz")) | |
447 | (sha256 (base32 | |
448 | "0hxs24c2m3mh0nq1zz63z3sb7dhy1rilg2s1igwwcb26x3pb7xqc")))) | |
57c9c349 AE |
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") | |
f71f29ca | 471 | (version "1.07.1") |
ed9f9a77 LC |
472 | (source (origin |
473 | (method url-fetch) | |
474 | (uri (string-append "mirror://gnu/bc/bc-" version ".tar.gz")) | |
475 | (sha256 | |
476 | (base32 | |
f71f29ca | 477 | "0amh9ik44jfg66csyvf4zz1l878c4755kjndq9j0270akflgrbb2")))) |
ed9f9a77 | 478 | (build-system gnu-build-system) |
f71f29ca MB |
479 | (native-inputs |
480 | `(("ed" ,ed) | |
481 | ("flex" ,flex) | |
482 | ("texinfo" ,texinfo))) | |
ed9f9a77 | 483 | (arguments |
f71f29ca | 484 | '(#:configure-flags |
f0bacad6 | 485 | (list "--with-readline"))) |
6fd52309 | 486 | (home-page "https://www.gnu.org/software/bc/") |
f50d2669 | 487 | (synopsis "Arbitrary precision numeric processing language") |
ed9f9a77 | 488 | (description |
a22dc0c4 LC |
489 | "bc is an arbitrary precision numeric processing language. It includes |
490 | an interactive environment for evaluating mathematical statements. Its | |
491 | syntax is similar to that of C, so basic usage is familiar. It also includes | |
492 | \"dc\", a reverse-polish calculator.") | |
9f51293c | 493 | (license license:gpl2+))) |
37e6cdcd | 494 | |
2a9b10c7 RW |
495 | ;; The original kiss-fft does not have a complete build system and does not |
496 | ;; build any shared libraries. This is a fork used by Extempore. | |
497 | (define-public kiss-fft-for-extempore | |
498 | (package | |
499 | (name "kiss-fft-for-extempore") | |
500 | (version "1.3.0") | |
501 | (source (origin | |
502 | (method url-fetch) | |
503 | (uri (string-append "https://github.com/extemporelang/kiss_fft/archive/" | |
504 | version ".tar.gz")) | |
505 | (file-name (string-append name "-" version ".tar.gz")) | |
506 | (sha256 | |
507 | (base32 | |
508 | "0hkp9l6l4c92fb1l2sh6a6zv1hynpvb2s4d03vd8vxyvybc0l4pv")))) | |
509 | (build-system cmake-build-system) | |
510 | (arguments `(#:tests? #f)) ; no tests included | |
39162ee4 RW |
511 | ;; Extempore refuses to build on architectures other than x86_64 |
512 | (supported-systems '("x86_64-linux")) | |
2a9b10c7 RW |
513 | (home-page "https://github.com/extemporelang/kiss_fft") |
514 | (synopsis "Mixed-radix Fast Fourier Transform") | |
515 | (description | |
516 | "Kiss FFT attempts to be a reasonably efficient, moderately useful FFT | |
517 | that can use fixed or floating data types and can easily be incorporated into | |
518 | a C program.") | |
519 | (license license:bsd-3))) | |
520 | ||
37e6cdcd LC |
521 | (define-public fftw |
522 | (package | |
523 | (name "fftw") | |
a0d4d2d8 | 524 | (version "3.3.7") |
37e6cdcd LC |
525 | (source (origin |
526 | (method url-fetch) | |
527 | (uri (string-append "ftp://ftp.fftw.org/pub/fftw/fftw-" | |
528 | version".tar.gz")) | |
529 | (sha256 | |
530 | (base32 | |
a0d4d2d8 | 531 | "0wsms8narnbhfsa8chdflv2j9hzspvflblnqdn7hw8x5xdzrnq1v")))) |
37e6cdcd LC |
532 | (build-system gnu-build-system) |
533 | (arguments | |
65bb2279 EB |
534 | `(#:configure-flags |
535 | `("--enable-shared" "--enable-openmp" "--enable-threads" | |
536 | ,,@(let ((system (or (%current-target-system) (%current-system)))) | |
537 | ;; Enable SIMD extensions for codelets. See details at: | |
538 | ;; <http://fftw.org/fftw3_doc/Installation-on-Unix.html>. | |
539 | (cond | |
540 | ((string-prefix? "x86_64" system) | |
541 | '("--enable-sse2" "--enable-avx" "--enable-avx2" | |
542 | "--enable-avx512" "--enable-avx-128-fma")) | |
543 | ((string-prefix? "i686" system) | |
544 | '("--enable-sse2")) | |
545 | ((string-prefix? "aarch64" system) | |
546 | '("--enable-neon" "--enable-armv8-cntvct-el0")) | |
547 | ((string-prefix? "arm" system) ;neon only for single-precision | |
548 | '("--enable-armv7a-cntvct")) ;on 32-bit arm | |
549 | ((string-prefix? "mips" system) | |
550 | '("--enable-mips-zbus-timer")))) | |
551 | ;; By default '-mtune=native' is used. However, that may cause the | |
552 | ;; use of ISA extensions (e.g. AVX) that are not necessarily | |
553 | ;; available on the user's machine when that package is built on a | |
554 | ;; different machine. | |
555 | "ax_cv_c_flags__mtune_native=no"))) | |
37e6cdcd LC |
556 | (native-inputs `(("perl" ,perl))) |
557 | (home-page "http://fftw.org") | |
558 | (synopsis "Computing the discrete Fourier transform") | |
559 | (description | |
560 | "FFTW is a C subroutine library for computing the discrete Fourier | |
561 | transform (DFT) in one or more dimensions, of arbitrary input size, and of | |
562 | both real and complex data (as well as of even/odd data---i.e. the discrete | |
563 | cosine/ sine transforms or DCT/DST).") | |
9f51293c | 564 | (license license:gpl2+))) |
7569c5cb EB |
565 | |
566 | (define-public fftwf | |
567 | (package (inherit fftw) | |
568 | (name "fftwf") | |
569 | (arguments | |
570 | (substitute-keyword-arguments (package-arguments fftw) | |
571 | ((#:configure-flags cf) | |
65bb2279 EB |
572 | (if (string-prefix? "arm" (or (%current-target-system) |
573 | (%current-system))) | |
574 | `(cons "--enable-neon" ,cf) | |
575 | cf)))) | |
7569c5cb EB |
576 | (description |
577 | (string-append (package-description fftw) | |
578 | " Single-precision version.")))) | |
e5c66f8c EB |
579 | |
580 | (define-public fftw-openmpi | |
581 | (package (inherit fftw) | |
582 | (name "fftw-openmpi") | |
583 | (inputs | |
584 | `(("openmpi" ,openmpi) | |
585 | ,@(package-inputs fftw))) | |
586 | (arguments | |
587 | (substitute-keyword-arguments (package-arguments fftw) | |
588 | ((#:configure-flags cf) | |
589 | `(cons "--enable-mpi" ,cf)))) | |
590 | (description | |
591 | (string-append (package-description fftw) | |
592 | " With OpenMPI parallelism support.")))) | |
8f4b1dfb | 593 | |
c8d99608 RW |
594 | (define-public java-la4j |
595 | (package | |
596 | (name "java-la4j") | |
597 | (version "0.6.0") | |
598 | (source (origin | |
599 | (method git-fetch) | |
600 | (uri (git-reference | |
601 | (url "https://github.com/vkostyukov/la4j.git") | |
602 | (commit version))) | |
603 | (file-name (string-append name "-" version "-checkout")) | |
604 | (sha256 | |
605 | (base32 | |
606 | "1qir8dr978cfvz9k12m2kbdwpyf6cqdf1d0ilb7lnkhbgq5i53w3")))) | |
607 | (build-system ant-build-system) | |
608 | (arguments | |
609 | `(#:jar-name "la4j.jar" | |
610 | #:jdk ,icedtea-8 | |
611 | #:test-exclude (list "**/Abstract*.java" | |
612 | "**/MatrixTest.java" | |
613 | "**/DenseMatrixTest.java" | |
614 | "**/SparseMatrixTest.java" | |
615 | "**/VectorTest.java" | |
616 | "**/SparseVectorTest.java" | |
617 | "**/DenseVectorTest.java"))) | |
618 | (native-inputs | |
619 | `(("java-junit" ,java-junit) | |
620 | ("java-hamcrest-core" ,java-hamcrest-core))) | |
621 | (home-page "http://la4j.org/") | |
622 | (synopsis "Java library that provides Linear Algebra primitives and algorithms") | |
623 | (description "The la4j library is a Java library that provides Linear | |
624 | Algebra primitives (matrices and vectors) and algorithms. The key features of | |
625 | the la4j library are: | |
626 | ||
627 | @itemize | |
628 | @item No dependencies and tiny size | |
629 | @item Fluent object-oriented/functional API | |
630 | @item Sparse (CRS, CCS) and dense (1D/2D arrays) matrices | |
631 | @item Linear systems solving (Gaussian, Jacobi, Zeidel, Square Root, Sweep and other) | |
632 | @item Matrices decomposition (Eigenvalues/Eigenvectors, SVD, QR, LU, Cholesky and other) | |
633 | @item MatrixMarket/CSV IO formats support for matrices and vectors | |
634 | @end itemize\n") | |
635 | (license license:asl2.0))) | |
636 | ||
24074b0b RW |
637 | (define-public java-jlargearrays |
638 | (package | |
639 | (name "java-jlargearrays") | |
640 | (version "1.6") | |
641 | (source (origin | |
642 | (method url-fetch) | |
643 | (uri (string-append "http://search.maven.org/remotecontent?" | |
644 | "filepath=pl/edu/icm/JLargeArrays/" | |
645 | version "/JLargeArrays-" version | |
646 | "-sources.jar")) | |
647 | (file-name (string-append name "-" version ".jar")) | |
648 | (sha256 | |
649 | (base32 | |
650 | "0v05iphpxbjnd7f4jf1rlqq3m8hslhcm0imdbsgxr20pi3xkaf2a")))) | |
651 | (build-system ant-build-system) | |
652 | (arguments | |
653 | `(#:jar-name "jlargearrays.jar" | |
654 | #:tests? #f ; tests are not included in the release archive | |
655 | #:jdk ,icedtea-8)) | |
656 | (propagated-inputs | |
657 | `(("java-commons-math3" ,java-commons-math3))) | |
658 | (home-page "https://gitlab.com/ICM-VisLab/JLargeArrays") | |
659 | (synopsis "Library of one-dimensional arrays that can store up to 263 elements") | |
660 | (description "JLargeArrays is a Java library of one-dimensional arrays | |
661 | that can store up to 263 elements.") | |
662 | (license license:bsd-2))) | |
663 | ||
4e92911c RW |
664 | (define-public java-jtransforms |
665 | (package | |
666 | (name "java-jtransforms") | |
667 | (version "3.1") | |
668 | (source (origin | |
669 | (method url-fetch) | |
670 | (uri (string-append "http://search.maven.org/remotecontent?" | |
671 | "filepath=com/github/wendykierp/JTransforms/" | |
672 | version "/JTransforms-" version "-sources.jar")) | |
673 | (sha256 | |
674 | (base32 | |
675 | "1haw5m8shv5srgcpwkl853dz8bv6h90bzlhcps6mdpb4cixjirsg")))) | |
676 | (build-system ant-build-system) | |
677 | (arguments | |
678 | `(#:jar-name "jtransforms.jar" | |
679 | #:tests? #f ; tests are not included in the release archive | |
680 | #:jdk ,icedtea-8)) | |
681 | (propagated-inputs | |
682 | `(("java-commons-math3" ,java-commons-math3) | |
683 | ("java-jlargearrays" ,java-jlargearrays))) | |
684 | (home-page "https://github.com/wendykierp/JTransforms") | |
685 | (synopsis "Multithreaded FFT library written in pure Java") | |
686 | (description "JTransforms is a multithreaded FFT library written in pure | |
687 | Java. Currently, four types of transforms are available: @dfn{Discrete | |
688 | Fourier Transform} (DFT), @dfn{Discrete Cosine Transform} (DCT), @dfn{Discrete | |
689 | Sine Transform} (DST) and @dfn{Discrete Hartley Transform} (DHT).") | |
690 | (license license:bsd-2))) | |
691 | ||
8f4b1dfb LC |
692 | (define-public eigen |
693 | (package | |
694 | (name "eigen") | |
1137d85b | 695 | (version "3.3.4") |
8f4b1dfb LC |
696 | (source (origin |
697 | (method url-fetch) | |
698 | (uri (string-append "https://bitbucket.org/eigen/eigen/get/" | |
9b268f12 | 699 | version ".tar.bz2")) |
8f4b1dfb LC |
700 | (sha256 |
701 | (base32 | |
1137d85b | 702 | "19m4406jvqnwh7kpcvx1lfx2vdc5zwia5q9ayv89bimg1gmln9fx")) |
2abcc935 | 703 | (file-name (string-append name "-" version ".tar.bz2")) |
1137d85b | 704 | (patches (search-patches "eigen-arm-neon-fixes.patch")) |
8f4b1dfb LC |
705 | (modules '((guix build utils))) |
706 | (snippet | |
707 | ;; There are 3 test failures in the "unsupported" directory, | |
708 | ;; but maintainers say it's a known issue and it's unsupported | |
709 | ;; anyway, so just skip them. | |
1137d85b EB |
710 | '(begin |
711 | (substitute* "CMakeLists.txt" | |
712 | (("add_subdirectory\\(unsupported\\)") | |
713 | "# Do not build the tests for unsupported features.\n") | |
714 | ;; Work around | |
715 | ;; <http://eigen.tuxfamily.org/bz/show_bug.cgi?id=1114>. | |
716 | (("\"include/eigen3\"") | |
717 | "\"${CMAKE_INSTALL_PREFIX}/include/eigen3\"")) | |
718 | (substitute* "test/bdcsvd.cpp" | |
719 | ;; See | |
720 | ;; https://bitbucket.org/eigen/eigen/commits/ea8c22ce6920e982d15245ee41d0531a46a28e5d | |
721 | ((".*svd_preallocate[^\n]*" &) | |
6cbee49d MW |
722 | (string-append "//" & " // Not supported by BDCSVD"))) |
723 | #t)))) | |
8f4b1dfb LC |
724 | (build-system cmake-build-system) |
725 | (arguments | |
726 | '(;; Turn off debugging symbols to save space. | |
727 | #:build-type "Release" | |
728 | ||
354f4fe2 | 729 | #:phases (modify-phases %standard-phases |
ef8742ea | 730 | (replace 'check |
354f4fe2 | 731 | (lambda _ |
354f4fe2 LC |
732 | (let* ((cores (parallel-job-count)) |
733 | (dash-j (format #f "-j~a" cores))) | |
1137d85b | 734 | (setenv "EIGEN_SEED" "1") ;for reproducibility |
ef8742ea LC |
735 | ;; First build the tests, in parallel. See |
736 | ;; <http://eigen.tuxfamily.org/index.php?title=Tests>. | |
737 | (and (zero? (system* "make" "buildtests" dash-j)) | |
8f4b1dfb | 738 | |
ef8742ea LC |
739 | ;; Then run 'CTest' with -V so we get more |
740 | ;; details upon failure. | |
741 | (zero? (system* "ctest" "-V" dash-j))))))))) | |
8f4b1dfb LC |
742 | (home-page "http://eigen.tuxfamily.org") |
743 | (synopsis "C++ template library for linear algebra") | |
744 | (description | |
745 | "Eigen is a C++ template library for linear algebra: matrices, vectors, | |
746 | numerical solvers, and related algorithms. It provides an elegant API based | |
747 | on \"expression templates\". It is versatile: it supports all matrix sizes, | |
748 | all standard numeric types, various matrix decompositions and geometry | |
749 | features, and more.") | |
750 | ||
751 | ;; Most of the code is MPLv2, with a few files under LGPLv2.1+ or BSD-3. | |
752 | ;; See 'COPYING.README' for details. | |
9f51293c | 753 | (license license:mpl2.0))) |