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