1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018 Andreas Enge <andreas@enge.fr>
3 ;;; Copyright © 2013, 2015, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
4 ;;; Copyright © 2016, 2017, 2018, 2019 Nicolas Goaziou <mail@nicolasgoaziou.fr>
5 ;;; Copyright © 2014, 2018 Mark H Weaver <mhw@netris.org>
6 ;;; Copyright © 2016, 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
7 ;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il>
8 ;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
9 ;;; Copyright © 2017 Marius Bakke <mbakke@fastmail.com>
10 ;;; Copyright © 2017, 2019 Eric Bavier <bavier@member.fsf.org>
12 ;;; This file is part of GNU Guix.
14 ;;; GNU Guix is free software; you can redistribute it and/or modify it
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.
19 ;;; GNU Guix is distributed in the hope that it will be useful, but
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.
24 ;;; You should have received a copy of the GNU General Public License
25 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
27 (define-module (gnu packages algebra)
28 #:use-module (gnu packages)
29 #:use-module (gnu packages autotools)
30 #:use-module (gnu packages check)
31 #:use-module (gnu packages compression)
32 #:use-module (gnu packages cpp)
33 #:use-module (gnu packages documentation)
34 #:use-module (gnu packages ed)
35 #:use-module (gnu packages flex)
36 #:use-module (gnu packages fltk)
37 #:use-module (gnu packages gl)
38 #:use-module (gnu packages graphviz)
39 #:use-module (gnu packages image)
40 #:use-module (gnu packages java)
41 #:use-module (gnu packages maths)
42 #:use-module (gnu packages mpi)
43 #:use-module (gnu packages multiprecision)
44 #:use-module (gnu packages perl)
45 #:use-module (gnu packages python)
46 #:use-module (gnu packages readline)
47 #:use-module (gnu packages shells)
48 #:use-module (gnu packages tex)
49 #:use-module (gnu packages texinfo)
50 #:use-module (gnu packages xiph)
51 #:use-module (gnu packages xorg)
52 #:use-module (guix build-system ant)
53 #:use-module (guix build-system gnu)
54 #:use-module (guix build-system cmake)
55 #:use-module (guix download)
56 #:use-module (guix git-download)
57 #:use-module ((guix licenses) #:prefix license:)
58 #:use-module (guix packages)
59 #:use-module (guix utils))
69 "http://www.multiprecision.org/downloads/mpfrcx-"
73 "1s968480ymv6w0rnvfp9mxvx98hvi29fkvw8nk4ggzc6azxgwybs"))))
74 (build-system gnu-build-system)
78 ("mpc" ,mpc))) ; Header files are included by mpfrcx.h.
79 (synopsis "Arithmetic of polynomials over arbitrary precision numbers")
81 "Mpfrcx is a library for the arithmetic of univariate polynomials over
82 arbitrary precision real (mpfr) or complex (mpc) numbers, without control
83 on the rounding. For the time being, only the few functions needed to
84 implement the floating point approach to complex multiplication are
85 implemented. On the other hand, these comprise asymptotically fast
86 multiplication routines such as Toom–Cook and the FFT.")
87 (license license:lgpl3+)
88 (home-page "http://mpfrcx.multiprecision.org/")))
97 "http://www.multiprecision.org/cm/download/cm-"
101 "1nf5kr0nqmhbzrsrinky18z0ighjpsmb5cr8zyg8jf04bfbyrfmc"))))
102 (build-system gnu-build-system)
105 ("zlib" ,zlib))) ; Header files included from cm_common.h.
107 `(("pari-gp" ,pari-gp)))
108 (synopsis "CM constructions for elliptic curves")
110 "The CM software implements the construction of ring class fields of
111 imaginary quadratic number fields and of elliptic curves with complex
112 multiplication via floating point approximations. It consists of libraries
113 that can be called from within a C program and of executable command
115 (license license:gpl3+)
116 (home-page "http://cm.multiprecision.org/")))
125 "http://perso.ens-lyon.fr/damien.stehle/fplll/libfplll-"
128 "1cbiby7ykis4z84swclpysrljmqhfcllpkcbll1m08rzskgb1a6b"))))
129 (build-system gnu-build-system)
130 (inputs `(("gmp" ,gmp)
132 (synopsis "Library for LLL-reduction of euclidean lattices")
134 "fplll LLL-reduces euclidean lattices. Since version 3, it can also
135 solve the shortest vector problem.")
136 (license license:lgpl2.1+)
137 (home-page "http://perso.ens-lyon.fr/damien.stehle/fplll/")))
139 (define-public pari-gp
146 "https://pari.math.u-bordeaux.fr/pub/pari/unix/pari-"
150 "1jfax92jpydjd02fwl30r6b8kfzqqd6sm4yx94gidyz9lqjb7a94"))))
151 (build-system gnu-build-system)
153 `(("texlive" ,(texlive-union
154 (list texlive-fonts-amsfonts
155 texlive-latex-amsfonts)))))
156 (inputs `(("gmp" ,gmp)
159 ("readline" ,readline)))
161 '(#:make-flags '("all")
162 #:test-target "dobench"
164 (modify-phases %standard-phases
166 (lambda* (#:key outputs #:allow-other-keys)
167 (invoke "./Configure"
168 (string-append "--prefix="
169 (assoc-ref outputs "out"))))))))
170 (synopsis "PARI/GP, a computer algebra system for number theory")
172 "PARI/GP is a widely used computer algebra system designed for fast
173 computations in number theory (factorisations, algebraic number theory,
174 elliptic curves...), but it also contains a large number of other useful
175 functions to compute with mathematical entities such as matrices,
176 polynomials, power series, algebraic numbers, etc., and a lot of
177 transcendental functions.
178 PARI is also available as a C library to allow for faster computations.")
179 (license license:gpl2+)
180 (home-page "https://pari.math.u-bordeaux.fr/")))
185 (version "0.0.11pl1")
189 "https://pari.math.u-bordeaux.fr/pub/pari/GP2C/gp2c-"
193 "1c6f6vmncw032kfzrfyr8bynw6yd3faxpy2285r009fmr0zxfs5s"))))
194 (build-system gnu-build-system)
195 (native-inputs `(("perl" ,perl)))
196 (inputs `(("pari-gp" ,pari-gp)))
199 (list (string-append "--with-paricfg="
200 (assoc-ref %build-inputs "pari-gp")
201 "/lib/pari/pari.cfg"))))
202 (synopsis "PARI/GP, a computer algebra system for number theory")
204 "PARI/GP is a widely used computer algebra system designed for fast
205 computations in number theory (factorisations, algebraic number theory,
206 elliptic curves...), but it also contains a large number of other useful
207 functions to compute with mathematical entities such as matrices,
208 polynomials, power series, algebraic numbers, etc., and a lot of
209 transcendental functions.
210 PARI is also available as a C library to allow for faster computations.
212 GP2C, the GP to C compiler, translates GP scripts to PARI programs.")
213 (license license:gpl2)
214 (home-page "https://pari.math.u-bordeaux.fr/")))
223 "https://gforge.inria.fr/frs/download.php/33497/cmh-"
227 "1a28xr9bs0igms0ik99x0w8lnb0jyfcmvyi26pbyh9ggcdivd33p"))))
228 (build-system gnu-build-system)
235 ("pari-gp" ,pari-gp)))
236 (synopsis "Igusa class polynomial computations")
238 "The CMH software computes Igusa (genus 2) class polynomials, which
239 parameterize the CM points in the moduli space of 2-dimensional abelian
240 varieties, i.e. Jacobians of hyperelliptic curves.
241 It can also be used to compute theta constants at arbitrary
243 (license license:gpl3+)
244 (home-page "http://cmh.gforge.inria.fr/")))
246 (define-public giac-xcas
252 ;; "~parisse/giac" is not used because the maintainer regularly
253 ;; overwrites the release tarball there, introducing a checksum
254 ;; mismatch every time. See
255 ;; <https://www-fourier.ujf-grenoble.fr/~parisse/debian/dists/stable/main/source/README>
256 (uri (string-append "https://www-fourier.ujf-grenoble.fr/"
257 "~parisse/debian/dists/stable/main/"
258 "source/giac_" version ".tar.gz"))
261 "1c6jmswv3ay13n6mjgh9w7nbpdgm5lbwdcmva5sli3vqn4chn3vq"))))
262 (build-system gnu-build-system)
263 (outputs '("out" "doc")) ;77MiB of documentation
265 `(#:modules ((ice-9 ftw)
267 (guix build gnu-build-system))
269 (modify-phases %standard-phases
270 (add-after 'unpack 'patch-bin-cp
271 ;; Some Makefiles contain hard-coded "/bin/cp".
273 (substitute* (find-files "doc" "^Makefile")
274 (("/bin/cp") (which "cp")))
276 (add-after 'unpack 'disable-failing-test
277 ;; FIXME: Test failing. Not sure why.
279 (substitute* "check/Makefile.in"
282 (add-after 'install 'install-doc
283 ;; Setting --docdir to "doc" output isn't sufficient as
284 ;; documentation and examples are scattered throughout the source.
285 (lambda* (#:key outputs #:allow-other-keys)
286 (let* ((out (assoc-ref outputs "out"))
287 (doc (assoc-ref outputs "doc"))
288 (docdir (string-append doc
290 (string-append ,name "-" ,version))))
291 ;; For some reason, the install process moves
292 ;; "share/giac/examples" instead of "share/giac/doc" to
293 ;; "$(docdir)". Clean up the mess and start over.
294 (delete-file-recursively (string-append doc "/share"))
296 (with-directory-excursion out
297 (for-each (lambda (f)
298 (unless (member f '("." ".."))
299 (copy-recursively (string-append "share/giac/" f)
300 (string-append docdir "/" f))))
301 (scandir "share/giac"))
302 (delete-file-recursively "share/giac")))
313 ("libxinerama" ,libxinerama)
323 ("texlive" ,texlive-tiny)))
324 (native-inputs `(("readline" ,readline)))
325 (home-page "https://www-fourier.ujf-grenoble.fr/~parisse/giac.html")
326 (synopsis "Computer algebra system")
328 "Giac/Xcas is a computer algebra system. It has a compatibility mode for
329 maple, mupad and the TI89. It is available as a standalone program (graphic
330 or text interfaces) or as a C++ library.")
331 (license license:gpl3+)))
340 "http://flintlib.org/flint-"
343 "11syazv1a8rrnac3wj3hnyhhflpqcmq02q8pqk2m6g2k6h0gxwfb"))
344 (patches (search-patches "flint-ldconfig.patch"))))
345 (build-system gnu-build-system)
348 ("mpfr" ,mpfr))) ; header files from both are included by flint/arith.h
350 `(#:parallel-tests? #f ; seems to be necessary on arm
352 (modify-phases %standard-phases
354 (lambda* (#:key inputs outputs #:allow-other-keys)
355 (let ((out (assoc-ref outputs "out"))
356 (gmp (assoc-ref inputs "gmp"))
357 (mpfr (assoc-ref inputs "mpfr")))
358 ;; do not pass "--enable-fast-install", which makes the
359 ;; homebrew configure process fail
360 (invoke "./configure"
361 (string-append "--prefix=" out)
362 (string-append "--with-gmp=" gmp)
363 (string-append "--with-mpfr=" mpfr))
365 (synopsis "Fast library for number theory")
367 "FLINT is a C library for number theory. It supports arithmetic
368 with numbers, polynomials, power series and matrices over many base
369 rings, including multiprecision integers and rationals, integers
370 modulo n, p-adic numbers, finite fields (prime and non-prime order)
371 and real and complex numbers (via the Arb extension library).
373 Operations that can be performed include conversions, arithmetic,
374 GCDs, factoring, solving linear systems, and evaluating special
375 functions. In addition, FLINT provides various low-level routines for
377 (license license:gpl2+)
378 (home-page "http://flintlib.org/")))
387 (url "https://github.com/fredrik-johansson/arb.git")
389 (file-name (git-file-name name version))
392 "1ndxg7h4xvccjgp5l9z2f8b66dsff6fhf86bn5n7f75a1ksd7554"))))
393 (build-system gnu-build-system)
395 `(("flint" ,flint))) ; flint.h is included by arf.h
401 (modify-phases %standard-phases
403 (lambda* (#:key inputs outputs #:allow-other-keys)
404 (let ((out (assoc-ref outputs "out"))
405 (flint (assoc-ref inputs "flint"))
406 (gmp (assoc-ref inputs "gmp"))
407 (mpfr (assoc-ref inputs "mpfr")))
408 ;; do not pass "--enable-fast-install", which makes the
409 ;; homebrew configure process fail
410 (invoke "./configure"
411 (string-append "--prefix=" out)
412 (string-append "--with-flint=" flint)
413 (string-append "--with-gmp=" gmp)
414 (string-append "--with-mpfr=" mpfr))))))))
415 (synopsis "Arbitrary precision floating-point ball arithmetic")
417 "Arb is a C library for arbitrary-precision floating-point ball
418 arithmetic. It supports efficient high-precision computation with
419 polynomials, power series, matrices and special functions over the
420 real and complex numbers, with automatic, rigorous error control.")
421 (license license:lgpl2.1+)
422 (home-page "http://fredrikj.net/arb/")))
430 (uri (string-append "http://shoup.net/ntl/ntl-"
433 "115frp5flyvw9wghz4zph1b3llmr5nbxk1skgsggckr81fh3gmxq"))))
434 (build-system gnu-build-system)
436 `(("libtool" ,libtool)
437 ("perl" ,perl))) ; for configuration
438 ;; FIXME: Add optional input gf2x once available; then also add
439 ;; configure flag "NTL_GF2X_LIB=on".
444 (modify-phases %standard-phases
446 (lambda* (#:key outputs #:allow-other-keys)
448 (system* "./configure"
449 (string-append "PREFIX=" (assoc-ref outputs "out"))
450 ;; Do not build especially for the build machine.
452 ;; Also do not tune to the build machine.
456 (synopsis "C++ library for number theory")
458 "NTL is a C++ library providing data structures and algorithms
459 for manipulating signed, arbitrary length integers, and for vectors,
460 matrices, and polynomials over the integers and over finite fields.")
461 (license license:gpl2+)
462 (home-page "http://shoup.net/ntl/")))
464 (define-public singular
472 (string-append "http://www.mathematik.uni-kl.de/ftp/pub/Math/"
476 (string-trim-right version #\p
477 0 (1- (string-length version)))
479 "/singular-" version ".tar.gz"))
481 "1qqj9bm9pkzm0iyycpvm8x6s79wws3nq60lz25h8x1q61h3426sm"))))
482 (build-system gnu-build-system)
484 `(("doxygen" ,doxygen)
485 ("graphviz" ,graphviz)
494 ("readline" ,readline)))
497 (list (string-append "--with-ntl="
498 (assoc-ref %build-inputs "ntl")))))
499 (synopsis "Computer algebra system for polynomial computations")
501 "Singular is a computer algebra system for polynomial computations,
502 with special emphasis on commutative and non-commutative algebra, algebraic
503 geometry and singularity theory.")
504 ;; Singular itself is dual licensed gpl2 or gpl3, but some of the
505 ;; libraries with which it links are licensed under lgpl3+, so the
506 ;; combined work becomes gpl3. See COPYING in the source code.
507 (license license:gpl3)
508 (home-page "http://www.singular.uni-kl.de/index.php")))
510 (define-public gmp-ecm
516 ;; Use the ‘Latest version’ link for a stable URI across releases.
517 (uri (string-append "https://gforge.inria.fr/frs/download.php/"
518 "latestfile/160/ecm-" version ".tar.gz"))
520 "0hxs24c2m3mh0nq1zz63z3sb7dhy1rilg2s1igwwcb26x3pb7xqc"))))
521 (build-system gnu-build-system)
525 `(#:configure-flags '("--enable-shared"
526 ;; Disable specific assembly routines, which depend
527 ;; on the subarchitecture of the build machine,
528 ;; and use gmp instead.
529 "--disable-asm-redc")))
530 (synopsis "Integer factorization library using the elliptic curve method")
532 "GMP-ECM factors integers using the elliptic curve method (ECM) as well
533 as the P-1 and P+1 algorithms. It provides a library and a stand-alone
535 ;; Most files are under lgpl3+, but some are under gpl3+ or gpl2+,
536 ;; so the combined work is under gpl3+.
537 (license license:gpl3+)
538 (home-page "http://ecm.gforge.inria.fr/")))
546 (uri (string-append "mirror://gnu/bc/bc-" version ".tar.gz"))
549 "0amh9ik44jfg66csyvf4zz1l878c4755kjndq9j0270akflgrbb2"))))
550 (build-system gnu-build-system)
554 ("texinfo" ,texinfo)))
557 (list "--with-readline")))
558 (home-page "https://www.gnu.org/software/bc/")
559 (synopsis "Arbitrary precision numeric processing language")
561 "bc is an arbitrary precision numeric processing language. It includes
562 an interactive environment for evaluating mathematical statements. Its
563 syntax is similar to that of C, so basic usage is familiar. It also includes
564 \"dc\", a reverse-polish calculator.")
565 (license license:gpl2+)))
567 ;; The original kiss-fft does not have a complete build system and does not
568 ;; build any shared libraries. This is a fork used by Extempore.
569 (define-public kiss-fft-for-extempore
571 (name "kiss-fft-for-extempore")
576 (url "https://github.com/extemporelang/kiss_fft.git")
578 (file-name (git-file-name name version))
581 "0jasbmqy4wkqrqx3w64s1dfmj34875xmsl72mb26aa4hpyn14bi2"))))
582 (build-system cmake-build-system)
583 (arguments `(#:tests? #f)) ; no tests included
584 ;; Extempore refuses to build on architectures other than x86_64
585 (supported-systems '("x86_64-linux"))
586 (home-page "https://github.com/extemporelang/kiss_fft")
587 (synopsis "Mixed-radix Fast Fourier Transform")
589 "Kiss FFT attempts to be a reasonably efficient, moderately useful FFT
590 that can use fixed or floating data types and can easily be incorporated into
592 (license license:bsd-3)))
600 (uri (string-append "ftp://ftp.fftw.org/pub/fftw/fftw-"
604 "00z3k8fq561wq2khssqg0kallk0504dzlx989x3vvicjdqpjc4v1"))))
605 (build-system gnu-build-system)
608 '("--enable-shared" "--enable-openmp" "--enable-threads"
609 ,@(let ((system (or (%current-target-system) (%current-system))))
610 ;; Enable SIMD extensions for codelets. See details at:
611 ;; <http://fftw.org/fftw3_doc/Installation-on-Unix.html>.
613 ((string-prefix? "x86_64" system)
614 '("--enable-sse2" "--enable-avx" "--enable-avx2"
615 "--enable-avx512" "--enable-avx-128-fma"))
616 ((string-prefix? "i686" system)
618 ((string-prefix? "aarch64" system)
619 ;; Note that fftw supports NEON on 32-bit ARM only when
620 ;; compiled for single-precision.
624 ;; By default '-mtune=native' is used. However, that may cause the
625 ;; use of ISA extensions (e.g. AVX) that are not necessarily
626 ;; available on the user's machine when that package is built on a
627 ;; different machine.
628 "ax_cv_c_flags__mtune_native=no")))
629 (native-inputs `(("perl" ,perl)))
630 (home-page "http://fftw.org")
631 (synopsis "Computing the discrete Fourier transform")
633 "FFTW is a C subroutine library for computing the discrete Fourier
634 transform (DFT) in one or more dimensions, of arbitrary input size, and of
635 both real and complex data (as well as of even/odd data---i.e. the discrete
636 cosine/ sine transforms or DCT/DST).")
637 (license license:gpl2+)))
640 (package (inherit fftw)
643 (substitute-keyword-arguments (package-arguments fftw)
644 ((#:configure-flags fftw-configure-flags)
645 `(cons* "--enable-single"
646 ,@(if (string-prefix? "arm" (or (%current-target-system)
648 ;; fftw supports NEON on 32-bit ARM only when compiled
649 ;; for single-precision, so add it here.
652 ,fftw-configure-flags))))
654 (string-append (package-description fftw)
655 " Single-precision version."))))
657 (define-public fftw-openmpi
658 (package (inherit fftw)
659 (name "fftw-openmpi")
661 `(("openmpi" ,openmpi)
662 ,@(package-inputs fftw)))
664 (substitute-keyword-arguments (package-arguments fftw)
665 ((#:configure-flags cf)
666 `(cons "--enable-mpi" ,cf))
667 ((#:phases phases '%standard-phases)
668 `(modify-phases ,phases
669 (add-before 'check 'mpi-setup
672 (string-append (package-description fftw)
673 " With OpenMPI parallelism support."))))
675 (define-public java-la4j
682 (url "https://github.com/vkostyukov/la4j.git")
684 (file-name (string-append name "-" version "-checkout"))
687 "1qir8dr978cfvz9k12m2kbdwpyf6cqdf1d0ilb7lnkhbgq5i53w3"))))
688 (build-system ant-build-system)
690 `(#:jar-name "la4j.jar"
692 #:test-exclude (list "**/Abstract*.java"
694 "**/DenseMatrixTest.java"
695 "**/SparseMatrixTest.java"
697 "**/SparseVectorTest.java"
698 "**/DenseVectorTest.java")))
700 `(("java-junit" ,java-junit)
701 ("java-hamcrest-core" ,java-hamcrest-core)))
702 (home-page "http://la4j.org/")
703 (synopsis "Java library that provides Linear Algebra primitives and algorithms")
704 (description "The la4j library is a Java library that provides Linear
705 Algebra primitives (matrices and vectors) and algorithms. The key features of
706 the la4j library are:
709 @item No dependencies and tiny size
710 @item Fluent object-oriented/functional API
711 @item Sparse (CRS, CCS) and dense (1D/2D arrays) matrices
712 @item Linear systems solving (Gaussian, Jacobi, Zeidel, Square Root, Sweep and other)
713 @item Matrices decomposition (Eigenvalues/Eigenvectors, SVD, QR, LU, Cholesky and other)
714 @item MatrixMarket/CSV IO formats support for matrices and vectors
716 (license license:asl2.0)))
718 (define-public java-jlargearrays
720 (name "java-jlargearrays")
724 (uri (string-append "http://search.maven.org/remotecontent?"
725 "filepath=pl/edu/icm/JLargeArrays/"
726 version "/JLargeArrays-" version
728 (file-name (string-append name "-" version ".jar"))
731 "0v05iphpxbjnd7f4jf1rlqq3m8hslhcm0imdbsgxr20pi3xkaf2a"))))
732 (build-system ant-build-system)
734 `(#:jar-name "jlargearrays.jar"
735 #:tests? #f ; tests are not included in the release archive
738 `(("java-commons-math3" ,java-commons-math3)))
739 (home-page "https://gitlab.com/ICM-VisLab/JLargeArrays")
740 (synopsis "Library of one-dimensional arrays that can store up to 263 elements")
741 (description "JLargeArrays is a Java library of one-dimensional arrays
742 that can store up to 263 elements.")
743 (license license:bsd-2)))
745 (define-public java-jtransforms
747 (name "java-jtransforms")
751 (uri (string-append "http://search.maven.org/remotecontent?"
752 "filepath=com/github/wendykierp/JTransforms/"
753 version "/JTransforms-" version "-sources.jar"))
756 "1haw5m8shv5srgcpwkl853dz8bv6h90bzlhcps6mdpb4cixjirsg"))))
757 (build-system ant-build-system)
759 `(#:jar-name "jtransforms.jar"
760 #:tests? #f ; tests are not included in the release archive
763 `(("java-commons-math3" ,java-commons-math3)
764 ("java-jlargearrays" ,java-jlargearrays)))
765 (home-page "https://github.com/wendykierp/JTransforms")
766 (synopsis "Multithreaded FFT library written in pure Java")
767 (description "JTransforms is a multithreaded FFT library written in pure
768 Java. Currently, four types of transforms are available: @dfn{Discrete
769 Fourier Transform} (DFT), @dfn{Discrete Cosine Transform} (DCT), @dfn{Discrete
770 Sine Transform} (DST) and @dfn{Discrete Hartley Transform} (DHT).")
771 (license license:bsd-2)))
779 (uri (string-append "https://bitbucket.org/eigen/eigen/get/"
783 "1qh3yrwn78ms5yhwbpl5wvblk4gbz02cacdygxylr7i9xbrvylkk"))
784 (file-name (string-append name "-" version ".tar.bz2"))
785 (modules '((guix build utils)))
787 ;; There are 3 test failures in the "unsupported" directory,
788 ;; but maintainers say it's a known issue and it's unsupported
789 ;; anyway, so just skip them.
791 (substitute* "unsupported/CMakeLists.txt"
792 (("add_subdirectory\\(test.*")
793 "# Do not build the tests for unsupported features.\n"))
795 (build-system cmake-build-system)
797 '(;; Turn off debugging symbols to save space.
798 #:build-type "Release"
800 #:phases (modify-phases %standard-phases
803 (let* ((cores (parallel-job-count))
804 (dash-j (format #f "-j~a" cores)))
805 (setenv "EIGEN_SEED" "1") ;for reproducibility
806 ;; First build the tests, in parallel. See
807 ;; <http://eigen.tuxfamily.org/index.php?title=Tests>.
808 (invoke "make" "buildtests" dash-j)
810 ;; Then run 'CTest' with -V so we get more
811 ;; details upon failure.
812 (invoke "ctest" "-V" dash-j)))))))
813 (home-page "https://eigen.tuxfamily.org")
814 (synopsis "C++ template library for linear algebra")
816 "Eigen is a C++ template library for linear algebra: matrices, vectors,
817 numerical solvers, and related algorithms. It provides an elegant API based
818 on \"expression templates\". It is versatile: it supports all matrix sizes,
819 all standard numeric types, various matrix decompositions and geometry
820 features, and more.")
822 ;; Most of the code is MPLv2, with a few files under LGPLv2.1+ or BSD-3.
823 ;; See 'COPYING.README' for details.
824 (license license:mpl2.0)))
826 (define-public xtensor
833 (url "https://github.com/QuantStack/xtensor.git")
837 "0w40v5lp0hp8ihf8nnvak373sb5xx0768pxgiqh3nzn57wf8px4r"))
838 (file-name (git-file-name name version))))
839 (build-system cmake-build-system)
841 `(("googletest" ,googletest)
845 '("-DBUILD_TESTS=ON")
846 #:test-target "xtest"))
847 (home-page "http://quantstack.net/xtensor")
848 (synopsis "C++ tensors with broadcasting and lazy computing")
849 (description "xtensor is a C++ library meant for numerical analysis with
850 multi-dimensional array expressions.
854 @item an extensible expression system enabling lazy broadcasting.
855 @item an API following the idioms of the C++ standard library.
856 @item tools to manipulate array expressions and build upon xtensor.
858 (license license:bsd-3)))