gnu: ungoogled-chromium: Update to 81.0.4044.122-0.31d6e60 [security fixes].
[jackhill/guix/guix.git] / gnu / packages / algebra.scm
CommitLineData
233e7676 1;;; GNU Guix --- Functional package management for GNU
3f074a21 2;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019 Andreas Enge <andreas@enge.fr>
4b0bf990 3;;; Copyright © 2013, 2015, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
a733253b 4;;; Copyright © 2016, 2017, 2018, 2019, 2020 Nicolas Goaziou <mail@nicolasgoaziou.fr>
69d5909e 5;;; Copyright © 2014, 2018 Mark H Weaver <mhw@netris.org>
67f39dd5 6;;; Copyright © 2016, 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
ecc5bc33 7;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il>
5144e314 8;;; Copyright © 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
f71f29ca 9;;; Copyright © 2017 Marius Bakke <mbakke@fastmail.com>
eb6785cf 10;;; Copyright © 2017, 2019 Eric Bavier <bavier@member.fsf.org>
4c877704 11;;; Copyright © 2020 Björn Höfling <bjoern.hoefling@bjoernhoefling.de>
7cc9e1dc 12;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
2ed139c4 13;;;
233e7676 14;;; This file is part of GNU Guix.
2ed139c4 15;;;
233e7676 16;;; GNU Guix is free software; you can redistribute it and/or modify it
2ed139c4
AE
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.
20;;;
233e7676 21;;; GNU Guix is distributed in the hope that it will be useful, but
2ed139c4
AE
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.
25;;;
26;;; You should have received a copy of the GNU General Public License
233e7676 27;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
2ed139c4 28
1ffa7090 29(define-module (gnu packages algebra)
59a43334 30 #:use-module (gnu packages)
14e6520e 31 #:use-module (gnu packages autotools)
fdb513a7 32 #:use-module (gnu packages bison)
70770b93 33 #:use-module (gnu packages check)
10b1f688 34 #:use-module (gnu packages compression)
70770b93 35 #:use-module (gnu packages cpp)
99828fa7 36 #:use-module (gnu packages documentation)
f71f29ca 37 #:use-module (gnu packages ed)
5894b604 38 #:use-module (gnu packages flex)
57497c57
NG
39 #:use-module (gnu packages fltk)
40 #:use-module (gnu packages gl)
aae03c48 41 #:use-module (gnu packages graphviz)
57497c57 42 #:use-module (gnu packages image)
c8d99608 43 #:use-module (gnu packages java)
aae03c48 44 #:use-module (gnu packages maths)
0fc54d4b 45 #:use-module (gnu packages mpi)
5894b604 46 #:use-module (gnu packages multiprecision)
1ffa7090 47 #:use-module (gnu packages perl)
4bf9cb40 48 #:use-module (gnu packages pkg-config)
6d3896b9 49 #:use-module (gnu packages pulseaudio)
aae03c48 50 #:use-module (gnu packages python)
1d6589db 51 #:use-module (gnu packages python-xyz)
5894b604 52 #:use-module (gnu packages readline)
b7194849 53 #:use-module (gnu packages shells)
8f9ac901 54 #:use-module (gnu packages tex)
f71f29ca 55 #:use-module (gnu packages texinfo)
57497c57 56 #:use-module (gnu packages xiph)
fb8d1be8 57 #:use-module (gnu packages xorg)
c8d99608 58 #:use-module (guix build-system ant)
7569c5cb 59 #:use-module (guix build-system gnu)
8f4b1dfb 60 #:use-module (guix build-system cmake)
1d6589db 61 #:use-module (guix build-system python)
5894b604 62 #:use-module (guix download)
c8d99608 63 #:use-module (guix git-download)
697eb65d 64 #:use-module (guix hg-download)
5894b604
TGR
65 #:use-module ((guix licenses) #:prefix license:)
66 #:use-module (guix packages)
7569c5cb 67 #:use-module (guix utils))
2ed139c4
AE
68
69
70(define-public mpfrcx
71 (package
72 (name "mpfrcx")
43a776e2 73 (version "0.5")
2ed139c4
AE
74 (source (origin
75 (method url-fetch)
76 (uri (string-append
43a776e2 77 "http://www.multiprecision.org/downloads/mpfrcx-"
2ed139c4
AE
78 version ".tar.gz"))
79 (sha256
80 (base32
43a776e2 81 "1s968480ymv6w0rnvfp9mxvx98hvi29fkvw8nk4ggzc6azxgwybs"))))
2ed139c4 82 (build-system gnu-build-system)
878c8f3f
AE
83 (propagated-inputs
84 `(("gmp" ,gmp)
85 ("mpfr" ,mpfr)
86 ("mpc" ,mpc))) ; Header files are included by mpfrcx.h.
35b9e423 87 (synopsis "Arithmetic of polynomials over arbitrary precision numbers")
2ed139c4 88 (description
35b9e423 89 "Mpfrcx is a library for the arithmetic of univariate polynomials over
2ed139c4 90arbitrary precision real (mpfr) or complex (mpc) numbers, without control
35b9e423 91on the rounding. For the time being, only the few functions needed to
2ed139c4 92implement the floating point approach to complex multiplication are
35b9e423 93implemented. On the other hand, these comprise asymptotically fast
e881752c 94multiplication routines such as Toom–Cook and the FFT.")
43a776e2 95 (license license:lgpl3+)
79d1550f 96 (home-page "http://www.multiprecision.org/mpfrcx/")))
2ed139c4 97
7c5f6231
AE
98(define-public gf2x
99 (package
100 (name "gf2x")
101 (version "1.2")
102 (source (origin
103 (method url-fetch)
104 (uri (string-append
105 "https://gforge.inria.fr/frs/download.php/file/36934/gf2x-"
106 version ".tar.gz"))
107 (sha256
108 (base32
109 "0d6vh1mxskvv3bxl6byp7gxxw3zzpkldrxnyajhnl05m0gx7yhk1"))))
110 (build-system gnu-build-system)
111 (synopsis "Arithmetic of polynomials over binary finite fields")
112 (description
113 "The gf2x library provides arithmetic of polynomials over finite fields
114of characteristic 2. It implements the multiplication, squaring and
115greatest common divisor operations.")
116 (license license:gpl3+)
117 (home-page "https://gforge.inria.fr/projects/gf2x/")))
118
10b1f688
AE
119(define-public cm
120 (package
121 (name "cm")
81b55bf7 122 (version "0.3")
10b1f688
AE
123 (source (origin
124 (method url-fetch)
125 (uri (string-append
126 "http://www.multiprecision.org/cm/download/cm-"
127 version ".tar.gz"))
128 (sha256
129 (base32
81b55bf7 130 "1nf5kr0nqmhbzrsrinky18z0ighjpsmb5cr8zyg8jf04bfbyrfmc"))))
10b1f688
AE
131 (build-system gnu-build-system)
132 (propagated-inputs
133 `(("mpfrcx" ,mpfrcx)
134 ("zlib" ,zlib))) ; Header files included from cm_common.h.
135 (inputs
136 `(("pari-gp" ,pari-gp)))
137 (synopsis "CM constructions for elliptic curves")
138 (description
139 "The CM software implements the construction of ring class fields of
140imaginary quadratic number fields and of elliptic curves with complex
141multiplication via floating point approximations. It consists of libraries
142that can be called from within a C program and of executable command
143line applications.")
81b55bf7 144 (license license:gpl3+)
79d1550f 145 (home-page "http://www.multiprecision.org/cm/")))
10b1f688 146
2ed139c4
AE
147(define-public fplll
148 (package
1de48e8f
NG
149 (name "fplll")
150 (version "5.2.1")
151 (source (origin
152 (method git-fetch)
153 (uri (git-reference
154 (url "https://github.com/fplll/fplll.git")
155 (commit version)))
156 (file-name (git-file-name name version))
157 (sha256
158 (base32
159 "015qmrd7nfaysbv1hbwiprz9g6hnww1y1z1xw8f43ysb7k1b5nbg"))))
160 (build-system gnu-build-system)
161 (native-inputs
162 `(("autoconf" ,autoconf)
163 ("automake" ,automake)
164 ("libtool" ,libtool)))
165 (inputs
166 `(("gmp" ,gmp)
167 ("mpfr" ,mpfr)))
168 (home-page "https://github.com/fplll/fplll")
169 (synopsis "Library for LLL-reduction of euclidean lattices")
170 (description
171 "fplll contains implementations of several lattice algorithms.
172The implementation relies on floating-point orthogonalization, and LLL
173is central to the code, hence the name.
174
175It includes implementations of floating-point LLL reduction
176algorithms, offering different speed/guarantees ratios. It contains
177a @emph{wrapper} choosing the estimated best sequence of variants in
178order to provide a guaranteed output as fast as possible. In the case
179of the wrapper, the succession of variants is oblivious to the user.
180
181It includes an implementation of the BKZ reduction algorithm,
182including the BKZ-2.0 improvements (extreme enumeration
183pruning, pre-processing of blocks, early termination). Additionally,
184Slide reduction and self dual BKZ are supported.
185
186It also includes a floating-point implementation of the
187Kannan-Fincke-Pohst algorithm that finds a shortest non-zero lattice
188vector. For the same task, the GaussSieve algorithm is also available
189in fplll. Finally, it contains a variant of the enumeration algorithm
190that computes a lattice vector closest to a given vector belonging to
191the real span of the lattice.")
192 (license license:lgpl2.1+)))
4e6b699d 193
25cbaa9e
NG
194(define-public python-fpylll
195 (package
196 (name "python-fpylll")
197 (version "0.4.1")
198 (source
199 (origin
200 ;; Pypi contains and older release, so we use a tagged release from
201 ;; Github instead.
202 (method git-fetch)
203 (uri (git-reference
204 (url "https://github.com/fplll/fpylll.git")
205 (commit (string-append version "dev"))))
f1d4d79f 206 (file-name (git-file-name name version))
25cbaa9e
NG
207 (sha256
208 (base32
209 "01x2sqdv0sbjj4g4waj0hj4rcn4bq7h17442xaqwbznym9azmn9w"))))
210 (build-system python-build-system)
211 (inputs
212 `(("fplll" ,fplll)
213 ("gmp" ,gmp)
214 ("mpfr" ,mpfr)
215 ("pari-gp" ,pari-gp)))
216 (propagated-inputs
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+)))
226
90a6d47c
AE
227(define-public pari-gp
228 (package
67f39dd5 229 (name "pari-gp")
bf82d83c 230 (version "2.11.3")
67f39dd5
RW
231 (source (origin
232 (method url-fetch)
233 (uri (string-append
234 "https://pari.math.u-bordeaux.fr/pub/pari/unix/pari-"
235 version ".tar.gz"))
236 (sha256
237 (base32
bf82d83c 238 "1jd65h2psrmba2dx7rkf5qidf9ka0cwbsg20pd18k45ggr30l467"))))
67f39dd5
RW
239 (build-system gnu-build-system)
240 (native-inputs
241 `(("texlive" ,(texlive-union
f75aa97f 242 (list texlive-amsfonts)))))
67f39dd5
RW
243 (inputs `(("gmp" ,gmp)
244 ("libx11" ,libx11)
245 ("perl" ,perl)
246 ("readline" ,readline)))
247 (arguments
248 '(#:make-flags '("all")
249 #:test-target "dobench"
250 #:phases
251 (modify-phases %standard-phases
252 (replace 'configure
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")
258 (description
259 "PARI/GP is a widely used computer algebra system designed for fast
90a6d47c
AE
260computations in number theory (factorisations, algebraic number theory,
261elliptic curves...), but it also contains a large number of other useful
262functions to compute with mathematical entities such as matrices,
263polynomials, power series, algebraic numbers, etc., and a lot of
264transcendental functions.
265PARI is also available as a C library to allow for faster computations.")
67f39dd5
RW
266 (license license:gpl2+)
267 (home-page "https://pari.math.u-bordeaux.fr/")))
ed9f9a77 268
f854a8c1
AE
269(define-public gp2c
270 (package
271 (name "gp2c")
11abc24a 272 (version "0.0.11pl3")
f854a8c1
AE
273 (source (origin
274 (method url-fetch)
275 (uri (string-append
eeb8b0e6 276 "https://pari.math.u-bordeaux.fr/pub/pari/GP2C/gp2c-"
f854a8c1 277 version ".tar.gz"))
324bdcd8
AE
278 (sha256
279 (base32
11abc24a 280 "0yymbrgyjw500hqgmkj5m4nmscd7c9rs9w2c96lxgrcyab8krhrm"))))
f854a8c1 281 (build-system gnu-build-system)
c67ccedd 282 (native-inputs `(("perl" ,perl)))
f854a8c1
AE
283 (inputs `(("pari-gp" ,pari-gp)))
284 (arguments
285 '(#:configure-flags
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")
290 (description
291 "PARI/GP is a widely used computer algebra system designed for fast
292computations in number theory (factorisations, algebraic number theory,
293elliptic curves...), but it also contains a large number of other useful
294functions to compute with mathematical entities such as matrices,
295polynomials, power series, algebraic numbers, etc., and a lot of
296transcendental functions.
297PARI is also available as a C library to allow for faster computations.
298
299GP2C, the GP to C compiler, translates GP scripts to PARI programs.")
9f51293c 300 (license license:gpl2)
eeb8b0e6 301 (home-page "https://pari.math.u-bordeaux.fr/")))
f854a8c1 302
ddfb6280
TGR
303(define fplll-4-cmh
304 (package
305 (inherit fplll)
306 (name "fplll")
307 (version "4.0.4")
308 (source
309 (origin
310 (method url-fetch)
311 (uri (string-append
312 "http://perso.ens-lyon.fr/damien.stehle/fplll/libfplll-"
313 version ".tar.gz"))
314 (sha256
315 (base32 "1cbiby7ykis4z84swclpysrljmqhfcllpkcbll1m08rzskgb1a6b"))))))
316
eea7cd75
AE
317(define-public cmh
318 (package
319 (name "cmh")
320 (version "1.0")
321 (source (origin
322 (method url-fetch)
323 (uri (string-append
324 "https://gforge.inria.fr/frs/download.php/33497/cmh-"
325 version ".tar.gz"))
326 (sha256
327 (base32
328 "1a28xr9bs0igms0ik99x0w8lnb0jyfcmvyi26pbyh9ggcdivd33p"))))
329 (build-system gnu-build-system)
330 (inputs
331 `(("gmp" ,gmp)
332 ("mpfr" ,mpfr)
333 ("mpc" ,mpc)
334 ("mpfrcx" ,mpfrcx)
ddfb6280 335 ("fplll" ,fplll-4-cmh)
eea7cd75
AE
336 ("pari-gp" ,pari-gp)))
337 (synopsis "Igusa class polynomial computations")
338 (description
339 "The CMH software computes Igusa (genus 2) class polynomials, which
340parameterize the CM points in the moduli space of 2-dimensional abelian
341varieties, i.e. Jacobians of hyperelliptic curves.
342It can also be used to compute theta constants at arbitrary
343precision.")
344 (license license:gpl3+)
345 (home-page "http://cmh.gforge.inria.fr/")))
346
7fc0e3db 347(define-public giac
57497c57 348 (package
7fc0e3db 349 (name "giac")
a733253b
NG
350 (version "1.5.0-87")
351 (source
352 (origin
353 (method url-fetch)
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"))
361 (sha256
362 (base32 "1d0h1yb7qvh9x7wwv9yrzmcp712f49w1iljkxp4y6g9pzsmg1mmv"))))
57497c57
NG
363 (build-system gnu-build-system)
364 (arguments
af90cc45
NG
365 `(#:modules ((ice-9 ftw)
366 (guix build utils)
367 (guix build gnu-build-system))
368 #:phases
57497c57
NG
369 (modify-phases %standard-phases
370 (add-after 'unpack 'patch-bin-cp
90d5ec55 371 ;; Some Makefiles contain hard-coded "/bin/cp".
57497c57 372 (lambda _
57497c57
NG
373 (substitute* (find-files "doc" "^Makefile")
374 (("/bin/cp") (which "cp")))
90d5ec55
NG
375 #t))
376 (add-after 'unpack 'disable-failing-test
377 ;; FIXME: Test failing. Not sure why.
378 (lambda _
379 (substitute* "check/Makefile.in"
380 (("chk_fhan11") ""))
af90cc45 381 #t))
9f73ac24 382 (add-after 'install 'fix-doc
af90cc45 383 (lambda* (#:key outputs #:allow-other-keys)
9f73ac24
NG
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"
390 "castor")))
391 ;; Remove duplicate documentation in
392 ;; "%out/share/doc/giac/", where Xcas does not expect
393 ;; to find it.
394 (delete-file-recursively (string-append out "/share/doc/giac"))
395 #t)))
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"))
400 #t))))))
57497c57 401 (inputs
6d3896b9 402 ;;; TODO: Add libnauty.
57497c57 403 `(("fltk" ,fltk)
6d3896b9 404 ("glpk" ,glpk)
57497c57
NG
405 ("gmp" ,gmp)
406 ("gsl" ,gsl)
407 ("lapack" ,lapack)
408 ("libao" ,ao)
409 ("libjpeg" ,libjpeg)
410 ("libpng" ,libpng)
6d3896b9 411 ("libsamplerate" ,libsamplerate)
57497c57 412 ("libx11" ,libx11)
99a00446 413 ("libxinerama" ,libxinerama)
57497c57
NG
414 ("libxft" ,libxft)
415 ("libxt" ,libxt)
416 ("mesa" ,mesa)
417 ("mpfi" ,mpfi)
418 ("mpfr" ,mpfr)
419 ("ntl" ,ntl)
420 ("perl" ,perl)
421 ("pari-gp" ,pari-gp)
9f73ac24
NG
422 ("tcsh" ,tcsh)))
423 (native-inputs
6d3896b9
NG
424 `(("bison" ,bison)
425 ("flex" ,flex)
426 ("readline" ,readline)
a023ec6e 427 ("texlive" ,texlive-tiny)))
57497c57
NG
428 (home-page "https://www-fourier.ujf-grenoble.fr/~parisse/giac.html")
429 (synopsis "Computer algebra system")
430 (description
431 "Giac/Xcas is a computer algebra system. It has a compatibility mode for
432maple, mupad and the TI89. It is available as a standalone program (graphic
433or text interfaces) or as a C++ library.")
434 (license license:gpl3+)))
435
d7ab698a
AE
436(define-public flint
437 (package
438 (name "flint")
6c591c8e 439 (version "2.5.2")
d7ab698a
AE
440 (source (origin
441 (method url-fetch)
442 (uri (string-append
443 "http://flintlib.org/flint-"
444 version ".tar.gz"))
445 (sha256 (base32
6c591c8e 446 "11syazv1a8rrnac3wj3hnyhhflpqcmq02q8pqk2m6g2k6h0gxwfb"))
fc1adab1 447 (patches (search-patches "flint-ldconfig.patch"))))
d7ab698a 448 (build-system gnu-build-system)
df15d17d 449 (propagated-inputs
d7ab698a 450 `(("gmp" ,gmp)
df15d17d 451 ("mpfr" ,mpfr))) ; header files from both are included by flint/arith.h
d7ab698a 452 (arguments
ad11974e
AE
453 `(#:parallel-tests? #f ; seems to be necessary on arm
454 #:phases
91430de6
AE
455 (modify-phases %standard-phases
456 (replace 'configure
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")))
91430de6
AE
461 ;; do not pass "--enable-fast-install", which makes the
462 ;; homebrew configure process fail
50233d95 463 (invoke "./configure"
91430de6
AE
464 (string-append "--prefix=" out)
465 (string-append "--with-gmp=" gmp)
50233d95
RW
466 (string-append "--with-mpfr=" mpfr))
467 #t))))))
d7ab698a
AE
468 (synopsis "Fast library for number theory")
469 (description
470 "FLINT is a C library for number theory. It supports arithmetic
471with numbers, polynomials, power series and matrices over many base
472rings, including multiprecision integers and rationals, integers
473modulo n, p-adic numbers, finite fields (prime and non-prime order)
474and real and complex numbers (via the Arb extension library).
475
476Operations that can be performed include conversions, arithmetic,
477GCDs, factoring, solving linear systems, and evaluating special
478functions. In addition, FLINT provides various low-level routines for
479fast arithmetic.")
9f51293c 480 (license license:gpl2+)
d7ab698a
AE
481 (home-page "http://flintlib.org/")))
482
6b8e8285
AE
483(define-public arb
484 (package
6aa54e23 485 (name "arb")
faefa2ed 486 (version "2.17.0")
6aa54e23
RW
487 (source (origin
488 (method git-fetch)
489 (uri (git-reference
490 (url "https://github.com/fredrik-johansson/arb.git")
491 (commit version)))
492 (file-name (git-file-name name version))
493 (sha256
494 (base32
faefa2ed 495 "05lpy3hkl5f8ik19aw40cqydrb932xaf2n8hbq9ib5dnk7f010p1"))))
6aa54e23
RW
496 (build-system gnu-build-system)
497 (propagated-inputs
498 `(("flint" ,flint))) ; flint.h is included by arf.h
499 (inputs
500 `(("gmp" ,gmp)
501 ("mpfr" ,mpfr)))
502 (arguments
503 `(#:phases
504 (modify-phases %standard-phases
505 (replace 'configure
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")))
faefa2ed
TGR
511 ;; Do not pass "--enable-fast-install", which makes the
512 ;; homebrew configure process fail.
6aa54e23
RW
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")
519 (description
520 "Arb is a C library for arbitrary-precision floating-point ball
6b8e8285
AE
521arithmetic. It supports efficient high-precision computation with
522polynomials, power series, matrices and special functions over the
523real and complex numbers, with automatic, rigorous error control.")
6aa54e23 524 (license license:lgpl2.1+)
faefa2ed 525 (home-page "http://arblib.org")))
6b8e8285 526
1d6589db
AE
527(define-public python-flint
528 (package
529 (name "python-flint")
530 (version "0.3.0")
531 (source (origin
532 (method git-fetch)
533 (uri (git-reference
534 (url "https://github.com/fredrik-johansson/python-flint.git")
535 (commit version)))
536 (file-name (git-file-name name version))
537 (sha256
538 (base32
539 "1v0anazbj1cfi68nl2j6dbd31kgkc1563xmr0zk5xk3xj78569pw"))
540 (patches (search-patches "python-flint-includes.patch"))))
541 (build-system python-build-system)
542 (native-inputs
543 `(("python-cython" ,python-cython)))
544 (propagated-inputs
545 `(("python-numpy" ,python-numpy)))
546 (inputs
547 `(("arb" ,arb)
548 ("flint" ,flint)))
549 (synopsis "Python module wrapping ARB and FLINT")
550 (description
551 "Python-flint is a Python extension module wrapping FLINT
552(Fast Library for Number Theory) and Arb (arbitrary-precision ball
553arithmetic). It supports integers, rationals, modular integers,
554real and complex ball arithmetic, polynomials and matrices over all
555these types and other mathematical functions.")
556 (license license:expat)
557 (home-page "http://fredrikj.net/python-flint/")))
558
14e6520e
AE
559(define-public ntl
560 (package
561 (name "ntl")
d96ad7fa 562 (version "11.4.3")
14e6520e
AE
563 (source (origin
564 (method url-fetch)
d96ad7fa 565 (uri (string-append "https://shoup.net/ntl/ntl-"
14e6520e 566 version ".tar.gz"))
d96ad7fa
JK
567 (sha256
568 (base32
569 "1lisp3064rch3jaa2wrhy1s9kll7i3ka3d0y6lj6l3l4ckfcrhdp"))
570 (modules '((guix build utils)))
571 (snippet
572 '(begin
573 (delete-file-recursively "src/libtool-origin")
574 #t))))
14e6520e
AE
575 (build-system gnu-build-system)
576 (native-inputs
577 `(("libtool" ,libtool)
578 ("perl" ,perl))) ; for configuration
14e6520e 579 (inputs
d96ad7fa
JK
580 `(("gmp" ,gmp)
581 ("gf2x" ,gf2x)))
14e6520e
AE
582 (arguments
583 `(#:phases
584 (modify-phases %standard-phases
585 (replace 'configure
d96ad7fa 586 (lambda* (#:key inputs outputs #:allow-other-keys)
14e6520e 587 (chdir "src")
d96ad7fa 588 (invoke "./configure"
14e6520e 589 (string-append "PREFIX=" (assoc-ref outputs "out"))
d96ad7fa
JK
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"))
14e6520e
AE
595 ;; Do not build especially for the build machine.
596 "NATIVE=off"
d96ad7fa
JK
597 "NTL_GF2X_LIB=on"
598 "SHARED=on"))))))
14e6520e
AE
599 (synopsis "C++ library for number theory")
600 (description
601 "NTL is a C++ library providing data structures and algorithms
602for manipulating signed, arbitrary length integers, and for vectors,
603matrices, and polynomials over the integers and over finite fields.")
604 (license license:gpl2+)
d96ad7fa 605 (home-page "https://shoup.net/ntl/")))
14e6520e 606
aae03c48
AE
607(define-public singular
608 (package
609 (name "singular")
ff6807dc 610 (version "4.1.2p1")
f35c3bbb
KK
611 (source
612 (origin
613 (method url-fetch)
614 (uri
615 (string-append "http://www.mathematik.uni-kl.de/ftp/pub/Math/"
616 "Singular/SOURCES/"
617 (string-join
618 (string-split
619 (string-trim-right version #\p
620 0 (1- (string-length version)))
621 #\.) "-")
622 "/singular-" version ".tar.gz"))
623 (sha256 (base32
ff6807dc 624 "0kvd55353fiqyq1msmi0kka66n5h0aqs7m3km60r01b1w2f8085m"))))
aae03c48
AE
625 (build-system gnu-build-system)
626 (native-inputs
627 `(("doxygen" ,doxygen)
628 ("graphviz" ,graphviz)
629 ("perl" ,perl)))
630 (inputs
631 `(("cddlib" ,cddlib)
632 ("gmp" ,gmp)
633 ("flint" ,flint)
634 ("mpfr" ,mpfr)
635 ("ntl" ,ntl)
636 ("python" ,python-2)
637 ("readline" ,readline)))
638 (arguments
639 `(#:configure-flags
640 (list (string-append "--with-ntl="
641 (assoc-ref %build-inputs "ntl")))))
642 (synopsis "Computer algebra system for polynomial computations")
643 (description
644 "Singular is a computer algebra system for polynomial computations,
645with special emphasis on commutative and non-commutative algebra, algebraic
646geometry 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")))
652
57c9c349
AE
653(define-public gmp-ecm
654 (package
655 (name "gmp-ecm")
7d15cf17 656 (version "7.0.4")
57c9c349 657 (source (origin
7d15cf17
TGR
658 (method url-fetch)
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"))
662 (sha256 (base32
663 "0hxs24c2m3mh0nq1zz63z3sb7dhy1rilg2s1igwwcb26x3pb7xqc"))))
57c9c349
AE
664 (build-system gnu-build-system)
665 (inputs
666 `(("gmp" ,gmp)))
667 (arguments
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")
674 (description
675 "GMP-ECM factors integers using the elliptic curve method (ECM) as well
676as the P-1 and P+1 algorithms. It provides a library and a stand-alone
677binary.")
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/")))
682
ed9f9a77
LC
683(define-public bc
684 (package
685 (name "bc")
f71f29ca 686 (version "1.07.1")
ed9f9a77
LC
687 (source (origin
688 (method url-fetch)
689 (uri (string-append "mirror://gnu/bc/bc-" version ".tar.gz"))
690 (sha256
691 (base32
f71f29ca 692 "0amh9ik44jfg66csyvf4zz1l878c4755kjndq9j0270akflgrbb2"))))
ed9f9a77 693 (build-system gnu-build-system)
f71f29ca
MB
694 (native-inputs
695 `(("ed" ,ed)
696 ("flex" ,flex)
697 ("texinfo" ,texinfo)))
ed9f9a77 698 (arguments
f71f29ca 699 '(#:configure-flags
f0bacad6 700 (list "--with-readline")))
6fd52309 701 (home-page "https://www.gnu.org/software/bc/")
f50d2669 702 (synopsis "Arbitrary precision numeric processing language")
ed9f9a77 703 (description
a22dc0c4
LC
704 "bc is an arbitrary precision numeric processing language. It includes
705an interactive environment for evaluating mathematical statements. Its
706syntax is similar to that of C, so basic usage is familiar. It also includes
707\"dc\", a reverse-polish calculator.")
9f51293c 708 (license license:gpl2+)))
37e6cdcd 709
2a9b10c7
RW
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
713 (package
714 (name "kiss-fft-for-extempore")
715 (version "1.3.0")
716 (source (origin
9774fac4
RW
717 (method git-fetch)
718 (uri (git-reference
719 (url "https://github.com/extemporelang/kiss_fft.git")
720 (commit version)))
721 (file-name (git-file-name name version))
2a9b10c7
RW
722 (sha256
723 (base32
9774fac4 724 "0jasbmqy4wkqrqx3w64s1dfmj34875xmsl72mb26aa4hpyn14bi2"))))
2a9b10c7
RW
725 (build-system cmake-build-system)
726 (arguments `(#:tests? #f)) ; no tests included
39162ee4
RW
727 ;; Extempore refuses to build on architectures other than x86_64
728 (supported-systems '("x86_64-linux"))
2a9b10c7
RW
729 (home-page "https://github.com/extemporelang/kiss_fft")
730 (synopsis "Mixed-radix Fast Fourier Transform")
731 (description
732 "Kiss FFT attempts to be a reasonably efficient, moderately useful FFT
733that can use fixed or floating data types and can easily be incorporated into
734a C program.")
735 (license license:bsd-3)))
736
37e6cdcd
LC
737(define-public fftw
738 (package
739 (name "fftw")
bdb74478 740 (version "3.3.8")
37e6cdcd
LC
741 (source (origin
742 (method url-fetch)
743 (uri (string-append "ftp://ftp.fftw.org/pub/fftw/fftw-"
744 version".tar.gz"))
745 (sha256
746 (base32
bdb74478 747 "00z3k8fq561wq2khssqg0kallk0504dzlx989x3vvicjdqpjc4v1"))))
37e6cdcd
LC
748 (build-system gnu-build-system)
749 (arguments
65bb2279 750 `(#:configure-flags
69d5909e
MW
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>.
755 (cond
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)
760 '("--enable-sse2"))
761 ((string-prefix? "aarch64" system)
762 ;; Note that fftw supports NEON on 32-bit ARM only when
763 ;; compiled for single-precision.
764 '("--enable-neon"))
765 (else
766 '())))
65bb2279
EB
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")))
37e6cdcd
LC
772 (native-inputs `(("perl" ,perl)))
773 (home-page "http://fftw.org")
774 (synopsis "Computing the discrete Fourier transform")
775 (description
776 "FFTW is a C subroutine library for computing the discrete Fourier
777transform (DFT) in one or more dimensions, of arbitrary input size, and of
778both real and complex data (as well as of even/odd data---i.e. the discrete
779cosine/ sine transforms or DCT/DST).")
9f51293c 780 (license license:gpl2+)))
7569c5cb
EB
781
782(define-public fftwf
783 (package (inherit fftw)
784 (name "fftwf")
785 (arguments
786 (substitute-keyword-arguments (package-arguments fftw)
69d5909e
MW
787 ((#:configure-flags fftw-configure-flags)
788 `(cons* "--enable-single"
789 ,@(if (string-prefix? "arm" (or (%current-target-system)
790 (%current-system)))
791 ;; fftw supports NEON on 32-bit ARM only when compiled
792 ;; for single-precision, so add it here.
793 '("--enable-neon")
794 '())
795 ,fftw-configure-flags))))
7569c5cb
EB
796 (description
797 (string-append (package-description fftw)
798 " Single-precision version."))))
e5c66f8c
EB
799
800(define-public fftw-openmpi
801 (package (inherit fftw)
802 (name "fftw-openmpi")
803 (inputs
804 `(("openmpi" ,openmpi)
805 ,@(package-inputs fftw)))
806 (arguments
807 (substitute-keyword-arguments (package-arguments fftw)
808 ((#:configure-flags cf)
eb6785cf
EB
809 `(cons "--enable-mpi" ,cf))
810 ((#:phases phases '%standard-phases)
811 `(modify-phases ,phases
812 (add-before 'check 'mpi-setup
813 ,%openmpi-setup)))))
e5c66f8c
EB
814 (description
815 (string-append (package-description fftw)
816 " With OpenMPI parallelism support."))))
8f4b1dfb 817
c8d99608
RW
818(define-public java-la4j
819 (package
820 (name "java-la4j")
821 (version "0.6.0")
822 (source (origin
823 (method git-fetch)
824 (uri (git-reference
825 (url "https://github.com/vkostyukov/la4j.git")
826 (commit version)))
827 (file-name (string-append name "-" version "-checkout"))
828 (sha256
829 (base32
830 "1qir8dr978cfvz9k12m2kbdwpyf6cqdf1d0ilb7lnkhbgq5i53w3"))))
831 (build-system ant-build-system)
832 (arguments
833 `(#:jar-name "la4j.jar"
834 #:jdk ,icedtea-8
835 #:test-exclude (list "**/Abstract*.java"
836 "**/MatrixTest.java"
837 "**/DenseMatrixTest.java"
838 "**/SparseMatrixTest.java"
839 "**/VectorTest.java"
840 "**/SparseVectorTest.java"
841 "**/DenseVectorTest.java")))
842 (native-inputs
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
848Algebra primitives (matrices and vectors) and algorithms. The key features of
849the la4j library are:
850
851@itemize
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
858@end itemize\n")
859 (license license:asl2.0)))
860
24074b0b
RW
861(define-public java-jlargearrays
862 (package
863 (name "java-jlargearrays")
864 (version "1.6")
865 (source (origin
866 (method url-fetch)
9f5eeb87
BH
867 (uri (string-append "https://repo1.maven.org/maven2/"
868 "pl/edu/icm/JLargeArrays/"
24074b0b
RW
869 version "/JLargeArrays-" version
870 "-sources.jar"))
871 (file-name (string-append name "-" version ".jar"))
872 (sha256
873 (base32
874 "0v05iphpxbjnd7f4jf1rlqq3m8hslhcm0imdbsgxr20pi3xkaf2a"))))
875 (build-system ant-build-system)
876 (arguments
877 `(#:jar-name "jlargearrays.jar"
878 #:tests? #f ; tests are not included in the release archive
879 #:jdk ,icedtea-8))
880 (propagated-inputs
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
885that can store up to 263 elements.")
886 (license license:bsd-2)))
887
4e92911c
RW
888(define-public java-jtransforms
889 (package
890 (name "java-jtransforms")
891 (version "3.1")
892 (source (origin
893 (method url-fetch)
4c877704
BH
894 (uri (string-append "https://repo1.maven.org/maven2/"
895 "com/github/wendykierp/JTransforms/"
4e92911c
RW
896 version "/JTransforms-" version "-sources.jar"))
897 (sha256
898 (base32
899 "1haw5m8shv5srgcpwkl853dz8bv6h90bzlhcps6mdpb4cixjirsg"))))
900 (build-system ant-build-system)
901 (arguments
902 `(#:jar-name "jtransforms.jar"
903 #:tests? #f ; tests are not included in the release archive
904 #:jdk ,icedtea-8))
905 (propagated-inputs
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
911Java. Currently, four types of transforms are available: @dfn{Discrete
912Fourier Transform} (DFT), @dfn{Discrete Cosine Transform} (DCT), @dfn{Discrete
913Sine Transform} (DST) and @dfn{Discrete Hartley Transform} (DHT).")
914 (license license:bsd-2)))
915
8f4b1dfb
LC
916(define-public eigen
917 (package
918 (name "eigen")
5144e314 919 (version "3.3.7")
8f4b1dfb
LC
920 (source (origin
921 (method url-fetch)
922 (uri (string-append "https://bitbucket.org/eigen/eigen/get/"
9b268f12 923 version ".tar.bz2"))
8f4b1dfb
LC
924 (sha256
925 (base32
5144e314 926 "1km3fyfzyqfdvmnl79drps3fjwnz3zbh0c7l34mfbqyvvs8cy4wz"))
2abcc935 927 (file-name (string-append name "-" version ".tar.bz2"))
5144e314 928 (patches (search-patches "eigen-stabilise-sparseqr-test.patch"))
8f4b1dfb
LC
929 (modules '((guix build utils)))
930 (snippet
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.
1137d85b 934 '(begin
44884a9d
RW
935 (substitute* "unsupported/CMakeLists.txt"
936 (("add_subdirectory\\(test.*")
937 "# Do not build the tests for unsupported features.\n"))
6cbee49d 938 #t))))
8f4b1dfb
LC
939 (build-system cmake-build-system)
940 (arguments
941 '(;; Turn off debugging symbols to save space.
942 #:build-type "Release"
943
354f4fe2 944 #:phases (modify-phases %standard-phases
ef8742ea 945 (replace 'check
354f4fe2 946 (lambda _
354f4fe2
LC
947 (let* ((cores (parallel-job-count))
948 (dash-j (format #f "-j~a" cores)))
1137d85b 949 (setenv "EIGEN_SEED" "1") ;for reproducibility
ef8742ea
LC
950 ;; First build the tests, in parallel. See
951 ;; <http://eigen.tuxfamily.org/index.php?title=Tests>.
fbe9c80f 952 (invoke "make" "buildtests" dash-j)
8f4b1dfb 953
fbe9c80f
TGR
954 ;; Then run 'CTest' with -V so we get more
955 ;; details upon failure.
956 (invoke "ctest" "-V" dash-j)))))))
eeb8b0e6 957 (home-page "https://eigen.tuxfamily.org")
8f4b1dfb
LC
958 (synopsis "C++ template library for linear algebra")
959 (description
960 "Eigen is a C++ template library for linear algebra: matrices, vectors,
961numerical solvers, and related algorithms. It provides an elegant API based
962on \"expression templates\". It is versatile: it supports all matrix sizes,
963all standard numeric types, various matrix decompositions and geometry
964features, and more.")
965
966 ;; Most of the code is MPLv2, with a few files under LGPLv2.1+ or BSD-3.
967 ;; See 'COPYING.README' for details.
9f51293c 968 (license license:mpl2.0)))
70770b93 969
697eb65d
RW
970(define-public eigen-for-tensorflow
971 (let ((changeset "fd6845384b86")
972 (revision "1"))
973 (package (inherit eigen)
974 (name "eigen-for-tensorflow")
975 (version (string-append "3.3.5-" revision "." changeset))
976 (source (origin
977 (method hg-fetch)
978 (uri (hg-reference
979 (url "https://bitbucket.org/eigen/eigen")
980 (changeset changeset)))
981 (sha256
982 (base32
983 "12cwgah63wqwb66xji048hcxc1z5zjg8a7701zlia5zbilnnk1n5"))
984 (file-name (string-append name "-" version "-checkout"))
985 (modules '((guix build utils)))
986 (snippet
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.
990 '(begin
991 (substitute* "unsupported/CMakeLists.txt"
992 (("add_subdirectory\\(test.*")
993 "# Do not build the tests for unsupported features.\n"))
994 #t)))))))
995
70770b93
FT
996(define-public xtensor
997 (package
998 (name "xtensor")
4e6568ce 999 (version "0.20.10")
70770b93 1000 (source (origin
e1ecaa83
KK
1001 (method git-fetch)
1002 (uri (git-reference
1003 (url "https://github.com/QuantStack/xtensor.git")
1004 (commit version)))
70770b93
FT
1005 (sha256
1006 (base32
4e6568ce 1007 "1fmv2hpx610xwhxrndfsfvlbqfyk4l3gi5q5d7pa9m82kblxjj9l"))
e1ecaa83 1008 (file-name (git-file-name name version))))
70770b93
FT
1009 (build-system cmake-build-system)
1010 (native-inputs
1011 `(("googletest" ,googletest)
1012 ("xtl" ,xtl)))
1013 (arguments
1014 `(#:configure-flags
1015 '("-DBUILD_TESTS=ON")
1016 #:test-target "xtest"))
3b1ccad0 1017 (home-page "https://quantstack.net/xtensor")
70770b93
FT
1018 (synopsis "C++ tensors with broadcasting and lazy computing")
1019 (description "xtensor is a C++ library meant for numerical analysis with
1020multi-dimensional array expressions.
1021
1022xtensor provides:
1023@itemize
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.
1027@end itemize")
1028 (license license:bsd-3)))
3f074a21
AE
1029
1030(define-public gap
1031 (package
1032 (name "gap")
c8a227df 1033 (version "4.10.2")
3f074a21
AE
1034 (source
1035 (origin
1036 (method url-fetch)
1037 (uri (string-append "https://www.gap-system.org/pub/gap/gap-"
1038 (version-major+minor version)
1039 "/tar.bz2/gap-"
1040 version
1041 ".tar.bz2"))
1042 (sha256
c8a227df 1043 (base32 "0cp6ddk0469zzv1m1vair6gm27ic6c5m77ri8rn0znq3gaps6x94"))
3f074a21
AE
1044 (modules '((guix build utils) (ice-9 ftw) (srfi srfi-1)))
1045 (snippet
1046 '(begin
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 ".")
1059 '("." ".."
1060 ;; Necessary packages.
1061 "GAPDoc-1.6.2"
1062 "primgrp-3.3.2"
1063 "SmallGrp-1.3" ; artistic2.0
1064 "transgrp" ; artistic2.0 for data,
1065 ; gpl2 or gpl3 for code
1066 ;; Recommanded package.
1067 "io-4.5.4" ; gpl3+
1068 ;; Optional packages, searched for at start,
1069 ;; and their depedencies.
1070 "alnuth-3.1.0"
3f074a21
AE
1071 "autpgrp-1.10"
1072 "crisp-1.4.4" ; bsd-2
bf95a142 1073 "ctbllib" ; gpl3+ according to doc/chap0.txt
3f074a21
AE
1074 "FactInt-1.6.2"
1075 "fga"
1076 "irredsol-1.4" ; bsd-2
bf95a142 1077 "laguna-3.9.2"
3f074a21
AE
1078 "polenta-1.3.8"
1079 "polycyclic-2.14"
1080 "radiroot-2.8"
1081 "resclasses-4.7.1"
1082 "sophus-1.24"
bf95a142
AE
1083 "tomlib-1.2.7" ; gpl2+, clarified in the git repository
1084 ; and the next release
3f074a21
AE
1085 "utils-0.59"))))
1086 #t))))
1087 (build-system gnu-build-system)
1088 (inputs
1089 `(("gmp" ,gmp)
1090 ("zlib" ,zlib)))
1091 (arguments
bf95a142
AE
1092 `(#:modules ((ice-9 ftw)
1093 (srfi srfi-26)
1094 (guix build gnu-build-system)
1095 (guix build utils))
1096 #:phases
3f074a21
AE
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.
1101 (lambda _
1102 (setenv "CONFIG_SHELL" (which "bash"))
1103 (with-directory-excursion "pkg"
1104 (invoke "../bin/BuildPackages.sh")
1105 #t)))
1106 (add-after 'build-packages 'build-doc
1107 ;; The documentation is bundled, but we create it from source.
1108 (lambda _
1109 (with-directory-excursion "doc"
1110 (invoke "./make_doc"))
1111 #t))
3f074a21
AE
1112 (replace 'install
1113 (lambda* (#:key outputs #:allow-other-keys)
1114 (let* ((out (assoc-ref outputs "out"))
1115 (bin (string-append out "/bin"))
bf95a142 1116 (lib (string-append out "/lib"))
3f074a21
AE
1117 (prog (string-append bin "/gap"))
1118 (prog-real (string-append bin "/.gap-real"))
1119 (share (string-append out "/share/gap"))
bf95a142
AE
1120 (include (string-append out "/include/gap"))
1121 (include-hpc (string-append include "/hpc")))
3f074a21
AE
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.
1125 (mkdir-p bin)
1126 (copy-file "gap" prog-real)
1127 (call-with-output-file prog
1128 (lambda (port)
1129 (format port
1130 "#!~a~%exec ~a -l ~a \"$@\"~%"
1131 (which "bash")
1132 prog-real
1133 share)))
1134 (chmod prog #o755)
bf95a142
AE
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)
3f074a21 1139 (install-file "gen/config.h" include)
bf95a142
AE
1140 (let ((file-name-predicate-without-stat
1141 (lambda (regex)
1142 (cut (file-name-predicate regex) <> #f))))
1143 (with-directory-excursion "src"
1144 (for-each
1145 (cut install-file <> include)
1146 (scandir "."
1147 (file-name-predicate-without-stat ".*\\.h$"))))
1148 (with-directory-excursion "src/hpc"
1149 (for-each
1150 (cut install-file <> include-hpc)
1151 (scandir "."
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
1160 ;; targets.
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"))
3f074a21
AE
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")))
1181 #t)))))
1182 (home-page "https://www.gap-system.org/")
1183 (synopsis
1184 "System for computational group theory")
1185 (description
1186 "GAP is a system for computational discrete algebra, with particular
1187emphasis on computational group theory. It provides a programming language,
1188a library of thousands of functions implementing algebraic algorithms
1189written in the GAP language as well as large data libraries of algebraic
1190objects.")
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+)))
f0fbb31d
AE
1198
1199(define-public givaro
1200 (package
1201 (name "givaro")
1202 (version "4.1.1")
1203 (source (origin
1204 (method git-fetch)
1205 (uri (git-reference
1206 (url "https://github.com/linbox-team/givaro")
1207 (commit (string-append "v" version))))
1208 (file-name (git-file-name name version))
1209 (sha256
1210 (base32
1211 "11wz57q6ijsvfs5r82masxgr319as92syi78lnl9lgdblpc6xigk"))))
1212 (build-system gnu-build-system)
1213 (native-inputs
1214 `(("autoconf" ,autoconf)
1215 ("automake" ,automake)
1216 ("libtool" ,libtool)))
1217 (propagated-inputs
1218 `(("gmp" ,gmp))) ; gmp++.h includes gmpxx.h
1219 (arguments
1220 `(#:phases
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.
1225 (lambda _
1226 (setenv "NOCONFIGURE" "yes")
1227 #t)))))
1228 (synopsis "Algebraic computations with exact rings and fields")
1229 (description
1230 "Givaro is a C++ library implementing the basic arithmetic of various
1231algebraic objects: prime fields, extension fields, finite fields, finite
1232rings, polynomials, algebraic numbers, arbitrary precision integers and
1233rationals (C++ wrappers over gmp), fixed precision integers. It also
1234provides data-structures and templated classes for the manipulation of
1235compound objects, such as vectors, matrices and univariate polynomials.")
1236 (license license:cecill-b)
1237 (home-page "https://github.com/linbox-team/givaro")))
4bf9cb40
AE
1238
1239(define-public fflas-ffpack
1240 (package
1241 (name "fflas-ffpack")
1242 (version "2.4.3")
1243 (source (origin
1244 (method git-fetch)
1245 (uri (git-reference
1246 (url "https://github.com/linbox-team/fflas-ffpack")
1247 (commit version)))
1248 (file-name (git-file-name name version))
1249 (sha256
1250 (base32
1251 "1ynbjd72qrwp0b4kpn0p5d7gddpvj8dlb5fwdxajr5pvkvi3if74"))))
1252 (build-system gnu-build-system)
1253 (native-inputs
1254 `(("autoconf" ,autoconf)
1255 ("automake" ,automake)
1256 ("libtool" ,libtool)
1257 ("pkg-config" ,pkg-config)))
1258 (inputs
1259 `(("openblas" ,openblas)))
1260 (propagated-inputs
1261 `(("givaro" ,givaro))) ; required according to the .pc file
1262 (arguments
1263 `(#:configure-flags
1264 (list (string-append "--with-blas-libs="
1265 (assoc-ref %build-inputs "openblas")
1266 "/lib/libopenblas.so"))
1267 #:phases
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.
1272 (lambda _
1273 (setenv "NOCONFIGURE" "yes")
1274 #t)))))
1275 (synopsis "C++ library for linear algebra over finite fields")
1276 (description
1277 "FFLAS-FFPACK is a C++ template library for basic linear algebra
1278operations over a finite field.
1279FFLAS (Finite Field Linear Algebra Subprograms) provides the implementation
1280of a subset of routines of the numerical BLAS; it also supports sparse
1281matrix-vector products.
1282FFPACK (Finite Field Linear Algebra Package) is inspired by the LAPACK
1283library to provide functionalities of higher level, using the kernel
1284of a BLAS. Additionally, it provides routines specific to exact linear
1285algebra, such as the row echelon form.")
1286 (license license:lgpl2.1+)
1287 (home-page "https://linbox-team.github.io/fflas-ffpack/")))
a612f866
AE
1288
1289(define-public linbox
1290 (package
1291 (name "linbox")
1292 (version "1.6.3")
1293 (source (origin
1294 (method git-fetch)
1295 (uri (git-reference
1296 (url "https://github.com/linbox-team/linbox")
1297 (commit (string-append "v" version))))
1298 (file-name (git-file-name name version))
1299 (sha256
1300 (base32
1301 "10j6dspbsq7d2l4q3y0c1l1xwmaqqba2fxg59q5bhgk9h5d7q571"))))
1302 (build-system gnu-build-system)
1303 (native-inputs
1304 `(("autoconf" ,autoconf)
1305 ("automake" ,automake)
1306 ("libtool" ,libtool)
1307 ("pkg-config" ,pkg-config)))
1308 (inputs
1309 `(("fflas-ffpack" ,fflas-ffpack)))
1310 (arguments
1311 `(#:phases
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.
1316 (lambda _
1317 (setenv "NOCONFIGURE" "yes")
1318 #t)))))
1319 (synopsis "C++ library for linear algebra over exact rings")
1320 (description
1321 "LinBox is a C++ template library for exact linear algebra computation
1322with dense, sparse, and structured matrices over the integers and over
1323finite fields.")
1324 (license license:lgpl2.1+)
1325 (home-page "https://linbox-team.github.io/linbox/")))
37edfb0f
AE
1326
1327(define-public m4ri
1328 (package
1329 (name "m4ri")
1330 (version "20140914")
1331 (source (origin
1332 (method git-fetch)
1333 (uri (git-reference
1334 (url "https://bitbucket.org/malb/m4ri")
1335 (commit (string-append "release-" version))))
1336 (file-name (git-file-name name version))
1337 (sha256
1338 (base32
1339 "0xfg6pffbn8r1s0y7bn9b8i55l00d41dkmhrpf7pwk53qa3achd3"))))
1340 (build-system gnu-build-system)
1341 (native-inputs
1342 `(("autoconf" ,autoconf)
1343 ("automake" ,automake)
1344 ("libtool" ,libtool)
1345 ("pkg-config" ,pkg-config)))
1346 (inputs
1347 `(("libpng" ,libpng)))
1348 (synopsis "Arithmetic of dense matrices over F_2")
1349 (description "M4RI is a library for fast arithmetic with dense matrices
1350over F2. The name M4RI comes from the first implemented algorithm: The
1351Method of the Four Russians inversion algorithm published by Gregory Bard.
1352This algorithm in turn is named after the Method of the Four Russians
1353multiplication algorithm.")
1354 (license license:gpl2+)
1355 (home-page "https://bitbucket.org/malb/m4ri/")))
ab398380 1356
75a73bb0
NG
1357(define-public symmetrica
1358 (package
1359 (name "symmetrica")
1360 (version "2.0")
1361 (source (origin
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")))
1367 (sha256
1368 (base32
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)
1376 (arguments
1377 `(#:tests? #f ;no test
1378 #:phases
1379 (modify-phases %standard-phases
1380 (add-after 'unpack 'fix-makefile
1381 (lambda _
1382 (substitute* "makefile"
e6eafd42 1383 (("cc -c") "gcc -c -fPIC"))
75a73bb0
NG
1384 #t))
1385 (add-after 'fix-makefile 'turn-off-banner
1386 (lambda _
1387 (substitute* "de.c"
1388 (("(INT no_banner = )FALSE" _ pre) (string-append pre "TRUE")))
1389 #t))
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$"))
1408 #t))))))
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
1412for the representation theory of the symmetric group and related groups,
1413combinatorics of tableaux, symmetric functions and polynomials, Schubert
1414polynomials, and the representation theory of Hecke algebras of type A_n.")
1415 (license license:public-domain)))
6cbedbd2
AE
1416
1417(define-public m4rie
1418 (package
1419 (name "m4rie")
1420 (version "20150908")
1421 (source (origin
1422 (method git-fetch)
1423 (uri (git-reference
1424 (url "https://bitbucket.org/malb/m4rie")
1425 (commit (string-append "release-" version))))
1426 (file-name (git-file-name name version))
1427 (sha256
1428 (base32
1429 "0r8lv46qx5mkz5kp3ay2jnsp0mbhlqr5z2z220wdk73wdshcznss"))))
1430 (build-system gnu-build-system)
1431 (native-inputs
1432 `(("autoconf" ,autoconf)
1433 ("automake" ,automake)
1434 ("libtool" ,libtool)))
1435 (inputs
1436 `(("m4ri" ,m4ri)))
1437 (synopsis "Arithmetic of dense matrices over F_{2^e}")
1438 (description "M4RI is a library for fast arithmetic with dense matrices
1439over finite fields of characteristic 2. So it extends the functionality
1440of M4RI from F_2 to F_{2^e}.")
1441 (license license:gpl2+)
1442 (home-page "https://bitbucket.org/malb/m4rie/")))
66c67e7b
AE
1443
1444(define-public eclib
1445 (package
1446 (name "eclib")
9a5f35fe 1447 (version "20190909")
66c67e7b
AE
1448 (source (origin
1449 (method git-fetch)
1450 (uri (git-reference
1451 (url "https://github.com/JohnCremona/eclib/")
1452 (commit (string-append "v" version))))
1453 (file-name (git-file-name name version))
1454 (sha256
1455 (base32
9a5f35fe 1456 "1gw27lqc3f525n8qdcmr2nyn16y9g10z9f6dnmckyyxcdzvhq35n"))))
66c67e7b
AE
1457 (build-system gnu-build-system)
1458 (native-inputs
1459 `(("autoconf" ,autoconf)
1460 ("automake" ,automake)
1461 ("libtool" ,libtool)))
1462 (inputs
d96ad7fa 1463 `(("ntl" ,ntl)
66c67e7b
AE
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
1467elliptic curves over Q) and modular symbol code; it has been written by
1468John 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"))))
197ebc36
AE
1472
1473(define-public lrcalc
1474 (package
1475 (name "lrcalc")
1476 (version "1.2")
1477 (source (origin
1478 (method git-fetch)
1479 (uri (git-reference
1480 (url "https://bitbucket.org/asbuch/lrcalc")
1481 (commit (string-append "lrcalc-" version))))
1482 (file-name (git-file-name name version))
1483 (sha256
1484 (base32
88f913e8
AE
1485 "1c12d04jdyxkkav4ak8d1aqrv594gzihwhpxvc6p9js0ry1fahss"))
1486 (patches (search-patches "lrcalc-includes.patch"))))
197ebc36
AE
1487 (build-system gnu-build-system)
1488 (native-inputs
1489 `(("autoconf" ,autoconf)
1490 ("automake" ,automake)
1491 ("libtool" ,libtool)))
1492 (arguments
1493 `(#:phases
1494 (modify-phases %standard-phases
1495 (add-before 'build 'fix-permission
1496 (lambda _
1497 (chmod "lrcalc.maple.src" #o644)
1498 #t)))))
1499 (synopsis "Littlewood-Richardson calculator in algebraic combinatorics")
1500 (description "The Littlewood-Richardson Calculator (lrcalc) is a
1501program designed to compute Littlewood-Richardson coefficients. It computes
1502single Littlewood-Richardson coefficients, products of Schur functions, or
1503skew Schur functions. In addition it computes products in the small quantum
1504cohomology ring of a Grassmann variety. The software package also includes
1505a program that performs fast computation of the more general multiplicative
1506structure constants of Schubert polynomials.")
1507 (license license:gpl2+)
1e30dff3 1508 (home-page "https://sites.math.rutgers.edu/~asbuch/lrcalc/")))
eacf2983
AE
1509
1510(define-public iml
1511 (package
1512 (name "iml")
1513 (version "1.0.5")
1514 (source
1515 (origin
1516 (method url-fetch)
1517 (uri (string-append "http://www.cs.uwaterloo.ca/~astorjoh/iml-"
1518 version ".tar.bz2"))
1519 (sha256
1520 (base32
1521 "0akwhhz9b40bz6lrfxpamp7r7wkk48p455qbn04mfnl9a1l6db8x"))))
1522 (build-system gnu-build-system)
1523 (inputs
1524 `(("gmp", gmp)
1525 ("cblas" ,openblas))) ; or any other BLAS library; the documentation
1526 ; mentions ATLAS in particular
1527 (arguments
1528 `(#:configure-flags
1529 (list
c68ec87c 1530 "--enable-shared"
eacf2983
AE
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")
1541 (synopsis
1542 "Solver for systems of linear equations over the integers")
1543 (description
1544 "IML is a C library implementing algorithms for computing exact
1545solutions to dense systems of linear equations over the integers.
1546Currently, IML provides the following functionality:
1547
1548@itemize
1549@item Nonsingular rational system solving:
1550compute the unique rational solution X to the system AX=B, where A and B
1551are integer matrices, A nonsingular.
1552@item Compute the right nullspace or kernel of an integer matrix.
1553@item Certified linear system solving:
1554compute a minimal denominator solution x to a system Ax=b, where b is an
1555integer vector and A is an integer matrix with arbitrary shape and
1556rank profile.
1557@end itemize
1558
1559In addition, IML provides some low level routines for a variety of mod p
1560matrix operations: computing the row-echelon form, determinant, rank
1561profile, and inverse of a mod p matrix. These mod p routines are not
1562general purpose; they require that p satisfy some preconditions based on
1563the dimension of the input matrix (usually p should be prime and should be
1564no more than about 20 bits long).")
1565 (license license:bsd-3)))