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, 2020 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, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
9 ;;; Copyright © 2017 Marius Bakke <mbakke@fastmail.com>
10 ;;; Copyright © 2017, 2019 Eric Bavier <bavier@member.fsf.org>
11 ;;; Copyright © 2020 Björn Höfling <bjoern.hoefling@bjoernhoefling.de>
12 ;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
14 ;;; This file is part of GNU Guix.
16 ;;; GNU Guix is free software; you can redistribute it and/or modify it
17 ;;; under the terms of the GNU General Public License as published by
18 ;;; the Free Software Foundation; either version 3 of the License, or (at
19 ;;; your option) any later version.
21 ;;; GNU Guix is distributed in the hope that it will be useful, but
22 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
23 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 ;;; GNU General Public License for more details.
26 ;;; You should have received a copy of the GNU General Public License
27 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
29 (define-module (gnu packages algebra)
30 #:use-module (gnu packages)
31 #:use-module (gnu packages autotools)
32 #:use-module (gnu packages bison)
33 #:use-module (gnu packages check)
34 #:use-module (gnu packages compression)
35 #:use-module (gnu packages cpp)
36 #:use-module (gnu packages documentation)
37 #:use-module (gnu packages ed)
38 #:use-module (gnu packages flex)
39 #:use-module (gnu packages fltk)
40 #:use-module (gnu packages gl)
41 #:use-module (gnu packages graphviz)
42 #:use-module (gnu packages image)
43 #:use-module (gnu packages java)
44 #:use-module (gnu packages maths)
45 #:use-module (gnu packages mpi)
46 #:use-module (gnu packages multiprecision)
47 #:use-module (gnu packages perl)
48 #:use-module (gnu packages pkg-config)
49 #:use-module (gnu packages pulseaudio)
50 #:use-module (gnu packages python)
51 #:use-module (gnu packages python-xyz)
52 #:use-module (gnu packages readline)
53 #:use-module (gnu packages shells)
54 #:use-module (gnu packages tex)
55 #:use-module (gnu packages texinfo)
56 #:use-module (gnu packages xiph)
57 #:use-module (gnu packages xorg)
58 #:use-module (guix build-system ant)
59 #:use-module (guix build-system gnu)
60 #:use-module (guix build-system cmake)
61 #:use-module (guix build-system python)
62 #:use-module (guix download)
63 #:use-module (guix git-download)
64 #:use-module (guix hg-download)
65 #:use-module ((guix licenses) #:prefix license:)
66 #:use-module (guix packages)
67 #:use-module (guix utils))
77 "http://www.multiprecision.org/downloads/mpfrcx-"
81 "1s968480ymv6w0rnvfp9mxvx98hvi29fkvw8nk4ggzc6azxgwybs"))))
82 (build-system gnu-build-system)
86 ("mpc" ,mpc))) ; Header files are included by mpfrcx.h.
87 (synopsis "Arithmetic of polynomials over arbitrary precision numbers")
89 "Mpfrcx is a library for the arithmetic of univariate polynomials over
90 arbitrary precision real (mpfr) or complex (mpc) numbers, without control
91 on the rounding. For the time being, only the few functions needed to
92 implement the floating point approach to complex multiplication are
93 implemented. On the other hand, these comprise asymptotically fast
94 multiplication routines such as Toom–Cook and the FFT.")
95 (license license:lgpl3+)
96 (home-page "http://www.multiprecision.org/mpfrcx/")))
105 "https://gforge.inria.fr/frs/download.php/file/36934/gf2x-"
109 "0d6vh1mxskvv3bxl6byp7gxxw3zzpkldrxnyajhnl05m0gx7yhk1"))))
110 (build-system gnu-build-system)
111 (synopsis "Arithmetic of polynomials over binary finite fields")
113 "The gf2x library provides arithmetic of polynomials over finite fields
114 of characteristic 2. It implements the multiplication, squaring and
115 greatest common divisor operations.")
116 (license license:gpl3+)
117 (home-page "https://gforge.inria.fr/projects/gf2x/")))
126 "http://www.multiprecision.org/cm/download/cm-"
130 "1nf5kr0nqmhbzrsrinky18z0ighjpsmb5cr8zyg8jf04bfbyrfmc"))))
131 (build-system gnu-build-system)
134 ("zlib" ,zlib))) ; Header files included from cm_common.h.
136 `(("pari-gp" ,pari-gp)))
137 (synopsis "CM constructions for elliptic curves")
139 "The CM software implements the construction of ring class fields of
140 imaginary quadratic number fields and of elliptic curves with complex
141 multiplication via floating point approximations. It consists of libraries
142 that can be called from within a C program and of executable command
144 (license license:gpl3+)
145 (home-page "http://www.multiprecision.org/cm/")))
154 (url "https://github.com/fplll/fplll.git")
156 (file-name (git-file-name name version))
159 "015qmrd7nfaysbv1hbwiprz9g6hnww1y1z1xw8f43ysb7k1b5nbg"))))
160 (build-system gnu-build-system)
162 `(("autoconf" ,autoconf)
163 ("automake" ,automake)
164 ("libtool" ,libtool)))
168 (home-page "https://github.com/fplll/fplll")
169 (synopsis "Library for LLL-reduction of euclidean lattices")
171 "fplll contains implementations of several lattice algorithms.
172 The implementation relies on floating-point orthogonalization, and LLL
173 is central to the code, hence the name.
175 It includes implementations of floating-point LLL reduction
176 algorithms, offering different speed/guarantees ratios. It contains
177 a @emph{wrapper} choosing the estimated best sequence of variants in
178 order to provide a guaranteed output as fast as possible. In the case
179 of the wrapper, the succession of variants is oblivious to the user.
181 It includes an implementation of the BKZ reduction algorithm,
182 including the BKZ-2.0 improvements (extreme enumeration
183 pruning, pre-processing of blocks, early termination). Additionally,
184 Slide reduction and self dual BKZ are supported.
186 It also includes a floating-point implementation of the
187 Kannan-Fincke-Pohst algorithm that finds a shortest non-zero lattice
188 vector. For the same task, the GaussSieve algorithm is also available
189 in fplll. Finally, it contains a variant of the enumeration algorithm
190 that computes a lattice vector closest to a given vector belonging to
191 the real span of the lattice.")
192 (license license:lgpl2.1+)))
194 (define-public python-fpylll
196 (name "python-fpylll")
200 ;; Pypi contains and older release, so we use a tagged release from
204 (url "https://github.com/fplll/fpylll.git")
205 (commit (string-append version "dev"))))
206 (file-name (git-file-name name version))
209 "01x2sqdv0sbjj4g4waj0hj4rcn4bq7h17442xaqwbznym9azmn9w"))))
210 (build-system python-build-system)
215 ("pari-gp" ,pari-gp)))
217 `(("cysignals" ,python-cysignals)
218 ("cython" ,python-cython)
219 ("flake8" ,python-flake8)
220 ("numpy" ,python-numpy)
221 ("pytest" ,python-pytest)))
222 (home-page "https://github.com/fplll/fpylll")
223 (synopsis "Python interface for fplll")
224 (description "fpylll is a Python wrapper for fplll.")
225 (license license:gpl2+)))
227 (define-public pari-gp
234 "https://pari.math.u-bordeaux.fr/pub/pari/unix/pari-"
238 "0fck8ssmirl8fy7s4mspgrxjs5sag76xbshqlqzkcl3kqyrk4raa"))))
239 (build-system gnu-build-system)
241 `(("texlive" ,(texlive-union
242 (list texlive-amsfonts)))))
243 (inputs `(("gmp" ,gmp)
246 ("readline" ,readline)))
248 '(#:make-flags '("all")
249 #:test-target "dobench"
251 (modify-phases %standard-phases
253 (lambda* (#:key outputs #:allow-other-keys)
254 (invoke "./Configure"
255 (string-append "--prefix="
256 (assoc-ref outputs "out"))))))))
257 (synopsis "PARI/GP, a computer algebra system for number theory")
259 "PARI/GP is a widely used computer algebra system designed for fast
260 computations in number theory (factorisations, algebraic number theory,
261 elliptic curves...), but it also contains a large number of other useful
262 functions to compute with mathematical entities such as matrices,
263 polynomials, power series, algebraic numbers, etc., and a lot of
264 transcendental functions.
265 PARI is also available as a C library to allow for faster computations.")
266 (license license:gpl2+)
267 (home-page "https://pari.math.u-bordeaux.fr/")))
272 (version "0.0.11pl2")
276 "https://pari.math.u-bordeaux.fr/pub/pari/GP2C/gp2c-"
280 "0wqsf05wgkqvmmsx7jinvzdqav6rl56sr8haibgs31nzz4x9xz9g"))))
281 (build-system gnu-build-system)
282 (native-inputs `(("perl" ,perl)))
283 (inputs `(("pari-gp" ,pari-gp)))
286 (list (string-append "--with-paricfg="
287 (assoc-ref %build-inputs "pari-gp")
288 "/lib/pari/pari.cfg"))))
289 (synopsis "PARI/GP, a computer algebra system for number theory")
291 "PARI/GP is a widely used computer algebra system designed for fast
292 computations in number theory (factorisations, algebraic number theory,
293 elliptic curves...), but it also contains a large number of other useful
294 functions to compute with mathematical entities such as matrices,
295 polynomials, power series, algebraic numbers, etc., and a lot of
296 transcendental functions.
297 PARI is also available as a C library to allow for faster computations.
299 GP2C, the GP to C compiler, translates GP scripts to PARI programs.")
300 (license license:gpl2)
301 (home-page "https://pari.math.u-bordeaux.fr/")))
312 "http://perso.ens-lyon.fr/damien.stehle/fplll/libfplll-"
315 (base32 "1cbiby7ykis4z84swclpysrljmqhfcllpkcbll1m08rzskgb1a6b"))))))
324 "https://gforge.inria.fr/frs/download.php/33497/cmh-"
328 "1a28xr9bs0igms0ik99x0w8lnb0jyfcmvyi26pbyh9ggcdivd33p"))))
329 (build-system gnu-build-system)
335 ("fplll" ,fplll-4-cmh)
336 ("pari-gp" ,pari-gp)))
337 (synopsis "Igusa class polynomial computations")
339 "The CMH software computes Igusa (genus 2) class polynomials, which
340 parameterize the CM points in the moduli space of 2-dimensional abelian
341 varieties, i.e. Jacobians of hyperelliptic curves.
342 It can also be used to compute theta constants at arbitrary
344 (license license:gpl3+)
345 (home-page "http://cmh.gforge.inria.fr/")))
354 ;; "~parisse/giac" is not used because the maintainer regularly
355 ;; overwrites the release tarball there, introducing a checksum
356 ;; mismatch every time. See
357 ;; <https://www-fourier.ujf-grenoble.fr/~parisse/debian/dists/stable/main/source/README>
358 (uri (string-append "https://www-fourier.ujf-grenoble.fr/"
359 "~parisse/debian/dists/stable/main/source/"
360 "giac_" version ".tar.gz"))
362 (base32 "1d0h1yb7qvh9x7wwv9yrzmcp712f49w1iljkxp4y6g9pzsmg1mmv"))))
363 (build-system gnu-build-system)
365 `(#:modules ((ice-9 ftw)
367 (guix build gnu-build-system))
369 (modify-phases %standard-phases
370 (add-after 'unpack 'patch-bin-cp
371 ;; Some Makefiles contain hard-coded "/bin/cp".
373 (substitute* (find-files "doc" "^Makefile")
374 (("/bin/cp") (which "cp")))
376 (add-after 'unpack 'disable-failing-test
377 ;; FIXME: Test failing. Not sure why.
379 (substitute* "check/Makefile.in"
382 (add-after 'install 'fix-doc
383 (lambda* (#:key outputs #:allow-other-keys)
384 (let ((out (assoc-ref outputs "out")))
385 ;; Most French documentation has a non-commercial
386 ;; license, so we need to remove it.
387 (with-directory-excursion (string-append out "/share/giac/doc/fr")
388 (for-each delete-file-recursively
389 '("cascas" "casexo" "casgeo" "casrouge" "cassim"
391 ;; Remove duplicate documentation in
392 ;; "%out/share/doc/giac/", where Xcas does not expect
394 (delete-file-recursively (string-append out "/share/doc/giac"))
396 (add-after 'install 'remove-unnecessary-executable
397 (lambda* (#:key outputs #:allow-other-keys)
398 (let ((out (assoc-ref outputs "out")))
399 (delete-file (string-append out "/bin/xcasnew"))
402 ;;; TODO: Add libnauty.
411 ("libsamplerate" ,libsamplerate)
413 ("libxinerama" ,libxinerama)
426 ("readline" ,readline)
427 ("texlive" ,texlive-tiny)))
428 (home-page "https://www-fourier.ujf-grenoble.fr/~parisse/giac.html")
429 (synopsis "Computer algebra system")
431 "Giac/Xcas is a computer algebra system. It has a compatibility mode for
432 maple, mupad and the TI89. It is available as a standalone program (graphic
433 or text interfaces) or as a C++ library.")
434 (license license:gpl3+)))
443 "http://flintlib.org/flint-"
446 "11syazv1a8rrnac3wj3hnyhhflpqcmq02q8pqk2m6g2k6h0gxwfb"))
447 (patches (search-patches "flint-ldconfig.patch"))))
448 (build-system gnu-build-system)
451 ("mpfr" ,mpfr))) ; header files from both are included by flint/arith.h
453 `(#:parallel-tests? #f ; seems to be necessary on arm
455 (modify-phases %standard-phases
457 (lambda* (#:key inputs outputs #:allow-other-keys)
458 (let ((out (assoc-ref outputs "out"))
459 (gmp (assoc-ref inputs "gmp"))
460 (mpfr (assoc-ref inputs "mpfr")))
461 ;; do not pass "--enable-fast-install", which makes the
462 ;; homebrew configure process fail
463 (invoke "./configure"
464 (string-append "--prefix=" out)
465 (string-append "--with-gmp=" gmp)
466 (string-append "--with-mpfr=" mpfr))
468 (synopsis "Fast library for number theory")
470 "FLINT is a C library for number theory. It supports arithmetic
471 with numbers, polynomials, power series and matrices over many base
472 rings, including multiprecision integers and rationals, integers
473 modulo n, p-adic numbers, finite fields (prime and non-prime order)
474 and real and complex numbers (via the Arb extension library).
476 Operations that can be performed include conversions, arithmetic,
477 GCDs, factoring, solving linear systems, and evaluating special
478 functions. In addition, FLINT provides various low-level routines for
480 (license license:gpl2+)
481 (home-page "http://flintlib.org/")))
490 (url "https://github.com/fredrik-johansson/arb.git")
492 (file-name (git-file-name name version))
495 "05lpy3hkl5f8ik19aw40cqydrb932xaf2n8hbq9ib5dnk7f010p1"))))
496 (build-system gnu-build-system)
498 `(("flint" ,flint))) ; flint.h is included by arf.h
504 (modify-phases %standard-phases
506 (lambda* (#:key inputs outputs #:allow-other-keys)
507 (let ((out (assoc-ref outputs "out"))
508 (flint (assoc-ref inputs "flint"))
509 (gmp (assoc-ref inputs "gmp"))
510 (mpfr (assoc-ref inputs "mpfr")))
511 ;; Do not pass "--enable-fast-install", which makes the
512 ;; homebrew configure process fail.
513 (invoke "./configure"
514 (string-append "--prefix=" out)
515 (string-append "--with-flint=" flint)
516 (string-append "--with-gmp=" gmp)
517 (string-append "--with-mpfr=" mpfr))))))))
518 (synopsis "Arbitrary precision floating-point ball arithmetic")
520 "Arb is a C library for arbitrary-precision floating-point ball
521 arithmetic. It supports efficient high-precision computation with
522 polynomials, power series, matrices and special functions over the
523 real and complex numbers, with automatic, rigorous error control.")
524 (license license:lgpl2.1+)
525 (home-page "http://arblib.org")))
527 (define-public python-flint
529 (name "python-flint")
534 (url "https://github.com/fredrik-johansson/python-flint.git")
536 (file-name (git-file-name name version))
539 "1v0anazbj1cfi68nl2j6dbd31kgkc1563xmr0zk5xk3xj78569pw"))
540 (patches (search-patches "python-flint-includes.patch"))))
541 (build-system python-build-system)
543 `(("python-cython" ,python-cython)))
545 `(("python-numpy" ,python-numpy)))
549 (synopsis "Python module wrapping ARB and FLINT")
551 "Python-flint is a Python extension module wrapping FLINT
552 (Fast Library for Number Theory) and Arb (arbitrary-precision ball
553 arithmetic). It supports integers, rationals, modular integers,
554 real and complex ball arithmetic, polynomials and matrices over all
555 these types and other mathematical functions.")
556 (license license:expat)
557 (home-page "http://fredrikj.net/python-flint/")))
565 (uri (string-append "https://shoup.net/ntl/ntl-"
569 "1lisp3064rch3jaa2wrhy1s9kll7i3ka3d0y6lj6l3l4ckfcrhdp"))
570 (modules '((guix build utils)))
573 (delete-file-recursively "src/libtool-origin")
575 (build-system gnu-build-system)
577 `(("libtool" ,libtool)
578 ("perl" ,perl))) ; for configuration
584 (modify-phases %standard-phases
586 (lambda* (#:key inputs outputs #:allow-other-keys)
588 (invoke "./configure"
589 (string-append "PREFIX=" (assoc-ref outputs "out"))
590 (string-append "LIBTOOL=" (assoc-ref inputs "libtool") "/bin/libtool")
591 ;; set the library prefixes explicitly so that they get
592 ;; embedded in the .la file
593 (string-append "GMP_PREFIX=" (assoc-ref inputs "gmp"))
594 (string-append "GF2X_PREFIX=" (assoc-ref inputs "gf2x"))
595 ;; Do not build especially for the build machine.
599 (synopsis "C++ library for number theory")
601 "NTL is a C++ library providing data structures and algorithms
602 for manipulating signed, arbitrary length integers, and for vectors,
603 matrices, and polynomials over the integers and over finite fields.")
604 (license license:gpl2+)
605 (home-page "https://shoup.net/ntl/")))
607 (define-public singular
615 (string-append "http://www.mathematik.uni-kl.de/ftp/pub/Math/"
619 (string-trim-right version #\p
620 0 (1- (string-length version)))
622 "/singular-" version ".tar.gz"))
624 "0kvd55353fiqyq1msmi0kka66n5h0aqs7m3km60r01b1w2f8085m"))))
625 (build-system gnu-build-system)
627 `(("doxygen" ,doxygen)
628 ("graphviz" ,graphviz)
637 ("readline" ,readline)))
640 (list (string-append "--with-ntl="
641 (assoc-ref %build-inputs "ntl")))))
642 (synopsis "Computer algebra system for polynomial computations")
644 "Singular is a computer algebra system for polynomial computations,
645 with special emphasis on commutative and non-commutative algebra, algebraic
646 geometry and singularity theory.")
647 ;; Singular itself is dual licensed gpl2 or gpl3, but some of the
648 ;; libraries with which it links are licensed under lgpl3+, so the
649 ;; combined work becomes gpl3. See COPYING in the source code.
650 (license license:gpl3)
651 (home-page "http://www.singular.uni-kl.de/index.php")))
653 (define-public gmp-ecm
659 ;; Use the ‘Latest version’ link for a stable URI across releases.
660 (uri (string-append "https://gforge.inria.fr/frs/download.php/"
661 "latestfile/160/ecm-" version ".tar.gz"))
663 "0hxs24c2m3mh0nq1zz63z3sb7dhy1rilg2s1igwwcb26x3pb7xqc"))))
664 (build-system gnu-build-system)
668 `(#:configure-flags '("--enable-shared"
669 ;; Disable specific assembly routines, which depend
670 ;; on the subarchitecture of the build machine,
671 ;; and use gmp instead.
672 "--disable-asm-redc")))
673 (synopsis "Integer factorization library using the elliptic curve method")
675 "GMP-ECM factors integers using the elliptic curve method (ECM) as well
676 as the P-1 and P+1 algorithms. It provides a library and a stand-alone
678 ;; Most files are under lgpl3+, but some are under gpl3+ or gpl2+,
679 ;; so the combined work is under gpl3+.
680 (license license:gpl3+)
681 (home-page "http://ecm.gforge.inria.fr/")))
689 (uri (string-append "mirror://gnu/bc/bc-" version ".tar.gz"))
692 "0amh9ik44jfg66csyvf4zz1l878c4755kjndq9j0270akflgrbb2"))))
693 (build-system gnu-build-system)
697 ("texinfo" ,texinfo)))
700 (list "--with-readline")))
701 (home-page "https://www.gnu.org/software/bc/")
702 (synopsis "Arbitrary precision numeric processing language")
704 "bc is an arbitrary precision numeric processing language. It includes
705 an interactive environment for evaluating mathematical statements. Its
706 syntax is similar to that of C, so basic usage is familiar. It also includes
707 \"dc\", a reverse-polish calculator.")
708 (license license:gpl2+)))
710 ;; The original kiss-fft does not have a complete build system and does not
711 ;; build any shared libraries. This is a fork used by Extempore.
712 (define-public kiss-fft-for-extempore
714 (name "kiss-fft-for-extempore")
719 (url "https://github.com/extemporelang/kiss_fft.git")
721 (file-name (git-file-name name version))
724 "0jasbmqy4wkqrqx3w64s1dfmj34875xmsl72mb26aa4hpyn14bi2"))))
725 (build-system cmake-build-system)
726 (arguments `(#:tests? #f)) ; no tests included
727 ;; Extempore refuses to build on architectures other than x86_64
728 (supported-systems '("x86_64-linux"))
729 (home-page "https://github.com/extemporelang/kiss_fft")
730 (synopsis "Mixed-radix Fast Fourier Transform")
732 "Kiss FFT attempts to be a reasonably efficient, moderately useful FFT
733 that can use fixed or floating data types and can easily be incorporated into
735 (license license:bsd-3)))
743 (uri (string-append "ftp://ftp.fftw.org/pub/fftw/fftw-"
747 "00z3k8fq561wq2khssqg0kallk0504dzlx989x3vvicjdqpjc4v1"))))
748 (build-system gnu-build-system)
751 '("--enable-shared" "--enable-openmp" "--enable-threads"
752 ,@(let ((system (or (%current-target-system) (%current-system))))
753 ;; Enable SIMD extensions for codelets. See details at:
754 ;; <http://fftw.org/fftw3_doc/Installation-on-Unix.html>.
756 ((string-prefix? "x86_64" system)
757 '("--enable-sse2" "--enable-avx" "--enable-avx2"
758 "--enable-avx512" "--enable-avx-128-fma"))
759 ((string-prefix? "i686" system)
761 ((string-prefix? "aarch64" system)
762 ;; Note that fftw supports NEON on 32-bit ARM only when
763 ;; compiled for single-precision.
767 ;; By default '-mtune=native' is used. However, that may cause the
768 ;; use of ISA extensions (e.g. AVX) that are not necessarily
769 ;; available on the user's machine when that package is built on a
770 ;; different machine.
771 "ax_cv_c_flags__mtune_native=no")))
772 (native-inputs `(("perl" ,perl)))
773 (home-page "http://fftw.org")
774 (synopsis "Computing the discrete Fourier transform")
776 "FFTW is a C subroutine library for computing the discrete Fourier
777 transform (DFT) in one or more dimensions, of arbitrary input size, and of
778 both real and complex data (as well as of even/odd data---i.e. the discrete
779 cosine/ sine transforms or DCT/DST).")
780 (license license:gpl2+)))
783 (package (inherit fftw)
786 (substitute-keyword-arguments (package-arguments fftw)
787 ((#:configure-flags fftw-configure-flags)
788 `(cons* "--enable-single"
789 ,@(if (string-prefix? "arm" (or (%current-target-system)
791 ;; fftw supports NEON on 32-bit ARM only when compiled
792 ;; for single-precision, so add it here.
795 ,fftw-configure-flags))))
797 (string-append (package-description fftw)
798 " Single-precision version."))))
800 (define-public fftw-openmpi
801 (package (inherit fftw)
802 (name "fftw-openmpi")
804 `(("openmpi" ,openmpi)
805 ,@(package-inputs fftw)))
807 (substitute-keyword-arguments (package-arguments fftw)
808 ((#:configure-flags cf)
809 `(cons "--enable-mpi" ,cf))
810 ((#:phases phases '%standard-phases)
811 `(modify-phases ,phases
812 (add-before 'check 'mpi-setup
815 (string-append (package-description fftw)
816 " With OpenMPI parallelism support."))))
818 (define-public java-la4j
825 (url "https://github.com/vkostyukov/la4j.git")
827 (file-name (string-append name "-" version "-checkout"))
830 "1qir8dr978cfvz9k12m2kbdwpyf6cqdf1d0ilb7lnkhbgq5i53w3"))))
831 (build-system ant-build-system)
833 `(#:jar-name "la4j.jar"
835 #:test-exclude (list "**/Abstract*.java"
837 "**/DenseMatrixTest.java"
838 "**/SparseMatrixTest.java"
840 "**/SparseVectorTest.java"
841 "**/DenseVectorTest.java")))
843 `(("java-junit" ,java-junit)
844 ("java-hamcrest-core" ,java-hamcrest-core)))
845 (home-page "http://la4j.org/")
846 (synopsis "Java library that provides Linear Algebra primitives and algorithms")
847 (description "The la4j library is a Java library that provides Linear
848 Algebra primitives (matrices and vectors) and algorithms. The key features of
849 the la4j library are:
852 @item No dependencies and tiny size
853 @item Fluent object-oriented/functional API
854 @item Sparse (CRS, CCS) and dense (1D/2D arrays) matrices
855 @item Linear systems solving (Gaussian, Jacobi, Zeidel, Square Root, Sweep and other)
856 @item Matrices decomposition (Eigenvalues/Eigenvectors, SVD, QR, LU, Cholesky and other)
857 @item MatrixMarket/CSV IO formats support for matrices and vectors
859 (license license:asl2.0)))
861 (define-public java-jlargearrays
863 (name "java-jlargearrays")
867 (uri (string-append "https://repo1.maven.org/maven2/"
868 "pl/edu/icm/JLargeArrays/"
869 version "/JLargeArrays-" version
871 (file-name (string-append name "-" version ".jar"))
874 "0v05iphpxbjnd7f4jf1rlqq3m8hslhcm0imdbsgxr20pi3xkaf2a"))))
875 (build-system ant-build-system)
877 `(#:jar-name "jlargearrays.jar"
878 #:tests? #f ; tests are not included in the release archive
881 `(("java-commons-math3" ,java-commons-math3)))
882 (home-page "https://gitlab.com/ICM-VisLab/JLargeArrays")
883 (synopsis "Library of one-dimensional arrays that can store up to 263 elements")
884 (description "JLargeArrays is a Java library of one-dimensional arrays
885 that can store up to 263 elements.")
886 (license license:bsd-2)))
888 (define-public java-jtransforms
890 (name "java-jtransforms")
894 (uri (string-append "https://repo1.maven.org/maven2/"
895 "com/github/wendykierp/JTransforms/"
896 version "/JTransforms-" version "-sources.jar"))
899 "1haw5m8shv5srgcpwkl853dz8bv6h90bzlhcps6mdpb4cixjirsg"))))
900 (build-system ant-build-system)
902 `(#:jar-name "jtransforms.jar"
903 #:tests? #f ; tests are not included in the release archive
906 `(("java-commons-math3" ,java-commons-math3)
907 ("java-jlargearrays" ,java-jlargearrays)))
908 (home-page "https://github.com/wendykierp/JTransforms")
909 (synopsis "Multithreaded FFT library written in pure Java")
910 (description "JTransforms is a multithreaded FFT library written in pure
911 Java. Currently, four types of transforms are available: @dfn{Discrete
912 Fourier Transform} (DFT), @dfn{Discrete Cosine Transform} (DCT), @dfn{Discrete
913 Sine Transform} (DST) and @dfn{Discrete Hartley Transform} (DHT).")
914 (license license:bsd-2)))
922 (uri (string-append "https://bitbucket.org/eigen/eigen/get/"
926 "1km3fyfzyqfdvmnl79drps3fjwnz3zbh0c7l34mfbqyvvs8cy4wz"))
927 (file-name (string-append name "-" version ".tar.bz2"))
928 (patches (search-patches "eigen-stabilise-sparseqr-test.patch"))
929 (modules '((guix build utils)))
931 ;; There are 3 test failures in the "unsupported" directory,
932 ;; but maintainers say it's a known issue and it's unsupported
933 ;; anyway, so just skip them.
935 (substitute* "unsupported/CMakeLists.txt"
936 (("add_subdirectory\\(test.*")
937 "# Do not build the tests for unsupported features.\n"))
939 (build-system cmake-build-system)
941 '(;; Turn off debugging symbols to save space.
942 #:build-type "Release"
944 #:phases (modify-phases %standard-phases
947 (let* ((cores (parallel-job-count))
948 (dash-j (format #f "-j~a" cores)))
949 (setenv "EIGEN_SEED" "1") ;for reproducibility
950 ;; First build the tests, in parallel. See
951 ;; <http://eigen.tuxfamily.org/index.php?title=Tests>.
952 (invoke "make" "buildtests" dash-j)
954 ;; Then run 'CTest' with -V so we get more
955 ;; details upon failure.
956 (invoke "ctest" "-V" dash-j)))))))
957 (home-page "https://eigen.tuxfamily.org")
958 (synopsis "C++ template library for linear algebra")
960 "Eigen is a C++ template library for linear algebra: matrices, vectors,
961 numerical solvers, and related algorithms. It provides an elegant API based
962 on \"expression templates\". It is versatile: it supports all matrix sizes,
963 all standard numeric types, various matrix decompositions and geometry
964 features, and more.")
966 ;; Most of the code is MPLv2, with a few files under LGPLv2.1+ or BSD-3.
967 ;; See 'COPYING.README' for details.
968 (license license:mpl2.0)))
970 (define-public eigen-for-tensorflow
971 (let ((changeset "fd6845384b86")
973 (package (inherit eigen)
974 (name "eigen-for-tensorflow")
975 (version (string-append "3.3.5-" revision "." changeset))
979 (url "https://bitbucket.org/eigen/eigen")
980 (changeset changeset)))
983 "12cwgah63wqwb66xji048hcxc1z5zjg8a7701zlia5zbilnnk1n5"))
984 (file-name (string-append name "-" version "-checkout"))
985 (modules '((guix build utils)))
987 ;; There are 3 test failures in the "unsupported" directory,
988 ;; but maintainers say it's a known issue and it's unsupported
989 ;; anyway, so just skip them.
991 (substitute* "unsupported/CMakeLists.txt"
992 (("add_subdirectory\\(test.*")
993 "# Do not build the tests for unsupported features.\n"))
996 (define-public xtensor
1003 (url "https://github.com/QuantStack/xtensor.git")
1007 "1fmv2hpx610xwhxrndfsfvlbqfyk4l3gi5q5d7pa9m82kblxjj9l"))
1008 (file-name (git-file-name name version))))
1009 (build-system cmake-build-system)
1011 `(("googletest" ,googletest)
1015 '("-DBUILD_TESTS=ON")
1016 #:test-target "xtest"))
1017 (home-page "https://quantstack.net/xtensor")
1018 (synopsis "C++ tensors with broadcasting and lazy computing")
1019 (description "xtensor is a C++ library meant for numerical analysis with
1020 multi-dimensional array expressions.
1024 @item an extensible expression system enabling lazy broadcasting.
1025 @item an API following the idioms of the C++ standard library.
1026 @item tools to manipulate array expressions and build upon xtensor.
1028 (license license:bsd-3)))
1037 (uri (string-append "https://www.gap-system.org/pub/gap/gap-"
1038 (version-major+minor version)
1043 (base32 "0cp6ddk0469zzv1m1vair6gm27ic6c5m77ri8rn0znq3gaps6x94"))
1044 (modules '((guix build utils) (ice-9 ftw) (srfi srfi-1)))
1047 ;; Delete the external gmp and zlib libraries
1048 ;; and a subdirectory not needed for our build.
1049 (for-each delete-file-recursively
1050 '("extern" "hpcgap"))
1051 ;; Delete a failing test.
1052 ;; FIXME: This might be fixed in the next release, see
1053 ;; https://github.com/gap-system/gap/issues/3292
1054 (delete-file "tst/testinstall/dir.tst")
1055 ;; Delete all packages except for a fixed list.
1056 (with-directory-excursion "pkg"
1057 (for-each delete-file-recursively
1058 (lset-difference string=? (scandir ".")
1060 ;; Necessary packages.
1063 "SmallGrp-1.3" ; artistic2.0
1064 "transgrp" ; artistic2.0 for data,
1065 ; gpl2 or gpl3 for code
1066 ;; Recommanded package.
1068 ;; Optional packages, searched for at start,
1069 ;; and their depedencies.
1072 "crisp-1.4.4" ; bsd-2
1073 "ctbllib" ; gpl3+ according to doc/chap0.txt
1076 "irredsol-1.4" ; bsd-2
1083 "tomlib-1.2.7" ; gpl2+, clarified in the git repository
1084 ; and the next release
1087 (build-system gnu-build-system)
1092 `(#:modules ((ice-9 ftw)
1094 (guix build gnu-build-system)
1097 (modify-phases %standard-phases
1098 (add-after 'build 'build-packages
1099 ;; Compile all packages that have not been deleted by the
1100 ;; code snippet above.
1102 (setenv "CONFIG_SHELL" (which "bash"))
1103 (with-directory-excursion "pkg"
1104 (invoke "../bin/BuildPackages.sh")
1106 (add-after 'build-packages 'build-doc
1107 ;; The documentation is bundled, but we create it from source.
1109 (with-directory-excursion "doc"
1110 (invoke "./make_doc"))
1113 (lambda* (#:key outputs #:allow-other-keys)
1114 (let* ((out (assoc-ref outputs "out"))
1115 (bin (string-append out "/bin"))
1116 (lib (string-append out "/lib"))
1117 (prog (string-append bin "/gap"))
1118 (prog-real (string-append bin "/.gap-real"))
1119 (share (string-append out "/share/gap"))
1120 (include (string-append out "/include/gap"))
1121 (include-hpc (string-append include "/hpc")))
1122 ;; Install only the gap binary; the gac compiler is left
1123 ;; for maybe later. "Wrap" it in a shell script that calls
1124 ;; the binary with the correct parameter.
1126 (copy-file "gap" prog-real)
1127 (call-with-output-file prog
1130 "#!~a~%exec ~a -l ~a \"$@\"~%"
1135 ;; Install the headers, which are needed by Sage. The
1136 ;; Makefile target "install-headers" was available in
1137 ;; gap-4.10.0, but has been commented out in gap-4.10.1.
1138 (mkdir-p include-hpc)
1139 (install-file "gen/config.h" include)
1140 (let ((file-name-predicate-without-stat
1142 (cut (file-name-predicate regex) <> #f))))
1143 (with-directory-excursion "src"
1145 (cut install-file <> include)
1147 (file-name-predicate-without-stat ".*\\.h$"))))
1148 (with-directory-excursion "src/hpc"
1150 (cut install-file <> include-hpc)
1152 (file-name-predicate-without-stat ".*\\.h$")))))
1153 ;; Install the library, which is needed by Sage. The
1154 ;; Makefile target "install-libgap" was available in
1155 ;; gap-4.10.0, but has been commented out in gap-4.10.1.
1156 ;; Compared to the Makefile, which used libtool, the
1157 ;; following approach of copying files and making symlinks
1158 ;; is rather pedestrian. There is hope that some later
1159 ;; version of gap reinstates and completes the install
1161 (invoke "make" "libgap.la")
1162 (install-file "libgap.la" lib)
1163 (install-file ".libs/libgap.so.0.0.0" lib)
1164 (symlink "libgap.so.0.0.0" (string-append lib "/libgap.so"))
1165 (symlink "libgap.so.0.0.0" (string-append lib "/libgap.so.0"))
1166 ;; Install a certain number of files and directories to
1167 ;; SHARE, where the wrapped shell script expects them.
1168 ;; Remove information on the build directory from sysinfo.gap.
1169 (substitute* "sysinfo.gap"
1170 (("GAP_BIN_DIR=\".*\"") "GAP_BIN_DIR=\"\"")
1171 (("GAP_LIB_DIR=\".*\"") "GAP_LIB_DIR=\"\"")
1172 (("GAP_CPPFLAGS=\".*\"") "GAP_CPPFLAGS=\"\""))
1173 (install-file "sysinfo.gap" share)
1174 (copy-recursively "grp" (string-append share "/grp"))
1175 (copy-recursively "pkg" (string-append share "/pkg"))
1176 ;; The following is not the C library libgap.so, but a
1177 ;; library of GAP code.
1178 (copy-recursively "lib" (string-append share "/lib"))
1179 ;; The gap binary looks for documentation inside SHARE.
1180 (copy-recursively "doc" (string-append share "/doc")))
1182 (home-page "https://www.gap-system.org/")
1184 "System for computational group theory")
1186 "GAP is a system for computational discrete algebra, with particular
1187 emphasis on computational group theory. It provides a programming language,
1188 a library of thousands of functions implementing algebraic algorithms
1189 written in the GAP language as well as large data libraries of algebraic
1191 ;; Some packages have different licenses (effectively forcing the
1192 ;; combined work to be licensed as gpl3+); if this is the case, this
1193 ;; is mentioned above next to their name.
1194 ;; Some packages have no license mentioned explicitly; supposedly this
1195 ;; means that the gpl2+ licence of GAP itself applies, but to be on the
1196 ;; safe side, we drop them for now.
1197 (license license:gpl2+)))
1199 (define-public givaro
1206 (url "https://github.com/linbox-team/givaro")
1207 (commit (string-append "v" version))))
1208 (file-name (git-file-name name version))
1211 "11wz57q6ijsvfs5r82masxgr319as92syi78lnl9lgdblpc6xigk"))))
1212 (build-system gnu-build-system)
1214 `(("autoconf" ,autoconf)
1215 ("automake" ,automake)
1216 ("libtool" ,libtool)))
1218 `(("gmp" ,gmp))) ; gmp++.h includes gmpxx.h
1221 (modify-phases %standard-phases
1222 (add-before 'bootstrap 'setenv
1223 ;; Prevent the autogen.sh script to carry out the configure
1224 ;; script, which has not yet been patched to replace /bin/sh.
1226 (setenv "NOCONFIGURE" "yes")
1228 (synopsis "Algebraic computations with exact rings and fields")
1230 "Givaro is a C++ library implementing the basic arithmetic of various
1231 algebraic objects: prime fields, extension fields, finite fields, finite
1232 rings, polynomials, algebraic numbers, arbitrary precision integers and
1233 rationals (C++ wrappers over gmp), fixed precision integers. It also
1234 provides data-structures and templated classes for the manipulation of
1235 compound objects, such as vectors, matrices and univariate polynomials.")
1236 (license license:cecill-b)
1237 (home-page "https://github.com/linbox-team/givaro")))
1239 (define-public fflas-ffpack
1241 (name "fflas-ffpack")
1246 (url "https://github.com/linbox-team/fflas-ffpack")
1248 (file-name (git-file-name name version))
1251 "1ynbjd72qrwp0b4kpn0p5d7gddpvj8dlb5fwdxajr5pvkvi3if74"))))
1252 (build-system gnu-build-system)
1254 `(("autoconf" ,autoconf)
1255 ("automake" ,automake)
1256 ("libtool" ,libtool)
1257 ("pkg-config" ,pkg-config)))
1259 `(("openblas" ,openblas)))
1261 `(("givaro" ,givaro))) ; required according to the .pc file
1264 (list (string-append "--with-blas-libs="
1265 (assoc-ref %build-inputs "openblas")
1266 "/lib/libopenblas.so"))
1268 (modify-phases %standard-phases
1269 (add-before 'bootstrap 'setenv
1270 ;; Prevent the autogen.sh script to carry out the configure
1271 ;; script, which has not yet been patched to replace /bin/sh.
1273 (setenv "NOCONFIGURE" "yes")
1275 (synopsis "C++ library for linear algebra over finite fields")
1277 "FFLAS-FFPACK is a C++ template library for basic linear algebra
1278 operations over a finite field.
1279 FFLAS (Finite Field Linear Algebra Subprograms) provides the implementation
1280 of a subset of routines of the numerical BLAS; it also supports sparse
1281 matrix-vector products.
1282 FFPACK (Finite Field Linear Algebra Package) is inspired by the LAPACK
1283 library to provide functionalities of higher level, using the kernel
1284 of a BLAS. Additionally, it provides routines specific to exact linear
1285 algebra, such as the row echelon form.")
1286 (license license:lgpl2.1+)
1287 (home-page "https://linbox-team.github.io/fflas-ffpack/")))
1289 (define-public linbox
1296 (url "https://github.com/linbox-team/linbox")
1297 (commit (string-append "v" version))))
1298 (file-name (git-file-name name version))
1301 "10j6dspbsq7d2l4q3y0c1l1xwmaqqba2fxg59q5bhgk9h5d7q571"))))
1302 (build-system gnu-build-system)
1304 `(("autoconf" ,autoconf)
1305 ("automake" ,automake)
1306 ("libtool" ,libtool)
1307 ("pkg-config" ,pkg-config)))
1309 `(("fflas-ffpack" ,fflas-ffpack)))
1312 (modify-phases %standard-phases
1313 (add-before 'bootstrap 'setenv
1314 ;; Prevent the autogen.sh script to carry out the configure
1315 ;; script, which has not yet been patched to replace /bin/sh.
1317 (setenv "NOCONFIGURE" "yes")
1319 (synopsis "C++ library for linear algebra over exact rings")
1321 "LinBox is a C++ template library for exact linear algebra computation
1322 with dense, sparse, and structured matrices over the integers and over
1324 (license license:lgpl2.1+)
1325 (home-page "https://linbox-team.github.io/linbox/")))
1330 (version "20140914")
1334 (url "https://bitbucket.org/malb/m4ri")
1335 (commit (string-append "release-" version))))
1336 (file-name (git-file-name name version))
1339 "0xfg6pffbn8r1s0y7bn9b8i55l00d41dkmhrpf7pwk53qa3achd3"))))
1340 (build-system gnu-build-system)
1342 `(("autoconf" ,autoconf)
1343 ("automake" ,automake)
1344 ("libtool" ,libtool)
1345 ("pkg-config" ,pkg-config)))
1347 `(("libpng" ,libpng)))
1348 (synopsis "Arithmetic of dense matrices over F_2")
1349 (description "M4RI is a library for fast arithmetic with dense matrices
1350 over F2. The name M4RI comes from the first implemented algorithm: The
1351 Method of the Four Russians inversion algorithm published by Gregory Bard.
1352 This algorithm in turn is named after the Method of the Four Russians
1353 multiplication algorithm.")
1354 (license license:gpl2+)
1355 (home-page "https://bitbucket.org/malb/m4ri/")))
1357 (define-public symmetrica
1362 (method url-fetch/tarbomb)
1363 (uri (let ((v (string-join (string-split version #\.) "_")))
1364 (string-append "http://www.algorithm.uni-bayreuth.de/"
1365 "en/research/SYMMETRICA/"
1366 "SYM" v "_tar.gz")))
1369 "1qhfrbd5ybb0sinl9pad64rscr08qvlfzrzmi4p4hk61xn6phlmz"))
1370 ;; Taken from <https://git.sagemath.org/sage.git/plain/build/pkgs/symmetrica/patches/>
1371 (patches (search-patches "symmetrica-bruch.patch"
1372 "symmetrica-int32.patch"
1373 "symmetrica-return_values.patch"
1374 "symmetrica-sort_sum_rename.patch"))))
1375 (build-system gnu-build-system)
1377 `(#:tests? #f ;no test
1379 (modify-phases %standard-phases
1380 (add-after 'unpack 'fix-makefile
1382 (substitute* "makefile"
1383 (("cc -c") "gcc -c -fPIC"))
1385 (add-after 'fix-makefile 'turn-off-banner
1388 (("(INT no_banner = )FALSE" _ pre) (string-append pre "TRUE")))
1390 (delete 'configure) ;no configure script
1391 (replace 'install ;no install target
1392 (lambda* (#:key outputs #:allow-other-keys)
1393 (let* ((out (assoc-ref outputs "out"))
1394 (lib (string-append out "/lib"))
1395 (inc (string-append out "/include/symmetrica"))
1396 (doc (string-append out "/share/doc/symmetrica-" ,version))
1397 (static "libsymmetrica.a"))
1398 ;; Build static library.
1399 (apply invoke "ar" "crs" static (find-files "." "\\.o$"))
1400 (invoke "ranlib" static)
1401 ;; Install static library and headers.
1402 (for-each (lambda (f) (install-file f inc))
1403 (find-files "." "\\.h$"))
1404 (install-file "libsymmetrica.a" lib)
1405 ;; Install documentation.
1406 (for-each (lambda (f) (install-file f doc))
1407 (find-files "." "\\.doc$"))
1409 (home-page "http://www.algorithm.uni-bayreuth.de/en/research/SYMMETRICA/")
1410 (synopsis "Combinatoric C Library")
1411 (description "Symmetrica is a library for combinatorics. It has support
1412 for the representation theory of the symmetric group and related groups,
1413 combinatorics of tableaux, symmetric functions and polynomials, Schubert
1414 polynomials, and the representation theory of Hecke algebras of type A_n.")
1415 (license license:public-domain)))
1417 (define-public m4rie
1420 (version "20150908")
1424 (url "https://bitbucket.org/malb/m4rie")
1425 (commit (string-append "release-" version))))
1426 (file-name (git-file-name name version))
1429 "0r8lv46qx5mkz5kp3ay2jnsp0mbhlqr5z2z220wdk73wdshcznss"))))
1430 (build-system gnu-build-system)
1432 `(("autoconf" ,autoconf)
1433 ("automake" ,automake)
1434 ("libtool" ,libtool)))
1437 (synopsis "Arithmetic of dense matrices over F_{2^e}")
1438 (description "M4RI is a library for fast arithmetic with dense matrices
1439 over finite fields of characteristic 2. So it extends the functionality
1440 of M4RI from F_2 to F_{2^e}.")
1441 (license license:gpl2+)
1442 (home-page "https://bitbucket.org/malb/m4rie/")))
1444 (define-public eclib
1447 (version "20190909")
1451 (url "https://github.com/JohnCremona/eclib/")
1452 (commit (string-append "v" version))))
1453 (file-name (git-file-name name version))
1456 "1gw27lqc3f525n8qdcmr2nyn16y9g10z9f6dnmckyyxcdzvhq35n"))))
1457 (build-system gnu-build-system)
1459 `(("autoconf" ,autoconf)
1460 ("automake" ,automake)
1461 ("libtool" ,libtool)))
1464 ("pari-gp" ,pari-gp)))
1465 (synopsis "Ranks of elliptic curves and modular symbols")
1466 (description "The eclib package includes mwrank (for 2-descent on
1467 elliptic curves over Q) and modular symbol code; it has been written by
1468 John Cremona to compute his elliptic curve database.")
1469 (license license:gpl2+)
1470 (home-page (string-append "http://homepages.warwick.ac.uk/staff/"
1471 "J.E.Cremona/mwrank/index.html"))))
1473 (define-public lrcalc
1480 (url "https://bitbucket.org/asbuch/lrcalc")
1481 (commit (string-append "lrcalc-" version))))
1482 (file-name (git-file-name name version))
1485 "1c12d04jdyxkkav4ak8d1aqrv594gzihwhpxvc6p9js0ry1fahss"))
1486 (patches (search-patches "lrcalc-includes.patch"))))
1487 (build-system gnu-build-system)
1489 `(("autoconf" ,autoconf)
1490 ("automake" ,automake)
1491 ("libtool" ,libtool)))
1494 (modify-phases %standard-phases
1495 (add-before 'build 'fix-permission
1497 (chmod "lrcalc.maple.src" #o644)
1499 (synopsis "Littlewood-Richardson calculator in algebraic combinatorics")
1500 (description "The Littlewood-Richardson Calculator (lrcalc) is a
1501 program designed to compute Littlewood-Richardson coefficients. It computes
1502 single Littlewood-Richardson coefficients, products of Schur functions, or
1503 skew Schur functions. In addition it computes products in the small quantum
1504 cohomology ring of a Grassmann variety. The software package also includes
1505 a program that performs fast computation of the more general multiplicative
1506 structure constants of Schubert polynomials.")
1507 (license license:gpl2+)
1508 (home-page "https://sites.math.rutgers.edu/~asbuch/lrcalc/")))
1517 (uri (string-append "http://www.cs.uwaterloo.ca/~astorjoh/iml-"
1518 version ".tar.bz2"))
1521 "0akwhhz9b40bz6lrfxpamp7r7wkk48p455qbn04mfnl9a1l6db8x"))))
1522 (build-system gnu-build-system)
1525 ("cblas" ,openblas))) ; or any other BLAS library; the documentation
1526 ; mentions ATLAS in particular
1531 (string-append "--with-gmp-include="
1532 (assoc-ref %build-inputs "gmp") "/include")
1533 (string-append "--with-gmp-lib="
1534 (assoc-ref %build-inputs "gmp") "/lib")
1535 "--with-cblas=-lopenblas"
1536 (string-append "--with-cblas-include="
1537 (assoc-ref %build-inputs "cblas") "/include")
1538 (string-append "--with-cblas-lib="
1539 (assoc-ref %build-inputs "cblas") "/lib"))))
1540 (home-page "https://cs.uwaterloo.ca/~astorjoh/iml.html")
1542 "Solver for systems of linear equations over the integers")
1544 "IML is a C library implementing algorithms for computing exact
1545 solutions to dense systems of linear equations over the integers.
1546 Currently, IML provides the following functionality:
1549 @item Nonsingular rational system solving:
1550 compute the unique rational solution X to the system AX=B, where A and B
1551 are integer matrices, A nonsingular.
1552 @item Compute the right nullspace or kernel of an integer matrix.
1553 @item Certified linear system solving:
1554 compute a minimal denominator solution x to a system Ax=b, where b is an
1555 integer vector and A is an integer matrix with arbitrary shape and
1559 In addition, IML provides some low level routines for a variety of mod p
1560 matrix operations: computing the row-echelon form, determinant, rank
1561 profile, and inverse of a mod p matrix. These mod p routines are not
1562 general purpose; they require that p satisfy some preconditions based on
1563 the dimension of the input matrix (usually p should be prime and should be
1564 no more than about 20 bits long).")
1565 (license license:bsd-3)))