gnu: Add r-mgsub.
[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>
9673402d 3;;; Copyright © 2013, 2015, 2017, 2018, 2021 Ludovic Courtès <ludo@gnu.org>
28f15b98 4;;; Copyright © 2016, 2017, 2018, 2019, 2020, 2021 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>
e188d2f8 7;;; Copyright © 2017, 2020 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>
06b2bc55 11;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
4c877704 12;;; Copyright © 2020 Björn Höfling <bjoern.hoefling@bjoernhoefling.de>
7cc9e1dc 13;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
feba2c97 14;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
d0337a22 15;;; Copyright © 2020 Vinicius Monego <monego@posteo.net>
2ed139c4 16;;;
233e7676 17;;; This file is part of GNU Guix.
2ed139c4 18;;;
233e7676 19;;; GNU Guix is free software; you can redistribute it and/or modify it
2ed139c4
AE
20;;; under the terms of the GNU General Public License as published by
21;;; the Free Software Foundation; either version 3 of the License, or (at
22;;; your option) any later version.
23;;;
233e7676 24;;; GNU Guix is distributed in the hope that it will be useful, but
2ed139c4
AE
25;;; WITHOUT ANY WARRANTY; without even the implied warranty of
26;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27;;; GNU General Public License for more details.
28;;;
29;;; You should have received a copy of the GNU General Public License
233e7676 30;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
2ed139c4 31
1ffa7090 32(define-module (gnu packages algebra)
59a43334 33 #:use-module (gnu packages)
14e6520e 34 #:use-module (gnu packages autotools)
fdb513a7 35 #:use-module (gnu packages bison)
70770b93 36 #:use-module (gnu packages check)
10b1f688 37 #:use-module (gnu packages compression)
70770b93 38 #:use-module (gnu packages cpp)
99828fa7 39 #:use-module (gnu packages documentation)
f71f29ca 40 #:use-module (gnu packages ed)
5894b604 41 #:use-module (gnu packages flex)
57497c57
NG
42 #:use-module (gnu packages fltk)
43 #:use-module (gnu packages gl)
aae03c48 44 #:use-module (gnu packages graphviz)
57497c57 45 #:use-module (gnu packages image)
c8d99608 46 #:use-module (gnu packages java)
aae03c48 47 #:use-module (gnu packages maths)
0fc54d4b 48 #:use-module (gnu packages mpi)
5894b604 49 #:use-module (gnu packages multiprecision)
1ceeaa5d 50 #:use-module (gnu packages ocaml)
1ffa7090 51 #:use-module (gnu packages perl)
4bf9cb40 52 #:use-module (gnu packages pkg-config)
6d3896b9 53 #:use-module (gnu packages pulseaudio)
aae03c48 54 #:use-module (gnu packages python)
1d6589db 55 #:use-module (gnu packages python-xyz)
5894b604 56 #:use-module (gnu packages readline)
b7194849 57 #:use-module (gnu packages shells)
8f9ac901 58 #:use-module (gnu packages tex)
f71f29ca 59 #:use-module (gnu packages texinfo)
57497c57 60 #:use-module (gnu packages xiph)
fb8d1be8 61 #:use-module (gnu packages xorg)
c8d99608 62 #:use-module (guix build-system ant)
7569c5cb 63 #:use-module (guix build-system gnu)
8f4b1dfb 64 #:use-module (guix build-system cmake)
1d6589db 65 #:use-module (guix build-system python)
5894b604 66 #:use-module (guix download)
c8d99608 67 #:use-module (guix git-download)
697eb65d 68 #:use-module (guix hg-download)
5894b604
TGR
69 #:use-module ((guix licenses) #:prefix license:)
70 #:use-module (guix packages)
7569c5cb 71 #:use-module (guix utils))
2ed139c4
AE
72
73
74(define-public mpfrcx
75 (package
76 (name "mpfrcx")
5f8ea8e4 77 (version "0.6")
2ed139c4
AE
78 (source (origin
79 (method url-fetch)
80 (uri (string-append
43a776e2 81 "http://www.multiprecision.org/downloads/mpfrcx-"
2ed139c4
AE
82 version ".tar.gz"))
83 (sha256
84 (base32
5f8ea8e4 85 "0gz5rma9al2jrifpknqkcnd9dkf8l05jcxy3s4ghwhd4y3h5dwia"))))
2ed139c4 86 (build-system gnu-build-system)
878c8f3f
AE
87 (propagated-inputs
88 `(("gmp" ,gmp)
89 ("mpfr" ,mpfr)
90 ("mpc" ,mpc))) ; Header files are included by mpfrcx.h.
35b9e423 91 (synopsis "Arithmetic of polynomials over arbitrary precision numbers")
2ed139c4 92 (description
35b9e423 93 "Mpfrcx is a library for the arithmetic of univariate polynomials over
2ed139c4 94arbitrary precision real (mpfr) or complex (mpc) numbers, without control
35b9e423 95on the rounding. For the time being, only the few functions needed to
2ed139c4 96implement the floating point approach to complex multiplication are
35b9e423 97implemented. On the other hand, these comprise asymptotically fast
e881752c 98multiplication routines such as Toom–Cook and the FFT.")
43a776e2 99 (license license:lgpl3+)
79d1550f 100 (home-page "http://www.multiprecision.org/mpfrcx/")))
2ed139c4 101
7c5f6231
AE
102(define-public gf2x
103 (package
104 (name "gf2x")
105 (version "1.2")
106 (source (origin
107 (method url-fetch)
108 (uri (string-append
109 "https://gforge.inria.fr/frs/download.php/file/36934/gf2x-"
110 version ".tar.gz"))
111 (sha256
112 (base32
113 "0d6vh1mxskvv3bxl6byp7gxxw3zzpkldrxnyajhnl05m0gx7yhk1"))))
114 (build-system gnu-build-system)
115 (synopsis "Arithmetic of polynomials over binary finite fields")
116 (description
117 "The gf2x library provides arithmetic of polynomials over finite fields
118of characteristic 2. It implements the multiplication, squaring and
119greatest common divisor operations.")
120 (license license:gpl3+)
121 (home-page "https://gforge.inria.fr/projects/gf2x/")))
122
10b1f688
AE
123(define-public cm
124 (package
125 (name "cm")
4c09ec43 126 (version "0.3.1")
10b1f688
AE
127 (source (origin
128 (method url-fetch)
129 (uri (string-append
4c09ec43 130 "http://www.multiprecision.org/downloads/cm-"
10b1f688
AE
131 version ".tar.gz"))
132 (sha256
133 (base32
4c09ec43 134 "0qq6b1kwb1byj8ws33ya5awq0ilkpm32037pi1l4cf2737fg9m42"))))
10b1f688
AE
135 (build-system gnu-build-system)
136 (propagated-inputs
137 `(("mpfrcx" ,mpfrcx)
138 ("zlib" ,zlib))) ; Header files included from cm_common.h.
139 (inputs
140 `(("pari-gp" ,pari-gp)))
141 (synopsis "CM constructions for elliptic curves")
142 (description
143 "The CM software implements the construction of ring class fields of
144imaginary quadratic number fields and of elliptic curves with complex
145multiplication via floating point approximations. It consists of libraries
146that can be called from within a C program and of executable command
147line applications.")
81b55bf7 148 (license license:gpl3+)
79d1550f 149 (home-page "http://www.multiprecision.org/cm/")))
10b1f688 150
2ed139c4
AE
151(define-public fplll
152 (package
1de48e8f 153 (name "fplll")
82f983da 154 (version "5.3.3")
1de48e8f
NG
155 (source (origin
156 (method git-fetch)
157 (uri (git-reference
b0e7b699 158 (url "https://github.com/fplll/fplll")
1de48e8f
NG
159 (commit version)))
160 (file-name (git-file-name name version))
161 (sha256
162 (base32
049a1714
AE
163 "06nyfidagp8pc2kfcw88ldgb2b1xm0a8z31n0sln7j72ihlmd8zj"))
164 (patches (search-patches "fplll-std-fenv.patch"))))
1de48e8f
NG
165 (build-system gnu-build-system)
166 (native-inputs
167 `(("autoconf" ,autoconf)
168 ("automake" ,automake)
82f983da
AE
169 ("libtool" ,libtool)
170 ("pkg-config" ,pkg-config)))
049a1714 171 (propagated-inputs ; header files pulled in by fplll/defs.h
1de48e8f
NG
172 `(("gmp" ,gmp)
173 ("mpfr" ,mpfr)))
174 (home-page "https://github.com/fplll/fplll")
175 (synopsis "Library for LLL-reduction of euclidean lattices")
176 (description
177 "fplll contains implementations of several lattice algorithms.
178The implementation relies on floating-point orthogonalization, and LLL
179is central to the code, hence the name.
180
181It includes implementations of floating-point LLL reduction
182algorithms, offering different speed/guarantees ratios. It contains
183a @emph{wrapper} choosing the estimated best sequence of variants in
184order to provide a guaranteed output as fast as possible. In the case
185of the wrapper, the succession of variants is oblivious to the user.
186
187It includes an implementation of the BKZ reduction algorithm,
188including the BKZ-2.0 improvements (extreme enumeration
189pruning, pre-processing of blocks, early termination). Additionally,
190Slide reduction and self dual BKZ are supported.
191
192It also includes a floating-point implementation of the
193Kannan-Fincke-Pohst algorithm that finds a shortest non-zero lattice
194vector. For the same task, the GaussSieve algorithm is also available
195in fplll. Finally, it contains a variant of the enumeration algorithm
196that computes a lattice vector closest to a given vector belonging to
197the real span of the lattice.")
198 (license license:lgpl2.1+)))
4e6b699d 199
25cbaa9e
NG
200(define-public python-fpylll
201 (package
202 (name "python-fpylll")
28045580 203 (version "0.5.2")
25cbaa9e
NG
204 (source
205 (origin
206 ;; Pypi contains and older release, so we use a tagged release from
207 ;; Github instead.
208 (method git-fetch)
209 (uri (git-reference
b0e7b699 210 (url "https://github.com/fplll/fpylll")
25cbaa9e 211 (commit (string-append version "dev"))))
f1d4d79f 212 (file-name (git-file-name name version))
25cbaa9e
NG
213 (sha256
214 (base32
28045580 215 "1a25iibihph626jl4wbs4b77xc4a2c4nfc2ypscf9wpani3dnhjf"))))
25cbaa9e
NG
216 (build-system python-build-system)
217 (inputs
218 `(("fplll" ,fplll)
219 ("gmp" ,gmp)
220 ("mpfr" ,mpfr)
221 ("pari-gp" ,pari-gp)))
222 (propagated-inputs
223 `(("cysignals" ,python-cysignals)
224 ("cython" ,python-cython)
225 ("flake8" ,python-flake8)
226 ("numpy" ,python-numpy)
227 ("pytest" ,python-pytest)))
228 (home-page "https://github.com/fplll/fpylll")
229 (synopsis "Python interface for fplll")
230 (description "fpylll is a Python wrapper for fplll.")
231 (license license:gpl2+)))
232
90a6d47c
AE
233(define-public pari-gp
234 (package
67f39dd5 235 (name "pari-gp")
9d22c0ca 236 (version "2.13.1")
67f39dd5
RW
237 (source (origin
238 (method url-fetch)
239 (uri (string-append
240 "https://pari.math.u-bordeaux.fr/pub/pari/unix/pari-"
241 version ".tar.gz"))
242 (sha256
243 (base32
9d22c0ca 244 "1cgwdpw8b797883z9y92ixxjkv72kiy65zsw2qqf5and1kbzgv41"))))
67f39dd5
RW
245 (build-system gnu-build-system)
246 (native-inputs
247 `(("texlive" ,(texlive-union
f75aa97f 248 (list texlive-amsfonts)))))
67f39dd5
RW
249 (inputs `(("gmp" ,gmp)
250 ("libx11" ,libx11)
251 ("perl" ,perl)
252 ("readline" ,readline)))
253 (arguments
254 '(#:make-flags '("all")
255 #:test-target "dobench"
256 #:phases
257 (modify-phases %standard-phases
258 (replace 'configure
259 (lambda* (#:key outputs #:allow-other-keys)
260 (invoke "./Configure"
261 (string-append "--prefix="
262 (assoc-ref outputs "out"))))))))
263 (synopsis "PARI/GP, a computer algebra system for number theory")
264 (description
265 "PARI/GP is a widely used computer algebra system designed for fast
90a6d47c
AE
266computations in number theory (factorisations, algebraic number theory,
267elliptic curves...), but it also contains a large number of other useful
268functions to compute with mathematical entities such as matrices,
269polynomials, power series, algebraic numbers, etc., and a lot of
270transcendental functions.
271PARI is also available as a C library to allow for faster computations.")
67f39dd5
RW
272 (license license:gpl2+)
273 (home-page "https://pari.math.u-bordeaux.fr/")))
ed9f9a77 274
f854a8c1
AE
275(define-public gp2c
276 (package
277 (name "gp2c")
19c782b3 278 (version "0.0.12")
f854a8c1
AE
279 (source (origin
280 (method url-fetch)
281 (uri (string-append
eeb8b0e6 282 "https://pari.math.u-bordeaux.fr/pub/pari/GP2C/gp2c-"
f854a8c1 283 version ".tar.gz"))
324bdcd8
AE
284 (sha256
285 (base32
19c782b3 286 "039ip7qkwwv46wrcdrz7y12m30kazzkjr44kqbc0h137g4wzd7zf"))))
f854a8c1 287 (build-system gnu-build-system)
c67ccedd 288 (native-inputs `(("perl" ,perl)))
f854a8c1
AE
289 (inputs `(("pari-gp" ,pari-gp)))
290 (arguments
291 '(#:configure-flags
292 (list (string-append "--with-paricfg="
293 (assoc-ref %build-inputs "pari-gp")
294 "/lib/pari/pari.cfg"))))
295 (synopsis "PARI/GP, a computer algebra system for number theory")
296 (description
297 "PARI/GP is a widely used computer algebra system designed for fast
298computations in number theory (factorisations, algebraic number theory,
299elliptic curves...), but it also contains a large number of other useful
300functions to compute with mathematical entities such as matrices,
301polynomials, power series, algebraic numbers, etc., and a lot of
302transcendental functions.
303PARI is also available as a C library to allow for faster computations.
304
305GP2C, the GP to C compiler, translates GP scripts to PARI programs.")
9f51293c 306 (license license:gpl2)
eeb8b0e6 307 (home-page "https://pari.math.u-bordeaux.fr/")))
f854a8c1 308
eea7cd75
AE
309(define-public cmh
310 (package
311 (name "cmh")
099026df 312 (version "1.1.0")
eea7cd75
AE
313 (source (origin
314 (method url-fetch)
9673402d
LC
315 ;; Git repo at <https://gitlab.inria.fr/cmh/cmh>.
316 (uri (string-append "http://www.multiprecision.org/downloads/cmh-"
317 version ".tar.gz"))
eea7cd75
AE
318 (sha256
319 (base32
099026df 320 "1ws2yhzxmm2l5xqqqcjcimmg40f9qq5l9i6d4i5434an9v9s8531"))))
eea7cd75
AE
321 (build-system gnu-build-system)
322 (inputs
323 `(("gmp" ,gmp)
324 ("mpfr" ,mpfr)
325 ("mpc" ,mpc)
326 ("mpfrcx" ,mpfrcx)
099026df 327 ("fplll" ,fplll)
eea7cd75
AE
328 ("pari-gp" ,pari-gp)))
329 (synopsis "Igusa class polynomial computations")
330 (description
331 "The CMH software computes Igusa (genus 2) class polynomials, which
332parameterize the CM points in the moduli space of 2-dimensional abelian
333varieties, i.e. Jacobians of hyperelliptic curves.
334It can also be used to compute theta constants at arbitrary
335precision.")
336 (license license:gpl3+)
9673402d 337 (home-page "http://www.multiprecision.org/cmh/home.html")))
eea7cd75 338
7fc0e3db 339(define-public giac
57497c57 340 (package
7fc0e3db 341 (name "giac")
9a062ce9 342 (version "1.6.0-47")
a733253b
NG
343 (source
344 (origin
345 (method url-fetch)
346 ;; "~parisse/giac" is not used because the maintainer regularly
347 ;; overwrites the release tarball there, introducing a checksum
348 ;; mismatch every time. See
349 ;; <https://www-fourier.ujf-grenoble.fr/~parisse/debian/dists/stable/main/source/README>
350 (uri (string-append "https://www-fourier.ujf-grenoble.fr/"
351 "~parisse/debian/dists/stable/main/source/"
352 "giac_" version ".tar.gz"))
353 (sha256
9a062ce9 354 (base32 "15sgsr8l6njp5spagbqclqkdy3x7ra23wi6wvpc8vzlbivy3v43k"))))
57497c57
NG
355 (build-system gnu-build-system)
356 (arguments
af90cc45
NG
357 `(#:modules ((ice-9 ftw)
358 (guix build utils)
359 (guix build gnu-build-system))
360 #:phases
57497c57
NG
361 (modify-phases %standard-phases
362 (add-after 'unpack 'patch-bin-cp
90d5ec55 363 ;; Some Makefiles contain hard-coded "/bin/cp".
57497c57 364 (lambda _
07c3c3ba
NG
365 (substitute* (cons "micropython-1.12/xcas/Makefile"
366 (find-files "doc" "^Makefile"))
57497c57 367 (("/bin/cp") (which "cp")))
90d5ec55
NG
368 #t))
369 (add-after 'unpack 'disable-failing-test
370 ;; FIXME: Test failing. Not sure why.
371 (lambda _
372 (substitute* "check/Makefile.in"
373 (("chk_fhan11") ""))
af90cc45 374 #t))
9f73ac24 375 (add-after 'install 'fix-doc
af90cc45 376 (lambda* (#:key outputs #:allow-other-keys)
9f73ac24
NG
377 (let ((out (assoc-ref outputs "out")))
378 ;; Most French documentation has a non-commercial
379 ;; license, so we need to remove it.
380 (with-directory-excursion (string-append out "/share/giac/doc/fr")
381 (for-each delete-file-recursively
382 '("cascas" "casexo" "casgeo" "casrouge" "cassim"
383 "castor")))
384 ;; Remove duplicate documentation in
385 ;; "%out/share/doc/giac/", where Xcas does not expect
386 ;; to find it.
387 (delete-file-recursively (string-append out "/share/doc/giac"))
388 #t)))
389 (add-after 'install 'remove-unnecessary-executable
390 (lambda* (#:key outputs #:allow-other-keys)
391 (let ((out (assoc-ref outputs "out")))
392 (delete-file (string-append out "/bin/xcasnew"))
393 #t))))))
57497c57 394 (inputs
07c3c3ba 395 ;; TODO: Add libnauty, unbundle "libmicropython.a".
57497c57 396 `(("fltk" ,fltk)
885fe927 397 ("glpk" ,glpk-4)
57497c57
NG
398 ("gmp" ,gmp)
399 ("gsl" ,gsl)
400 ("lapack" ,lapack)
401 ("libao" ,ao)
4bd428a7 402 ("libjpeg" ,libjpeg-turbo)
57497c57 403 ("libpng" ,libpng)
6d3896b9 404 ("libsamplerate" ,libsamplerate)
57497c57 405 ("libx11" ,libx11)
99a00446 406 ("libxinerama" ,libxinerama)
57497c57
NG
407 ("libxft" ,libxft)
408 ("libxt" ,libxt)
409 ("mesa" ,mesa)
410 ("mpfi" ,mpfi)
411 ("mpfr" ,mpfr)
412 ("ntl" ,ntl)
413 ("perl" ,perl)
414 ("pari-gp" ,pari-gp)
9f73ac24
NG
415 ("tcsh" ,tcsh)))
416 (native-inputs
6d3896b9
NG
417 `(("bison" ,bison)
418 ("flex" ,flex)
1ceeaa5d 419 ("hevea" ,hevea)
07c3c3ba 420 ("python" ,python-wrapper)
6d3896b9 421 ("readline" ,readline)
a023ec6e 422 ("texlive" ,texlive-tiny)))
57497c57
NG
423 (home-page "https://www-fourier.ujf-grenoble.fr/~parisse/giac.html")
424 (synopsis "Computer algebra system")
425 (description
426 "Giac/Xcas is a computer algebra system. It has a compatibility mode for
427maple, mupad and the TI89. It is available as a standalone program (graphic
428or text interfaces) or as a C++ library.")
429 (license license:gpl3+)))
430
d7ab698a
AE
431(define-public flint
432 (package
433 (name "flint")
eefa30c1 434 (version "2.6.3")
a8139e97
TGR
435 (source
436 (origin
437 (method url-fetch)
438 (uri (string-append "http://flintlib.org/flint-" version ".tar.gz"))
439 (sha256
eefa30c1 440 (base32 "1qrf6hzbbmg7mhkhbb0bab8z2xpdnba5cj4kmmf72lzs0457a6nf"))))
d7ab698a 441 (build-system gnu-build-system)
d7c8bcc4
JK
442 (inputs
443 `(("ntl" ,ntl)))
df15d17d 444 (propagated-inputs
d7ab698a 445 `(("gmp" ,gmp)
df15d17d 446 ("mpfr" ,mpfr))) ; header files from both are included by flint/arith.h
d7ab698a 447 (arguments
fa0c1774 448 `(#:parallel-tests? #f ; seems to be necessary on arm
ad11974e 449 #:phases
91430de6 450 (modify-phases %standard-phases
d7c8bcc4
JK
451 (add-before 'configure 'newer-c++
452 (lambda _
453 (substitute* "configure"
454 (("-ansi") ""))
455 #t))
91430de6
AE
456 (replace 'configure
457 (lambda* (#:key inputs outputs #:allow-other-keys)
458 (let ((out (assoc-ref outputs "out"))
459 (gmp (assoc-ref inputs "gmp"))
d7c8bcc4
JK
460 (mpfr (assoc-ref inputs "mpfr"))
461 (ntl (assoc-ref inputs "ntl")))
fa0c1774
TGR
462 ;; Do not pass "--enable-fast-install", which makes the
463 ;; homebrew configure process fail.
50233d95 464 (invoke "./configure"
91430de6
AE
465 (string-append "--prefix=" out)
466 (string-append "--with-gmp=" gmp)
d7c8bcc4
JK
467 (string-append "--with-mpfr=" mpfr)
468 (string-append "--with-ntl=" ntl))
50233d95 469 #t))))))
d7ab698a
AE
470 (synopsis "Fast library for number theory")
471 (description
472 "FLINT is a C library for number theory. It supports arithmetic
473with numbers, polynomials, power series and matrices over many base
474rings, including multiprecision integers and rationals, integers
475modulo n, p-adic numbers, finite fields (prime and non-prime order)
476and real and complex numbers (via the Arb extension library).
477
478Operations that can be performed include conversions, arithmetic,
479GCDs, factoring, solving linear systems, and evaluating special
480functions. In addition, FLINT provides various low-level routines for
481fast arithmetic.")
eefa30c1 482 (license license:lgpl2.1+)
d7ab698a
AE
483 (home-page "http://flintlib.org/")))
484
6b8e8285
AE
485(define-public arb
486 (package
6aa54e23 487 (name "arb")
7dcf5296 488 (version "2.18.1")
6aa54e23
RW
489 (source (origin
490 (method git-fetch)
491 (uri (git-reference
b0e7b699 492 (url "https://github.com/fredrik-johansson/arb")
6aa54e23
RW
493 (commit version)))
494 (file-name (git-file-name name version))
495 (sha256
496 (base32
7dcf5296 497 "15fx3dcbzgwddw9p1nysmx0dbh058afv5m8cj5pdjkcmcl7kw7z9"))))
6aa54e23
RW
498 (build-system gnu-build-system)
499 (propagated-inputs
500 `(("flint" ,flint))) ; flint.h is included by arf.h
501 (inputs
502 `(("gmp" ,gmp)
503 ("mpfr" ,mpfr)))
504 (arguments
505 `(#:phases
506 (modify-phases %standard-phases
507 (replace 'configure
508 (lambda* (#:key inputs outputs #:allow-other-keys)
509 (let ((out (assoc-ref outputs "out"))
510 (flint (assoc-ref inputs "flint"))
511 (gmp (assoc-ref inputs "gmp"))
512 (mpfr (assoc-ref inputs "mpfr")))
faefa2ed
TGR
513 ;; Do not pass "--enable-fast-install", which makes the
514 ;; homebrew configure process fail.
6aa54e23
RW
515 (invoke "./configure"
516 (string-append "--prefix=" out)
517 (string-append "--with-flint=" flint)
518 (string-append "--with-gmp=" gmp)
519 (string-append "--with-mpfr=" mpfr))))))))
2f4dcff4 520 (home-page "https://arblib.org")
6aa54e23
RW
521 (synopsis "Arbitrary precision floating-point ball arithmetic")
522 (description
523 "Arb is a C library for arbitrary-precision floating-point ball
6b8e8285
AE
524arithmetic. It supports efficient high-precision computation with
525polynomials, power series, matrices and special functions over the
526real and complex numbers, with automatic, rigorous error control.")
2f4dcff4 527 (license license:lgpl2.1+)))
6b8e8285 528
1d6589db
AE
529(define-public python-flint
530 (package
531 (name "python-flint")
532 (version "0.3.0")
533 (source (origin
534 (method git-fetch)
535 (uri (git-reference
b0e7b699 536 (url "https://github.com/fredrik-johansson/python-flint")
1d6589db
AE
537 (commit version)))
538 (file-name (git-file-name name version))
539 (sha256
540 (base32
541 "1v0anazbj1cfi68nl2j6dbd31kgkc1563xmr0zk5xk3xj78569pw"))
542 (patches (search-patches "python-flint-includes.patch"))))
543 (build-system python-build-system)
544 (native-inputs
545 `(("python-cython" ,python-cython)))
546 (propagated-inputs
547 `(("python-numpy" ,python-numpy)))
548 (inputs
549 `(("arb" ,arb)
550 ("flint" ,flint)))
551 (synopsis "Python module wrapping ARB and FLINT")
552 (description
553 "Python-flint is a Python extension module wrapping FLINT
554(Fast Library for Number Theory) and Arb (arbitrary-precision ball
555arithmetic). It supports integers, rationals, modular integers,
556real and complex ball arithmetic, polynomials and matrices over all
557these types and other mathematical functions.")
558 (license license:expat)
f54b11b9 559 (home-page "https://fredrikj.net/python-flint/")))
1d6589db 560
14e6520e
AE
561(define-public ntl
562 (package
563 (name "ntl")
d96ad7fa 564 (version "11.4.3")
14e6520e
AE
565 (source (origin
566 (method url-fetch)
d96ad7fa 567 (uri (string-append "https://shoup.net/ntl/ntl-"
14e6520e 568 version ".tar.gz"))
d96ad7fa
JK
569 (sha256
570 (base32
571 "1lisp3064rch3jaa2wrhy1s9kll7i3ka3d0y6lj6l3l4ckfcrhdp"))
572 (modules '((guix build utils)))
573 (snippet
574 '(begin
575 (delete-file-recursively "src/libtool-origin")
576 #t))))
14e6520e
AE
577 (build-system gnu-build-system)
578 (native-inputs
579 `(("libtool" ,libtool)
580 ("perl" ,perl))) ; for configuration
14e6520e 581 (inputs
d96ad7fa
JK
582 `(("gmp" ,gmp)
583 ("gf2x" ,gf2x)))
14e6520e
AE
584 (arguments
585 `(#:phases
586 (modify-phases %standard-phases
587 (replace 'configure
d96ad7fa 588 (lambda* (#:key inputs outputs #:allow-other-keys)
14e6520e 589 (chdir "src")
d96ad7fa 590 (invoke "./configure"
14e6520e 591 (string-append "PREFIX=" (assoc-ref outputs "out"))
d96ad7fa
JK
592 (string-append "LIBTOOL=" (assoc-ref inputs "libtool") "/bin/libtool")
593 ;; set the library prefixes explicitly so that they get
594 ;; embedded in the .la file
595 (string-append "GMP_PREFIX=" (assoc-ref inputs "gmp"))
596 (string-append "GF2X_PREFIX=" (assoc-ref inputs "gf2x"))
14e6520e
AE
597 ;; Do not build especially for the build machine.
598 "NATIVE=off"
d96ad7fa
JK
599 "NTL_GF2X_LIB=on"
600 "SHARED=on"))))))
14e6520e
AE
601 (synopsis "C++ library for number theory")
602 (description
603 "NTL is a C++ library providing data structures and algorithms
604for manipulating signed, arbitrary length integers, and for vectors,
605matrices, and polynomials over the integers and over finite fields.")
606 (license license:gpl2+)
d96ad7fa 607 (home-page "https://shoup.net/ntl/")))
14e6520e 608
aae03c48
AE
609(define-public singular
610 (package
611 (name "singular")
33209660 612 (version "4.1.3p2")
f35c3bbb
KK
613 (source
614 (origin
615 (method url-fetch)
616 (uri
617 (string-append "http://www.mathematik.uni-kl.de/ftp/pub/Math/"
618 "Singular/SOURCES/"
619 (string-join
620 (string-split
621 (string-trim-right version #\p
622 0 (1- (string-length version)))
623 #\.) "-")
624 "/singular-" version ".tar.gz"))
625 (sha256 (base32
33209660 626 "1524yrni7gh0hir5ckridq671q5s6avfjdsdyahj51kzdl3wcypf"))))
aae03c48
AE
627 (build-system gnu-build-system)
628 (native-inputs
629 `(("doxygen" ,doxygen)
630 ("graphviz" ,graphviz)
631 ("perl" ,perl)))
632 (inputs
633 `(("cddlib" ,cddlib)
634 ("gmp" ,gmp)
635 ("flint" ,flint)
636 ("mpfr" ,mpfr)
637 ("ntl" ,ntl)
638 ("python" ,python-2)
639 ("readline" ,readline)))
640 (arguments
641 `(#:configure-flags
642 (list (string-append "--with-ntl="
643 (assoc-ref %build-inputs "ntl")))))
644 (synopsis "Computer algebra system for polynomial computations")
645 (description
646 "Singular is a computer algebra system for polynomial computations,
647with special emphasis on commutative and non-commutative algebra, algebraic
648geometry and singularity theory.")
649 ;; Singular itself is dual licensed gpl2 or gpl3, but some of the
650 ;; libraries with which it links are licensed under lgpl3+, so the
651 ;; combined work becomes gpl3. See COPYING in the source code.
652 (license license:gpl3)
ac93e583 653 (home-page "https://www.singular.uni-kl.de/index.php")))
aae03c48 654
57c9c349
AE
655(define-public gmp-ecm
656 (package
657 (name "gmp-ecm")
7d15cf17 658 (version "7.0.4")
57c9c349 659 (source (origin
7d15cf17 660 (method url-fetch)
56bfc71f
AE
661 (uri
662 (let ((hash "00c4c691a1ef8605b65bdf794a71539d"))
663 (string-append "https://gitlab.inria.fr/zimmerma/ecm/"
664 "uploads/" hash "/ecm-" version
665 ".tar.gz")))
7d15cf17
TGR
666 (sha256 (base32
667 "0hxs24c2m3mh0nq1zz63z3sb7dhy1rilg2s1igwwcb26x3pb7xqc"))))
57c9c349
AE
668 (build-system gnu-build-system)
669 (inputs
670 `(("gmp" ,gmp)))
671 (arguments
672 `(#:configure-flags '("--enable-shared"
673 ;; Disable specific assembly routines, which depend
674 ;; on the subarchitecture of the build machine,
675 ;; and use gmp instead.
676 "--disable-asm-redc")))
677 (synopsis "Integer factorization library using the elliptic curve method")
678 (description
679 "GMP-ECM factors integers using the elliptic curve method (ECM) as well
680as the P-1 and P+1 algorithms. It provides a library and a stand-alone
681binary.")
682 ;; Most files are under lgpl3+, but some are under gpl3+ or gpl2+,
683 ;; so the combined work is under gpl3+.
684 (license license:gpl3+)
685 (home-page "http://ecm.gforge.inria.fr/")))
686
ed9f9a77
LC
687(define-public bc
688 (package
689 (name "bc")
f71f29ca 690 (version "1.07.1")
ed9f9a77
LC
691 (source (origin
692 (method url-fetch)
693 (uri (string-append "mirror://gnu/bc/bc-" version ".tar.gz"))
694 (sha256
695 (base32
06b2bc55
MO
696 "0amh9ik44jfg66csyvf4zz1l878c4755kjndq9j0270akflgrbb2"))
697 (patches (search-patches "bc-fix-cross-compilation.patch"))))
ed9f9a77 698 (build-system gnu-build-system)
f71f29ca 699 (native-inputs
06b2bc55
MO
700 `(("automake" ,automake)
701 ("autoconf" ,autoconf)
702 ("ed" ,ed)
f71f29ca
MB
703 ("flex" ,flex)
704 ("texinfo" ,texinfo)))
ed9f9a77 705 (arguments
f71f29ca 706 '(#:configure-flags
06b2bc55
MO
707 (list "--with-readline")
708 #:phases
709 (modify-phases %standard-phases
710 (add-after 'unpack 'autogen
711 (lambda _
712 (invoke "autoreconf" "-vif"))))))
6fd52309 713 (home-page "https://www.gnu.org/software/bc/")
f50d2669 714 (synopsis "Arbitrary precision numeric processing language")
ed9f9a77 715 (description
a22dc0c4
LC
716 "bc is an arbitrary precision numeric processing language. It includes
717an interactive environment for evaluating mathematical statements. Its
718syntax is similar to that of C, so basic usage is familiar. It also includes
719\"dc\", a reverse-polish calculator.")
9f51293c 720 (license license:gpl2+)))
37e6cdcd 721
2a9b10c7
RW
722;; The original kiss-fft does not have a complete build system and does not
723;; build any shared libraries. This is a fork used by Extempore.
724(define-public kiss-fft-for-extempore
725 (package
726 (name "kiss-fft-for-extempore")
727 (version "1.3.0")
728 (source (origin
9774fac4
RW
729 (method git-fetch)
730 (uri (git-reference
b0e7b699 731 (url "https://github.com/extemporelang/kiss_fft")
9774fac4
RW
732 (commit version)))
733 (file-name (git-file-name name version))
2a9b10c7
RW
734 (sha256
735 (base32
9774fac4 736 "0jasbmqy4wkqrqx3w64s1dfmj34875xmsl72mb26aa4hpyn14bi2"))))
2a9b10c7
RW
737 (build-system cmake-build-system)
738 (arguments `(#:tests? #f)) ; no tests included
39162ee4
RW
739 ;; Extempore refuses to build on architectures other than x86_64
740 (supported-systems '("x86_64-linux"))
2a9b10c7
RW
741 (home-page "https://github.com/extemporelang/kiss_fft")
742 (synopsis "Mixed-radix Fast Fourier Transform")
743 (description
744 "Kiss FFT attempts to be a reasonably efficient, moderately useful FFT
745that can use fixed or floating data types and can easily be incorporated into
746a C program.")
747 (license license:bsd-3)))
748
37e6cdcd
LC
749(define-public fftw
750 (package
751 (name "fftw")
bdb74478 752 (version "3.3.8")
37e6cdcd
LC
753 (source (origin
754 (method url-fetch)
755 (uri (string-append "ftp://ftp.fftw.org/pub/fftw/fftw-"
756 version".tar.gz"))
757 (sha256
758 (base32
bdb74478 759 "00z3k8fq561wq2khssqg0kallk0504dzlx989x3vvicjdqpjc4v1"))))
37e6cdcd
LC
760 (build-system gnu-build-system)
761 (arguments
65bb2279 762 `(#:configure-flags
69d5909e
MW
763 '("--enable-shared" "--enable-openmp" "--enable-threads"
764 ,@(let ((system (or (%current-target-system) (%current-system))))
765 ;; Enable SIMD extensions for codelets. See details at:
766 ;; <http://fftw.org/fftw3_doc/Installation-on-Unix.html>.
767 (cond
768 ((string-prefix? "x86_64" system)
769 '("--enable-sse2" "--enable-avx" "--enable-avx2"
770 "--enable-avx512" "--enable-avx-128-fma"))
771 ((string-prefix? "i686" system)
772 '("--enable-sse2"))
773 ((string-prefix? "aarch64" system)
774 ;; Note that fftw supports NEON on 32-bit ARM only when
775 ;; compiled for single-precision.
776 '("--enable-neon"))
777 (else
778 '())))
65bb2279
EB
779 ;; By default '-mtune=native' is used. However, that may cause the
780 ;; use of ISA extensions (e.g. AVX) that are not necessarily
781 ;; available on the user's machine when that package is built on a
782 ;; different machine.
783 "ax_cv_c_flags__mtune_native=no")))
37e6cdcd
LC
784 (native-inputs `(("perl" ,perl)))
785 (home-page "http://fftw.org")
786 (synopsis "Computing the discrete Fourier transform")
787 (description
788 "FFTW is a C subroutine library for computing the discrete Fourier
789transform (DFT) in one or more dimensions, of arbitrary input size, and of
790both real and complex data (as well as of even/odd data---i.e. the discrete
791cosine/ sine transforms or DCT/DST).")
9f51293c 792 (license license:gpl2+)))
7569c5cb
EB
793
794(define-public fftwf
795 (package (inherit fftw)
796 (name "fftwf")
797 (arguments
798 (substitute-keyword-arguments (package-arguments fftw)
69d5909e
MW
799 ((#:configure-flags fftw-configure-flags)
800 `(cons* "--enable-single"
801 ,@(if (string-prefix? "arm" (or (%current-target-system)
802 (%current-system)))
803 ;; fftw supports NEON on 32-bit ARM only when compiled
804 ;; for single-precision, so add it here.
805 '("--enable-neon")
806 '())
807 ,fftw-configure-flags))))
7569c5cb
EB
808 (description
809 (string-append (package-description fftw)
810 " Single-precision version."))))
e5c66f8c
EB
811
812(define-public fftw-openmpi
813 (package (inherit fftw)
814 (name "fftw-openmpi")
815 (inputs
816 `(("openmpi" ,openmpi)
817 ,@(package-inputs fftw)))
818 (arguments
819 (substitute-keyword-arguments (package-arguments fftw)
820 ((#:configure-flags cf)
eb6785cf
EB
821 `(cons "--enable-mpi" ,cf))
822 ((#:phases phases '%standard-phases)
823 `(modify-phases ,phases
824 (add-before 'check 'mpi-setup
825 ,%openmpi-setup)))))
e5c66f8c
EB
826 (description
827 (string-append (package-description fftw)
828 " With OpenMPI parallelism support."))))
8f4b1dfb 829
c8d99608
RW
830(define-public java-la4j
831 (package
832 (name "java-la4j")
833 (version "0.6.0")
834 (source (origin
835 (method git-fetch)
836 (uri (git-reference
b0e7b699 837 (url "https://github.com/vkostyukov/la4j")
c8d99608
RW
838 (commit version)))
839 (file-name (string-append name "-" version "-checkout"))
840 (sha256
841 (base32
842 "1qir8dr978cfvz9k12m2kbdwpyf6cqdf1d0ilb7lnkhbgq5i53w3"))))
843 (build-system ant-build-system)
844 (arguments
845 `(#:jar-name "la4j.jar"
846 #:jdk ,icedtea-8
847 #:test-exclude (list "**/Abstract*.java"
848 "**/MatrixTest.java"
849 "**/DenseMatrixTest.java"
850 "**/SparseMatrixTest.java"
851 "**/VectorTest.java"
852 "**/SparseVectorTest.java"
853 "**/DenseVectorTest.java")))
854 (native-inputs
855 `(("java-junit" ,java-junit)
856 ("java-hamcrest-core" ,java-hamcrest-core)))
857 (home-page "http://la4j.org/")
858 (synopsis "Java library that provides Linear Algebra primitives and algorithms")
859 (description "The la4j library is a Java library that provides Linear
860Algebra primitives (matrices and vectors) and algorithms. The key features of
861the la4j library are:
862
863@itemize
864@item No dependencies and tiny size
865@item Fluent object-oriented/functional API
866@item Sparse (CRS, CCS) and dense (1D/2D arrays) matrices
867@item Linear systems solving (Gaussian, Jacobi, Zeidel, Square Root, Sweep and other)
868@item Matrices decomposition (Eigenvalues/Eigenvectors, SVD, QR, LU, Cholesky and other)
869@item MatrixMarket/CSV IO formats support for matrices and vectors
870@end itemize\n")
871 (license license:asl2.0)))
872
24074b0b
RW
873(define-public java-jlargearrays
874 (package
875 (name "java-jlargearrays")
876 (version "1.6")
877 (source (origin
878 (method url-fetch)
9f5eeb87
BH
879 (uri (string-append "https://repo1.maven.org/maven2/"
880 "pl/edu/icm/JLargeArrays/"
24074b0b
RW
881 version "/JLargeArrays-" version
882 "-sources.jar"))
883 (file-name (string-append name "-" version ".jar"))
884 (sha256
885 (base32
886 "0v05iphpxbjnd7f4jf1rlqq3m8hslhcm0imdbsgxr20pi3xkaf2a"))))
887 (build-system ant-build-system)
888 (arguments
889 `(#:jar-name "jlargearrays.jar"
890 #:tests? #f ; tests are not included in the release archive
891 #:jdk ,icedtea-8))
892 (propagated-inputs
893 `(("java-commons-math3" ,java-commons-math3)))
894 (home-page "https://gitlab.com/ICM-VisLab/JLargeArrays")
895 (synopsis "Library of one-dimensional arrays that can store up to 263 elements")
896 (description "JLargeArrays is a Java library of one-dimensional arrays
897that can store up to 263 elements.")
898 (license license:bsd-2)))
899
4e92911c
RW
900(define-public java-jtransforms
901 (package
902 (name "java-jtransforms")
903 (version "3.1")
904 (source (origin
905 (method url-fetch)
4c877704
BH
906 (uri (string-append "https://repo1.maven.org/maven2/"
907 "com/github/wendykierp/JTransforms/"
4e92911c
RW
908 version "/JTransforms-" version "-sources.jar"))
909 (sha256
910 (base32
911 "1haw5m8shv5srgcpwkl853dz8bv6h90bzlhcps6mdpb4cixjirsg"))))
912 (build-system ant-build-system)
913 (arguments
914 `(#:jar-name "jtransforms.jar"
915 #:tests? #f ; tests are not included in the release archive
916 #:jdk ,icedtea-8))
917 (propagated-inputs
918 `(("java-commons-math3" ,java-commons-math3)
919 ("java-jlargearrays" ,java-jlargearrays)))
920 (home-page "https://github.com/wendykierp/JTransforms")
921 (synopsis "Multithreaded FFT library written in pure Java")
922 (description "JTransforms is a multithreaded FFT library written in pure
923Java. Currently, four types of transforms are available: @dfn{Discrete
924Fourier Transform} (DFT), @dfn{Discrete Cosine Transform} (DCT), @dfn{Discrete
925Sine Transform} (DST) and @dfn{Discrete Hartley Transform} (DHT).")
926 (license license:bsd-2)))
927
feba2c97
VL
928(define-public lmfit
929 (package
930 (name "lmfit")
931 (version "8.2.2")
932 (source (origin
933 (method git-fetch)
934 (uri (git-reference
935 (url "https://jugit.fz-juelich.de/mlz/lmfit.git")
936 (commit (string-append "v" version))))
937 (file-name (git-file-name name version))
938 (sha256
939 (base32
940 "00bch77a6qgnw6vzsjn2a42n8n683ih3xm0wpr454jxa15hw78vf"))))
941 (build-system cmake-build-system)
942 (native-inputs
943 `(("perl" ,perl))) ; for pod2man
944 (home-page "https://jugit.fz-juelich.de/mlz/lmfit")
945 (synopsis "Levenberg-Marquardt minimization and least-squares fitting")
946 (description "lmfit is a C library for Levenberg-Marquardt least-squares
947minimization and curve fitting. It is mature code, based on decades-old
948algorithms from the FORTRAN library MINPACK.")
949 (license license:bsd-2)))
950
d0337a22
VM
951(define-public symengine
952 (package
953 (name "symengine")
954 (version "0.6.0")
955 (source
956 (origin
af0307a0
NG
957 (method git-fetch)
958 (uri (git-reference
b0e7b699 959 (url "https://github.com/symengine/symengine")
af0307a0
NG
960 (commit (string-append "v" version))))
961 (file-name (git-file-name name version))
962 (sha256
963 (base32 "129iv9maabmb42ylfdv0l0g94mcbf3y4q3np175008rcqdr8z6h1"))))
d0337a22
VM
964 (build-system cmake-build-system)
965 (arguments
af0307a0
NG
966 '(#:configure-flags
967 ;; These are the suggested build options in the README.
d0337a22
VM
968 '("-DCMAKE_BUILD_TYPE=Release"
969 "-DWITH_GMP=on"
970 "-DWITH_MPFR=on"
971 "-DWITH_MPC=on"
972 "-DINTEGER_CLASS=flint"
d0337a22 973 "-DWITH_SYMENGINE_THREAD_SAFE=on"
af0307a0 974 "-DBUILD_SHARED_LIBS=on"))) ;also build libsymengine
d0337a22
VM
975 (inputs
976 `(("flint" ,flint)
977 ("gmp" ,gmp)
978 ("mpc" ,mpc)
979 ("mpfr" ,mpfr)))
980 (home-page "https://github.com/symengine/symengine")
981 (synopsis "Fast symbolic manipulation library")
af0307a0
NG
982 (description
983 "SymEngine is a standalone fast C++ symbolic manipulation library.
984Optional thin wrappers allow usage of the library from other languages.")
985 (license (list license:expat ;SymEngine
986 license:bsd-3)))) ;3rd party code
d0337a22 987
8f4b1dfb
LC
988(define-public eigen
989 (package
990 (name "eigen")
2d2ac742 991 (version "3.3.8")
8f4b1dfb
LC
992 (source (origin
993 (method url-fetch)
57797b85
EF
994 (uri (list
995 (string-append "https://bitbucket.org/eigen/eigen/get/"
996 version ".tar.bz2")
997 (string-append "mirror://debian/pool/main/e/eigen3/eigen3_"
998 version ".orig.tar.bz2")))
8f4b1dfb
LC
999 (sha256
1000 (base32
2d2ac742 1001 "1vxrsncfnkyq6gwxpsannpryp12mk7lc8f42ybvz3saf7icwc582"))
2abcc935 1002 (file-name (string-append name "-" version ".tar.bz2"))
ba902a15
TGR
1003 (patches (search-patches "eigen-remove-openmp-error-counting.patch"
1004 "eigen-stabilise-sparseqr-test.patch"))
8f4b1dfb
LC
1005 (modules '((guix build utils)))
1006 (snippet
1007 ;; There are 3 test failures in the "unsupported" directory,
1008 ;; but maintainers say it's a known issue and it's unsupported
1009 ;; anyway, so just skip them.
1137d85b 1010 '(begin
44884a9d
RW
1011 (substitute* "unsupported/CMakeLists.txt"
1012 (("add_subdirectory\\(test.*")
1013 "# Do not build the tests for unsupported features.\n"))
6cbee49d 1014 #t))))
8f4b1dfb
LC
1015 (build-system cmake-build-system)
1016 (arguments
1017 '(;; Turn off debugging symbols to save space.
1018 #:build-type "Release"
1019
354f4fe2 1020 #:phases (modify-phases %standard-phases
ef8742ea 1021 (replace 'check
354f4fe2 1022 (lambda _
354f4fe2
LC
1023 (let* ((cores (parallel-job-count))
1024 (dash-j (format #f "-j~a" cores)))
1137d85b 1025 (setenv "EIGEN_SEED" "1") ;for reproducibility
ef8742ea
LC
1026 ;; First build the tests, in parallel. See
1027 ;; <http://eigen.tuxfamily.org/index.php?title=Tests>.
fbe9c80f 1028 (invoke "make" "buildtests" dash-j)
8f4b1dfb 1029
fbe9c80f
TGR
1030 ;; Then run 'CTest' with -V so we get more
1031 ;; details upon failure.
1032 (invoke "ctest" "-V" dash-j)))))))
eeb8b0e6 1033 (home-page "https://eigen.tuxfamily.org")
8f4b1dfb
LC
1034 (synopsis "C++ template library for linear algebra")
1035 (description
1036 "Eigen is a C++ template library for linear algebra: matrices, vectors,
1037numerical solvers, and related algorithms. It provides an elegant API based
1038on \"expression templates\". It is versatile: it supports all matrix sizes,
1039all standard numeric types, various matrix decompositions and geometry
1040features, and more.")
1041
1042 ;; Most of the code is MPLv2, with a few files under LGPLv2.1+ or BSD-3.
1043 ;; See 'COPYING.README' for details.
9f51293c 1044 (license license:mpl2.0)))
70770b93 1045
697eb65d
RW
1046(define-public eigen-for-tensorflow
1047 (let ((changeset "fd6845384b86")
1048 (revision "1"))
1049 (package (inherit eigen)
1050 (name "eigen-for-tensorflow")
1051 (version (string-append "3.3.5-" revision "." changeset))
1052 (source (origin
1053 (method hg-fetch)
1054 (uri (hg-reference
1055 (url "https://bitbucket.org/eigen/eigen")
1056 (changeset changeset)))
1057 (sha256
1058 (base32
1059 "12cwgah63wqwb66xji048hcxc1z5zjg8a7701zlia5zbilnnk1n5"))
1060 (file-name (string-append name "-" version "-checkout"))
1061 (modules '((guix build utils)))
1062 (snippet
1063 ;; There are 3 test failures in the "unsupported" directory,
1064 ;; but maintainers say it's a known issue and it's unsupported
1065 ;; anyway, so just skip them.
1066 '(begin
1067 (substitute* "unsupported/CMakeLists.txt"
1068 (("add_subdirectory\\(test.*")
1069 "# Do not build the tests for unsupported features.\n"))
1070 #t)))))))
1071
70770b93
FT
1072(define-public xtensor
1073 (package
1074 (name "xtensor")
4e6568ce 1075 (version "0.20.10")
70770b93 1076 (source (origin
e1ecaa83
KK
1077 (method git-fetch)
1078 (uri (git-reference
7c30e234 1079 (url "https://github.com/xtensor-stack/xtensor")
e1ecaa83 1080 (commit version)))
70770b93
FT
1081 (sha256
1082 (base32
4e6568ce 1083 "1fmv2hpx610xwhxrndfsfvlbqfyk4l3gi5q5d7pa9m82kblxjj9l"))
e1ecaa83 1084 (file-name (git-file-name name version))))
70770b93
FT
1085 (build-system cmake-build-system)
1086 (native-inputs
1087 `(("googletest" ,googletest)
1088 ("xtl" ,xtl)))
1089 (arguments
1090 `(#:configure-flags
1091 '("-DBUILD_TESTS=ON")
1092 #:test-target "xtest"))
7c30e234 1093 (home-page "https://xtensor.readthedocs.io/en/latest/")
70770b93
FT
1094 (synopsis "C++ tensors with broadcasting and lazy computing")
1095 (description "xtensor is a C++ library meant for numerical analysis with
1096multi-dimensional array expressions.
1097
1098xtensor provides:
1099@itemize
1100@item an extensible expression system enabling lazy broadcasting.
1101@item an API following the idioms of the C++ standard library.
1102@item tools to manipulate array expressions and build upon xtensor.
1103@end itemize")
1104 (license license:bsd-3)))
3f074a21
AE
1105
1106(define-public gap
1107 (package
1108 (name "gap")
42ed5317 1109 (version "4.11.0")
3f074a21
AE
1110 (source
1111 (origin
1112 (method url-fetch)
42ed5317 1113 (uri (string-append "https://files.gap-system.org/gap-"
3f074a21
AE
1114 (version-major+minor version)
1115 "/tar.bz2/gap-"
1116 version
1117 ".tar.bz2"))
1118 (sha256
42ed5317 1119 (base32 "00l6hvy4iggnlrib4vp805sxdm3j7n3hzpv5zs9hbiiavh80l1xz"))
3f074a21
AE
1120 (modules '((guix build utils) (ice-9 ftw) (srfi srfi-1)))
1121 (snippet
1122 '(begin
1123 ;; Delete the external gmp and zlib libraries
1124 ;; and a subdirectory not needed for our build.
1125 (for-each delete-file-recursively
1126 '("extern" "hpcgap"))
1127 ;; Delete a failing test.
1128 ;; FIXME: This might be fixed in the next release, see
1129 ;; https://github.com/gap-system/gap/issues/3292
1130 (delete-file "tst/testinstall/dir.tst")
42ed5317
AE
1131 ;; Delete all packages except for a fixed list,
1132 ;; given by their names up to version numbers.
3f074a21
AE
1133 (with-directory-excursion "pkg"
1134 (for-each delete-file-recursively
42ed5317
AE
1135 (lset-difference
1136 (lambda (all keep) (string-prefix? keep all))
1137 (scandir ".")
3f074a21
AE
1138 '("." ".."
1139 ;; Necessary packages.
42ed5317
AE
1140 "GAPDoc-"
1141 "primgrp-"
1142 "SmallGrp-" ; artistic2.0
1143 "transgrp" ; artistic2.0 for data,
1144 ; gpl2 or gpl3 for code
1145 ;; Recommended package.
1146 "io-" ; gpl3+
3f074a21
AE
1147 ;; Optional packages, searched for at start,
1148 ;; and their depedencies.
42ed5317
AE
1149 "alnuth-"
1150 "autpgrp-"
1151 "crisp-" ; bsd-2
1152 "ctbllib" ; gpl3+, clarified in the next release;
1153 ; see
1154 ; http://www.math.rwth-aachen.de/~Thomas.Breuer/ctbllib/README.md
1155 "FactInt-"
3f074a21 1156 "fga"
42ed5317
AE
1157 "irredsol-" ; bsd-2
1158 "laguna-"
1159 "polenta-"
1160 "polycyclic-"
1161 "radiroot-"
1162 "resclasses-"
1163 "sophus-"
1164 "tomlib-"
1165 "utils-"))))
3f074a21
AE
1166 #t))))
1167 (build-system gnu-build-system)
1168 (inputs
1169 `(("gmp" ,gmp)
42ed5317 1170 ("readline" ,readline)
3f074a21
AE
1171 ("zlib" ,zlib)))
1172 (arguments
bf95a142
AE
1173 `(#:modules ((ice-9 ftw)
1174 (srfi srfi-26)
1175 (guix build gnu-build-system)
1176 (guix build utils))
1177 #:phases
3f074a21
AE
1178 (modify-phases %standard-phases
1179 (add-after 'build 'build-packages
1180 ;; Compile all packages that have not been deleted by the
1181 ;; code snippet above.
1182 (lambda _
1183 (setenv "CONFIG_SHELL" (which "bash"))
1184 (with-directory-excursion "pkg"
1185 (invoke "../bin/BuildPackages.sh")
1186 #t)))
1187 (add-after 'build-packages 'build-doc
1188 ;; The documentation is bundled, but we create it from source.
1189 (lambda _
1190 (with-directory-excursion "doc"
1191 (invoke "./make_doc"))
1192 #t))
3f074a21
AE
1193 (replace 'install
1194 (lambda* (#:key outputs #:allow-other-keys)
1195 (let* ((out (assoc-ref outputs "out"))
1196 (bin (string-append out "/bin"))
1197 (prog (string-append bin "/gap"))
1198 (prog-real (string-append bin "/.gap-real"))
42ed5317 1199 (share (string-append out "/share/gap")))
3f074a21
AE
1200 ;; Install only the gap binary; the gac compiler is left
1201 ;; for maybe later. "Wrap" it in a shell script that calls
1202 ;; the binary with the correct parameter.
42ed5317
AE
1203 ;; The make target install-bin is supposed to do that, but
1204 ;; is not currently working.
3f074a21
AE
1205 (mkdir-p bin)
1206 (copy-file "gap" prog-real)
1207 (call-with-output-file prog
1208 (lambda (port)
1209 (format port
1210 "#!~a~%exec ~a -l ~a \"$@\"~%"
1211 (which "bash")
1212 prog-real
1213 share)))
1214 (chmod prog #o755)
42ed5317
AE
1215 ;; Install the headers and library, which are needed by Sage.
1216 (invoke "make" "install-headers")
1217 (invoke "make" "install-libgap")
3f074a21
AE
1218 ;; Remove information on the build directory from sysinfo.gap.
1219 (substitute* "sysinfo.gap"
1220 (("GAP_BIN_DIR=\".*\"") "GAP_BIN_DIR=\"\"")
1221 (("GAP_LIB_DIR=\".*\"") "GAP_LIB_DIR=\"\"")
1222 (("GAP_CPPFLAGS=\".*\"") "GAP_CPPFLAGS=\"\""))
42ed5317
AE
1223 (invoke "make" "install-gaproot")
1224 ;; Copy the directory of compiled packages; the make target
1225 ;; install-pkg is currently empty.
1226 (copy-recursively "pkg" (string-append share "/pkg")))
3f074a21
AE
1227 #t)))))
1228 (home-page "https://www.gap-system.org/")
1229 (synopsis
1230 "System for computational group theory")
1231 (description
1232 "GAP is a system for computational discrete algebra, with particular
1233emphasis on computational group theory. It provides a programming language,
1234a library of thousands of functions implementing algebraic algorithms
1235written in the GAP language as well as large data libraries of algebraic
1236objects.")
1237 ;; Some packages have different licenses (effectively forcing the
1238 ;; combined work to be licensed as gpl3+); if this is the case, this
1239 ;; is mentioned above next to their name.
1240 ;; Some packages have no license mentioned explicitly; supposedly this
1241 ;; means that the gpl2+ licence of GAP itself applies, but to be on the
1242 ;; safe side, we drop them for now.
1243 (license license:gpl2+)))
f0fbb31d
AE
1244
1245(define-public givaro
1246 (package
1247 (name "givaro")
1248 (version "4.1.1")
1249 (source (origin
1250 (method git-fetch)
1251 (uri (git-reference
1252 (url "https://github.com/linbox-team/givaro")
1253 (commit (string-append "v" version))))
1254 (file-name (git-file-name name version))
1255 (sha256
1256 (base32
1257 "11wz57q6ijsvfs5r82masxgr319as92syi78lnl9lgdblpc6xigk"))))
1258 (build-system gnu-build-system)
1259 (native-inputs
1260 `(("autoconf" ,autoconf)
1261 ("automake" ,automake)
1262 ("libtool" ,libtool)))
1263 (propagated-inputs
1264 `(("gmp" ,gmp))) ; gmp++.h includes gmpxx.h
f0fbb31d
AE
1265 (synopsis "Algebraic computations with exact rings and fields")
1266 (description
1267 "Givaro is a C++ library implementing the basic arithmetic of various
1268algebraic objects: prime fields, extension fields, finite fields, finite
1269rings, polynomials, algebraic numbers, arbitrary precision integers and
1270rationals (C++ wrappers over gmp), fixed precision integers. It also
1271provides data-structures and templated classes for the manipulation of
1272compound objects, such as vectors, matrices and univariate polynomials.")
1273 (license license:cecill-b)
1274 (home-page "https://github.com/linbox-team/givaro")))
4bf9cb40
AE
1275
1276(define-public fflas-ffpack
1277 (package
1278 (name "fflas-ffpack")
1279 (version "2.4.3")
1280 (source (origin
1281 (method git-fetch)
1282 (uri (git-reference
1283 (url "https://github.com/linbox-team/fflas-ffpack")
1284 (commit version)))
1285 (file-name (git-file-name name version))
1286 (sha256
1287 (base32
1288 "1ynbjd72qrwp0b4kpn0p5d7gddpvj8dlb5fwdxajr5pvkvi3if74"))))
1289 (build-system gnu-build-system)
1290 (native-inputs
1291 `(("autoconf" ,autoconf)
1292 ("automake" ,automake)
1293 ("libtool" ,libtool)
1294 ("pkg-config" ,pkg-config)))
1295 (inputs
1296 `(("openblas" ,openblas)))
1297 (propagated-inputs
1298 `(("givaro" ,givaro))) ; required according to the .pc file
1299 (arguments
1300 `(#:configure-flags
1301 (list (string-append "--with-blas-libs="
1302 (assoc-ref %build-inputs "openblas")
778d6b52 1303 "/lib/libopenblas.so"))))
4bf9cb40
AE
1304 (synopsis "C++ library for linear algebra over finite fields")
1305 (description
1306 "FFLAS-FFPACK is a C++ template library for basic linear algebra
1307operations over a finite field.
1308FFLAS (Finite Field Linear Algebra Subprograms) provides the implementation
1309of a subset of routines of the numerical BLAS; it also supports sparse
1310matrix-vector products.
1311FFPACK (Finite Field Linear Algebra Package) is inspired by the LAPACK
1312library to provide functionalities of higher level, using the kernel
1313of a BLAS. Additionally, it provides routines specific to exact linear
1314algebra, such as the row echelon form.")
1315 (license license:lgpl2.1+)
1316 (home-page "https://linbox-team.github.io/fflas-ffpack/")))
a612f866
AE
1317
1318(define-public linbox
1319 (package
1320 (name "linbox")
1321 (version "1.6.3")
1322 (source (origin
1323 (method git-fetch)
1324 (uri (git-reference
1325 (url "https://github.com/linbox-team/linbox")
1326 (commit (string-append "v" version))))
1327 (file-name (git-file-name name version))
1328 (sha256
1329 (base32
781d03f1
JK
1330 "10j6dspbsq7d2l4q3y0c1l1xwmaqqba2fxg59q5bhgk9h5d7q571"))
1331 (patches (search-patches "linbox-fix-pkgconfig.patch"))))
a612f866
AE
1332 (build-system gnu-build-system)
1333 (native-inputs
1334 `(("autoconf" ,autoconf)
1335 ("automake" ,automake)
1336 ("libtool" ,libtool)
1337 ("pkg-config" ,pkg-config)))
781d03f1 1338 (propagated-inputs
a612f866 1339 `(("fflas-ffpack" ,fflas-ffpack)))
a612f866
AE
1340 (synopsis "C++ library for linear algebra over exact rings")
1341 (description
1342 "LinBox is a C++ template library for exact linear algebra computation
1343with dense, sparse, and structured matrices over the integers and over
1344finite fields.")
1345 (license license:lgpl2.1+)
1346 (home-page "https://linbox-team.github.io/linbox/")))
37edfb0f
AE
1347
1348(define-public m4ri
1349 (package
1350 (name "m4ri")
1351 (version "20140914")
1352 (source (origin
1353 (method git-fetch)
1354 (uri (git-reference
1355 (url "https://bitbucket.org/malb/m4ri")
1356 (commit (string-append "release-" version))))
1357 (file-name (git-file-name name version))
1358 (sha256
1359 (base32
1360 "0xfg6pffbn8r1s0y7bn9b8i55l00d41dkmhrpf7pwk53qa3achd3"))))
1361 (build-system gnu-build-system)
1362 (native-inputs
1363 `(("autoconf" ,autoconf)
1364 ("automake" ,automake)
1365 ("libtool" ,libtool)
1366 ("pkg-config" ,pkg-config)))
1367 (inputs
1368 `(("libpng" ,libpng)))
1369 (synopsis "Arithmetic of dense matrices over F_2")
1370 (description "M4RI is a library for fast arithmetic with dense matrices
1371over F2. The name M4RI comes from the first implemented algorithm: The
1372Method of the Four Russians inversion algorithm published by Gregory Bard.
1373This algorithm in turn is named after the Method of the Four Russians
1374multiplication algorithm.")
1375 (license license:gpl2+)
1376 (home-page "https://bitbucket.org/malb/m4ri/")))
ab398380 1377
75a73bb0
NG
1378(define-public symmetrica
1379 (package
1380 (name "symmetrica")
1381 (version "2.0")
1382 (source (origin
1383 (method url-fetch/tarbomb)
1384 (uri (let ((v (string-join (string-split version #\.) "_")))
1385 (string-append "http://www.algorithm.uni-bayreuth.de/"
1386 "en/research/SYMMETRICA/"
1387 "SYM" v "_tar.gz")))
1388 (sha256
1389 (base32
1390 "1qhfrbd5ybb0sinl9pad64rscr08qvlfzrzmi4p4hk61xn6phlmz"))
1391 ;; Taken from <https://git.sagemath.org/sage.git/plain/build/pkgs/symmetrica/patches/>
1392 (patches (search-patches "symmetrica-bruch.patch"
1393 "symmetrica-int32.patch"
1394 "symmetrica-return_values.patch"
1395 "symmetrica-sort_sum_rename.patch"))))
1396 (build-system gnu-build-system)
1397 (arguments
1398 `(#:tests? #f ;no test
1399 #:phases
1400 (modify-phases %standard-phases
1401 (add-after 'unpack 'fix-makefile
1402 (lambda _
1403 (substitute* "makefile"
e6eafd42 1404 (("cc -c") "gcc -c -fPIC"))
75a73bb0
NG
1405 #t))
1406 (add-after 'fix-makefile 'turn-off-banner
1407 (lambda _
1408 (substitute* "de.c"
1409 (("(INT no_banner = )FALSE" _ pre) (string-append pre "TRUE")))
1410 #t))
1411 (delete 'configure) ;no configure script
1412 (replace 'install ;no install target
1413 (lambda* (#:key outputs #:allow-other-keys)
1414 (let* ((out (assoc-ref outputs "out"))
1415 (lib (string-append out "/lib"))
1416 (inc (string-append out "/include/symmetrica"))
1417 (doc (string-append out "/share/doc/symmetrica-" ,version))
1418 (static "libsymmetrica.a"))
1419 ;; Build static library.
1420 (apply invoke "ar" "crs" static (find-files "." "\\.o$"))
1421 (invoke "ranlib" static)
1422 ;; Install static library and headers.
1423 (for-each (lambda (f) (install-file f inc))
1424 (find-files "." "\\.h$"))
1425 (install-file "libsymmetrica.a" lib)
1426 ;; Install documentation.
1427 (for-each (lambda (f) (install-file f doc))
1428 (find-files "." "\\.doc$"))
1429 #t))))))
1430 (home-page "http://www.algorithm.uni-bayreuth.de/en/research/SYMMETRICA/")
1431 (synopsis "Combinatoric C Library")
1432 (description "Symmetrica is a library for combinatorics. It has support
1433for the representation theory of the symmetric group and related groups,
1434combinatorics of tableaux, symmetric functions and polynomials, Schubert
1435polynomials, and the representation theory of Hecke algebras of type A_n.")
1436 (license license:public-domain)))
6cbedbd2
AE
1437
1438(define-public m4rie
1439 (package
1440 (name "m4rie")
1441 (version "20150908")
1442 (source (origin
1443 (method git-fetch)
1444 (uri (git-reference
1445 (url "https://bitbucket.org/malb/m4rie")
1446 (commit (string-append "release-" version))))
1447 (file-name (git-file-name name version))
1448 (sha256
1449 (base32
1450 "0r8lv46qx5mkz5kp3ay2jnsp0mbhlqr5z2z220wdk73wdshcznss"))))
1451 (build-system gnu-build-system)
1452 (native-inputs
1453 `(("autoconf" ,autoconf)
1454 ("automake" ,automake)
1455 ("libtool" ,libtool)))
1456 (inputs
1457 `(("m4ri" ,m4ri)))
1458 (synopsis "Arithmetic of dense matrices over F_{2^e}")
1459 (description "M4RI is a library for fast arithmetic with dense matrices
1460over finite fields of characteristic 2. So it extends the functionality
1461of M4RI from F_2 to F_{2^e}.")
1462 (license license:gpl2+)
1463 (home-page "https://bitbucket.org/malb/m4rie/")))
66c67e7b
AE
1464
1465(define-public eclib
1466 (package
1467 (name "eclib")
9a5f35fe 1468 (version "20190909")
66c67e7b
AE
1469 (source (origin
1470 (method git-fetch)
1471 (uri (git-reference
1472 (url "https://github.com/JohnCremona/eclib/")
1473 (commit (string-append "v" version))))
1474 (file-name (git-file-name name version))
1475 (sha256
1476 (base32
9a5f35fe 1477 "1gw27lqc3f525n8qdcmr2nyn16y9g10z9f6dnmckyyxcdzvhq35n"))))
66c67e7b
AE
1478 (build-system gnu-build-system)
1479 (native-inputs
1480 `(("autoconf" ,autoconf)
1481 ("automake" ,automake)
1482 ("libtool" ,libtool)))
1483 (inputs
d96ad7fa 1484 `(("ntl" ,ntl)
66c67e7b
AE
1485 ("pari-gp" ,pari-gp)))
1486 (synopsis "Ranks of elliptic curves and modular symbols")
1487 (description "The eclib package includes mwrank (for 2-descent on
1488elliptic curves over Q) and modular symbol code; it has been written by
1489John Cremona to compute his elliptic curve database.")
1490 (license license:gpl2+)
1491 (home-page (string-append "http://homepages.warwick.ac.uk/staff/"
1492 "J.E.Cremona/mwrank/index.html"))))
197ebc36
AE
1493
1494(define-public lrcalc
1495 (package
1496 (name "lrcalc")
1497 (version "1.2")
1498 (source (origin
1499 (method git-fetch)
1500 (uri (git-reference
1501 (url "https://bitbucket.org/asbuch/lrcalc")
1502 (commit (string-append "lrcalc-" version))))
1503 (file-name (git-file-name name version))
1504 (sha256
1505 (base32
88f913e8
AE
1506 "1c12d04jdyxkkav4ak8d1aqrv594gzihwhpxvc6p9js0ry1fahss"))
1507 (patches (search-patches "lrcalc-includes.patch"))))
197ebc36
AE
1508 (build-system gnu-build-system)
1509 (native-inputs
1510 `(("autoconf" ,autoconf)
1511 ("automake" ,automake)
1512 ("libtool" ,libtool)))
1513 (arguments
1514 `(#:phases
1515 (modify-phases %standard-phases
1516 (add-before 'build 'fix-permission
1517 (lambda _
1518 (chmod "lrcalc.maple.src" #o644)
1519 #t)))))
1520 (synopsis "Littlewood-Richardson calculator in algebraic combinatorics")
1521 (description "The Littlewood-Richardson Calculator (lrcalc) is a
1522program designed to compute Littlewood-Richardson coefficients. It computes
1523single Littlewood-Richardson coefficients, products of Schur functions, or
1524skew Schur functions. In addition it computes products in the small quantum
1525cohomology ring of a Grassmann variety. The software package also includes
1526a program that performs fast computation of the more general multiplicative
1527structure constants of Schubert polynomials.")
1528 (license license:gpl2+)
1e30dff3 1529 (home-page "https://sites.math.rutgers.edu/~asbuch/lrcalc/")))
eacf2983
AE
1530
1531(define-public iml
1532 (package
1533 (name "iml")
1534 (version "1.0.5")
1535 (source
1536 (origin
1537 (method url-fetch)
1538 (uri (string-append "http://www.cs.uwaterloo.ca/~astorjoh/iml-"
1539 version ".tar.bz2"))
1540 (sha256
1541 (base32
1542 "0akwhhz9b40bz6lrfxpamp7r7wkk48p455qbn04mfnl9a1l6db8x"))))
1543 (build-system gnu-build-system)
1544 (inputs
1628d57b 1545 `(("gmp" ,gmp)
eacf2983
AE
1546 ("cblas" ,openblas))) ; or any other BLAS library; the documentation
1547 ; mentions ATLAS in particular
1548 (arguments
1549 `(#:configure-flags
1550 (list
c68ec87c 1551 "--enable-shared"
eacf2983
AE
1552 (string-append "--with-gmp-include="
1553 (assoc-ref %build-inputs "gmp") "/include")
1554 (string-append "--with-gmp-lib="
1555 (assoc-ref %build-inputs "gmp") "/lib")
1556 "--with-cblas=-lopenblas"
1557 (string-append "--with-cblas-include="
1558 (assoc-ref %build-inputs "cblas") "/include")
1559 (string-append "--with-cblas-lib="
1560 (assoc-ref %build-inputs "cblas") "/lib"))))
1561 (home-page "https://cs.uwaterloo.ca/~astorjoh/iml.html")
1562 (synopsis
1563 "Solver for systems of linear equations over the integers")
1564 (description
1565 "IML is a C library implementing algorithms for computing exact
1566solutions to dense systems of linear equations over the integers.
1567Currently, IML provides the following functionality:
1568
1569@itemize
1570@item Nonsingular rational system solving:
1571compute the unique rational solution X to the system AX=B, where A and B
1572are integer matrices, A nonsingular.
1573@item Compute the right nullspace or kernel of an integer matrix.
1574@item Certified linear system solving:
1575compute a minimal denominator solution x to a system Ax=b, where b is an
1576integer vector and A is an integer matrix with arbitrary shape and
1577rank profile.
1578@end itemize
1579
1580In addition, IML provides some low level routines for a variety of mod p
1581matrix operations: computing the row-echelon form, determinant, rank
1582profile, and inverse of a mod p matrix. These mod p routines are not
1583general purpose; they require that p satisfy some preconditions based on
1584the dimension of the input matrix (usually p should be prime and should be
1585no more than about 20 bits long).")
1586 (license license:bsd-3)))