gnu: Remove webkitgtk-2.4 and webkitgtk/gtk+-2.
[jackhill/guix/guix.git] / gnu / packages / algebra.scm
CommitLineData
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 80arbitrary precision real (mpfr) or complex (mpc) numbers, without control
35b9e423 81on the rounding. For the time being, only the few functions needed to
2ed139c4 82implement the floating point approach to complex multiplication are
35b9e423 83implemented. On the other hand, these comprise asymptotically fast
e881752c 84multiplication 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
109imaginary quadratic number fields and of elliptic curves with complex
110multiplication via floating point approximations. It consists of libraries
111that can be called from within a C program and of executable command
112line 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 133solve 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
168computations in number theory (factorisations, algebraic number theory,
169elliptic curves...), but it also contains a large number of other useful
170functions to compute with mathematical entities such as matrices,
171polynomials, power series, algebraic numbers, etc., and a lot of
172transcendental functions.
173PARI 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
200computations in number theory (factorisations, algebraic number theory,
201elliptic curves...), but it also contains a large number of other useful
202functions to compute with mathematical entities such as matrices,
203polynomials, power series, algebraic numbers, etc., and a lot of
204transcendental functions.
205PARI is also available as a C library to allow for faster computations.
206
207GP2C, 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")
0903a517 214 (version "1.4.9-45")
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
0903a517 226 "11za5rznr2dgy6598y4iwrcyi86w7f601ci9i794kl8k22pqhcd8"))))
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
262maple, mupad and the TI89. It is available as a standalone program (graphic
263or 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
301with numbers, polynomials, power series and matrices over many base
302rings, including multiprecision integers and rationals, integers
303modulo n, p-adic numbers, finite fields (prime and non-prime order)
304and real and complex numbers (via the Arb extension library).
305
306Operations that can be performed include conversions, arithmetic,
307GCDs, factoring, solving linear systems, and evaluating special
308functions. In addition, FLINT provides various low-level routines for
309fast 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
352arithmetic. It supports efficient high-precision computation with
353polynomials, power series, matrices and special functions over the
354real 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
393for manipulating signed, arbitrary length integers, and for vectors,
394matrices, 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,
430with special emphasis on commutative and non-commutative algebra, algebraic
431geometry 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
461as the P-1 and P+1 algorithms. It provides a library and a stand-alone
462binary.")
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
490an interactive environment for evaluating mathematical statements. Its
491syntax 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
517that can use fixed or floating data types and can easily be incorporated into
518a 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
86f4e9d7
RW
534 '(#:configure-flags
535 '("--enable-shared" "--enable-openmp" "--enable-threads")
b07e817e
TGR
536 #:phases
537 (modify-phases %standard-phases
538 (add-before 'build 'no-native
37e6cdcd
LC
539 (lambda _
540 ;; By default '-mtune=native' is used. However, that may
541 ;; cause the use of ISA extensions (SSE2, etc.) that are
542 ;; not necessarily available on the user's machine when
543 ;; that package is built on a different machine.
544 (substitute* (find-files "." "Makefile$")
b07e817e
TGR
545 (("-mtune=native") ""))
546 #t)))))
37e6cdcd
LC
547 (native-inputs `(("perl" ,perl)))
548 (home-page "http://fftw.org")
549 (synopsis "Computing the discrete Fourier transform")
550 (description
551 "FFTW is a C subroutine library for computing the discrete Fourier
552transform (DFT) in one or more dimensions, of arbitrary input size, and of
553both real and complex data (as well as of even/odd data---i.e. the discrete
554cosine/ sine transforms or DCT/DST).")
9f51293c 555 (license license:gpl2+)))
7569c5cb
EB
556
557(define-public fftwf
558 (package (inherit fftw)
559 (name "fftwf")
560 (arguments
561 (substitute-keyword-arguments (package-arguments fftw)
562 ((#:configure-flags cf)
563 `(cons "--enable-float" ,cf))))
564 (description
565 (string-append (package-description fftw)
566 " Single-precision version."))))
e5c66f8c
EB
567
568(define-public fftw-openmpi
569 (package (inherit fftw)
570 (name "fftw-openmpi")
571 (inputs
572 `(("openmpi" ,openmpi)
573 ,@(package-inputs fftw)))
574 (arguments
575 (substitute-keyword-arguments (package-arguments fftw)
576 ((#:configure-flags cf)
577 `(cons "--enable-mpi" ,cf))))
578 (description
579 (string-append (package-description fftw)
580 " With OpenMPI parallelism support."))))
8f4b1dfb 581
ea562473
LC
582(define-public fftw-avx
583 (package
a0d4d2d8 584 (inherit fftw)
ea562473
LC
585 (name "fftw-avx")
586 (arguments
a0d4d2d8 587 (substitute-keyword-arguments (package-arguments fftw)
ea562473
LC
588 ((#:configure-flags flags ''())
589 ;; Enable AVX & co. See details at:
590 ;; <http://fftw.org/fftw3_doc/Installation-on-Unix.html>.
591 `(append '("--enable-avx" "--enable-avx2" "--enable-avx512"
592 "--enable-avx-128-fma")
593 ,flags))
594 ((#:substitutable? _ #f)
595 ;; To run the tests, we must have a CPU that supports all these
596 ;; extensions. Since we cannot be sure that machines in the build
597 ;; farm support them, disable substitutes altogether.
598 #f)
599 ((#:phases _)
600 ;; Since we're not providing binaries, let '-mtune=native' through.
601 '%standard-phases)))
602 (synopsis "Computing the discrete Fourier transform (AVX2-optimized)")
603 (supported-systems '("x86_64-linux"))))
604
c8d99608
RW
605(define-public java-la4j
606 (package
607 (name "java-la4j")
608 (version "0.6.0")
609 (source (origin
610 (method git-fetch)
611 (uri (git-reference
612 (url "https://github.com/vkostyukov/la4j.git")
613 (commit version)))
614 (file-name (string-append name "-" version "-checkout"))
615 (sha256
616 (base32
617 "1qir8dr978cfvz9k12m2kbdwpyf6cqdf1d0ilb7lnkhbgq5i53w3"))))
618 (build-system ant-build-system)
619 (arguments
620 `(#:jar-name "la4j.jar"
621 #:jdk ,icedtea-8
622 #:test-exclude (list "**/Abstract*.java"
623 "**/MatrixTest.java"
624 "**/DenseMatrixTest.java"
625 "**/SparseMatrixTest.java"
626 "**/VectorTest.java"
627 "**/SparseVectorTest.java"
628 "**/DenseVectorTest.java")))
629 (native-inputs
630 `(("java-junit" ,java-junit)
631 ("java-hamcrest-core" ,java-hamcrest-core)))
632 (home-page "http://la4j.org/")
633 (synopsis "Java library that provides Linear Algebra primitives and algorithms")
634 (description "The la4j library is a Java library that provides Linear
635Algebra primitives (matrices and vectors) and algorithms. The key features of
636the la4j library are:
637
638@itemize
639@item No dependencies and tiny size
640@item Fluent object-oriented/functional API
641@item Sparse (CRS, CCS) and dense (1D/2D arrays) matrices
642@item Linear systems solving (Gaussian, Jacobi, Zeidel, Square Root, Sweep and other)
643@item Matrices decomposition (Eigenvalues/Eigenvectors, SVD, QR, LU, Cholesky and other)
644@item MatrixMarket/CSV IO formats support for matrices and vectors
645@end itemize\n")
646 (license license:asl2.0)))
647
24074b0b
RW
648(define-public java-jlargearrays
649 (package
650 (name "java-jlargearrays")
651 (version "1.6")
652 (source (origin
653 (method url-fetch)
654 (uri (string-append "http://search.maven.org/remotecontent?"
655 "filepath=pl/edu/icm/JLargeArrays/"
656 version "/JLargeArrays-" version
657 "-sources.jar"))
658 (file-name (string-append name "-" version ".jar"))
659 (sha256
660 (base32
661 "0v05iphpxbjnd7f4jf1rlqq3m8hslhcm0imdbsgxr20pi3xkaf2a"))))
662 (build-system ant-build-system)
663 (arguments
664 `(#:jar-name "jlargearrays.jar"
665 #:tests? #f ; tests are not included in the release archive
666 #:jdk ,icedtea-8))
667 (propagated-inputs
668 `(("java-commons-math3" ,java-commons-math3)))
669 (home-page "https://gitlab.com/ICM-VisLab/JLargeArrays")
670 (synopsis "Library of one-dimensional arrays that can store up to 263 elements")
671 (description "JLargeArrays is a Java library of one-dimensional arrays
672that can store up to 263 elements.")
673 (license license:bsd-2)))
674
4e92911c
RW
675(define-public java-jtransforms
676 (package
677 (name "java-jtransforms")
678 (version "3.1")
679 (source (origin
680 (method url-fetch)
681 (uri (string-append "http://search.maven.org/remotecontent?"
682 "filepath=com/github/wendykierp/JTransforms/"
683 version "/JTransforms-" version "-sources.jar"))
684 (sha256
685 (base32
686 "1haw5m8shv5srgcpwkl853dz8bv6h90bzlhcps6mdpb4cixjirsg"))))
687 (build-system ant-build-system)
688 (arguments
689 `(#:jar-name "jtransforms.jar"
690 #:tests? #f ; tests are not included in the release archive
691 #:jdk ,icedtea-8))
692 (propagated-inputs
693 `(("java-commons-math3" ,java-commons-math3)
694 ("java-jlargearrays" ,java-jlargearrays)))
695 (home-page "https://github.com/wendykierp/JTransforms")
696 (synopsis "Multithreaded FFT library written in pure Java")
697 (description "JTransforms is a multithreaded FFT library written in pure
698Java. Currently, four types of transforms are available: @dfn{Discrete
699Fourier Transform} (DFT), @dfn{Discrete Cosine Transform} (DCT), @dfn{Discrete
700Sine Transform} (DST) and @dfn{Discrete Hartley Transform} (DHT).")
701 (license license:bsd-2)))
702
8f4b1dfb
LC
703(define-public eigen
704 (package
705 (name "eigen")
1137d85b 706 (version "3.3.4")
8f4b1dfb
LC
707 (source (origin
708 (method url-fetch)
709 (uri (string-append "https://bitbucket.org/eigen/eigen/get/"
9b268f12 710 version ".tar.bz2"))
8f4b1dfb
LC
711 (sha256
712 (base32
1137d85b 713 "19m4406jvqnwh7kpcvx1lfx2vdc5zwia5q9ayv89bimg1gmln9fx"))
2abcc935 714 (file-name (string-append name "-" version ".tar.bz2"))
1137d85b 715 (patches (search-patches "eigen-arm-neon-fixes.patch"))
8f4b1dfb
LC
716 (modules '((guix build utils)))
717 (snippet
718 ;; There are 3 test failures in the "unsupported" directory,
719 ;; but maintainers say it's a known issue and it's unsupported
720 ;; anyway, so just skip them.
1137d85b
EB
721 '(begin
722 (substitute* "CMakeLists.txt"
723 (("add_subdirectory\\(unsupported\\)")
724 "# Do not build the tests for unsupported features.\n")
725 ;; Work around
726 ;; <http://eigen.tuxfamily.org/bz/show_bug.cgi?id=1114>.
727 (("\"include/eigen3\"")
728 "\"${CMAKE_INSTALL_PREFIX}/include/eigen3\""))
729 (substitute* "test/bdcsvd.cpp"
730 ;; See
731 ;; https://bitbucket.org/eigen/eigen/commits/ea8c22ce6920e982d15245ee41d0531a46a28e5d
732 ((".*svd_preallocate[^\n]*" &)
6cbee49d
MW
733 (string-append "//" & " // Not supported by BDCSVD")))
734 #t))))
8f4b1dfb
LC
735 (build-system cmake-build-system)
736 (arguments
737 '(;; Turn off debugging symbols to save space.
738 #:build-type "Release"
739
354f4fe2 740 #:phases (modify-phases %standard-phases
ef8742ea 741 (replace 'check
354f4fe2 742 (lambda _
354f4fe2
LC
743 (let* ((cores (parallel-job-count))
744 (dash-j (format #f "-j~a" cores)))
1137d85b 745 (setenv "EIGEN_SEED" "1") ;for reproducibility
ef8742ea
LC
746 ;; First build the tests, in parallel. See
747 ;; <http://eigen.tuxfamily.org/index.php?title=Tests>.
748 (and (zero? (system* "make" "buildtests" dash-j))
8f4b1dfb 749
ef8742ea
LC
750 ;; Then run 'CTest' with -V so we get more
751 ;; details upon failure.
752 (zero? (system* "ctest" "-V" dash-j)))))))))
8f4b1dfb
LC
753 (home-page "http://eigen.tuxfamily.org")
754 (synopsis "C++ template library for linear algebra")
755 (description
756 "Eigen is a C++ template library for linear algebra: matrices, vectors,
757numerical solvers, and related algorithms. It provides an elegant API based
758on \"expression templates\". It is versatile: it supports all matrix sizes,
759all standard numeric types, various matrix decompositions and geometry
760features, and more.")
761
762 ;; Most of the code is MPLv2, with a few files under LGPLv2.1+ or BSD-3.
763 ;; See 'COPYING.README' for details.
9f51293c 764 (license license:mpl2.0)))