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