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