gnu: Add zn_poly.
[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>
7f055a0a 4;;; Copyright © 2016, 2017, 2018, 2019 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>
ff6807dc 8;;; Copyright © 2017, 2018, 2019 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>
2ed139c4 11;;;
233e7676 12;;; This file is part of GNU Guix.
2ed139c4 13;;;
233e7676 14;;; GNU Guix is free software; you can redistribute it and/or modify it
2ed139c4
AE
15;;; under the terms of the GNU General Public License as published by
16;;; the Free Software Foundation; either version 3 of the License, or (at
17;;; your option) any later version.
18;;;
233e7676 19;;; GNU Guix is distributed in the hope that it will be useful, but
2ed139c4
AE
20;;; WITHOUT ANY WARRANTY; without even the implied warranty of
21;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22;;; GNU General Public License for more details.
23;;;
24;;; You should have received a copy of the GNU General Public License
233e7676 25;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
2ed139c4 26
1ffa7090 27(define-module (gnu packages algebra)
59a43334 28 #:use-module (gnu packages)
14e6520e 29 #:use-module (gnu packages autotools)
fdb513a7 30 #:use-module (gnu packages bison)
70770b93 31 #:use-module (gnu packages check)
10b1f688 32 #:use-module (gnu packages compression)
70770b93 33 #:use-module (gnu packages cpp)
99828fa7 34 #:use-module (gnu packages documentation)
f71f29ca 35 #:use-module (gnu packages ed)
5894b604 36 #:use-module (gnu packages flex)
57497c57
NG
37 #:use-module (gnu packages fltk)
38 #:use-module (gnu packages gl)
aae03c48 39 #:use-module (gnu packages graphviz)
57497c57 40 #:use-module (gnu packages image)
c8d99608 41 #:use-module (gnu packages java)
aae03c48 42 #:use-module (gnu packages maths)
0fc54d4b 43 #:use-module (gnu packages mpi)
5894b604 44 #:use-module (gnu packages multiprecision)
1ffa7090 45 #:use-module (gnu packages perl)
4bf9cb40 46 #:use-module (gnu packages pkg-config)
6d3896b9 47 #:use-module (gnu packages pulseaudio)
aae03c48 48 #:use-module (gnu packages python)
1d6589db 49 #:use-module (gnu packages python-xyz)
5894b604 50 #:use-module (gnu packages readline)
b7194849 51 #:use-module (gnu packages shells)
8f9ac901 52 #:use-module (gnu packages tex)
f71f29ca 53 #:use-module (gnu packages texinfo)
57497c57 54 #:use-module (gnu packages xiph)
fb8d1be8 55 #:use-module (gnu packages xorg)
c8d99608 56 #:use-module (guix build-system ant)
7569c5cb 57 #:use-module (guix build-system gnu)
8f4b1dfb 58 #:use-module (guix build-system cmake)
1d6589db 59 #:use-module (guix build-system python)
5894b604 60 #:use-module (guix download)
c8d99608 61 #:use-module (guix git-download)
697eb65d 62 #:use-module (guix hg-download)
5894b604
TGR
63 #:use-module ((guix licenses) #:prefix license:)
64 #:use-module (guix packages)
7569c5cb 65 #:use-module (guix utils))
2ed139c4
AE
66
67
68(define-public mpfrcx
69 (package
70 (name "mpfrcx")
43a776e2 71 (version "0.5")
2ed139c4
AE
72 (source (origin
73 (method url-fetch)
74 (uri (string-append
43a776e2 75 "http://www.multiprecision.org/downloads/mpfrcx-"
2ed139c4
AE
76 version ".tar.gz"))
77 (sha256
78 (base32
43a776e2 79 "1s968480ymv6w0rnvfp9mxvx98hvi29fkvw8nk4ggzc6azxgwybs"))))
2ed139c4 80 (build-system gnu-build-system)
878c8f3f
AE
81 (propagated-inputs
82 `(("gmp" ,gmp)
83 ("mpfr" ,mpfr)
84 ("mpc" ,mpc))) ; Header files are included by mpfrcx.h.
35b9e423 85 (synopsis "Arithmetic of polynomials over arbitrary precision numbers")
2ed139c4 86 (description
35b9e423 87 "Mpfrcx is a library for the arithmetic of univariate polynomials over
2ed139c4 88arbitrary precision real (mpfr) or complex (mpc) numbers, without control
35b9e423 89on the rounding. For the time being, only the few functions needed to
2ed139c4 90implement the floating point approach to complex multiplication are
35b9e423 91implemented. On the other hand, these comprise asymptotically fast
e881752c 92multiplication routines such as Toom–Cook and the FFT.")
43a776e2 93 (license license:lgpl3+)
2ed139c4
AE
94 (home-page "http://mpfrcx.multiprecision.org/")))
95
10b1f688
AE
96(define-public cm
97 (package
98 (name "cm")
81b55bf7 99 (version "0.3")
10b1f688
AE
100 (source (origin
101 (method url-fetch)
102 (uri (string-append
103 "http://www.multiprecision.org/cm/download/cm-"
104 version ".tar.gz"))
105 (sha256
106 (base32
81b55bf7 107 "1nf5kr0nqmhbzrsrinky18z0ighjpsmb5cr8zyg8jf04bfbyrfmc"))))
10b1f688
AE
108 (build-system gnu-build-system)
109 (propagated-inputs
110 `(("mpfrcx" ,mpfrcx)
111 ("zlib" ,zlib))) ; Header files included from cm_common.h.
112 (inputs
113 `(("pari-gp" ,pari-gp)))
114 (synopsis "CM constructions for elliptic curves")
115 (description
116 "The CM software implements the construction of ring class fields of
117imaginary quadratic number fields and of elliptic curves with complex
118multiplication via floating point approximations. It consists of libraries
119that can be called from within a C program and of executable command
120line applications.")
81b55bf7 121 (license license:gpl3+)
10b1f688
AE
122 (home-page "http://cm.multiprecision.org/")))
123
2ed139c4
AE
124(define-public fplll
125 (package
126 (name "fplll")
5a15ed50 127 (version "4.0.4")
2ed139c4
AE
128 (source (origin
129 (method url-fetch)
130 (uri (string-append
131 "http://perso.ens-lyon.fr/damien.stehle/fplll/libfplll-"
132 version ".tar.gz"))
133 (sha256 (base32
5a15ed50 134 "1cbiby7ykis4z84swclpysrljmqhfcllpkcbll1m08rzskgb1a6b"))))
2ed139c4
AE
135 (build-system gnu-build-system)
136 (inputs `(("gmp" ,gmp)
137 ("mpfr" ,mpfr)))
35b9e423 138 (synopsis "Library for LLL-reduction of euclidean lattices")
2ed139c4 139 (description
35b9e423 140 "fplll LLL-reduces euclidean lattices. Since version 3, it can also
2ed139c4 141solve the shortest vector problem.")
9f51293c 142 (license license:lgpl2.1+)
2ed139c4 143 (home-page "http://perso.ens-lyon.fr/damien.stehle/fplll/")))
4e6b699d 144
90a6d47c
AE
145(define-public pari-gp
146 (package
67f39dd5
RW
147 (name "pari-gp")
148 (version "2.11.1")
149 (source (origin
150 (method url-fetch)
151 (uri (string-append
152 "https://pari.math.u-bordeaux.fr/pub/pari/unix/pari-"
153 version ".tar.gz"))
154 (sha256
155 (base32
4ebfe99a 156 "1jfax92jpydjd02fwl30r6b8kfzqqd6sm4yx94gidyz9lqjb7a94"))))
67f39dd5
RW
157 (build-system gnu-build-system)
158 (native-inputs
159 `(("texlive" ,(texlive-union
160 (list texlive-fonts-amsfonts
161 texlive-latex-amsfonts)))))
162 (inputs `(("gmp" ,gmp)
163 ("libx11" ,libx11)
164 ("perl" ,perl)
165 ("readline" ,readline)))
166 (arguments
167 '(#:make-flags '("all")
168 #:test-target "dobench"
169 #:phases
170 (modify-phases %standard-phases
171 (replace 'configure
172 (lambda* (#:key outputs #:allow-other-keys)
173 (invoke "./Configure"
174 (string-append "--prefix="
175 (assoc-ref outputs "out"))))))))
176 (synopsis "PARI/GP, a computer algebra system for number theory")
177 (description
178 "PARI/GP is a widely used computer algebra system designed for fast
90a6d47c
AE
179computations in number theory (factorisations, algebraic number theory,
180elliptic curves...), but it also contains a large number of other useful
181functions to compute with mathematical entities such as matrices,
182polynomials, power series, algebraic numbers, etc., and a lot of
183transcendental functions.
184PARI is also available as a C library to allow for faster computations.")
67f39dd5
RW
185 (license license:gpl2+)
186 (home-page "https://pari.math.u-bordeaux.fr/")))
ed9f9a77 187
f854a8c1
AE
188(define-public gp2c
189 (package
190 (name "gp2c")
44ff80fc 191 (version "0.0.11pl1")
f854a8c1
AE
192 (source (origin
193 (method url-fetch)
194 (uri (string-append
eeb8b0e6 195 "https://pari.math.u-bordeaux.fr/pub/pari/GP2C/gp2c-"
f854a8c1 196 version ".tar.gz"))
324bdcd8
AE
197 (sha256
198 (base32
44ff80fc 199 "1c6f6vmncw032kfzrfyr8bynw6yd3faxpy2285r009fmr0zxfs5s"))))
f854a8c1 200 (build-system gnu-build-system)
c67ccedd 201 (native-inputs `(("perl" ,perl)))
f854a8c1
AE
202 (inputs `(("pari-gp" ,pari-gp)))
203 (arguments
204 '(#:configure-flags
205 (list (string-append "--with-paricfg="
206 (assoc-ref %build-inputs "pari-gp")
207 "/lib/pari/pari.cfg"))))
208 (synopsis "PARI/GP, a computer algebra system for number theory")
209 (description
210 "PARI/GP is a widely used computer algebra system designed for fast
211computations in number theory (factorisations, algebraic number theory,
212elliptic curves...), but it also contains a large number of other useful
213functions to compute with mathematical entities such as matrices,
214polynomials, power series, algebraic numbers, etc., and a lot of
215transcendental functions.
216PARI is also available as a C library to allow for faster computations.
217
218GP2C, the GP to C compiler, translates GP scripts to PARI programs.")
9f51293c 219 (license license:gpl2)
eeb8b0e6 220 (home-page "https://pari.math.u-bordeaux.fr/")))
f854a8c1 221
eea7cd75
AE
222(define-public cmh
223 (package
224 (name "cmh")
225 (version "1.0")
226 (source (origin
227 (method url-fetch)
228 (uri (string-append
229 "https://gforge.inria.fr/frs/download.php/33497/cmh-"
230 version ".tar.gz"))
231 (sha256
232 (base32
233 "1a28xr9bs0igms0ik99x0w8lnb0jyfcmvyi26pbyh9ggcdivd33p"))))
234 (build-system gnu-build-system)
235 (inputs
236 `(("gmp" ,gmp)
237 ("mpfr" ,mpfr)
238 ("mpc" ,mpc)
239 ("mpfrcx" ,mpfrcx)
240 ("fplll" ,fplll)
241 ("pari-gp" ,pari-gp)))
242 (synopsis "Igusa class polynomial computations")
243 (description
244 "The CMH software computes Igusa (genus 2) class polynomials, which
245parameterize the CM points in the moduli space of 2-dimensional abelian
246varieties, i.e. Jacobians of hyperelliptic curves.
247It can also be used to compute theta constants at arbitrary
248precision.")
249 (license license:gpl3+)
250 (home-page "http://cmh.gforge.inria.fr/")))
251
7fc0e3db 252(define-public giac
57497c57 253 (package
7fc0e3db 254 (name "giac")
fd4d3939 255 (version "1.5.0-57")
57497c57
NG
256 (source (origin
257 (method url-fetch)
258 ;; "~parisse/giac" is not used because the maintainer regularly
259 ;; overwrites the release tarball there, introducing a checksum
260 ;; mismatch every time. See
261 ;; <https://www-fourier.ujf-grenoble.fr/~parisse/debian/dists/stable/main/source/README>
262 (uri (string-append "https://www-fourier.ujf-grenoble.fr/"
263 "~parisse/debian/dists/stable/main/"
264 "source/giac_" version ".tar.gz"))
265 (sha256
266 (base32
fd4d3939 267 "08c93knsisbk9dkyyrignw0wvqbr1sa5czlvk5l307ahxbbmqncf"))))
57497c57
NG
268 (build-system gnu-build-system)
269 (arguments
af90cc45
NG
270 `(#:modules ((ice-9 ftw)
271 (guix build utils)
272 (guix build gnu-build-system))
273 #:phases
57497c57
NG
274 (modify-phases %standard-phases
275 (add-after 'unpack 'patch-bin-cp
90d5ec55 276 ;; Some Makefiles contain hard-coded "/bin/cp".
57497c57 277 (lambda _
57497c57
NG
278 (substitute* (find-files "doc" "^Makefile")
279 (("/bin/cp") (which "cp")))
90d5ec55
NG
280 #t))
281 (add-after 'unpack 'disable-failing-test
282 ;; FIXME: Test failing. Not sure why.
283 (lambda _
284 (substitute* "check/Makefile.in"
285 (("chk_fhan11") ""))
af90cc45 286 #t))
9f73ac24 287 (add-after 'install 'fix-doc
af90cc45 288 (lambda* (#:key outputs #:allow-other-keys)
9f73ac24
NG
289 (let ((out (assoc-ref outputs "out")))
290 ;; Most French documentation has a non-commercial
291 ;; license, so we need to remove it.
292 (with-directory-excursion (string-append out "/share/giac/doc/fr")
293 (for-each delete-file-recursively
294 '("cascas" "casexo" "casgeo" "casrouge" "cassim"
295 "castor")))
296 ;; Remove duplicate documentation in
297 ;; "%out/share/doc/giac/", where Xcas does not expect
298 ;; to find it.
299 (delete-file-recursively (string-append out "/share/doc/giac"))
300 #t)))
301 (add-after 'install 'remove-unnecessary-executable
302 (lambda* (#:key outputs #:allow-other-keys)
303 (let ((out (assoc-ref outputs "out")))
304 (delete-file (string-append out "/bin/xcasnew"))
305 #t))))))
57497c57 306 (inputs
6d3896b9 307 ;;; TODO: Add libnauty.
57497c57 308 `(("fltk" ,fltk)
6d3896b9 309 ("glpk" ,glpk)
57497c57
NG
310 ("gmp" ,gmp)
311 ("gsl" ,gsl)
312 ("lapack" ,lapack)
313 ("libao" ,ao)
314 ("libjpeg" ,libjpeg)
315 ("libpng" ,libpng)
6d3896b9 316 ("libsamplerate" ,libsamplerate)
57497c57 317 ("libx11" ,libx11)
99a00446 318 ("libxinerama" ,libxinerama)
57497c57
NG
319 ("libxft" ,libxft)
320 ("libxt" ,libxt)
321 ("mesa" ,mesa)
322 ("mpfi" ,mpfi)
323 ("mpfr" ,mpfr)
324 ("ntl" ,ntl)
325 ("perl" ,perl)
326 ("pari-gp" ,pari-gp)
9f73ac24
NG
327 ("tcsh" ,tcsh)))
328 (native-inputs
6d3896b9
NG
329 `(("bison" ,bison)
330 ("flex" ,flex)
331 ("readline" ,readline)
a023ec6e 332 ("texlive" ,texlive-tiny)))
57497c57
NG
333 (home-page "https://www-fourier.ujf-grenoble.fr/~parisse/giac.html")
334 (synopsis "Computer algebra system")
335 (description
336 "Giac/Xcas is a computer algebra system. It has a compatibility mode for
337maple, mupad and the TI89. It is available as a standalone program (graphic
338or text interfaces) or as a C++ library.")
339 (license license:gpl3+)))
340
7fc0e3db 341(define-public giac-xcas
e0f3a4fe 342 (deprecated-package "giac-xcas" giac))
7fc0e3db 343
d7ab698a
AE
344(define-public flint
345 (package
346 (name "flint")
6c591c8e 347 (version "2.5.2")
d7ab698a
AE
348 (source (origin
349 (method url-fetch)
350 (uri (string-append
351 "http://flintlib.org/flint-"
352 version ".tar.gz"))
353 (sha256 (base32
6c591c8e 354 "11syazv1a8rrnac3wj3hnyhhflpqcmq02q8pqk2m6g2k6h0gxwfb"))
fc1adab1 355 (patches (search-patches "flint-ldconfig.patch"))))
d7ab698a 356 (build-system gnu-build-system)
df15d17d 357 (propagated-inputs
d7ab698a 358 `(("gmp" ,gmp)
df15d17d 359 ("mpfr" ,mpfr))) ; header files from both are included by flint/arith.h
d7ab698a 360 (arguments
ad11974e
AE
361 `(#:parallel-tests? #f ; seems to be necessary on arm
362 #:phases
91430de6
AE
363 (modify-phases %standard-phases
364 (replace 'configure
365 (lambda* (#:key inputs outputs #:allow-other-keys)
366 (let ((out (assoc-ref outputs "out"))
367 (gmp (assoc-ref inputs "gmp"))
368 (mpfr (assoc-ref inputs "mpfr")))
91430de6
AE
369 ;; do not pass "--enable-fast-install", which makes the
370 ;; homebrew configure process fail
50233d95 371 (invoke "./configure"
91430de6
AE
372 (string-append "--prefix=" out)
373 (string-append "--with-gmp=" gmp)
50233d95
RW
374 (string-append "--with-mpfr=" mpfr))
375 #t))))))
d7ab698a
AE
376 (synopsis "Fast library for number theory")
377 (description
378 "FLINT is a C library for number theory. It supports arithmetic
379with numbers, polynomials, power series and matrices over many base
380rings, including multiprecision integers and rationals, integers
381modulo n, p-adic numbers, finite fields (prime and non-prime order)
382and real and complex numbers (via the Arb extension library).
383
384Operations that can be performed include conversions, arithmetic,
385GCDs, factoring, solving linear systems, and evaluating special
386functions. In addition, FLINT provides various low-level routines for
387fast arithmetic.")
9f51293c 388 (license license:gpl2+)
d7ab698a
AE
389 (home-page "http://flintlib.org/")))
390
6b8e8285
AE
391(define-public arb
392 (package
6aa54e23 393 (name "arb")
402db511 394 (version "2.16.0")
6aa54e23
RW
395 (source (origin
396 (method git-fetch)
397 (uri (git-reference
398 (url "https://github.com/fredrik-johansson/arb.git")
399 (commit version)))
400 (file-name (git-file-name name version))
401 (sha256
402 (base32
402db511 403 "0478671wfwy3gl26sbxh1jq1ih36z4k72waa8y2y2lvn649gb7cd"))))
6aa54e23
RW
404 (build-system gnu-build-system)
405 (propagated-inputs
406 `(("flint" ,flint))) ; flint.h is included by arf.h
407 (inputs
408 `(("gmp" ,gmp)
409 ("mpfr" ,mpfr)))
410 (arguments
411 `(#:phases
412 (modify-phases %standard-phases
413 (replace 'configure
414 (lambda* (#:key inputs outputs #:allow-other-keys)
415 (let ((out (assoc-ref outputs "out"))
416 (flint (assoc-ref inputs "flint"))
417 (gmp (assoc-ref inputs "gmp"))
418 (mpfr (assoc-ref inputs "mpfr")))
419 ;; do not pass "--enable-fast-install", which makes the
420 ;; homebrew configure process fail
421 (invoke "./configure"
422 (string-append "--prefix=" out)
423 (string-append "--with-flint=" flint)
424 (string-append "--with-gmp=" gmp)
425 (string-append "--with-mpfr=" mpfr))))))))
426 (synopsis "Arbitrary precision floating-point ball arithmetic")
427 (description
428 "Arb is a C library for arbitrary-precision floating-point ball
6b8e8285
AE
429arithmetic. It supports efficient high-precision computation with
430polynomials, power series, matrices and special functions over the
431real and complex numbers, with automatic, rigorous error control.")
6aa54e23
RW
432 (license license:lgpl2.1+)
433 (home-page "http://fredrikj.net/arb/")))
6b8e8285 434
1d6589db
AE
435(define-public python-flint
436 (package
437 (name "python-flint")
438 (version "0.3.0")
439 (source (origin
440 (method git-fetch)
441 (uri (git-reference
442 (url "https://github.com/fredrik-johansson/python-flint.git")
443 (commit version)))
444 (file-name (git-file-name name version))
445 (sha256
446 (base32
447 "1v0anazbj1cfi68nl2j6dbd31kgkc1563xmr0zk5xk3xj78569pw"))
448 (patches (search-patches "python-flint-includes.patch"))))
449 (build-system python-build-system)
450 (native-inputs
451 `(("python-cython" ,python-cython)))
452 (propagated-inputs
453 `(("python-numpy" ,python-numpy)))
454 (inputs
455 `(("arb" ,arb)
456 ("flint" ,flint)))
457 (synopsis "Python module wrapping ARB and FLINT")
458 (description
459 "Python-flint is a Python extension module wrapping FLINT
460(Fast Library for Number Theory) and Arb (arbitrary-precision ball
461arithmetic). It supports integers, rationals, modular integers,
462real and complex ball arithmetic, polynomials and matrices over all
463these types and other mathematical functions.")
464 (license license:expat)
465 (home-page "http://fredrikj.net/python-flint/")))
466
14e6520e
AE
467(define-public ntl
468 (package
469 (name "ntl")
470 (version "9.7.0")
471 (source (origin
472 (method url-fetch)
473 (uri (string-append "http://shoup.net/ntl/ntl-"
474 version ".tar.gz"))
475 (sha256 (base32
476 "115frp5flyvw9wghz4zph1b3llmr5nbxk1skgsggckr81fh3gmxq"))))
477 (build-system gnu-build-system)
478 (native-inputs
479 `(("libtool" ,libtool)
480 ("perl" ,perl))) ; for configuration
481 ;; FIXME: Add optional input gf2x once available; then also add
482 ;; configure flag "NTL_GF2X_LIB=on".
483 (inputs
484 `(("gmp" ,gmp)))
485 (arguments
486 `(#:phases
487 (modify-phases %standard-phases
488 (replace 'configure
489 (lambda* (#:key outputs #:allow-other-keys)
490 (chdir "src")
491 (system* "./configure"
492 (string-append "PREFIX=" (assoc-ref outputs "out"))
493 ;; Do not build especially for the build machine.
494 "NATIVE=off"
495 ;; Also do not tune to the build machine.
496 "WIZARD=off"
497 "SHARED=on")
498 #t)))))
499 (synopsis "C++ library for number theory")
500 (description
501 "NTL is a C++ library providing data structures and algorithms
502for manipulating signed, arbitrary length integers, and for vectors,
503matrices, and polynomials over the integers and over finite fields.")
504 (license license:gpl2+)
505 (home-page "http://shoup.net/ntl/")))
506
aae03c48
AE
507(define-public singular
508 (package
509 (name "singular")
ff6807dc 510 (version "4.1.2p1")
f35c3bbb
KK
511 (source
512 (origin
513 (method url-fetch)
514 (uri
515 (string-append "http://www.mathematik.uni-kl.de/ftp/pub/Math/"
516 "Singular/SOURCES/"
517 (string-join
518 (string-split
519 (string-trim-right version #\p
520 0 (1- (string-length version)))
521 #\.) "-")
522 "/singular-" version ".tar.gz"))
523 (sha256 (base32
ff6807dc 524 "0kvd55353fiqyq1msmi0kka66n5h0aqs7m3km60r01b1w2f8085m"))))
aae03c48
AE
525 (build-system gnu-build-system)
526 (native-inputs
527 `(("doxygen" ,doxygen)
528 ("graphviz" ,graphviz)
529 ("perl" ,perl)))
530 (inputs
531 `(("cddlib" ,cddlib)
532 ("gmp" ,gmp)
533 ("flint" ,flint)
534 ("mpfr" ,mpfr)
535 ("ntl" ,ntl)
536 ("python" ,python-2)
537 ("readline" ,readline)))
538 (arguments
539 `(#:configure-flags
540 (list (string-append "--with-ntl="
541 (assoc-ref %build-inputs "ntl")))))
542 (synopsis "Computer algebra system for polynomial computations")
543 (description
544 "Singular is a computer algebra system for polynomial computations,
545with special emphasis on commutative and non-commutative algebra, algebraic
546geometry and singularity theory.")
547 ;; Singular itself is dual licensed gpl2 or gpl3, but some of the
548 ;; libraries with which it links are licensed under lgpl3+, so the
549 ;; combined work becomes gpl3. See COPYING in the source code.
550 (license license:gpl3)
551 (home-page "http://www.singular.uni-kl.de/index.php")))
552
57c9c349
AE
553(define-public gmp-ecm
554 (package
555 (name "gmp-ecm")
7d15cf17 556 (version "7.0.4")
57c9c349 557 (source (origin
7d15cf17
TGR
558 (method url-fetch)
559 ;; Use the ‘Latest version’ link for a stable URI across releases.
560 (uri (string-append "https://gforge.inria.fr/frs/download.php/"
561 "latestfile/160/ecm-" version ".tar.gz"))
562 (sha256 (base32
563 "0hxs24c2m3mh0nq1zz63z3sb7dhy1rilg2s1igwwcb26x3pb7xqc"))))
57c9c349
AE
564 (build-system gnu-build-system)
565 (inputs
566 `(("gmp" ,gmp)))
567 (arguments
568 `(#:configure-flags '("--enable-shared"
569 ;; Disable specific assembly routines, which depend
570 ;; on the subarchitecture of the build machine,
571 ;; and use gmp instead.
572 "--disable-asm-redc")))
573 (synopsis "Integer factorization library using the elliptic curve method")
574 (description
575 "GMP-ECM factors integers using the elliptic curve method (ECM) as well
576as the P-1 and P+1 algorithms. It provides a library and a stand-alone
577binary.")
578 ;; Most files are under lgpl3+, but some are under gpl3+ or gpl2+,
579 ;; so the combined work is under gpl3+.
580 (license license:gpl3+)
581 (home-page "http://ecm.gforge.inria.fr/")))
582
ed9f9a77
LC
583(define-public bc
584 (package
585 (name "bc")
f71f29ca 586 (version "1.07.1")
ed9f9a77
LC
587 (source (origin
588 (method url-fetch)
589 (uri (string-append "mirror://gnu/bc/bc-" version ".tar.gz"))
590 (sha256
591 (base32
f71f29ca 592 "0amh9ik44jfg66csyvf4zz1l878c4755kjndq9j0270akflgrbb2"))))
ed9f9a77 593 (build-system gnu-build-system)
f71f29ca
MB
594 (native-inputs
595 `(("ed" ,ed)
596 ("flex" ,flex)
597 ("texinfo" ,texinfo)))
ed9f9a77 598 (arguments
f71f29ca 599 '(#:configure-flags
f0bacad6 600 (list "--with-readline")))
6fd52309 601 (home-page "https://www.gnu.org/software/bc/")
f50d2669 602 (synopsis "Arbitrary precision numeric processing language")
ed9f9a77 603 (description
a22dc0c4
LC
604 "bc is an arbitrary precision numeric processing language. It includes
605an interactive environment for evaluating mathematical statements. Its
606syntax is similar to that of C, so basic usage is familiar. It also includes
607\"dc\", a reverse-polish calculator.")
9f51293c 608 (license license:gpl2+)))
37e6cdcd 609
2a9b10c7
RW
610;; The original kiss-fft does not have a complete build system and does not
611;; build any shared libraries. This is a fork used by Extempore.
612(define-public kiss-fft-for-extempore
613 (package
614 (name "kiss-fft-for-extempore")
615 (version "1.3.0")
616 (source (origin
9774fac4
RW
617 (method git-fetch)
618 (uri (git-reference
619 (url "https://github.com/extemporelang/kiss_fft.git")
620 (commit version)))
621 (file-name (git-file-name name version))
2a9b10c7
RW
622 (sha256
623 (base32
9774fac4 624 "0jasbmqy4wkqrqx3w64s1dfmj34875xmsl72mb26aa4hpyn14bi2"))))
2a9b10c7
RW
625 (build-system cmake-build-system)
626 (arguments `(#:tests? #f)) ; no tests included
39162ee4
RW
627 ;; Extempore refuses to build on architectures other than x86_64
628 (supported-systems '("x86_64-linux"))
2a9b10c7
RW
629 (home-page "https://github.com/extemporelang/kiss_fft")
630 (synopsis "Mixed-radix Fast Fourier Transform")
631 (description
632 "Kiss FFT attempts to be a reasonably efficient, moderately useful FFT
633that can use fixed or floating data types and can easily be incorporated into
634a C program.")
635 (license license:bsd-3)))
636
37e6cdcd
LC
637(define-public fftw
638 (package
639 (name "fftw")
bdb74478 640 (version "3.3.8")
37e6cdcd
LC
641 (source (origin
642 (method url-fetch)
643 (uri (string-append "ftp://ftp.fftw.org/pub/fftw/fftw-"
644 version".tar.gz"))
645 (sha256
646 (base32
bdb74478 647 "00z3k8fq561wq2khssqg0kallk0504dzlx989x3vvicjdqpjc4v1"))))
37e6cdcd
LC
648 (build-system gnu-build-system)
649 (arguments
65bb2279 650 `(#:configure-flags
69d5909e
MW
651 '("--enable-shared" "--enable-openmp" "--enable-threads"
652 ,@(let ((system (or (%current-target-system) (%current-system))))
653 ;; Enable SIMD extensions for codelets. See details at:
654 ;; <http://fftw.org/fftw3_doc/Installation-on-Unix.html>.
655 (cond
656 ((string-prefix? "x86_64" system)
657 '("--enable-sse2" "--enable-avx" "--enable-avx2"
658 "--enable-avx512" "--enable-avx-128-fma"))
659 ((string-prefix? "i686" system)
660 '("--enable-sse2"))
661 ((string-prefix? "aarch64" system)
662 ;; Note that fftw supports NEON on 32-bit ARM only when
663 ;; compiled for single-precision.
664 '("--enable-neon"))
665 (else
666 '())))
65bb2279
EB
667 ;; By default '-mtune=native' is used. However, that may cause the
668 ;; use of ISA extensions (e.g. AVX) that are not necessarily
669 ;; available on the user's machine when that package is built on a
670 ;; different machine.
671 "ax_cv_c_flags__mtune_native=no")))
37e6cdcd
LC
672 (native-inputs `(("perl" ,perl)))
673 (home-page "http://fftw.org")
674 (synopsis "Computing the discrete Fourier transform")
675 (description
676 "FFTW is a C subroutine library for computing the discrete Fourier
677transform (DFT) in one or more dimensions, of arbitrary input size, and of
678both real and complex data (as well as of even/odd data---i.e. the discrete
679cosine/ sine transforms or DCT/DST).")
9f51293c 680 (license license:gpl2+)))
7569c5cb
EB
681
682(define-public fftwf
683 (package (inherit fftw)
684 (name "fftwf")
685 (arguments
686 (substitute-keyword-arguments (package-arguments fftw)
69d5909e
MW
687 ((#:configure-flags fftw-configure-flags)
688 `(cons* "--enable-single"
689 ,@(if (string-prefix? "arm" (or (%current-target-system)
690 (%current-system)))
691 ;; fftw supports NEON on 32-bit ARM only when compiled
692 ;; for single-precision, so add it here.
693 '("--enable-neon")
694 '())
695 ,fftw-configure-flags))))
7569c5cb
EB
696 (description
697 (string-append (package-description fftw)
698 " Single-precision version."))))
e5c66f8c
EB
699
700(define-public fftw-openmpi
701 (package (inherit fftw)
702 (name "fftw-openmpi")
703 (inputs
704 `(("openmpi" ,openmpi)
705 ,@(package-inputs fftw)))
706 (arguments
707 (substitute-keyword-arguments (package-arguments fftw)
708 ((#:configure-flags cf)
eb6785cf
EB
709 `(cons "--enable-mpi" ,cf))
710 ((#:phases phases '%standard-phases)
711 `(modify-phases ,phases
712 (add-before 'check 'mpi-setup
713 ,%openmpi-setup)))))
e5c66f8c
EB
714 (description
715 (string-append (package-description fftw)
716 " With OpenMPI parallelism support."))))
8f4b1dfb 717
c8d99608
RW
718(define-public java-la4j
719 (package
720 (name "java-la4j")
721 (version "0.6.0")
722 (source (origin
723 (method git-fetch)
724 (uri (git-reference
725 (url "https://github.com/vkostyukov/la4j.git")
726 (commit version)))
727 (file-name (string-append name "-" version "-checkout"))
728 (sha256
729 (base32
730 "1qir8dr978cfvz9k12m2kbdwpyf6cqdf1d0ilb7lnkhbgq5i53w3"))))
731 (build-system ant-build-system)
732 (arguments
733 `(#:jar-name "la4j.jar"
734 #:jdk ,icedtea-8
735 #:test-exclude (list "**/Abstract*.java"
736 "**/MatrixTest.java"
737 "**/DenseMatrixTest.java"
738 "**/SparseMatrixTest.java"
739 "**/VectorTest.java"
740 "**/SparseVectorTest.java"
741 "**/DenseVectorTest.java")))
742 (native-inputs
743 `(("java-junit" ,java-junit)
744 ("java-hamcrest-core" ,java-hamcrest-core)))
745 (home-page "http://la4j.org/")
746 (synopsis "Java library that provides Linear Algebra primitives and algorithms")
747 (description "The la4j library is a Java library that provides Linear
748Algebra primitives (matrices and vectors) and algorithms. The key features of
749the la4j library are:
750
751@itemize
752@item No dependencies and tiny size
753@item Fluent object-oriented/functional API
754@item Sparse (CRS, CCS) and dense (1D/2D arrays) matrices
755@item Linear systems solving (Gaussian, Jacobi, Zeidel, Square Root, Sweep and other)
756@item Matrices decomposition (Eigenvalues/Eigenvectors, SVD, QR, LU, Cholesky and other)
757@item MatrixMarket/CSV IO formats support for matrices and vectors
758@end itemize\n")
759 (license license:asl2.0)))
760
24074b0b
RW
761(define-public java-jlargearrays
762 (package
763 (name "java-jlargearrays")
764 (version "1.6")
765 (source (origin
766 (method url-fetch)
767 (uri (string-append "http://search.maven.org/remotecontent?"
768 "filepath=pl/edu/icm/JLargeArrays/"
769 version "/JLargeArrays-" version
770 "-sources.jar"))
771 (file-name (string-append name "-" version ".jar"))
772 (sha256
773 (base32
774 "0v05iphpxbjnd7f4jf1rlqq3m8hslhcm0imdbsgxr20pi3xkaf2a"))))
775 (build-system ant-build-system)
776 (arguments
777 `(#:jar-name "jlargearrays.jar"
778 #:tests? #f ; tests are not included in the release archive
779 #:jdk ,icedtea-8))
780 (propagated-inputs
781 `(("java-commons-math3" ,java-commons-math3)))
782 (home-page "https://gitlab.com/ICM-VisLab/JLargeArrays")
783 (synopsis "Library of one-dimensional arrays that can store up to 263 elements")
784 (description "JLargeArrays is a Java library of one-dimensional arrays
785that can store up to 263 elements.")
786 (license license:bsd-2)))
787
4e92911c
RW
788(define-public java-jtransforms
789 (package
790 (name "java-jtransforms")
791 (version "3.1")
792 (source (origin
793 (method url-fetch)
794 (uri (string-append "http://search.maven.org/remotecontent?"
795 "filepath=com/github/wendykierp/JTransforms/"
796 version "/JTransforms-" version "-sources.jar"))
797 (sha256
798 (base32
799 "1haw5m8shv5srgcpwkl853dz8bv6h90bzlhcps6mdpb4cixjirsg"))))
800 (build-system ant-build-system)
801 (arguments
802 `(#:jar-name "jtransforms.jar"
803 #:tests? #f ; tests are not included in the release archive
804 #:jdk ,icedtea-8))
805 (propagated-inputs
806 `(("java-commons-math3" ,java-commons-math3)
807 ("java-jlargearrays" ,java-jlargearrays)))
808 (home-page "https://github.com/wendykierp/JTransforms")
809 (synopsis "Multithreaded FFT library written in pure Java")
810 (description "JTransforms is a multithreaded FFT library written in pure
811Java. Currently, four types of transforms are available: @dfn{Discrete
812Fourier Transform} (DFT), @dfn{Discrete Cosine Transform} (DCT), @dfn{Discrete
813Sine Transform} (DST) and @dfn{Discrete Hartley Transform} (DHT).")
814 (license license:bsd-2)))
815
8f4b1dfb
LC
816(define-public eigen
817 (package
818 (name "eigen")
8cd80a4b 819 (version "3.3.5")
8f4b1dfb
LC
820 (source (origin
821 (method url-fetch)
822 (uri (string-append "https://bitbucket.org/eigen/eigen/get/"
9b268f12 823 version ".tar.bz2"))
8f4b1dfb
LC
824 (sha256
825 (base32
8cd80a4b 826 "1qh3yrwn78ms5yhwbpl5wvblk4gbz02cacdygxylr7i9xbrvylkk"))
2abcc935 827 (file-name (string-append name "-" version ".tar.bz2"))
8f4b1dfb
LC
828 (modules '((guix build utils)))
829 (snippet
830 ;; There are 3 test failures in the "unsupported" directory,
831 ;; but maintainers say it's a known issue and it's unsupported
832 ;; anyway, so just skip them.
1137d85b 833 '(begin
44884a9d
RW
834 (substitute* "unsupported/CMakeLists.txt"
835 (("add_subdirectory\\(test.*")
836 "# Do not build the tests for unsupported features.\n"))
6cbee49d 837 #t))))
8f4b1dfb
LC
838 (build-system cmake-build-system)
839 (arguments
840 '(;; Turn off debugging symbols to save space.
841 #:build-type "Release"
842
354f4fe2 843 #:phases (modify-phases %standard-phases
ef8742ea 844 (replace 'check
354f4fe2 845 (lambda _
354f4fe2
LC
846 (let* ((cores (parallel-job-count))
847 (dash-j (format #f "-j~a" cores)))
1137d85b 848 (setenv "EIGEN_SEED" "1") ;for reproducibility
ef8742ea
LC
849 ;; First build the tests, in parallel. See
850 ;; <http://eigen.tuxfamily.org/index.php?title=Tests>.
fbe9c80f 851 (invoke "make" "buildtests" dash-j)
8f4b1dfb 852
fbe9c80f
TGR
853 ;; Then run 'CTest' with -V so we get more
854 ;; details upon failure.
855 (invoke "ctest" "-V" dash-j)))))))
eeb8b0e6 856 (home-page "https://eigen.tuxfamily.org")
8f4b1dfb
LC
857 (synopsis "C++ template library for linear algebra")
858 (description
859 "Eigen is a C++ template library for linear algebra: matrices, vectors,
860numerical solvers, and related algorithms. It provides an elegant API based
861on \"expression templates\". It is versatile: it supports all matrix sizes,
862all standard numeric types, various matrix decompositions and geometry
863features, and more.")
864
865 ;; Most of the code is MPLv2, with a few files under LGPLv2.1+ or BSD-3.
866 ;; See 'COPYING.README' for details.
9f51293c 867 (license license:mpl2.0)))
70770b93 868
697eb65d
RW
869(define-public eigen-for-tensorflow
870 (let ((changeset "fd6845384b86")
871 (revision "1"))
872 (package (inherit eigen)
873 (name "eigen-for-tensorflow")
874 (version (string-append "3.3.5-" revision "." changeset))
875 (source (origin
876 (method hg-fetch)
877 (uri (hg-reference
878 (url "https://bitbucket.org/eigen/eigen")
879 (changeset changeset)))
880 (sha256
881 (base32
882 "12cwgah63wqwb66xji048hcxc1z5zjg8a7701zlia5zbilnnk1n5"))
883 (file-name (string-append name "-" version "-checkout"))
884 (modules '((guix build utils)))
885 (snippet
886 ;; There are 3 test failures in the "unsupported" directory,
887 ;; but maintainers say it's a known issue and it's unsupported
888 ;; anyway, so just skip them.
889 '(begin
890 (substitute* "unsupported/CMakeLists.txt"
891 (("add_subdirectory\\(test.*")
892 "# Do not build the tests for unsupported features.\n"))
893 #t)))))))
894
70770b93
FT
895(define-public xtensor
896 (package
897 (name "xtensor")
98080807 898 (version "0.20.5")
70770b93 899 (source (origin
e1ecaa83
KK
900 (method git-fetch)
901 (uri (git-reference
902 (url "https://github.com/QuantStack/xtensor.git")
903 (commit version)))
70770b93
FT
904 (sha256
905 (base32
98080807 906 "0kkc4ar7p2d94jnclmrh46dwv7ldy9lx630vm9gci3pp4hnhbj9f"))
e1ecaa83 907 (file-name (git-file-name name version))))
70770b93
FT
908 (build-system cmake-build-system)
909 (native-inputs
910 `(("googletest" ,googletest)
911 ("xtl" ,xtl)))
912 (arguments
913 `(#:configure-flags
914 '("-DBUILD_TESTS=ON")
915 #:test-target "xtest"))
916 (home-page "http://quantstack.net/xtensor")
917 (synopsis "C++ tensors with broadcasting and lazy computing")
918 (description "xtensor is a C++ library meant for numerical analysis with
919multi-dimensional array expressions.
920
921xtensor provides:
922@itemize
923@item an extensible expression system enabling lazy broadcasting.
924@item an API following the idioms of the C++ standard library.
925@item tools to manipulate array expressions and build upon xtensor.
926@end itemize")
927 (license license:bsd-3)))
3f074a21
AE
928
929(define-public gap
930 (package
931 (name "gap")
bf95a142 932 (version "4.10.1")
3f074a21
AE
933 (source
934 (origin
935 (method url-fetch)
936 (uri (string-append "https://www.gap-system.org/pub/gap/gap-"
937 (version-major+minor version)
938 "/tar.bz2/gap-"
939 version
940 ".tar.bz2"))
941 (sha256
942 (base32
bf95a142 943 "136s0zvhcw41fshj5zgsrjcy2kd58cdh2m3ddp5rdizi4rx54f10"))
3f074a21
AE
944 (modules '((guix build utils) (ice-9 ftw) (srfi srfi-1)))
945 (snippet
946 '(begin
947 ;; Delete the external gmp and zlib libraries
948 ;; and a subdirectory not needed for our build.
949 (for-each delete-file-recursively
950 '("extern" "hpcgap"))
951 ;; Delete a failing test.
952 ;; FIXME: This might be fixed in the next release, see
953 ;; https://github.com/gap-system/gap/issues/3292
954 (delete-file "tst/testinstall/dir.tst")
955 ;; Delete all packages except for a fixed list.
956 (with-directory-excursion "pkg"
957 (for-each delete-file-recursively
958 (lset-difference string=? (scandir ".")
959 '("." ".."
960 ;; Necessary packages.
961 "GAPDoc-1.6.2"
962 "primgrp-3.3.2"
963 "SmallGrp-1.3" ; artistic2.0
964 "transgrp" ; artistic2.0 for data,
965 ; gpl2 or gpl3 for code
966 ;; Recommanded package.
967 "io-4.5.4" ; gpl3+
968 ;; Optional packages, searched for at start,
969 ;; and their depedencies.
970 "alnuth-3.1.0"
3f074a21
AE
971 "autpgrp-1.10"
972 "crisp-1.4.4" ; bsd-2
bf95a142 973 "ctbllib" ; gpl3+ according to doc/chap0.txt
3f074a21
AE
974 "FactInt-1.6.2"
975 "fga"
976 "irredsol-1.4" ; bsd-2
bf95a142 977 "laguna-3.9.2"
3f074a21
AE
978 "polenta-1.3.8"
979 "polycyclic-2.14"
980 "radiroot-2.8"
981 "resclasses-4.7.1"
982 "sophus-1.24"
bf95a142
AE
983 "tomlib-1.2.7" ; gpl2+, clarified in the git repository
984 ; and the next release
3f074a21
AE
985 "utils-0.59"))))
986 #t))))
987 (build-system gnu-build-system)
988 (inputs
989 `(("gmp" ,gmp)
990 ("zlib" ,zlib)))
991 (arguments
bf95a142
AE
992 `(#:modules ((ice-9 ftw)
993 (srfi srfi-26)
994 (guix build gnu-build-system)
995 (guix build utils))
996 #:phases
3f074a21
AE
997 (modify-phases %standard-phases
998 (add-after 'build 'build-packages
999 ;; Compile all packages that have not been deleted by the
1000 ;; code snippet above.
1001 (lambda _
1002 (setenv "CONFIG_SHELL" (which "bash"))
1003 (with-directory-excursion "pkg"
1004 (invoke "../bin/BuildPackages.sh")
1005 #t)))
1006 (add-after 'build-packages 'build-doc
1007 ;; The documentation is bundled, but we create it from source.
1008 (lambda _
1009 (with-directory-excursion "doc"
1010 (invoke "./make_doc"))
1011 #t))
3f074a21
AE
1012 (replace 'install
1013 (lambda* (#:key outputs #:allow-other-keys)
1014 (let* ((out (assoc-ref outputs "out"))
1015 (bin (string-append out "/bin"))
bf95a142 1016 (lib (string-append out "/lib"))
3f074a21
AE
1017 (prog (string-append bin "/gap"))
1018 (prog-real (string-append bin "/.gap-real"))
1019 (share (string-append out "/share/gap"))
bf95a142
AE
1020 (include (string-append out "/include/gap"))
1021 (include-hpc (string-append include "/hpc")))
3f074a21
AE
1022 ;; Install only the gap binary; the gac compiler is left
1023 ;; for maybe later. "Wrap" it in a shell script that calls
1024 ;; the binary with the correct parameter.
1025 (mkdir-p bin)
1026 (copy-file "gap" prog-real)
1027 (call-with-output-file prog
1028 (lambda (port)
1029 (format port
1030 "#!~a~%exec ~a -l ~a \"$@\"~%"
1031 (which "bash")
1032 prog-real
1033 share)))
1034 (chmod prog #o755)
bf95a142
AE
1035 ;; Install the headers, which are needed by Sage. The
1036 ;; Makefile target "install-headers" was available in
1037 ;; gap-4.10.0, but has been commented out in gap-4.10.1.
1038 (mkdir-p include-hpc)
3f074a21 1039 (install-file "gen/config.h" include)
bf95a142
AE
1040 (let ((file-name-predicate-without-stat
1041 (lambda (regex)
1042 (cut (file-name-predicate regex) <> #f))))
1043 (with-directory-excursion "src"
1044 (for-each
1045 (cut install-file <> include)
1046 (scandir "."
1047 (file-name-predicate-without-stat ".*\\.h$"))))
1048 (with-directory-excursion "src/hpc"
1049 (for-each
1050 (cut install-file <> include-hpc)
1051 (scandir "."
1052 (file-name-predicate-without-stat ".*\\.h$")))))
1053 ;; Install the library, which is needed by Sage. The
1054 ;; Makefile target "install-libgap" was available in
1055 ;; gap-4.10.0, but has been commented out in gap-4.10.1.
1056 ;; Compared to the Makefile, which used libtool, the
1057 ;; following approach of copying files and making symlinks
1058 ;; is rather pedestrian. There is hope that some later
1059 ;; version of gap reinstates and completes the install
1060 ;; targets.
1061 (invoke "make" "libgap.la")
1062 (install-file "libgap.la" lib)
1063 (install-file ".libs/libgap.so.0.0.0" lib)
1064 (symlink "libgap.so.0.0.0" (string-append lib "/libgap.so"))
1065 (symlink "libgap.so.0.0.0" (string-append lib "/libgap.so.0"))
3f074a21
AE
1066 ;; Install a certain number of files and directories to
1067 ;; SHARE, where the wrapped shell script expects them.
1068 ;; Remove information on the build directory from sysinfo.gap.
1069 (substitute* "sysinfo.gap"
1070 (("GAP_BIN_DIR=\".*\"") "GAP_BIN_DIR=\"\"")
1071 (("GAP_LIB_DIR=\".*\"") "GAP_LIB_DIR=\"\"")
1072 (("GAP_CPPFLAGS=\".*\"") "GAP_CPPFLAGS=\"\""))
1073 (install-file "sysinfo.gap" share)
1074 (copy-recursively "grp" (string-append share "/grp"))
1075 (copy-recursively "pkg" (string-append share "/pkg"))
1076 ;; The following is not the C library libgap.so, but a
1077 ;; library of GAP code.
1078 (copy-recursively "lib" (string-append share "/lib"))
1079 ;; The gap binary looks for documentation inside SHARE.
1080 (copy-recursively "doc" (string-append share "/doc")))
1081 #t)))))
1082 (home-page "https://www.gap-system.org/")
1083 (synopsis
1084 "System for computational group theory")
1085 (description
1086 "GAP is a system for computational discrete algebra, with particular
1087emphasis on computational group theory. It provides a programming language,
1088a library of thousands of functions implementing algebraic algorithms
1089written in the GAP language as well as large data libraries of algebraic
1090objects.")
1091 ;; Some packages have different licenses (effectively forcing the
1092 ;; combined work to be licensed as gpl3+); if this is the case, this
1093 ;; is mentioned above next to their name.
1094 ;; Some packages have no license mentioned explicitly; supposedly this
1095 ;; means that the gpl2+ licence of GAP itself applies, but to be on the
1096 ;; safe side, we drop them for now.
1097 (license license:gpl2+)))
f0fbb31d
AE
1098
1099(define-public givaro
1100 (package
1101 (name "givaro")
1102 (version "4.1.1")
1103 (source (origin
1104 (method git-fetch)
1105 (uri (git-reference
1106 (url "https://github.com/linbox-team/givaro")
1107 (commit (string-append "v" version))))
1108 (file-name (git-file-name name version))
1109 (sha256
1110 (base32
1111 "11wz57q6ijsvfs5r82masxgr319as92syi78lnl9lgdblpc6xigk"))))
1112 (build-system gnu-build-system)
1113 (native-inputs
1114 `(("autoconf" ,autoconf)
1115 ("automake" ,automake)
1116 ("libtool" ,libtool)))
1117 (propagated-inputs
1118 `(("gmp" ,gmp))) ; gmp++.h includes gmpxx.h
1119 (arguments
1120 `(#:phases
1121 (modify-phases %standard-phases
1122 (add-before 'bootstrap 'setenv
1123 ;; Prevent the autogen.sh script to carry out the configure
1124 ;; script, which has not yet been patched to replace /bin/sh.
1125 (lambda _
1126 (setenv "NOCONFIGURE" "yes")
1127 #t)))))
1128 (synopsis "Algebraic computations with exact rings and fields")
1129 (description
1130 "Givaro is a C++ library implementing the basic arithmetic of various
1131algebraic objects: prime fields, extension fields, finite fields, finite
1132rings, polynomials, algebraic numbers, arbitrary precision integers and
1133rationals (C++ wrappers over gmp), fixed precision integers. It also
1134provides data-structures and templated classes for the manipulation of
1135compound objects, such as vectors, matrices and univariate polynomials.")
1136 (license license:cecill-b)
1137 (home-page "https://github.com/linbox-team/givaro")))
4bf9cb40
AE
1138
1139(define-public fflas-ffpack
1140 (package
1141 (name "fflas-ffpack")
1142 (version "2.4.3")
1143 (source (origin
1144 (method git-fetch)
1145 (uri (git-reference
1146 (url "https://github.com/linbox-team/fflas-ffpack")
1147 (commit version)))
1148 (file-name (git-file-name name version))
1149 (sha256
1150 (base32
1151 "1ynbjd72qrwp0b4kpn0p5d7gddpvj8dlb5fwdxajr5pvkvi3if74"))))
1152 (build-system gnu-build-system)
1153 (native-inputs
1154 `(("autoconf" ,autoconf)
1155 ("automake" ,automake)
1156 ("libtool" ,libtool)
1157 ("pkg-config" ,pkg-config)))
1158 (inputs
1159 `(("openblas" ,openblas)))
1160 (propagated-inputs
1161 `(("givaro" ,givaro))) ; required according to the .pc file
1162 (arguments
1163 `(#:configure-flags
1164 (list (string-append "--with-blas-libs="
1165 (assoc-ref %build-inputs "openblas")
1166 "/lib/libopenblas.so"))
1167 #:phases
1168 (modify-phases %standard-phases
1169 (add-before 'bootstrap 'setenv
1170 ;; Prevent the autogen.sh script to carry out the configure
1171 ;; script, which has not yet been patched to replace /bin/sh.
1172 (lambda _
1173 (setenv "NOCONFIGURE" "yes")
1174 #t)))))
1175 (synopsis "C++ library for linear algebra over finite fields")
1176 (description
1177 "FFLAS-FFPACK is a C++ template library for basic linear algebra
1178operations over a finite field.
1179FFLAS (Finite Field Linear Algebra Subprograms) provides the implementation
1180of a subset of routines of the numerical BLAS; it also supports sparse
1181matrix-vector products.
1182FFPACK (Finite Field Linear Algebra Package) is inspired by the LAPACK
1183library to provide functionalities of higher level, using the kernel
1184of a BLAS. Additionally, it provides routines specific to exact linear
1185algebra, such as the row echelon form.")
1186 (license license:lgpl2.1+)
1187 (home-page "https://linbox-team.github.io/fflas-ffpack/")))
a612f866
AE
1188
1189(define-public linbox
1190 (package
1191 (name "linbox")
1192 (version "1.6.3")
1193 (source (origin
1194 (method git-fetch)
1195 (uri (git-reference
1196 (url "https://github.com/linbox-team/linbox")
1197 (commit (string-append "v" version))))
1198 (file-name (git-file-name name version))
1199 (sha256
1200 (base32
1201 "10j6dspbsq7d2l4q3y0c1l1xwmaqqba2fxg59q5bhgk9h5d7q571"))))
1202 (build-system gnu-build-system)
1203 (native-inputs
1204 `(("autoconf" ,autoconf)
1205 ("automake" ,automake)
1206 ("libtool" ,libtool)
1207 ("pkg-config" ,pkg-config)))
1208 (inputs
1209 `(("fflas-ffpack" ,fflas-ffpack)))
1210 (arguments
1211 `(#:phases
1212 (modify-phases %standard-phases
1213 (add-before 'bootstrap 'setenv
1214 ;; Prevent the autogen.sh script to carry out the configure
1215 ;; script, which has not yet been patched to replace /bin/sh.
1216 (lambda _
1217 (setenv "NOCONFIGURE" "yes")
1218 #t)))))
1219 (synopsis "C++ library for linear algebra over exact rings")
1220 (description
1221 "LinBox is a C++ template library for exact linear algebra computation
1222with dense, sparse, and structured matrices over the integers and over
1223finite fields.")
1224 (license license:lgpl2.1+)
1225 (home-page "https://linbox-team.github.io/linbox/")))