1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019 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 python-xyz)
47 #:use-module (gnu packages readline)
48 #:use-module (gnu packages shells)
49 #:use-module (gnu packages tex)
50 #:use-module (gnu packages texinfo)
51 #:use-module (gnu packages xiph)
52 #:use-module (gnu packages xorg)
53 #:use-module (guix build-system ant)
54 #:use-module (guix build-system gnu)
55 #:use-module (guix build-system cmake)
56 #:use-module (guix build-system python)
57 #:use-module (guix download)
58 #:use-module (guix git-download)
59 #:use-module (guix hg-download)
60 #:use-module ((guix licenses) #:prefix license:)
61 #:use-module (guix packages)
62 #:use-module (guix utils))
72 "http://www.multiprecision.org/downloads/mpfrcx-"
76 "1s968480ymv6w0rnvfp9mxvx98hvi29fkvw8nk4ggzc6azxgwybs"))))
77 (build-system gnu-build-system)
81 ("mpc" ,mpc))) ; Header files are included by mpfrcx.h.
82 (synopsis "Arithmetic of polynomials over arbitrary precision numbers")
84 "Mpfrcx is a library for the arithmetic of univariate polynomials over
85 arbitrary precision real (mpfr) or complex (mpc) numbers, without control
86 on the rounding. For the time being, only the few functions needed to
87 implement the floating point approach to complex multiplication are
88 implemented. On the other hand, these comprise asymptotically fast
89 multiplication routines such as Toom–Cook and the FFT.")
90 (license license:lgpl3+)
91 (home-page "http://mpfrcx.multiprecision.org/")))
100 "http://www.multiprecision.org/cm/download/cm-"
104 "1nf5kr0nqmhbzrsrinky18z0ighjpsmb5cr8zyg8jf04bfbyrfmc"))))
105 (build-system gnu-build-system)
108 ("zlib" ,zlib))) ; Header files included from cm_common.h.
110 `(("pari-gp" ,pari-gp)))
111 (synopsis "CM constructions for elliptic curves")
113 "The CM software implements the construction of ring class fields of
114 imaginary quadratic number fields and of elliptic curves with complex
115 multiplication via floating point approximations. It consists of libraries
116 that can be called from within a C program and of executable command
118 (license license:gpl3+)
119 (home-page "http://cm.multiprecision.org/")))
128 "http://perso.ens-lyon.fr/damien.stehle/fplll/libfplll-"
131 "1cbiby7ykis4z84swclpysrljmqhfcllpkcbll1m08rzskgb1a6b"))))
132 (build-system gnu-build-system)
133 (inputs `(("gmp" ,gmp)
135 (synopsis "Library for LLL-reduction of euclidean lattices")
137 "fplll LLL-reduces euclidean lattices. Since version 3, it can also
138 solve the shortest vector problem.")
139 (license license:lgpl2.1+)
140 (home-page "http://perso.ens-lyon.fr/damien.stehle/fplll/")))
142 (define-public pari-gp
149 "https://pari.math.u-bordeaux.fr/pub/pari/unix/pari-"
153 "1jfax92jpydjd02fwl30r6b8kfzqqd6sm4yx94gidyz9lqjb7a94"))))
154 (build-system gnu-build-system)
156 `(("texlive" ,(texlive-union
157 (list texlive-fonts-amsfonts
158 texlive-latex-amsfonts)))))
159 (inputs `(("gmp" ,gmp)
162 ("readline" ,readline)))
164 '(#:make-flags '("all")
165 #:test-target "dobench"
167 (modify-phases %standard-phases
169 (lambda* (#:key outputs #:allow-other-keys)
170 (invoke "./Configure"
171 (string-append "--prefix="
172 (assoc-ref outputs "out"))))))))
173 (synopsis "PARI/GP, a computer algebra system for number theory")
175 "PARI/GP is a widely used computer algebra system designed for fast
176 computations in number theory (factorisations, algebraic number theory,
177 elliptic curves...), but it also contains a large number of other useful
178 functions to compute with mathematical entities such as matrices,
179 polynomials, power series, algebraic numbers, etc., and a lot of
180 transcendental functions.
181 PARI is also available as a C library to allow for faster computations.")
182 (license license:gpl2+)
183 (home-page "https://pari.math.u-bordeaux.fr/")))
188 (version "0.0.11pl1")
192 "https://pari.math.u-bordeaux.fr/pub/pari/GP2C/gp2c-"
196 "1c6f6vmncw032kfzrfyr8bynw6yd3faxpy2285r009fmr0zxfs5s"))))
197 (build-system gnu-build-system)
198 (native-inputs `(("perl" ,perl)))
199 (inputs `(("pari-gp" ,pari-gp)))
202 (list (string-append "--with-paricfg="
203 (assoc-ref %build-inputs "pari-gp")
204 "/lib/pari/pari.cfg"))))
205 (synopsis "PARI/GP, a computer algebra system for number theory")
207 "PARI/GP is a widely used computer algebra system designed for fast
208 computations in number theory (factorisations, algebraic number theory,
209 elliptic curves...), but it also contains a large number of other useful
210 functions to compute with mathematical entities such as matrices,
211 polynomials, power series, algebraic numbers, etc., and a lot of
212 transcendental functions.
213 PARI is also available as a C library to allow for faster computations.
215 GP2C, the GP to C compiler, translates GP scripts to PARI programs.")
216 (license license:gpl2)
217 (home-page "https://pari.math.u-bordeaux.fr/")))
226 "https://gforge.inria.fr/frs/download.php/33497/cmh-"
230 "1a28xr9bs0igms0ik99x0w8lnb0jyfcmvyi26pbyh9ggcdivd33p"))))
231 (build-system gnu-build-system)
238 ("pari-gp" ,pari-gp)))
239 (synopsis "Igusa class polynomial computations")
241 "The CMH software computes Igusa (genus 2) class polynomials, which
242 parameterize the CM points in the moduli space of 2-dimensional abelian
243 varieties, i.e. Jacobians of hyperelliptic curves.
244 It can also be used to compute theta constants at arbitrary
246 (license license:gpl3+)
247 (home-page "http://cmh.gforge.inria.fr/")))
249 (define-public giac-xcas
255 ;; "~parisse/giac" is not used because the maintainer regularly
256 ;; overwrites the release tarball there, introducing a checksum
257 ;; mismatch every time. See
258 ;; <https://www-fourier.ujf-grenoble.fr/~parisse/debian/dists/stable/main/source/README>
259 (uri (string-append "https://www-fourier.ujf-grenoble.fr/"
260 "~parisse/debian/dists/stable/main/"
261 "source/giac_" version ".tar.gz"))
264 "0f4pkand9vmqfayw18jm5qxbhcwi1405qfd7ibzh9lwzz6amkm3l"))))
265 (build-system gnu-build-system)
266 (outputs '("out" "doc")) ;77MiB of documentation
268 `(#:modules ((ice-9 ftw)
270 (guix build gnu-build-system))
272 (modify-phases %standard-phases
273 (add-after 'unpack 'patch-bin-cp
274 ;; Some Makefiles contain hard-coded "/bin/cp".
276 (substitute* (find-files "doc" "^Makefile")
277 (("/bin/cp") (which "cp")))
279 (add-after 'unpack 'disable-failing-test
280 ;; FIXME: Test failing. Not sure why.
282 (substitute* "check/Makefile.in"
285 (add-after 'install 'install-doc
286 ;; Setting --docdir to "doc" output isn't sufficient as
287 ;; documentation and examples are scattered throughout the source.
288 (lambda* (#:key outputs #:allow-other-keys)
289 (let* ((out (assoc-ref outputs "out"))
290 (doc (assoc-ref outputs "doc"))
291 (docdir (string-append doc
293 (string-append ,name "-" ,version))))
294 ;; For some reason, the install process moves
295 ;; "share/giac/examples" instead of "share/giac/doc" to
296 ;; "$(docdir)". Clean up the mess and start over.
297 (delete-file-recursively (string-append doc "/share"))
299 (with-directory-excursion out
300 (for-each (lambda (f)
301 (unless (member f '("." ".."))
302 (copy-recursively (string-append "share/giac/" f)
303 (string-append docdir "/" f))))
304 (scandir "share/giac"))
305 (delete-file-recursively "share/giac")))
316 ("libxinerama" ,libxinerama)
326 ("texlive" ,texlive-tiny)))
327 (native-inputs `(("readline" ,readline)))
328 (home-page "https://www-fourier.ujf-grenoble.fr/~parisse/giac.html")
329 (synopsis "Computer algebra system")
331 "Giac/Xcas is a computer algebra system. It has a compatibility mode for
332 maple, mupad and the TI89. It is available as a standalone program (graphic
333 or text interfaces) or as a C++ library.")
334 (license license:gpl3+)))
343 "http://flintlib.org/flint-"
346 "11syazv1a8rrnac3wj3hnyhhflpqcmq02q8pqk2m6g2k6h0gxwfb"))
347 (patches (search-patches "flint-ldconfig.patch"))))
348 (build-system gnu-build-system)
351 ("mpfr" ,mpfr))) ; header files from both are included by flint/arith.h
353 `(#:parallel-tests? #f ; seems to be necessary on arm
355 (modify-phases %standard-phases
357 (lambda* (#:key inputs outputs #:allow-other-keys)
358 (let ((out (assoc-ref outputs "out"))
359 (gmp (assoc-ref inputs "gmp"))
360 (mpfr (assoc-ref inputs "mpfr")))
361 ;; do not pass "--enable-fast-install", which makes the
362 ;; homebrew configure process fail
363 (invoke "./configure"
364 (string-append "--prefix=" out)
365 (string-append "--with-gmp=" gmp)
366 (string-append "--with-mpfr=" mpfr))
368 (synopsis "Fast library for number theory")
370 "FLINT is a C library for number theory. It supports arithmetic
371 with numbers, polynomials, power series and matrices over many base
372 rings, including multiprecision integers and rationals, integers
373 modulo n, p-adic numbers, finite fields (prime and non-prime order)
374 and real and complex numbers (via the Arb extension library).
376 Operations that can be performed include conversions, arithmetic,
377 GCDs, factoring, solving linear systems, and evaluating special
378 functions. In addition, FLINT provides various low-level routines for
380 (license license:gpl2+)
381 (home-page "http://flintlib.org/")))
390 (url "https://github.com/fredrik-johansson/arb.git")
392 (file-name (git-file-name name version))
395 "0478671wfwy3gl26sbxh1jq1ih36z4k72waa8y2y2lvn649gb7cd"))))
396 (build-system gnu-build-system)
398 `(("flint" ,flint))) ; flint.h is included by arf.h
404 (modify-phases %standard-phases
406 (lambda* (#:key inputs outputs #:allow-other-keys)
407 (let ((out (assoc-ref outputs "out"))
408 (flint (assoc-ref inputs "flint"))
409 (gmp (assoc-ref inputs "gmp"))
410 (mpfr (assoc-ref inputs "mpfr")))
411 ;; do not pass "--enable-fast-install", which makes the
412 ;; homebrew configure process fail
413 (invoke "./configure"
414 (string-append "--prefix=" out)
415 (string-append "--with-flint=" flint)
416 (string-append "--with-gmp=" gmp)
417 (string-append "--with-mpfr=" mpfr))))))))
418 (synopsis "Arbitrary precision floating-point ball arithmetic")
420 "Arb is a C library for arbitrary-precision floating-point ball
421 arithmetic. It supports efficient high-precision computation with
422 polynomials, power series, matrices and special functions over the
423 real and complex numbers, with automatic, rigorous error control.")
424 (license license:lgpl2.1+)
425 (home-page "http://fredrikj.net/arb/")))
427 (define-public python-flint
429 (name "python-flint")
434 (url "https://github.com/fredrik-johansson/python-flint.git")
436 (file-name (git-file-name name version))
439 "1v0anazbj1cfi68nl2j6dbd31kgkc1563xmr0zk5xk3xj78569pw"))
440 (patches (search-patches "python-flint-includes.patch"))))
441 (build-system python-build-system)
443 `(("python-cython" ,python-cython)))
445 `(("python-numpy" ,python-numpy)))
449 (synopsis "Python module wrapping ARB and FLINT")
451 "Python-flint is a Python extension module wrapping FLINT
452 (Fast Library for Number Theory) and Arb (arbitrary-precision ball
453 arithmetic). It supports integers, rationals, modular integers,
454 real and complex ball arithmetic, polynomials and matrices over all
455 these types and other mathematical functions.")
456 (license license:expat)
457 (home-page "http://fredrikj.net/python-flint/")))
465 (uri (string-append "http://shoup.net/ntl/ntl-"
468 "115frp5flyvw9wghz4zph1b3llmr5nbxk1skgsggckr81fh3gmxq"))))
469 (build-system gnu-build-system)
471 `(("libtool" ,libtool)
472 ("perl" ,perl))) ; for configuration
473 ;; FIXME: Add optional input gf2x once available; then also add
474 ;; configure flag "NTL_GF2X_LIB=on".
479 (modify-phases %standard-phases
481 (lambda* (#:key outputs #:allow-other-keys)
483 (system* "./configure"
484 (string-append "PREFIX=" (assoc-ref outputs "out"))
485 ;; Do not build especially for the build machine.
487 ;; Also do not tune to the build machine.
491 (synopsis "C++ library for number theory")
493 "NTL is a C++ library providing data structures and algorithms
494 for manipulating signed, arbitrary length integers, and for vectors,
495 matrices, and polynomials over the integers and over finite fields.")
496 (license license:gpl2+)
497 (home-page "http://shoup.net/ntl/")))
499 (define-public singular
507 (string-append "http://www.mathematik.uni-kl.de/ftp/pub/Math/"
511 (string-trim-right version #\p
512 0 (1- (string-length version)))
514 "/singular-" version ".tar.gz"))
516 "1qqj9bm9pkzm0iyycpvm8x6s79wws3nq60lz25h8x1q61h3426sm"))))
517 (build-system gnu-build-system)
519 `(("doxygen" ,doxygen)
520 ("graphviz" ,graphviz)
529 ("readline" ,readline)))
532 (list (string-append "--with-ntl="
533 (assoc-ref %build-inputs "ntl")))))
534 (synopsis "Computer algebra system for polynomial computations")
536 "Singular is a computer algebra system for polynomial computations,
537 with special emphasis on commutative and non-commutative algebra, algebraic
538 geometry and singularity theory.")
539 ;; Singular itself is dual licensed gpl2 or gpl3, but some of the
540 ;; libraries with which it links are licensed under lgpl3+, so the
541 ;; combined work becomes gpl3. See COPYING in the source code.
542 (license license:gpl3)
543 (home-page "http://www.singular.uni-kl.de/index.php")))
545 (define-public gmp-ecm
551 ;; Use the ‘Latest version’ link for a stable URI across releases.
552 (uri (string-append "https://gforge.inria.fr/frs/download.php/"
553 "latestfile/160/ecm-" version ".tar.gz"))
555 "0hxs24c2m3mh0nq1zz63z3sb7dhy1rilg2s1igwwcb26x3pb7xqc"))))
556 (build-system gnu-build-system)
560 `(#:configure-flags '("--enable-shared"
561 ;; Disable specific assembly routines, which depend
562 ;; on the subarchitecture of the build machine,
563 ;; and use gmp instead.
564 "--disable-asm-redc")))
565 (synopsis "Integer factorization library using the elliptic curve method")
567 "GMP-ECM factors integers using the elliptic curve method (ECM) as well
568 as the P-1 and P+1 algorithms. It provides a library and a stand-alone
570 ;; Most files are under lgpl3+, but some are under gpl3+ or gpl2+,
571 ;; so the combined work is under gpl3+.
572 (license license:gpl3+)
573 (home-page "http://ecm.gforge.inria.fr/")))
581 (uri (string-append "mirror://gnu/bc/bc-" version ".tar.gz"))
584 "0amh9ik44jfg66csyvf4zz1l878c4755kjndq9j0270akflgrbb2"))))
585 (build-system gnu-build-system)
589 ("texinfo" ,texinfo)))
592 (list "--with-readline")))
593 (home-page "https://www.gnu.org/software/bc/")
594 (synopsis "Arbitrary precision numeric processing language")
596 "bc is an arbitrary precision numeric processing language. It includes
597 an interactive environment for evaluating mathematical statements. Its
598 syntax is similar to that of C, so basic usage is familiar. It also includes
599 \"dc\", a reverse-polish calculator.")
600 (license license:gpl2+)))
602 ;; The original kiss-fft does not have a complete build system and does not
603 ;; build any shared libraries. This is a fork used by Extempore.
604 (define-public kiss-fft-for-extempore
606 (name "kiss-fft-for-extempore")
611 (url "https://github.com/extemporelang/kiss_fft.git")
613 (file-name (git-file-name name version))
616 "0jasbmqy4wkqrqx3w64s1dfmj34875xmsl72mb26aa4hpyn14bi2"))))
617 (build-system cmake-build-system)
618 (arguments `(#:tests? #f)) ; no tests included
619 ;; Extempore refuses to build on architectures other than x86_64
620 (supported-systems '("x86_64-linux"))
621 (home-page "https://github.com/extemporelang/kiss_fft")
622 (synopsis "Mixed-radix Fast Fourier Transform")
624 "Kiss FFT attempts to be a reasonably efficient, moderately useful FFT
625 that can use fixed or floating data types and can easily be incorporated into
627 (license license:bsd-3)))
635 (uri (string-append "ftp://ftp.fftw.org/pub/fftw/fftw-"
639 "00z3k8fq561wq2khssqg0kallk0504dzlx989x3vvicjdqpjc4v1"))))
640 (build-system gnu-build-system)
643 '("--enable-shared" "--enable-openmp" "--enable-threads"
644 ,@(let ((system (or (%current-target-system) (%current-system))))
645 ;; Enable SIMD extensions for codelets. See details at:
646 ;; <http://fftw.org/fftw3_doc/Installation-on-Unix.html>.
648 ((string-prefix? "x86_64" system)
649 '("--enable-sse2" "--enable-avx" "--enable-avx2"
650 "--enable-avx512" "--enable-avx-128-fma"))
651 ((string-prefix? "i686" system)
653 ((string-prefix? "aarch64" system)
654 ;; Note that fftw supports NEON on 32-bit ARM only when
655 ;; compiled for single-precision.
659 ;; By default '-mtune=native' is used. However, that may cause the
660 ;; use of ISA extensions (e.g. AVX) that are not necessarily
661 ;; available on the user's machine when that package is built on a
662 ;; different machine.
663 "ax_cv_c_flags__mtune_native=no")))
664 (native-inputs `(("perl" ,perl)))
665 (home-page "http://fftw.org")
666 (synopsis "Computing the discrete Fourier transform")
668 "FFTW is a C subroutine library for computing the discrete Fourier
669 transform (DFT) in one or more dimensions, of arbitrary input size, and of
670 both real and complex data (as well as of even/odd data---i.e. the discrete
671 cosine/ sine transforms or DCT/DST).")
672 (license license:gpl2+)))
675 (package (inherit fftw)
678 (substitute-keyword-arguments (package-arguments fftw)
679 ((#:configure-flags fftw-configure-flags)
680 `(cons* "--enable-single"
681 ,@(if (string-prefix? "arm" (or (%current-target-system)
683 ;; fftw supports NEON on 32-bit ARM only when compiled
684 ;; for single-precision, so add it here.
687 ,fftw-configure-flags))))
689 (string-append (package-description fftw)
690 " Single-precision version."))))
692 (define-public fftw-openmpi
693 (package (inherit fftw)
694 (name "fftw-openmpi")
696 `(("openmpi" ,openmpi)
697 ,@(package-inputs fftw)))
699 (substitute-keyword-arguments (package-arguments fftw)
700 ((#:configure-flags cf)
701 `(cons "--enable-mpi" ,cf))
702 ((#:phases phases '%standard-phases)
703 `(modify-phases ,phases
704 (add-before 'check 'mpi-setup
707 (string-append (package-description fftw)
708 " With OpenMPI parallelism support."))))
710 (define-public java-la4j
717 (url "https://github.com/vkostyukov/la4j.git")
719 (file-name (string-append name "-" version "-checkout"))
722 "1qir8dr978cfvz9k12m2kbdwpyf6cqdf1d0ilb7lnkhbgq5i53w3"))))
723 (build-system ant-build-system)
725 `(#:jar-name "la4j.jar"
727 #:test-exclude (list "**/Abstract*.java"
729 "**/DenseMatrixTest.java"
730 "**/SparseMatrixTest.java"
732 "**/SparseVectorTest.java"
733 "**/DenseVectorTest.java")))
735 `(("java-junit" ,java-junit)
736 ("java-hamcrest-core" ,java-hamcrest-core)))
737 (home-page "http://la4j.org/")
738 (synopsis "Java library that provides Linear Algebra primitives and algorithms")
739 (description "The la4j library is a Java library that provides Linear
740 Algebra primitives (matrices and vectors) and algorithms. The key features of
741 the la4j library are:
744 @item No dependencies and tiny size
745 @item Fluent object-oriented/functional API
746 @item Sparse (CRS, CCS) and dense (1D/2D arrays) matrices
747 @item Linear systems solving (Gaussian, Jacobi, Zeidel, Square Root, Sweep and other)
748 @item Matrices decomposition (Eigenvalues/Eigenvectors, SVD, QR, LU, Cholesky and other)
749 @item MatrixMarket/CSV IO formats support for matrices and vectors
751 (license license:asl2.0)))
753 (define-public java-jlargearrays
755 (name "java-jlargearrays")
759 (uri (string-append "http://search.maven.org/remotecontent?"
760 "filepath=pl/edu/icm/JLargeArrays/"
761 version "/JLargeArrays-" version
763 (file-name (string-append name "-" version ".jar"))
766 "0v05iphpxbjnd7f4jf1rlqq3m8hslhcm0imdbsgxr20pi3xkaf2a"))))
767 (build-system ant-build-system)
769 `(#:jar-name "jlargearrays.jar"
770 #:tests? #f ; tests are not included in the release archive
773 `(("java-commons-math3" ,java-commons-math3)))
774 (home-page "https://gitlab.com/ICM-VisLab/JLargeArrays")
775 (synopsis "Library of one-dimensional arrays that can store up to 263 elements")
776 (description "JLargeArrays is a Java library of one-dimensional arrays
777 that can store up to 263 elements.")
778 (license license:bsd-2)))
780 (define-public java-jtransforms
782 (name "java-jtransforms")
786 (uri (string-append "http://search.maven.org/remotecontent?"
787 "filepath=com/github/wendykierp/JTransforms/"
788 version "/JTransforms-" version "-sources.jar"))
791 "1haw5m8shv5srgcpwkl853dz8bv6h90bzlhcps6mdpb4cixjirsg"))))
792 (build-system ant-build-system)
794 `(#:jar-name "jtransforms.jar"
795 #:tests? #f ; tests are not included in the release archive
798 `(("java-commons-math3" ,java-commons-math3)
799 ("java-jlargearrays" ,java-jlargearrays)))
800 (home-page "https://github.com/wendykierp/JTransforms")
801 (synopsis "Multithreaded FFT library written in pure Java")
802 (description "JTransforms is a multithreaded FFT library written in pure
803 Java. Currently, four types of transforms are available: @dfn{Discrete
804 Fourier Transform} (DFT), @dfn{Discrete Cosine Transform} (DCT), @dfn{Discrete
805 Sine Transform} (DST) and @dfn{Discrete Hartley Transform} (DHT).")
806 (license license:bsd-2)))
814 (uri (string-append "https://bitbucket.org/eigen/eigen/get/"
818 "1qh3yrwn78ms5yhwbpl5wvblk4gbz02cacdygxylr7i9xbrvylkk"))
819 (file-name (string-append name "-" version ".tar.bz2"))
820 (modules '((guix build utils)))
822 ;; There are 3 test failures in the "unsupported" directory,
823 ;; but maintainers say it's a known issue and it's unsupported
824 ;; anyway, so just skip them.
826 (substitute* "unsupported/CMakeLists.txt"
827 (("add_subdirectory\\(test.*")
828 "# Do not build the tests for unsupported features.\n"))
830 (build-system cmake-build-system)
832 '(;; Turn off debugging symbols to save space.
833 #:build-type "Release"
835 #:phases (modify-phases %standard-phases
838 (let* ((cores (parallel-job-count))
839 (dash-j (format #f "-j~a" cores)))
840 (setenv "EIGEN_SEED" "1") ;for reproducibility
841 ;; First build the tests, in parallel. See
842 ;; <http://eigen.tuxfamily.org/index.php?title=Tests>.
843 (invoke "make" "buildtests" dash-j)
845 ;; Then run 'CTest' with -V so we get more
846 ;; details upon failure.
847 (invoke "ctest" "-V" dash-j)))))))
848 (home-page "https://eigen.tuxfamily.org")
849 (synopsis "C++ template library for linear algebra")
851 "Eigen is a C++ template library for linear algebra: matrices, vectors,
852 numerical solvers, and related algorithms. It provides an elegant API based
853 on \"expression templates\". It is versatile: it supports all matrix sizes,
854 all standard numeric types, various matrix decompositions and geometry
855 features, and more.")
857 ;; Most of the code is MPLv2, with a few files under LGPLv2.1+ or BSD-3.
858 ;; See 'COPYING.README' for details.
859 (license license:mpl2.0)))
861 (define-public eigen-for-tensorflow
862 (let ((changeset "fd6845384b86")
864 (package (inherit eigen)
865 (name "eigen-for-tensorflow")
866 (version (string-append "3.3.5-" revision "." changeset))
870 (url "https://bitbucket.org/eigen/eigen")
871 (changeset changeset)))
874 "12cwgah63wqwb66xji048hcxc1z5zjg8a7701zlia5zbilnnk1n5"))
875 (file-name (string-append name "-" version "-checkout"))
876 (modules '((guix build utils)))
878 ;; There are 3 test failures in the "unsupported" directory,
879 ;; but maintainers say it's a known issue and it's unsupported
880 ;; anyway, so just skip them.
882 (substitute* "unsupported/CMakeLists.txt"
883 (("add_subdirectory\\(test.*")
884 "# Do not build the tests for unsupported features.\n"))
887 (define-public xtensor
894 (url "https://github.com/QuantStack/xtensor.git")
898 "0w40v5lp0hp8ihf8nnvak373sb5xx0768pxgiqh3nzn57wf8px4r"))
899 (file-name (git-file-name name version))))
900 (build-system cmake-build-system)
902 `(("googletest" ,googletest)
906 '("-DBUILD_TESTS=ON")
907 #:test-target "xtest"))
908 (home-page "http://quantstack.net/xtensor")
909 (synopsis "C++ tensors with broadcasting and lazy computing")
910 (description "xtensor is a C++ library meant for numerical analysis with
911 multi-dimensional array expressions.
915 @item an extensible expression system enabling lazy broadcasting.
916 @item an API following the idioms of the C++ standard library.
917 @item tools to manipulate array expressions and build upon xtensor.
919 (license license:bsd-3)))
928 (uri (string-append "https://www.gap-system.org/pub/gap/gap-"
929 (version-major+minor version)
935 "1dmb8v4p7j1nnf7sx8sg54b49yln36bi9acwp7w1d3a1nxj17ird"))
936 (modules '((guix build utils) (ice-9 ftw) (srfi srfi-1)))
939 ;; Delete the external gmp and zlib libraries
940 ;; and a subdirectory not needed for our build.
941 (for-each delete-file-recursively
942 '("extern" "hpcgap"))
943 ;; Delete a failing test.
944 ;; FIXME: This might be fixed in the next release, see
945 ;; https://github.com/gap-system/gap/issues/3292
946 (delete-file "tst/testinstall/dir.tst")
947 ;; Delete all packages except for a fixed list.
948 (with-directory-excursion "pkg"
949 (for-each delete-file-recursively
950 (lset-difference string=? (scandir ".")
952 ;; Necessary packages.
955 "SmallGrp-1.3" ; artistic2.0
956 "transgrp" ; artistic2.0 for data,
957 ; gpl2 or gpl3 for code
958 ;; Recommanded package.
960 ;; Optional packages, searched for at start,
961 ;; and their depedencies.
965 "crisp-1.4.4" ; bsd-2
966 ; "ctbllib" ; no explicit license, drop
969 "irredsol-1.4" ; bsd-2
976 ; "tomlib-1.2.7" ; no explicit license, drop
979 (build-system gnu-build-system)
985 (modify-phases %standard-phases
986 (add-after 'build 'build-packages
987 ;; Compile all packages that have not been deleted by the
988 ;; code snippet above.
990 (setenv "CONFIG_SHELL" (which "bash"))
991 (with-directory-excursion "pkg"
992 (invoke "../bin/BuildPackages.sh")
994 (add-after 'build-packages 'build-doc
995 ;; The documentation is bundled, but we create it from source.
997 (with-directory-excursion "doc"
998 (invoke "./make_doc"))
1002 ;; "make check" is expected to appear in gap-4.10.1
1003 (invoke "./gap" "tst/testinstall.g")
1006 (lambda* (#:key outputs #:allow-other-keys)
1007 (let* ((out (assoc-ref outputs "out"))
1008 (bin (string-append out "/bin"))
1009 (prog (string-append bin "/gap"))
1010 (prog-real (string-append bin "/.gap-real"))
1011 (share (string-append out "/share/gap"))
1012 (include (string-append out "/include/gap")))
1013 ;; Install only the gap binary; the gac compiler is left
1014 ;; for maybe later. "Wrap" it in a shell script that calls
1015 ;; the binary with the correct parameter.
1017 (copy-file "gap" prog-real)
1018 (call-with-output-file prog
1021 "#!~a~%exec ~a -l ~a \"$@\"~%"
1026 ;; Install the headers and the library, which are needed by
1027 ;; Sage. The Makefile targets are available in gap-4.10.0,
1028 ;; but planned to be removed in gap-4.10.1.
1029 (invoke "make" "install-headers")
1030 (invoke "make" "install-libgap")
1031 (install-file "gen/config.h" include)
1032 ;; Install a certain number of files and directories to
1033 ;; SHARE, where the wrapped shell script expects them.
1034 ;; Remove information on the build directory from sysinfo.gap.
1035 (substitute* "sysinfo.gap"
1036 (("GAP_BIN_DIR=\".*\"") "GAP_BIN_DIR=\"\"")
1037 (("GAP_LIB_DIR=\".*\"") "GAP_LIB_DIR=\"\"")
1038 (("GAP_CPPFLAGS=\".*\"") "GAP_CPPFLAGS=\"\""))
1039 (install-file "sysinfo.gap" share)
1040 (copy-recursively "grp" (string-append share "/grp"))
1041 (copy-recursively "pkg" (string-append share "/pkg"))
1042 ;; The following is not the C library libgap.so, but a
1043 ;; library of GAP code.
1044 (copy-recursively "lib" (string-append share "/lib"))
1045 ;; The gap binary looks for documentation inside SHARE.
1046 (copy-recursively "doc" (string-append share "/doc")))
1048 (home-page "https://www.gap-system.org/")
1050 "System for computational group theory")
1052 "GAP is a system for computational discrete algebra, with particular
1053 emphasis on computational group theory. It provides a programming language,
1054 a library of thousands of functions implementing algebraic algorithms
1055 written in the GAP language as well as large data libraries of algebraic
1057 ;; Some packages have different licenses (effectively forcing the
1058 ;; combined work to be licensed as gpl3+); if this is the case, this
1059 ;; is mentioned above next to their name.
1060 ;; Some packages have no license mentioned explicitly; supposedly this
1061 ;; means that the gpl2+ licence of GAP itself applies, but to be on the
1062 ;; safe side, we drop them for now.
1063 (license license:gpl2+)))