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> |
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") | |
a2662bfe | 182 | (version "0.0.11") |
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 | |
a2662bfe | 190 | "1z69xj2dpd8yyi8108rz26c50xpv0k2j8qnk0bzy1c5lw3pd1adm")))) |
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 | |
57497c57 NG |
213 | (define-public giac-xcas |
214 | (package | |
215 | (name "giac-xcas") | |
adcde217 | 216 | (version "1.4.9-59") |
57497c57 NG |
217 | (source (origin |
218 | (method url-fetch) | |
219 | ;; "~parisse/giac" is not used because the maintainer regularly | |
220 | ;; overwrites the release tarball there, introducing a checksum | |
221 | ;; mismatch every time. See | |
222 | ;; <https://www-fourier.ujf-grenoble.fr/~parisse/debian/dists/stable/main/source/README> | |
223 | (uri (string-append "https://www-fourier.ujf-grenoble.fr/" | |
224 | "~parisse/debian/dists/stable/main/" | |
225 | "source/giac_" version ".tar.gz")) | |
226 | (sha256 | |
227 | (base32 | |
adcde217 | 228 | "0dv5p5y6gkrsmz3xa7fw87rjyabwdwk09mqb09kb7gai9n9dgayk")))) |
57497c57 NG |
229 | (build-system gnu-build-system) |
230 | (arguments | |
231 | `(#:phases | |
232 | (modify-phases %standard-phases | |
233 | (add-after 'unpack 'patch-bin-cp | |
234 | (lambda _ | |
235 | ;; Some Makefiles contain hard-coded "/bin/cp". | |
236 | (substitute* (find-files "doc" "^Makefile") | |
237 | (("/bin/cp") (which "cp"))) | |
57497c57 NG |
238 | #t))))) |
239 | (inputs | |
240 | `(("fltk" ,fltk) | |
241 | ("gmp" ,gmp) | |
242 | ("gsl" ,gsl) | |
243 | ("lapack" ,lapack) | |
244 | ("libao" ,ao) | |
245 | ("libjpeg" ,libjpeg) | |
246 | ("libpng" ,libpng) | |
247 | ("libx11" ,libx11) | |
99a00446 | 248 | ("libxinerama" ,libxinerama) |
57497c57 NG |
249 | ("libxft" ,libxft) |
250 | ("libxt" ,libxt) | |
251 | ("mesa" ,mesa) | |
252 | ("mpfi" ,mpfi) | |
253 | ("mpfr" ,mpfr) | |
254 | ("ntl" ,ntl) | |
255 | ("perl" ,perl) | |
256 | ("pari-gp" ,pari-gp) | |
257 | ("tcsh" ,tcsh) | |
a023ec6e | 258 | ("texlive" ,texlive-tiny))) |
57497c57 NG |
259 | (native-inputs `(("readline" ,readline))) |
260 | (home-page "https://www-fourier.ujf-grenoble.fr/~parisse/giac.html") | |
261 | (synopsis "Computer algebra system") | |
262 | (description | |
263 | "Giac/Xcas is a computer algebra system. It has a compatibility mode for | |
264 | maple, mupad and the TI89. It is available as a standalone program (graphic | |
265 | or text interfaces) or as a C++ library.") | |
266 | (license license:gpl3+))) | |
267 | ||
d7ab698a AE |
268 | (define-public flint |
269 | (package | |
270 | (name "flint") | |
6c591c8e | 271 | (version "2.5.2") |
d7ab698a AE |
272 | (source (origin |
273 | (method url-fetch) | |
274 | (uri (string-append | |
275 | "http://flintlib.org/flint-" | |
276 | version ".tar.gz")) | |
277 | (sha256 (base32 | |
6c591c8e | 278 | "11syazv1a8rrnac3wj3hnyhhflpqcmq02q8pqk2m6g2k6h0gxwfb")) |
fc1adab1 | 279 | (patches (search-patches "flint-ldconfig.patch")))) |
d7ab698a | 280 | (build-system gnu-build-system) |
df15d17d | 281 | (propagated-inputs |
d7ab698a | 282 | `(("gmp" ,gmp) |
df15d17d | 283 | ("mpfr" ,mpfr))) ; header files from both are included by flint/arith.h |
d7ab698a | 284 | (arguments |
ad11974e AE |
285 | `(#:parallel-tests? #f ; seems to be necessary on arm |
286 | #:phases | |
91430de6 AE |
287 | (modify-phases %standard-phases |
288 | (replace 'configure | |
289 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
290 | (let ((out (assoc-ref outputs "out")) | |
291 | (gmp (assoc-ref inputs "gmp")) | |
292 | (mpfr (assoc-ref inputs "mpfr"))) | |
91430de6 AE |
293 | ;; do not pass "--enable-fast-install", which makes the |
294 | ;; homebrew configure process fail | |
295 | (zero? (system* | |
296 | "./configure" | |
297 | (string-append "--prefix=" out) | |
298 | (string-append "--with-gmp=" gmp) | |
299 | (string-append "--with-mpfr=" mpfr))))))))) | |
d7ab698a AE |
300 | (synopsis "Fast library for number theory") |
301 | (description | |
302 | "FLINT is a C library for number theory. It supports arithmetic | |
303 | with numbers, polynomials, power series and matrices over many base | |
304 | rings, including multiprecision integers and rationals, integers | |
305 | modulo n, p-adic numbers, finite fields (prime and non-prime order) | |
306 | and real and complex numbers (via the Arb extension library). | |
307 | ||
308 | Operations that can be performed include conversions, arithmetic, | |
309 | GCDs, factoring, solving linear systems, and evaluating special | |
310 | functions. In addition, FLINT provides various low-level routines for | |
311 | fast arithmetic.") | |
9f51293c | 312 | (license license:gpl2+) |
d7ab698a AE |
313 | (home-page "http://flintlib.org/"))) |
314 | ||
6b8e8285 AE |
315 | (define-public arb |
316 | (package | |
317 | (name "arb") | |
2cdb257e | 318 | (version "2.14.0") |
6b8e8285 AE |
319 | (source (origin |
320 | (method url-fetch) | |
321 | (uri (string-append | |
322 | "https://github.com/fredrik-johansson/arb/archive/" | |
323 | version ".tar.gz")) | |
f586c877 | 324 | (file-name (string-append name "-" version ".tar.gz")) |
424ce93d AE |
325 | (sha256 |
326 | (base32 | |
2cdb257e | 327 | "0ncr27nd20xxi18nj30cvpa6r52v59nq7gbi34x3l4xym3p8mlmx")))) |
6b8e8285 | 328 | (build-system gnu-build-system) |
480d19e6 AE |
329 | (propagated-inputs |
330 | `(("flint" ,flint))) ; flint.h is included by arf.h | |
6b8e8285 | 331 | (inputs |
480d19e6 | 332 | `(("gmp" ,gmp) |
6b8e8285 AE |
333 | ("mpfr" ,mpfr))) |
334 | (arguments | |
335 | `(#:phases | |
dc1d3cde KK |
336 | (modify-phases %standard-phases |
337 | (replace 'configure | |
338 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
339 | (let ((out (assoc-ref outputs "out")) | |
340 | (flint (assoc-ref inputs "flint")) | |
341 | (gmp (assoc-ref inputs "gmp")) | |
342 | (mpfr (assoc-ref inputs "mpfr"))) | |
343 | ;; do not pass "--enable-fast-install", which makes the | |
344 | ;; homebrew configure process fail | |
2cdb257e | 345 | (invoke "./configure" |
dc1d3cde KK |
346 | (string-append "--prefix=" out) |
347 | (string-append "--with-flint=" flint) | |
348 | (string-append "--with-gmp=" gmp) | |
2cdb257e | 349 | (string-append "--with-mpfr=" mpfr)))))))) |
6b8e8285 AE |
350 | (synopsis "Arbitrary precision floating-point ball arithmetic") |
351 | (description | |
352 | "Arb is a C library for arbitrary-precision floating-point ball | |
353 | arithmetic. It supports efficient high-precision computation with | |
354 | polynomials, power series, matrices and special functions over the | |
355 | real and complex numbers, with automatic, rigorous error control.") | |
2cdb257e | 356 | (license license:lgpl2.1+) |
6b8e8285 AE |
357 | (home-page "http://fredrikj.net/arb/"))) |
358 | ||
14e6520e AE |
359 | (define-public ntl |
360 | (package | |
361 | (name "ntl") | |
362 | (version "9.7.0") | |
363 | (source (origin | |
364 | (method url-fetch) | |
365 | (uri (string-append "http://shoup.net/ntl/ntl-" | |
366 | version ".tar.gz")) | |
367 | (sha256 (base32 | |
368 | "115frp5flyvw9wghz4zph1b3llmr5nbxk1skgsggckr81fh3gmxq")))) | |
369 | (build-system gnu-build-system) | |
370 | (native-inputs | |
371 | `(("libtool" ,libtool) | |
372 | ("perl" ,perl))) ; for configuration | |
373 | ;; FIXME: Add optional input gf2x once available; then also add | |
374 | ;; configure flag "NTL_GF2X_LIB=on". | |
375 | (inputs | |
376 | `(("gmp" ,gmp))) | |
377 | (arguments | |
378 | `(#:phases | |
379 | (modify-phases %standard-phases | |
380 | (replace 'configure | |
381 | (lambda* (#:key outputs #:allow-other-keys) | |
382 | (chdir "src") | |
383 | (system* "./configure" | |
384 | (string-append "PREFIX=" (assoc-ref outputs "out")) | |
385 | ;; Do not build especially for the build machine. | |
386 | "NATIVE=off" | |
387 | ;; Also do not tune to the build machine. | |
388 | "WIZARD=off" | |
389 | "SHARED=on") | |
390 | #t))))) | |
391 | (synopsis "C++ library for number theory") | |
392 | (description | |
393 | "NTL is a C++ library providing data structures and algorithms | |
394 | for manipulating signed, arbitrary length integers, and for vectors, | |
395 | matrices, and polynomials over the integers and over finite fields.") | |
396 | (license license:gpl2+) | |
397 | (home-page "http://shoup.net/ntl/"))) | |
398 | ||
aae03c48 AE |
399 | (define-public singular |
400 | (package | |
401 | (name "singular") | |
402 | (version "4.0.3") | |
403 | (source (origin | |
404 | (method url-fetch) | |
405 | (uri (string-append "http://www.mathematik.uni-kl.de/ftp/pub/" | |
406 | "Math/Singular/SOURCES/" | |
407 | (string-join (string-split version #\.) "-") | |
408 | "/singular-" version ".tar.gz")) | |
409 | (sha256 (base32 | |
7d4c6ee8 | 410 | "0viidy2fz62rln9p0s9qfs7fnm55c6fw1agydd1py26gxylp1ksc")))) |
aae03c48 AE |
411 | (build-system gnu-build-system) |
412 | (native-inputs | |
413 | `(("doxygen" ,doxygen) | |
414 | ("graphviz" ,graphviz) | |
415 | ("perl" ,perl))) | |
416 | (inputs | |
417 | `(("cddlib" ,cddlib) | |
418 | ("gmp" ,gmp) | |
419 | ("flint" ,flint) | |
420 | ("mpfr" ,mpfr) | |
421 | ("ntl" ,ntl) | |
422 | ("python" ,python-2) | |
423 | ("readline" ,readline))) | |
424 | (arguments | |
425 | `(#:configure-flags | |
426 | (list (string-append "--with-ntl=" | |
427 | (assoc-ref %build-inputs "ntl"))))) | |
428 | (synopsis "Computer algebra system for polynomial computations") | |
429 | (description | |
430 | "Singular is a computer algebra system for polynomial computations, | |
431 | with special emphasis on commutative and non-commutative algebra, algebraic | |
432 | geometry and singularity theory.") | |
433 | ;; Singular itself is dual licensed gpl2 or gpl3, but some of the | |
434 | ;; libraries with which it links are licensed under lgpl3+, so the | |
435 | ;; combined work becomes gpl3. See COPYING in the source code. | |
436 | (license license:gpl3) | |
437 | (home-page "http://www.singular.uni-kl.de/index.php"))) | |
438 | ||
57c9c349 AE |
439 | (define-public gmp-ecm |
440 | (package | |
441 | (name "gmp-ecm") | |
7d15cf17 | 442 | (version "7.0.4") |
57c9c349 | 443 | (source (origin |
7d15cf17 TGR |
444 | (method url-fetch) |
445 | ;; Use the ‘Latest version’ link for a stable URI across releases. | |
446 | (uri (string-append "https://gforge.inria.fr/frs/download.php/" | |
447 | "latestfile/160/ecm-" version ".tar.gz")) | |
448 | (sha256 (base32 | |
449 | "0hxs24c2m3mh0nq1zz63z3sb7dhy1rilg2s1igwwcb26x3pb7xqc")))) | |
57c9c349 AE |
450 | (build-system gnu-build-system) |
451 | (inputs | |
452 | `(("gmp" ,gmp))) | |
453 | (arguments | |
454 | `(#:configure-flags '("--enable-shared" | |
455 | ;; Disable specific assembly routines, which depend | |
456 | ;; on the subarchitecture of the build machine, | |
457 | ;; and use gmp instead. | |
458 | "--disable-asm-redc"))) | |
459 | (synopsis "Integer factorization library using the elliptic curve method") | |
460 | (description | |
461 | "GMP-ECM factors integers using the elliptic curve method (ECM) as well | |
462 | as the P-1 and P+1 algorithms. It provides a library and a stand-alone | |
463 | binary.") | |
464 | ;; Most files are under lgpl3+, but some are under gpl3+ or gpl2+, | |
465 | ;; so the combined work is under gpl3+. | |
466 | (license license:gpl3+) | |
467 | (home-page "http://ecm.gforge.inria.fr/"))) | |
468 | ||
ed9f9a77 LC |
469 | (define-public bc |
470 | (package | |
471 | (name "bc") | |
f71f29ca | 472 | (version "1.07.1") |
ed9f9a77 LC |
473 | (source (origin |
474 | (method url-fetch) | |
475 | (uri (string-append "mirror://gnu/bc/bc-" version ".tar.gz")) | |
476 | (sha256 | |
477 | (base32 | |
f71f29ca | 478 | "0amh9ik44jfg66csyvf4zz1l878c4755kjndq9j0270akflgrbb2")))) |
ed9f9a77 | 479 | (build-system gnu-build-system) |
f71f29ca MB |
480 | (native-inputs |
481 | `(("ed" ,ed) | |
482 | ("flex" ,flex) | |
483 | ("texinfo" ,texinfo))) | |
ed9f9a77 | 484 | (arguments |
f71f29ca | 485 | '(#:configure-flags |
f0bacad6 | 486 | (list "--with-readline"))) |
6fd52309 | 487 | (home-page "https://www.gnu.org/software/bc/") |
f50d2669 | 488 | (synopsis "Arbitrary precision numeric processing language") |
ed9f9a77 | 489 | (description |
a22dc0c4 LC |
490 | "bc is an arbitrary precision numeric processing language. It includes |
491 | an interactive environment for evaluating mathematical statements. Its | |
492 | syntax is similar to that of C, so basic usage is familiar. It also includes | |
493 | \"dc\", a reverse-polish calculator.") | |
9f51293c | 494 | (license license:gpl2+))) |
37e6cdcd | 495 | |
2a9b10c7 RW |
496 | ;; The original kiss-fft does not have a complete build system and does not |
497 | ;; build any shared libraries. This is a fork used by Extempore. | |
498 | (define-public kiss-fft-for-extempore | |
499 | (package | |
500 | (name "kiss-fft-for-extempore") | |
501 | (version "1.3.0") | |
502 | (source (origin | |
503 | (method url-fetch) | |
504 | (uri (string-append "https://github.com/extemporelang/kiss_fft/archive/" | |
505 | version ".tar.gz")) | |
506 | (file-name (string-append name "-" version ".tar.gz")) | |
507 | (sha256 | |
508 | (base32 | |
509 | "0hkp9l6l4c92fb1l2sh6a6zv1hynpvb2s4d03vd8vxyvybc0l4pv")))) | |
510 | (build-system cmake-build-system) | |
511 | (arguments `(#:tests? #f)) ; no tests included | |
39162ee4 RW |
512 | ;; Extempore refuses to build on architectures other than x86_64 |
513 | (supported-systems '("x86_64-linux")) | |
2a9b10c7 RW |
514 | (home-page "https://github.com/extemporelang/kiss_fft") |
515 | (synopsis "Mixed-radix Fast Fourier Transform") | |
516 | (description | |
517 | "Kiss FFT attempts to be a reasonably efficient, moderately useful FFT | |
518 | that can use fixed or floating data types and can easily be incorporated into | |
519 | a C program.") | |
520 | (license license:bsd-3))) | |
521 | ||
37e6cdcd LC |
522 | (define-public fftw |
523 | (package | |
524 | (name "fftw") | |
a0d4d2d8 | 525 | (version "3.3.7") |
37e6cdcd LC |
526 | (source (origin |
527 | (method url-fetch) | |
528 | (uri (string-append "ftp://ftp.fftw.org/pub/fftw/fftw-" | |
529 | version".tar.gz")) | |
530 | (sha256 | |
531 | (base32 | |
a0d4d2d8 | 532 | "0wsms8narnbhfsa8chdflv2j9hzspvflblnqdn7hw8x5xdzrnq1v")))) |
37e6cdcd LC |
533 | (build-system gnu-build-system) |
534 | (arguments | |
65bb2279 | 535 | `(#:configure-flags |
69d5909e MW |
536 | '("--enable-shared" "--enable-openmp" "--enable-threads" |
537 | ,@(let ((system (or (%current-target-system) (%current-system)))) | |
538 | ;; Enable SIMD extensions for codelets. See details at: | |
539 | ;; <http://fftw.org/fftw3_doc/Installation-on-Unix.html>. | |
540 | (cond | |
541 | ((string-prefix? "x86_64" system) | |
542 | '("--enable-sse2" "--enable-avx" "--enable-avx2" | |
543 | "--enable-avx512" "--enable-avx-128-fma")) | |
544 | ((string-prefix? "i686" system) | |
545 | '("--enable-sse2")) | |
546 | ((string-prefix? "aarch64" system) | |
547 | ;; Note that fftw supports NEON on 32-bit ARM only when | |
548 | ;; compiled for single-precision. | |
549 | '("--enable-neon")) | |
550 | (else | |
551 | '()))) | |
65bb2279 EB |
552 | ;; By default '-mtune=native' is used. However, that may cause the |
553 | ;; use of ISA extensions (e.g. AVX) that are not necessarily | |
554 | ;; available on the user's machine when that package is built on a | |
555 | ;; different machine. | |
556 | "ax_cv_c_flags__mtune_native=no"))) | |
37e6cdcd LC |
557 | (native-inputs `(("perl" ,perl))) |
558 | (home-page "http://fftw.org") | |
559 | (synopsis "Computing the discrete Fourier transform") | |
560 | (description | |
561 | "FFTW is a C subroutine library for computing the discrete Fourier | |
562 | transform (DFT) in one or more dimensions, of arbitrary input size, and of | |
563 | both real and complex data (as well as of even/odd data---i.e. the discrete | |
564 | cosine/ sine transforms or DCT/DST).") | |
9f51293c | 565 | (license license:gpl2+))) |
7569c5cb EB |
566 | |
567 | (define-public fftwf | |
568 | (package (inherit fftw) | |
569 | (name "fftwf") | |
570 | (arguments | |
571 | (substitute-keyword-arguments (package-arguments fftw) | |
69d5909e MW |
572 | ((#:configure-flags fftw-configure-flags) |
573 | `(cons* "--enable-single" | |
574 | ,@(if (string-prefix? "arm" (or (%current-target-system) | |
575 | (%current-system))) | |
576 | ;; fftw supports NEON on 32-bit ARM only when compiled | |
577 | ;; for single-precision, so add it here. | |
578 | '("--enable-neon") | |
579 | '()) | |
580 | ,fftw-configure-flags)))) | |
7569c5cb EB |
581 | (description |
582 | (string-append (package-description fftw) | |
583 | " Single-precision version.")))) | |
e5c66f8c EB |
584 | |
585 | (define-public fftw-openmpi | |
586 | (package (inherit fftw) | |
587 | (name "fftw-openmpi") | |
588 | (inputs | |
589 | `(("openmpi" ,openmpi) | |
590 | ,@(package-inputs fftw))) | |
591 | (arguments | |
592 | (substitute-keyword-arguments (package-arguments fftw) | |
593 | ((#:configure-flags cf) | |
594 | `(cons "--enable-mpi" ,cf)))) | |
595 | (description | |
596 | (string-append (package-description fftw) | |
597 | " With OpenMPI parallelism support.")))) | |
8f4b1dfb | 598 | |
c8d99608 RW |
599 | (define-public java-la4j |
600 | (package | |
601 | (name "java-la4j") | |
602 | (version "0.6.0") | |
603 | (source (origin | |
604 | (method git-fetch) | |
605 | (uri (git-reference | |
606 | (url "https://github.com/vkostyukov/la4j.git") | |
607 | (commit version))) | |
608 | (file-name (string-append name "-" version "-checkout")) | |
609 | (sha256 | |
610 | (base32 | |
611 | "1qir8dr978cfvz9k12m2kbdwpyf6cqdf1d0ilb7lnkhbgq5i53w3")))) | |
612 | (build-system ant-build-system) | |
613 | (arguments | |
614 | `(#:jar-name "la4j.jar" | |
615 | #:jdk ,icedtea-8 | |
616 | #:test-exclude (list "**/Abstract*.java" | |
617 | "**/MatrixTest.java" | |
618 | "**/DenseMatrixTest.java" | |
619 | "**/SparseMatrixTest.java" | |
620 | "**/VectorTest.java" | |
621 | "**/SparseVectorTest.java" | |
622 | "**/DenseVectorTest.java"))) | |
623 | (native-inputs | |
624 | `(("java-junit" ,java-junit) | |
625 | ("java-hamcrest-core" ,java-hamcrest-core))) | |
626 | (home-page "http://la4j.org/") | |
627 | (synopsis "Java library that provides Linear Algebra primitives and algorithms") | |
628 | (description "The la4j library is a Java library that provides Linear | |
629 | Algebra primitives (matrices and vectors) and algorithms. The key features of | |
630 | the la4j library are: | |
631 | ||
632 | @itemize | |
633 | @item No dependencies and tiny size | |
634 | @item Fluent object-oriented/functional API | |
635 | @item Sparse (CRS, CCS) and dense (1D/2D arrays) matrices | |
636 | @item Linear systems solving (Gaussian, Jacobi, Zeidel, Square Root, Sweep and other) | |
637 | @item Matrices decomposition (Eigenvalues/Eigenvectors, SVD, QR, LU, Cholesky and other) | |
638 | @item MatrixMarket/CSV IO formats support for matrices and vectors | |
639 | @end itemize\n") | |
640 | (license license:asl2.0))) | |
641 | ||
24074b0b RW |
642 | (define-public java-jlargearrays |
643 | (package | |
644 | (name "java-jlargearrays") | |
645 | (version "1.6") | |
646 | (source (origin | |
647 | (method url-fetch) | |
648 | (uri (string-append "http://search.maven.org/remotecontent?" | |
649 | "filepath=pl/edu/icm/JLargeArrays/" | |
650 | version "/JLargeArrays-" version | |
651 | "-sources.jar")) | |
652 | (file-name (string-append name "-" version ".jar")) | |
653 | (sha256 | |
654 | (base32 | |
655 | "0v05iphpxbjnd7f4jf1rlqq3m8hslhcm0imdbsgxr20pi3xkaf2a")))) | |
656 | (build-system ant-build-system) | |
657 | (arguments | |
658 | `(#:jar-name "jlargearrays.jar" | |
659 | #:tests? #f ; tests are not included in the release archive | |
660 | #:jdk ,icedtea-8)) | |
661 | (propagated-inputs | |
662 | `(("java-commons-math3" ,java-commons-math3))) | |
663 | (home-page "https://gitlab.com/ICM-VisLab/JLargeArrays") | |
664 | (synopsis "Library of one-dimensional arrays that can store up to 263 elements") | |
665 | (description "JLargeArrays is a Java library of one-dimensional arrays | |
666 | that can store up to 263 elements.") | |
667 | (license license:bsd-2))) | |
668 | ||
4e92911c RW |
669 | (define-public java-jtransforms |
670 | (package | |
671 | (name "java-jtransforms") | |
672 | (version "3.1") | |
673 | (source (origin | |
674 | (method url-fetch) | |
675 | (uri (string-append "http://search.maven.org/remotecontent?" | |
676 | "filepath=com/github/wendykierp/JTransforms/" | |
677 | version "/JTransforms-" version "-sources.jar")) | |
678 | (sha256 | |
679 | (base32 | |
680 | "1haw5m8shv5srgcpwkl853dz8bv6h90bzlhcps6mdpb4cixjirsg")))) | |
681 | (build-system ant-build-system) | |
682 | (arguments | |
683 | `(#:jar-name "jtransforms.jar" | |
684 | #:tests? #f ; tests are not included in the release archive | |
685 | #:jdk ,icedtea-8)) | |
686 | (propagated-inputs | |
687 | `(("java-commons-math3" ,java-commons-math3) | |
688 | ("java-jlargearrays" ,java-jlargearrays))) | |
689 | (home-page "https://github.com/wendykierp/JTransforms") | |
690 | (synopsis "Multithreaded FFT library written in pure Java") | |
691 | (description "JTransforms is a multithreaded FFT library written in pure | |
692 | Java. Currently, four types of transforms are available: @dfn{Discrete | |
693 | Fourier Transform} (DFT), @dfn{Discrete Cosine Transform} (DCT), @dfn{Discrete | |
694 | Sine Transform} (DST) and @dfn{Discrete Hartley Transform} (DHT).") | |
695 | (license license:bsd-2))) | |
696 | ||
8f4b1dfb LC |
697 | (define-public eigen |
698 | (package | |
699 | (name "eigen") | |
1137d85b | 700 | (version "3.3.4") |
8f4b1dfb LC |
701 | (source (origin |
702 | (method url-fetch) | |
703 | (uri (string-append "https://bitbucket.org/eigen/eigen/get/" | |
9b268f12 | 704 | version ".tar.bz2")) |
8f4b1dfb LC |
705 | (sha256 |
706 | (base32 | |
1137d85b | 707 | "19m4406jvqnwh7kpcvx1lfx2vdc5zwia5q9ayv89bimg1gmln9fx")) |
2abcc935 | 708 | (file-name (string-append name "-" version ".tar.bz2")) |
1137d85b | 709 | (patches (search-patches "eigen-arm-neon-fixes.patch")) |
8f4b1dfb LC |
710 | (modules '((guix build utils))) |
711 | (snippet | |
712 | ;; There are 3 test failures in the "unsupported" directory, | |
713 | ;; but maintainers say it's a known issue and it's unsupported | |
714 | ;; anyway, so just skip them. | |
1137d85b | 715 | '(begin |
44884a9d RW |
716 | (substitute* "unsupported/CMakeLists.txt" |
717 | (("add_subdirectory\\(test.*") | |
718 | "# Do not build the tests for unsupported features.\n")) | |
1137d85b | 719 | (substitute* "CMakeLists.txt" |
1137d85b EB |
720 | ;; Work around |
721 | ;; <http://eigen.tuxfamily.org/bz/show_bug.cgi?id=1114>. | |
722 | (("\"include/eigen3\"") | |
723 | "\"${CMAKE_INSTALL_PREFIX}/include/eigen3\"")) | |
724 | (substitute* "test/bdcsvd.cpp" | |
725 | ;; See | |
726 | ;; https://bitbucket.org/eigen/eigen/commits/ea8c22ce6920e982d15245ee41d0531a46a28e5d | |
727 | ((".*svd_preallocate[^\n]*" &) | |
6cbee49d MW |
728 | (string-append "//" & " // Not supported by BDCSVD"))) |
729 | #t)))) | |
8f4b1dfb LC |
730 | (build-system cmake-build-system) |
731 | (arguments | |
732 | '(;; Turn off debugging symbols to save space. | |
733 | #:build-type "Release" | |
734 | ||
354f4fe2 | 735 | #:phases (modify-phases %standard-phases |
ef8742ea | 736 | (replace 'check |
354f4fe2 | 737 | (lambda _ |
354f4fe2 LC |
738 | (let* ((cores (parallel-job-count)) |
739 | (dash-j (format #f "-j~a" cores))) | |
1137d85b | 740 | (setenv "EIGEN_SEED" "1") ;for reproducibility |
ef8742ea LC |
741 | ;; First build the tests, in parallel. See |
742 | ;; <http://eigen.tuxfamily.org/index.php?title=Tests>. | |
743 | (and (zero? (system* "make" "buildtests" dash-j)) | |
8f4b1dfb | 744 | |
ef8742ea LC |
745 | ;; Then run 'CTest' with -V so we get more |
746 | ;; details upon failure. | |
747 | (zero? (system* "ctest" "-V" dash-j))))))))) | |
eeb8b0e6 | 748 | (home-page "https://eigen.tuxfamily.org") |
8f4b1dfb LC |
749 | (synopsis "C++ template library for linear algebra") |
750 | (description | |
751 | "Eigen is a C++ template library for linear algebra: matrices, vectors, | |
752 | numerical solvers, and related algorithms. It provides an elegant API based | |
753 | on \"expression templates\". It is versatile: it supports all matrix sizes, | |
754 | all standard numeric types, various matrix decompositions and geometry | |
755 | features, and more.") | |
756 | ||
757 | ;; Most of the code is MPLv2, with a few files under LGPLv2.1+ or BSD-3. | |
758 | ;; See 'COPYING.README' for details. | |
9f51293c | 759 | (license license:mpl2.0))) |
70770b93 FT |
760 | |
761 | (define-public xtensor | |
762 | (package | |
763 | (name "xtensor") | |
764 | (version "0.15.9") | |
765 | (source (origin | |
766 | (method url-fetch) | |
767 | (uri (string-append | |
768 | "https://github.com/QuantStack/xtensor/archive/" | |
769 | version ".tar.gz")) | |
770 | (sha256 | |
771 | (base32 | |
772 | "0mlsw4p1w5mh7pscddfdamz27zq3wml5qla3vbzgvif34vsqc8ra")) | |
773 | (file-name (string-append name "-" version ".tar.gz")))) | |
774 | (build-system cmake-build-system) | |
775 | (native-inputs | |
776 | `(("googletest" ,googletest) | |
777 | ("xtl" ,xtl))) | |
778 | (arguments | |
779 | `(#:configure-flags | |
780 | '("-DBUILD_TESTS=ON") | |
781 | #:test-target "xtest")) | |
782 | (home-page "http://quantstack.net/xtensor") | |
783 | (synopsis "C++ tensors with broadcasting and lazy computing") | |
784 | (description "xtensor is a C++ library meant for numerical analysis with | |
785 | multi-dimensional array expressions. | |
786 | ||
787 | xtensor provides: | |
788 | @itemize | |
789 | @item an extensible expression system enabling lazy broadcasting. | |
790 | @item an API following the idioms of the C++ standard library. | |
791 | @item tools to manipulate array expressions and build upon xtensor. | |
792 | @end itemize") | |
793 | (license license:bsd-3))) |