Commit | Line | Data |
---|---|---|
233e7676 | 1 | ;;; GNU Guix --- Functional package management for GNU |
3f074a21 | 2 | ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019 Andreas Enge <andreas@enge.fr> |
4b0bf990 | 3 | ;;; Copyright © 2013, 2015, 2017, 2018 Ludovic Courtès <ludo@gnu.org> |
a733253b | 4 | ;;; Copyright © 2016, 2017, 2018, 2019, 2020 Nicolas Goaziou <mail@nicolasgoaziou.fr> |
69d5909e | 5 | ;;; Copyright © 2014, 2018 Mark H Weaver <mhw@netris.org> |
67f39dd5 | 6 | ;;; Copyright © 2016, 2018, 2019 Ricardo Wurmus <rekado@elephly.net> |
ecc5bc33 | 7 | ;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il> |
5144e314 | 8 | ;;; Copyright © 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr> |
f71f29ca | 9 | ;;; Copyright © 2017 Marius Bakke <mbakke@fastmail.com> |
eb6785cf | 10 | ;;; Copyright © 2017, 2019 Eric Bavier <bavier@member.fsf.org> |
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) |
d0337a22 | 47 | #:use-module (gnu packages llvm) |
aae03c48 | 48 | #:use-module (gnu packages maths) |
0fc54d4b | 49 | #:use-module (gnu packages mpi) |
5894b604 | 50 | #:use-module (gnu packages multiprecision) |
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") | |
43a776e2 | 77 | (version "0.5") |
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 | |
43a776e2 | 85 | "1s968480ymv6w0rnvfp9mxvx98hvi29fkvw8nk4ggzc6azxgwybs")))) |
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 | 94 | arbitrary precision real (mpfr) or complex (mpc) numbers, without control |
35b9e423 | 95 | on the rounding. For the time being, only the few functions needed to |
2ed139c4 | 96 | implement the floating point approach to complex multiplication are |
35b9e423 | 97 | implemented. On the other hand, these comprise asymptotically fast |
e881752c | 98 | multiplication 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 | |
118 | of characteristic 2. It implements the multiplication, squaring and | |
119 | greatest 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") | |
81b55bf7 | 126 | (version "0.3") |
10b1f688 AE |
127 | (source (origin |
128 | (method url-fetch) | |
129 | (uri (string-append | |
130 | "http://www.multiprecision.org/cm/download/cm-" | |
131 | version ".tar.gz")) | |
132 | (sha256 | |
133 | (base32 | |
81b55bf7 | 134 | "1nf5kr0nqmhbzrsrinky18z0ighjpsmb5cr8zyg8jf04bfbyrfmc")))) |
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 | |
144 | imaginary quadratic number fields and of elliptic curves with complex | |
145 | multiplication via floating point approximations. It consists of libraries | |
146 | that can be called from within a C program and of executable command | |
147 | line 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 NG |
153 | (name "fplll") |
154 | (version "5.2.1") | |
155 | (source (origin | |
156 | (method git-fetch) | |
157 | (uri (git-reference | |
158 | (url "https://github.com/fplll/fplll.git") | |
159 | (commit version))) | |
160 | (file-name (git-file-name name version)) | |
161 | (sha256 | |
162 | (base32 | |
163 | "015qmrd7nfaysbv1hbwiprz9g6hnww1y1z1xw8f43ysb7k1b5nbg")))) | |
164 | (build-system gnu-build-system) | |
165 | (native-inputs | |
166 | `(("autoconf" ,autoconf) | |
167 | ("automake" ,automake) | |
168 | ("libtool" ,libtool))) | |
169 | (inputs | |
170 | `(("gmp" ,gmp) | |
171 | ("mpfr" ,mpfr))) | |
172 | (home-page "https://github.com/fplll/fplll") | |
173 | (synopsis "Library for LLL-reduction of euclidean lattices") | |
174 | (description | |
175 | "fplll contains implementations of several lattice algorithms. | |
176 | The implementation relies on floating-point orthogonalization, and LLL | |
177 | is central to the code, hence the name. | |
178 | ||
179 | It includes implementations of floating-point LLL reduction | |
180 | algorithms, offering different speed/guarantees ratios. It contains | |
181 | a @emph{wrapper} choosing the estimated best sequence of variants in | |
182 | order to provide a guaranteed output as fast as possible. In the case | |
183 | of the wrapper, the succession of variants is oblivious to the user. | |
184 | ||
185 | It includes an implementation of the BKZ reduction algorithm, | |
186 | including the BKZ-2.0 improvements (extreme enumeration | |
187 | pruning, pre-processing of blocks, early termination). Additionally, | |
188 | Slide reduction and self dual BKZ are supported. | |
189 | ||
190 | It also includes a floating-point implementation of the | |
191 | Kannan-Fincke-Pohst algorithm that finds a shortest non-zero lattice | |
192 | vector. For the same task, the GaussSieve algorithm is also available | |
193 | in fplll. Finally, it contains a variant of the enumeration algorithm | |
194 | that computes a lattice vector closest to a given vector belonging to | |
195 | the real span of the lattice.") | |
196 | (license license:lgpl2.1+))) | |
4e6b699d | 197 | |
25cbaa9e NG |
198 | (define-public python-fpylll |
199 | (package | |
200 | (name "python-fpylll") | |
201 | (version "0.4.1") | |
202 | (source | |
203 | (origin | |
204 | ;; Pypi contains and older release, so we use a tagged release from | |
205 | ;; Github instead. | |
206 | (method git-fetch) | |
207 | (uri (git-reference | |
208 | (url "https://github.com/fplll/fpylll.git") | |
209 | (commit (string-append version "dev")))) | |
f1d4d79f | 210 | (file-name (git-file-name name version)) |
25cbaa9e NG |
211 | (sha256 |
212 | (base32 | |
213 | "01x2sqdv0sbjj4g4waj0hj4rcn4bq7h17442xaqwbznym9azmn9w")))) | |
214 | (build-system python-build-system) | |
215 | (inputs | |
216 | `(("fplll" ,fplll) | |
217 | ("gmp" ,gmp) | |
218 | ("mpfr" ,mpfr) | |
219 | ("pari-gp" ,pari-gp))) | |
220 | (propagated-inputs | |
221 | `(("cysignals" ,python-cysignals) | |
222 | ("cython" ,python-cython) | |
223 | ("flake8" ,python-flake8) | |
224 | ("numpy" ,python-numpy) | |
225 | ("pytest" ,python-pytest))) | |
226 | (home-page "https://github.com/fplll/fpylll") | |
227 | (synopsis "Python interface for fplll") | |
228 | (description "fpylll is a Python wrapper for fplll.") | |
229 | (license license:gpl2+))) | |
230 | ||
90a6d47c AE |
231 | (define-public pari-gp |
232 | (package | |
67f39dd5 | 233 | (name "pari-gp") |
f916ac12 | 234 | (version "2.11.4") |
67f39dd5 RW |
235 | (source (origin |
236 | (method url-fetch) | |
237 | (uri (string-append | |
238 | "https://pari.math.u-bordeaux.fr/pub/pari/unix/pari-" | |
239 | version ".tar.gz")) | |
240 | (sha256 | |
241 | (base32 | |
f916ac12 | 242 | "070bjw4kg7r6lqs1hfs08n5fmjv90cpwflp3wr04hbrmyz28zj5z")))) |
67f39dd5 RW |
243 | (build-system gnu-build-system) |
244 | (native-inputs | |
245 | `(("texlive" ,(texlive-union | |
f75aa97f | 246 | (list texlive-amsfonts))))) |
67f39dd5 RW |
247 | (inputs `(("gmp" ,gmp) |
248 | ("libx11" ,libx11) | |
249 | ("perl" ,perl) | |
250 | ("readline" ,readline))) | |
251 | (arguments | |
252 | '(#:make-flags '("all") | |
253 | #:test-target "dobench" | |
254 | #:phases | |
255 | (modify-phases %standard-phases | |
256 | (replace 'configure | |
257 | (lambda* (#:key outputs #:allow-other-keys) | |
258 | (invoke "./Configure" | |
259 | (string-append "--prefix=" | |
260 | (assoc-ref outputs "out")))))))) | |
261 | (synopsis "PARI/GP, a computer algebra system for number theory") | |
262 | (description | |
263 | "PARI/GP is a widely used computer algebra system designed for fast | |
90a6d47c AE |
264 | computations in number theory (factorisations, algebraic number theory, |
265 | elliptic curves...), but it also contains a large number of other useful | |
266 | functions to compute with mathematical entities such as matrices, | |
267 | polynomials, power series, algebraic numbers, etc., and a lot of | |
268 | transcendental functions. | |
269 | PARI is also available as a C library to allow for faster computations.") | |
67f39dd5 RW |
270 | (license license:gpl2+) |
271 | (home-page "https://pari.math.u-bordeaux.fr/"))) | |
ed9f9a77 | 272 | |
f854a8c1 AE |
273 | (define-public gp2c |
274 | (package | |
275 | (name "gp2c") | |
11abc24a | 276 | (version "0.0.11pl3") |
f854a8c1 AE |
277 | (source (origin |
278 | (method url-fetch) | |
279 | (uri (string-append | |
eeb8b0e6 | 280 | "https://pari.math.u-bordeaux.fr/pub/pari/GP2C/gp2c-" |
f854a8c1 | 281 | version ".tar.gz")) |
324bdcd8 AE |
282 | (sha256 |
283 | (base32 | |
11abc24a | 284 | "0yymbrgyjw500hqgmkj5m4nmscd7c9rs9w2c96lxgrcyab8krhrm")))) |
f854a8c1 | 285 | (build-system gnu-build-system) |
c67ccedd | 286 | (native-inputs `(("perl" ,perl))) |
f854a8c1 AE |
287 | (inputs `(("pari-gp" ,pari-gp))) |
288 | (arguments | |
289 | '(#:configure-flags | |
290 | (list (string-append "--with-paricfg=" | |
291 | (assoc-ref %build-inputs "pari-gp") | |
292 | "/lib/pari/pari.cfg")))) | |
293 | (synopsis "PARI/GP, a computer algebra system for number theory") | |
294 | (description | |
295 | "PARI/GP is a widely used computer algebra system designed for fast | |
296 | computations in number theory (factorisations, algebraic number theory, | |
297 | elliptic curves...), but it also contains a large number of other useful | |
298 | functions to compute with mathematical entities such as matrices, | |
299 | polynomials, power series, algebraic numbers, etc., and a lot of | |
300 | transcendental functions. | |
301 | PARI is also available as a C library to allow for faster computations. | |
302 | ||
303 | GP2C, the GP to C compiler, translates GP scripts to PARI programs.") | |
9f51293c | 304 | (license license:gpl2) |
eeb8b0e6 | 305 | (home-page "https://pari.math.u-bordeaux.fr/"))) |
f854a8c1 | 306 | |
ddfb6280 TGR |
307 | (define fplll-4-cmh |
308 | (package | |
309 | (inherit fplll) | |
310 | (name "fplll") | |
311 | (version "4.0.4") | |
312 | (source | |
313 | (origin | |
314 | (method url-fetch) | |
315 | (uri (string-append | |
316 | "http://perso.ens-lyon.fr/damien.stehle/fplll/libfplll-" | |
317 | version ".tar.gz")) | |
318 | (sha256 | |
319 | (base32 "1cbiby7ykis4z84swclpysrljmqhfcllpkcbll1m08rzskgb1a6b")))))) | |
320 | ||
eea7cd75 AE |
321 | (define-public cmh |
322 | (package | |
323 | (name "cmh") | |
324 | (version "1.0") | |
325 | (source (origin | |
326 | (method url-fetch) | |
327 | (uri (string-append | |
328 | "https://gforge.inria.fr/frs/download.php/33497/cmh-" | |
329 | version ".tar.gz")) | |
330 | (sha256 | |
331 | (base32 | |
332 | "1a28xr9bs0igms0ik99x0w8lnb0jyfcmvyi26pbyh9ggcdivd33p")))) | |
333 | (build-system gnu-build-system) | |
334 | (inputs | |
335 | `(("gmp" ,gmp) | |
336 | ("mpfr" ,mpfr) | |
337 | ("mpc" ,mpc) | |
338 | ("mpfrcx" ,mpfrcx) | |
ddfb6280 | 339 | ("fplll" ,fplll-4-cmh) |
eea7cd75 AE |
340 | ("pari-gp" ,pari-gp))) |
341 | (synopsis "Igusa class polynomial computations") | |
342 | (description | |
343 | "The CMH software computes Igusa (genus 2) class polynomials, which | |
344 | parameterize the CM points in the moduli space of 2-dimensional abelian | |
345 | varieties, i.e. Jacobians of hyperelliptic curves. | |
346 | It can also be used to compute theta constants at arbitrary | |
347 | precision.") | |
348 | (license license:gpl3+) | |
349 | (home-page "http://cmh.gforge.inria.fr/"))) | |
350 | ||
7fc0e3db | 351 | (define-public giac |
57497c57 | 352 | (package |
7fc0e3db | 353 | (name "giac") |
a733253b NG |
354 | (version "1.5.0-87") |
355 | (source | |
356 | (origin | |
357 | (method url-fetch) | |
358 | ;; "~parisse/giac" is not used because the maintainer regularly | |
359 | ;; overwrites the release tarball there, introducing a checksum | |
360 | ;; mismatch every time. See | |
361 | ;; <https://www-fourier.ujf-grenoble.fr/~parisse/debian/dists/stable/main/source/README> | |
362 | (uri (string-append "https://www-fourier.ujf-grenoble.fr/" | |
363 | "~parisse/debian/dists/stable/main/source/" | |
364 | "giac_" version ".tar.gz")) | |
365 | (sha256 | |
366 | (base32 "1d0h1yb7qvh9x7wwv9yrzmcp712f49w1iljkxp4y6g9pzsmg1mmv")))) | |
57497c57 NG |
367 | (build-system gnu-build-system) |
368 | (arguments | |
af90cc45 NG |
369 | `(#:modules ((ice-9 ftw) |
370 | (guix build utils) | |
371 | (guix build gnu-build-system)) | |
372 | #:phases | |
57497c57 NG |
373 | (modify-phases %standard-phases |
374 | (add-after 'unpack 'patch-bin-cp | |
90d5ec55 | 375 | ;; Some Makefiles contain hard-coded "/bin/cp". |
57497c57 | 376 | (lambda _ |
57497c57 NG |
377 | (substitute* (find-files "doc" "^Makefile") |
378 | (("/bin/cp") (which "cp"))) | |
90d5ec55 NG |
379 | #t)) |
380 | (add-after 'unpack 'disable-failing-test | |
381 | ;; FIXME: Test failing. Not sure why. | |
382 | (lambda _ | |
383 | (substitute* "check/Makefile.in" | |
384 | (("chk_fhan11") "")) | |
af90cc45 | 385 | #t)) |
9f73ac24 | 386 | (add-after 'install 'fix-doc |
af90cc45 | 387 | (lambda* (#:key outputs #:allow-other-keys) |
9f73ac24 NG |
388 | (let ((out (assoc-ref outputs "out"))) |
389 | ;; Most French documentation has a non-commercial | |
390 | ;; license, so we need to remove it. | |
391 | (with-directory-excursion (string-append out "/share/giac/doc/fr") | |
392 | (for-each delete-file-recursively | |
393 | '("cascas" "casexo" "casgeo" "casrouge" "cassim" | |
394 | "castor"))) | |
395 | ;; Remove duplicate documentation in | |
396 | ;; "%out/share/doc/giac/", where Xcas does not expect | |
397 | ;; to find it. | |
398 | (delete-file-recursively (string-append out "/share/doc/giac")) | |
399 | #t))) | |
400 | (add-after 'install 'remove-unnecessary-executable | |
401 | (lambda* (#:key outputs #:allow-other-keys) | |
402 | (let ((out (assoc-ref outputs "out"))) | |
403 | (delete-file (string-append out "/bin/xcasnew")) | |
404 | #t)))))) | |
57497c57 | 405 | (inputs |
6d3896b9 | 406 | ;;; TODO: Add libnauty. |
57497c57 | 407 | `(("fltk" ,fltk) |
6d3896b9 | 408 | ("glpk" ,glpk) |
57497c57 NG |
409 | ("gmp" ,gmp) |
410 | ("gsl" ,gsl) | |
411 | ("lapack" ,lapack) | |
412 | ("libao" ,ao) | |
4bd428a7 | 413 | ("libjpeg" ,libjpeg-turbo) |
57497c57 | 414 | ("libpng" ,libpng) |
6d3896b9 | 415 | ("libsamplerate" ,libsamplerate) |
57497c57 | 416 | ("libx11" ,libx11) |
99a00446 | 417 | ("libxinerama" ,libxinerama) |
57497c57 NG |
418 | ("libxft" ,libxft) |
419 | ("libxt" ,libxt) | |
420 | ("mesa" ,mesa) | |
421 | ("mpfi" ,mpfi) | |
422 | ("mpfr" ,mpfr) | |
423 | ("ntl" ,ntl) | |
424 | ("perl" ,perl) | |
425 | ("pari-gp" ,pari-gp) | |
9f73ac24 NG |
426 | ("tcsh" ,tcsh))) |
427 | (native-inputs | |
6d3896b9 NG |
428 | `(("bison" ,bison) |
429 | ("flex" ,flex) | |
430 | ("readline" ,readline) | |
a023ec6e | 431 | ("texlive" ,texlive-tiny))) |
57497c57 NG |
432 | (home-page "https://www-fourier.ujf-grenoble.fr/~parisse/giac.html") |
433 | (synopsis "Computer algebra system") | |
434 | (description | |
435 | "Giac/Xcas is a computer algebra system. It has a compatibility mode for | |
436 | maple, mupad and the TI89. It is available as a standalone program (graphic | |
437 | or text interfaces) or as a C++ library.") | |
438 | (license license:gpl3+))) | |
439 | ||
d7ab698a AE |
440 | (define-public flint |
441 | (package | |
442 | (name "flint") | |
6c591c8e | 443 | (version "2.5.2") |
d7ab698a AE |
444 | (source (origin |
445 | (method url-fetch) | |
446 | (uri (string-append | |
447 | "http://flintlib.org/flint-" | |
448 | version ".tar.gz")) | |
449 | (sha256 (base32 | |
6c591c8e | 450 | "11syazv1a8rrnac3wj3hnyhhflpqcmq02q8pqk2m6g2k6h0gxwfb")) |
fc1adab1 | 451 | (patches (search-patches "flint-ldconfig.patch")))) |
d7ab698a | 452 | (build-system gnu-build-system) |
df15d17d | 453 | (propagated-inputs |
d7ab698a | 454 | `(("gmp" ,gmp) |
df15d17d | 455 | ("mpfr" ,mpfr))) ; header files from both are included by flint/arith.h |
d7ab698a | 456 | (arguments |
ad11974e AE |
457 | `(#:parallel-tests? #f ; seems to be necessary on arm |
458 | #:phases | |
91430de6 AE |
459 | (modify-phases %standard-phases |
460 | (replace 'configure | |
461 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
462 | (let ((out (assoc-ref outputs "out")) | |
463 | (gmp (assoc-ref inputs "gmp")) | |
464 | (mpfr (assoc-ref inputs "mpfr"))) | |
91430de6 AE |
465 | ;; do not pass "--enable-fast-install", which makes the |
466 | ;; homebrew configure process fail | |
50233d95 | 467 | (invoke "./configure" |
91430de6 AE |
468 | (string-append "--prefix=" out) |
469 | (string-append "--with-gmp=" gmp) | |
50233d95 RW |
470 | (string-append "--with-mpfr=" mpfr)) |
471 | #t)))))) | |
d7ab698a AE |
472 | (synopsis "Fast library for number theory") |
473 | (description | |
474 | "FLINT is a C library for number theory. It supports arithmetic | |
475 | with numbers, polynomials, power series and matrices over many base | |
476 | rings, including multiprecision integers and rationals, integers | |
477 | modulo n, p-adic numbers, finite fields (prime and non-prime order) | |
478 | and real and complex numbers (via the Arb extension library). | |
479 | ||
480 | Operations that can be performed include conversions, arithmetic, | |
481 | GCDs, factoring, solving linear systems, and evaluating special | |
482 | functions. In addition, FLINT provides various low-level routines for | |
483 | fast arithmetic.") | |
9f51293c | 484 | (license license:gpl2+) |
d7ab698a AE |
485 | (home-page "http://flintlib.org/"))) |
486 | ||
6b8e8285 AE |
487 | (define-public arb |
488 | (package | |
6aa54e23 | 489 | (name "arb") |
faefa2ed | 490 | (version "2.17.0") |
6aa54e23 RW |
491 | (source (origin |
492 | (method git-fetch) | |
493 | (uri (git-reference | |
494 | (url "https://github.com/fredrik-johansson/arb.git") | |
495 | (commit version))) | |
496 | (file-name (git-file-name name version)) | |
497 | (sha256 | |
498 | (base32 | |
faefa2ed | 499 | "05lpy3hkl5f8ik19aw40cqydrb932xaf2n8hbq9ib5dnk7f010p1")))) |
6aa54e23 RW |
500 | (build-system gnu-build-system) |
501 | (propagated-inputs | |
502 | `(("flint" ,flint))) ; flint.h is included by arf.h | |
503 | (inputs | |
504 | `(("gmp" ,gmp) | |
505 | ("mpfr" ,mpfr))) | |
506 | (arguments | |
507 | `(#:phases | |
508 | (modify-phases %standard-phases | |
509 | (replace 'configure | |
510 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
511 | (let ((out (assoc-ref outputs "out")) | |
512 | (flint (assoc-ref inputs "flint")) | |
513 | (gmp (assoc-ref inputs "gmp")) | |
514 | (mpfr (assoc-ref inputs "mpfr"))) | |
faefa2ed TGR |
515 | ;; Do not pass "--enable-fast-install", which makes the |
516 | ;; homebrew configure process fail. | |
6aa54e23 RW |
517 | (invoke "./configure" |
518 | (string-append "--prefix=" out) | |
519 | (string-append "--with-flint=" flint) | |
520 | (string-append "--with-gmp=" gmp) | |
521 | (string-append "--with-mpfr=" mpfr)))))))) | |
522 | (synopsis "Arbitrary precision floating-point ball arithmetic") | |
523 | (description | |
524 | "Arb is a C library for arbitrary-precision floating-point ball | |
6b8e8285 AE |
525 | arithmetic. It supports efficient high-precision computation with |
526 | polynomials, power series, matrices and special functions over the | |
527 | real and complex numbers, with automatic, rigorous error control.") | |
6aa54e23 | 528 | (license license:lgpl2.1+) |
faefa2ed | 529 | (home-page "http://arblib.org"))) |
6b8e8285 | 530 | |
1d6589db AE |
531 | (define-public python-flint |
532 | (package | |
533 | (name "python-flint") | |
534 | (version "0.3.0") | |
535 | (source (origin | |
536 | (method git-fetch) | |
537 | (uri (git-reference | |
538 | (url "https://github.com/fredrik-johansson/python-flint.git") | |
539 | (commit version))) | |
540 | (file-name (git-file-name name version)) | |
541 | (sha256 | |
542 | (base32 | |
543 | "1v0anazbj1cfi68nl2j6dbd31kgkc1563xmr0zk5xk3xj78569pw")) | |
544 | (patches (search-patches "python-flint-includes.patch")))) | |
545 | (build-system python-build-system) | |
546 | (native-inputs | |
547 | `(("python-cython" ,python-cython))) | |
548 | (propagated-inputs | |
549 | `(("python-numpy" ,python-numpy))) | |
550 | (inputs | |
551 | `(("arb" ,arb) | |
552 | ("flint" ,flint))) | |
553 | (synopsis "Python module wrapping ARB and FLINT") | |
554 | (description | |
555 | "Python-flint is a Python extension module wrapping FLINT | |
556 | (Fast Library for Number Theory) and Arb (arbitrary-precision ball | |
557 | arithmetic). It supports integers, rationals, modular integers, | |
558 | real and complex ball arithmetic, polynomials and matrices over all | |
559 | these types and other mathematical functions.") | |
560 | (license license:expat) | |
561 | (home-page "http://fredrikj.net/python-flint/"))) | |
562 | ||
14e6520e AE |
563 | (define-public ntl |
564 | (package | |
565 | (name "ntl") | |
d96ad7fa | 566 | (version "11.4.3") |
14e6520e AE |
567 | (source (origin |
568 | (method url-fetch) | |
d96ad7fa | 569 | (uri (string-append "https://shoup.net/ntl/ntl-" |
14e6520e | 570 | version ".tar.gz")) |
d96ad7fa JK |
571 | (sha256 |
572 | (base32 | |
573 | "1lisp3064rch3jaa2wrhy1s9kll7i3ka3d0y6lj6l3l4ckfcrhdp")) | |
574 | (modules '((guix build utils))) | |
575 | (snippet | |
576 | '(begin | |
577 | (delete-file-recursively "src/libtool-origin") | |
578 | #t)))) | |
14e6520e AE |
579 | (build-system gnu-build-system) |
580 | (native-inputs | |
581 | `(("libtool" ,libtool) | |
582 | ("perl" ,perl))) ; for configuration | |
14e6520e | 583 | (inputs |
d96ad7fa JK |
584 | `(("gmp" ,gmp) |
585 | ("gf2x" ,gf2x))) | |
14e6520e AE |
586 | (arguments |
587 | `(#:phases | |
588 | (modify-phases %standard-phases | |
589 | (replace 'configure | |
d96ad7fa | 590 | (lambda* (#:key inputs outputs #:allow-other-keys) |
14e6520e | 591 | (chdir "src") |
d96ad7fa | 592 | (invoke "./configure" |
14e6520e | 593 | (string-append "PREFIX=" (assoc-ref outputs "out")) |
d96ad7fa JK |
594 | (string-append "LIBTOOL=" (assoc-ref inputs "libtool") "/bin/libtool") |
595 | ;; set the library prefixes explicitly so that they get | |
596 | ;; embedded in the .la file | |
597 | (string-append "GMP_PREFIX=" (assoc-ref inputs "gmp")) | |
598 | (string-append "GF2X_PREFIX=" (assoc-ref inputs "gf2x")) | |
14e6520e AE |
599 | ;; Do not build especially for the build machine. |
600 | "NATIVE=off" | |
d96ad7fa JK |
601 | "NTL_GF2X_LIB=on" |
602 | "SHARED=on")))))) | |
14e6520e AE |
603 | (synopsis "C++ library for number theory") |
604 | (description | |
605 | "NTL is a C++ library providing data structures and algorithms | |
606 | for manipulating signed, arbitrary length integers, and for vectors, | |
607 | matrices, and polynomials over the integers and over finite fields.") | |
608 | (license license:gpl2+) | |
d96ad7fa | 609 | (home-page "https://shoup.net/ntl/"))) |
14e6520e | 610 | |
aae03c48 AE |
611 | (define-public singular |
612 | (package | |
613 | (name "singular") | |
33209660 | 614 | (version "4.1.3p2") |
f35c3bbb KK |
615 | (source |
616 | (origin | |
617 | (method url-fetch) | |
618 | (uri | |
619 | (string-append "http://www.mathematik.uni-kl.de/ftp/pub/Math/" | |
620 | "Singular/SOURCES/" | |
621 | (string-join | |
622 | (string-split | |
623 | (string-trim-right version #\p | |
624 | 0 (1- (string-length version))) | |
625 | #\.) "-") | |
626 | "/singular-" version ".tar.gz")) | |
627 | (sha256 (base32 | |
33209660 | 628 | "1524yrni7gh0hir5ckridq671q5s6avfjdsdyahj51kzdl3wcypf")))) |
aae03c48 AE |
629 | (build-system gnu-build-system) |
630 | (native-inputs | |
631 | `(("doxygen" ,doxygen) | |
632 | ("graphviz" ,graphviz) | |
633 | ("perl" ,perl))) | |
634 | (inputs | |
635 | `(("cddlib" ,cddlib) | |
636 | ("gmp" ,gmp) | |
637 | ("flint" ,flint) | |
638 | ("mpfr" ,mpfr) | |
639 | ("ntl" ,ntl) | |
640 | ("python" ,python-2) | |
641 | ("readline" ,readline))) | |
642 | (arguments | |
643 | `(#:configure-flags | |
644 | (list (string-append "--with-ntl=" | |
645 | (assoc-ref %build-inputs "ntl"))))) | |
646 | (synopsis "Computer algebra system for polynomial computations") | |
647 | (description | |
648 | "Singular is a computer algebra system for polynomial computations, | |
649 | with special emphasis on commutative and non-commutative algebra, algebraic | |
650 | geometry and singularity theory.") | |
651 | ;; Singular itself is dual licensed gpl2 or gpl3, but some of the | |
652 | ;; libraries with which it links are licensed under lgpl3+, so the | |
653 | ;; combined work becomes gpl3. See COPYING in the source code. | |
654 | (license license:gpl3) | |
655 | (home-page "http://www.singular.uni-kl.de/index.php"))) | |
656 | ||
57c9c349 AE |
657 | (define-public gmp-ecm |
658 | (package | |
659 | (name "gmp-ecm") | |
7d15cf17 | 660 | (version "7.0.4") |
57c9c349 | 661 | (source (origin |
7d15cf17 TGR |
662 | (method url-fetch) |
663 | ;; Use the ‘Latest version’ link for a stable URI across releases. | |
664 | (uri (string-append "https://gforge.inria.fr/frs/download.php/" | |
665 | "latestfile/160/ecm-" version ".tar.gz")) | |
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 | |
680 | as the P-1 and P+1 algorithms. It provides a library and a stand-alone | |
681 | binary.") | |
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 |
717 | an interactive environment for evaluating mathematical statements. Its | |
718 | syntax 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 | |
731 | (url "https://github.com/extemporelang/kiss_fft.git") | |
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 | |
745 | that can use fixed or floating data types and can easily be incorporated into | |
746 | a 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 | |
789 | transform (DFT) in one or more dimensions, of arbitrary input size, and of | |
790 | both real and complex data (as well as of even/odd data---i.e. the discrete | |
791 | cosine/ 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 | |
837 | (url "https://github.com/vkostyukov/la4j.git") | |
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 | |
860 | Algebra primitives (matrices and vectors) and algorithms. The key features of | |
861 | the 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 | |
897 | that 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 | |
923 | Java. Currently, four types of transforms are available: @dfn{Discrete | |
924 | Fourier Transform} (DFT), @dfn{Discrete Cosine Transform} (DCT), @dfn{Discrete | |
925 | Sine 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 | |
947 | minimization and curve fitting. It is mature code, based on decades-old | |
948 | algorithms 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 | |
959 | (url "https://github.com/symengine/symengine.git") | |
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" | |
973 | "-DWITH_LLVM=on" | |
974 | "-DWITH_SYMENGINE_THREAD_SAFE=on" | |
af0307a0 | 975 | "-DBUILD_SHARED_LIBS=on"))) ;also build libsymengine |
d0337a22 VM |
976 | (native-inputs |
977 | `(("llvm" ,llvm))) | |
978 | (inputs | |
979 | `(("flint" ,flint) | |
980 | ("gmp" ,gmp) | |
981 | ("mpc" ,mpc) | |
982 | ("mpfr" ,mpfr))) | |
983 | (home-page "https://github.com/symengine/symengine") | |
984 | (synopsis "Fast symbolic manipulation library") | |
af0307a0 NG |
985 | (description |
986 | "SymEngine is a standalone fast C++ symbolic manipulation library. | |
987 | Optional thin wrappers allow usage of the library from other languages.") | |
988 | (license (list license:expat ;SymEngine | |
989 | license:bsd-3)))) ;3rd party code | |
d0337a22 | 990 | |
8f4b1dfb LC |
991 | (define-public eigen |
992 | (package | |
993 | (name "eigen") | |
5144e314 | 994 | (version "3.3.7") |
8f4b1dfb LC |
995 | (source (origin |
996 | (method url-fetch) | |
997 | (uri (string-append "https://bitbucket.org/eigen/eigen/get/" | |
9b268f12 | 998 | version ".tar.bz2")) |
8f4b1dfb LC |
999 | (sha256 |
1000 | (base32 | |
5144e314 | 1001 | "1km3fyfzyqfdvmnl79drps3fjwnz3zbh0c7l34mfbqyvvs8cy4wz")) |
2abcc935 | 1002 | (file-name (string-append name "-" version ".tar.bz2")) |
5144e314 | 1003 | (patches (search-patches "eigen-stabilise-sparseqr-test.patch")) |
8f4b1dfb LC |
1004 | (modules '((guix build utils))) |
1005 | (snippet | |
1006 | ;; There are 3 test failures in the "unsupported" directory, | |
1007 | ;; but maintainers say it's a known issue and it's unsupported | |
1008 | ;; anyway, so just skip them. | |
1137d85b | 1009 | '(begin |
44884a9d RW |
1010 | (substitute* "unsupported/CMakeLists.txt" |
1011 | (("add_subdirectory\\(test.*") | |
1012 | "# Do not build the tests for unsupported features.\n")) | |
6cbee49d | 1013 | #t)))) |
8f4b1dfb LC |
1014 | (build-system cmake-build-system) |
1015 | (arguments | |
1016 | '(;; Turn off debugging symbols to save space. | |
1017 | #:build-type "Release" | |
1018 | ||
354f4fe2 | 1019 | #:phases (modify-phases %standard-phases |
ef8742ea | 1020 | (replace 'check |
354f4fe2 | 1021 | (lambda _ |
354f4fe2 LC |
1022 | (let* ((cores (parallel-job-count)) |
1023 | (dash-j (format #f "-j~a" cores))) | |
1137d85b | 1024 | (setenv "EIGEN_SEED" "1") ;for reproducibility |
ef8742ea LC |
1025 | ;; First build the tests, in parallel. See |
1026 | ;; <http://eigen.tuxfamily.org/index.php?title=Tests>. | |
fbe9c80f | 1027 | (invoke "make" "buildtests" dash-j) |
8f4b1dfb | 1028 | |
fbe9c80f TGR |
1029 | ;; Then run 'CTest' with -V so we get more |
1030 | ;; details upon failure. | |
1031 | (invoke "ctest" "-V" dash-j))))))) | |
eeb8b0e6 | 1032 | (home-page "https://eigen.tuxfamily.org") |
8f4b1dfb LC |
1033 | (synopsis "C++ template library for linear algebra") |
1034 | (description | |
1035 | "Eigen is a C++ template library for linear algebra: matrices, vectors, | |
1036 | numerical solvers, and related algorithms. It provides an elegant API based | |
1037 | on \"expression templates\". It is versatile: it supports all matrix sizes, | |
1038 | all standard numeric types, various matrix decompositions and geometry | |
1039 | features, and more.") | |
1040 | ||
1041 | ;; Most of the code is MPLv2, with a few files under LGPLv2.1+ or BSD-3. | |
1042 | ;; See 'COPYING.README' for details. | |
9f51293c | 1043 | (license license:mpl2.0))) |
70770b93 | 1044 | |
697eb65d RW |
1045 | (define-public eigen-for-tensorflow |
1046 | (let ((changeset "fd6845384b86") | |
1047 | (revision "1")) | |
1048 | (package (inherit eigen) | |
1049 | (name "eigen-for-tensorflow") | |
1050 | (version (string-append "3.3.5-" revision "." changeset)) | |
1051 | (source (origin | |
1052 | (method hg-fetch) | |
1053 | (uri (hg-reference | |
1054 | (url "https://bitbucket.org/eigen/eigen") | |
1055 | (changeset changeset))) | |
1056 | (sha256 | |
1057 | (base32 | |
1058 | "12cwgah63wqwb66xji048hcxc1z5zjg8a7701zlia5zbilnnk1n5")) | |
1059 | (file-name (string-append name "-" version "-checkout")) | |
1060 | (modules '((guix build utils))) | |
1061 | (snippet | |
1062 | ;; There are 3 test failures in the "unsupported" directory, | |
1063 | ;; but maintainers say it's a known issue and it's unsupported | |
1064 | ;; anyway, so just skip them. | |
1065 | '(begin | |
1066 | (substitute* "unsupported/CMakeLists.txt" | |
1067 | (("add_subdirectory\\(test.*") | |
1068 | "# Do not build the tests for unsupported features.\n")) | |
1069 | #t))))))) | |
1070 | ||
70770b93 FT |
1071 | (define-public xtensor |
1072 | (package | |
1073 | (name "xtensor") | |
4e6568ce | 1074 | (version "0.20.10") |
70770b93 | 1075 | (source (origin |
e1ecaa83 KK |
1076 | (method git-fetch) |
1077 | (uri (git-reference | |
1078 | (url "https://github.com/QuantStack/xtensor.git") | |
1079 | (commit version))) | |
70770b93 FT |
1080 | (sha256 |
1081 | (base32 | |
4e6568ce | 1082 | "1fmv2hpx610xwhxrndfsfvlbqfyk4l3gi5q5d7pa9m82kblxjj9l")) |
e1ecaa83 | 1083 | (file-name (git-file-name name version)))) |
70770b93 FT |
1084 | (build-system cmake-build-system) |
1085 | (native-inputs | |
1086 | `(("googletest" ,googletest) | |
1087 | ("xtl" ,xtl))) | |
1088 | (arguments | |
1089 | `(#:configure-flags | |
1090 | '("-DBUILD_TESTS=ON") | |
1091 | #:test-target "xtest")) | |
3b1ccad0 | 1092 | (home-page "https://quantstack.net/xtensor") |
70770b93 FT |
1093 | (synopsis "C++ tensors with broadcasting and lazy computing") |
1094 | (description "xtensor is a C++ library meant for numerical analysis with | |
1095 | multi-dimensional array expressions. | |
1096 | ||
1097 | xtensor provides: | |
1098 | @itemize | |
1099 | @item an extensible expression system enabling lazy broadcasting. | |
1100 | @item an API following the idioms of the C++ standard library. | |
1101 | @item tools to manipulate array expressions and build upon xtensor. | |
1102 | @end itemize") | |
1103 | (license license:bsd-3))) | |
3f074a21 AE |
1104 | |
1105 | (define-public gap | |
1106 | (package | |
1107 | (name "gap") | |
c8a227df | 1108 | (version "4.10.2") |
3f074a21 AE |
1109 | (source |
1110 | (origin | |
1111 | (method url-fetch) | |
1112 | (uri (string-append "https://www.gap-system.org/pub/gap/gap-" | |
1113 | (version-major+minor version) | |
1114 | "/tar.bz2/gap-" | |
1115 | version | |
1116 | ".tar.bz2")) | |
1117 | (sha256 | |
c8a227df | 1118 | (base32 "0cp6ddk0469zzv1m1vair6gm27ic6c5m77ri8rn0znq3gaps6x94")) |
3f074a21 AE |
1119 | (modules '((guix build utils) (ice-9 ftw) (srfi srfi-1))) |
1120 | (snippet | |
1121 | '(begin | |
1122 | ;; Delete the external gmp and zlib libraries | |
1123 | ;; and a subdirectory not needed for our build. | |
1124 | (for-each delete-file-recursively | |
1125 | '("extern" "hpcgap")) | |
1126 | ;; Delete a failing test. | |
1127 | ;; FIXME: This might be fixed in the next release, see | |
1128 | ;; https://github.com/gap-system/gap/issues/3292 | |
1129 | (delete-file "tst/testinstall/dir.tst") | |
1130 | ;; Delete all packages except for a fixed list. | |
1131 | (with-directory-excursion "pkg" | |
1132 | (for-each delete-file-recursively | |
1133 | (lset-difference string=? (scandir ".") | |
1134 | '("." ".." | |
1135 | ;; Necessary packages. | |
1136 | "GAPDoc-1.6.2" | |
1137 | "primgrp-3.3.2" | |
1138 | "SmallGrp-1.3" ; artistic2.0 | |
1139 | "transgrp" ; artistic2.0 for data, | |
1140 | ; gpl2 or gpl3 for code | |
1141 | ;; Recommanded package. | |
1142 | "io-4.5.4" ; gpl3+ | |
1143 | ;; Optional packages, searched for at start, | |
1144 | ;; and their depedencies. | |
1145 | "alnuth-3.1.0" | |
3f074a21 AE |
1146 | "autpgrp-1.10" |
1147 | "crisp-1.4.4" ; bsd-2 | |
bf95a142 | 1148 | "ctbllib" ; gpl3+ according to doc/chap0.txt |
3f074a21 AE |
1149 | "FactInt-1.6.2" |
1150 | "fga" | |
1151 | "irredsol-1.4" ; bsd-2 | |
bf95a142 | 1152 | "laguna-3.9.2" |
3f074a21 AE |
1153 | "polenta-1.3.8" |
1154 | "polycyclic-2.14" | |
1155 | "radiroot-2.8" | |
1156 | "resclasses-4.7.1" | |
1157 | "sophus-1.24" | |
bf95a142 AE |
1158 | "tomlib-1.2.7" ; gpl2+, clarified in the git repository |
1159 | ; and the next release | |
3f074a21 AE |
1160 | "utils-0.59")))) |
1161 | #t)))) | |
1162 | (build-system gnu-build-system) | |
1163 | (inputs | |
1164 | `(("gmp" ,gmp) | |
1165 | ("zlib" ,zlib))) | |
1166 | (arguments | |
bf95a142 AE |
1167 | `(#:modules ((ice-9 ftw) |
1168 | (srfi srfi-26) | |
1169 | (guix build gnu-build-system) | |
1170 | (guix build utils)) | |
1171 | #:phases | |
3f074a21 AE |
1172 | (modify-phases %standard-phases |
1173 | (add-after 'build 'build-packages | |
1174 | ;; Compile all packages that have not been deleted by the | |
1175 | ;; code snippet above. | |
1176 | (lambda _ | |
1177 | (setenv "CONFIG_SHELL" (which "bash")) | |
1178 | (with-directory-excursion "pkg" | |
1179 | (invoke "../bin/BuildPackages.sh") | |
1180 | #t))) | |
1181 | (add-after 'build-packages 'build-doc | |
1182 | ;; The documentation is bundled, but we create it from source. | |
1183 | (lambda _ | |
1184 | (with-directory-excursion "doc" | |
1185 | (invoke "./make_doc")) | |
1186 | #t)) | |
3f074a21 AE |
1187 | (replace 'install |
1188 | (lambda* (#:key outputs #:allow-other-keys) | |
1189 | (let* ((out (assoc-ref outputs "out")) | |
1190 | (bin (string-append out "/bin")) | |
bf95a142 | 1191 | (lib (string-append out "/lib")) |
3f074a21 AE |
1192 | (prog (string-append bin "/gap")) |
1193 | (prog-real (string-append bin "/.gap-real")) | |
1194 | (share (string-append out "/share/gap")) | |
bf95a142 AE |
1195 | (include (string-append out "/include/gap")) |
1196 | (include-hpc (string-append include "/hpc"))) | |
3f074a21 AE |
1197 | ;; Install only the gap binary; the gac compiler is left |
1198 | ;; for maybe later. "Wrap" it in a shell script that calls | |
1199 | ;; the binary with the correct parameter. | |
1200 | (mkdir-p bin) | |
1201 | (copy-file "gap" prog-real) | |
1202 | (call-with-output-file prog | |
1203 | (lambda (port) | |
1204 | (format port | |
1205 | "#!~a~%exec ~a -l ~a \"$@\"~%" | |
1206 | (which "bash") | |
1207 | prog-real | |
1208 | share))) | |
1209 | (chmod prog #o755) | |
bf95a142 AE |
1210 | ;; Install the headers, which are needed by Sage. The |
1211 | ;; Makefile target "install-headers" was available in | |
1212 | ;; gap-4.10.0, but has been commented out in gap-4.10.1. | |
1213 | (mkdir-p include-hpc) | |
3f074a21 | 1214 | (install-file "gen/config.h" include) |
bf95a142 AE |
1215 | (let ((file-name-predicate-without-stat |
1216 | (lambda (regex) | |
1217 | (cut (file-name-predicate regex) <> #f)))) | |
1218 | (with-directory-excursion "src" | |
1219 | (for-each | |
1220 | (cut install-file <> include) | |
1221 | (scandir "." | |
1222 | (file-name-predicate-without-stat ".*\\.h$")))) | |
1223 | (with-directory-excursion "src/hpc" | |
1224 | (for-each | |
1225 | (cut install-file <> include-hpc) | |
1226 | (scandir "." | |
1227 | (file-name-predicate-without-stat ".*\\.h$"))))) | |
1228 | ;; Install the library, which is needed by Sage. The | |
1229 | ;; Makefile target "install-libgap" was available in | |
1230 | ;; gap-4.10.0, but has been commented out in gap-4.10.1. | |
1231 | ;; Compared to the Makefile, which used libtool, the | |
1232 | ;; following approach of copying files and making symlinks | |
1233 | ;; is rather pedestrian. There is hope that some later | |
1234 | ;; version of gap reinstates and completes the install | |
1235 | ;; targets. | |
1236 | (invoke "make" "libgap.la") | |
1237 | (install-file "libgap.la" lib) | |
1238 | (install-file ".libs/libgap.so.0.0.0" lib) | |
1239 | (symlink "libgap.so.0.0.0" (string-append lib "/libgap.so")) | |
1240 | (symlink "libgap.so.0.0.0" (string-append lib "/libgap.so.0")) | |
3f074a21 AE |
1241 | ;; Install a certain number of files and directories to |
1242 | ;; SHARE, where the wrapped shell script expects them. | |
1243 | ;; Remove information on the build directory from sysinfo.gap. | |
1244 | (substitute* "sysinfo.gap" | |
1245 | (("GAP_BIN_DIR=\".*\"") "GAP_BIN_DIR=\"\"") | |
1246 | (("GAP_LIB_DIR=\".*\"") "GAP_LIB_DIR=\"\"") | |
1247 | (("GAP_CPPFLAGS=\".*\"") "GAP_CPPFLAGS=\"\"")) | |
1248 | (install-file "sysinfo.gap" share) | |
1249 | (copy-recursively "grp" (string-append share "/grp")) | |
1250 | (copy-recursively "pkg" (string-append share "/pkg")) | |
1251 | ;; The following is not the C library libgap.so, but a | |
1252 | ;; library of GAP code. | |
1253 | (copy-recursively "lib" (string-append share "/lib")) | |
1254 | ;; The gap binary looks for documentation inside SHARE. | |
1255 | (copy-recursively "doc" (string-append share "/doc"))) | |
1256 | #t))))) | |
1257 | (home-page "https://www.gap-system.org/") | |
1258 | (synopsis | |
1259 | "System for computational group theory") | |
1260 | (description | |
1261 | "GAP is a system for computational discrete algebra, with particular | |
1262 | emphasis on computational group theory. It provides a programming language, | |
1263 | a library of thousands of functions implementing algebraic algorithms | |
1264 | written in the GAP language as well as large data libraries of algebraic | |
1265 | objects.") | |
1266 | ;; Some packages have different licenses (effectively forcing the | |
1267 | ;; combined work to be licensed as gpl3+); if this is the case, this | |
1268 | ;; is mentioned above next to their name. | |
1269 | ;; Some packages have no license mentioned explicitly; supposedly this | |
1270 | ;; means that the gpl2+ licence of GAP itself applies, but to be on the | |
1271 | ;; safe side, we drop them for now. | |
1272 | (license license:gpl2+))) | |
f0fbb31d AE |
1273 | |
1274 | (define-public givaro | |
1275 | (package | |
1276 | (name "givaro") | |
1277 | (version "4.1.1") | |
1278 | (source (origin | |
1279 | (method git-fetch) | |
1280 | (uri (git-reference | |
1281 | (url "https://github.com/linbox-team/givaro") | |
1282 | (commit (string-append "v" version)))) | |
1283 | (file-name (git-file-name name version)) | |
1284 | (sha256 | |
1285 | (base32 | |
1286 | "11wz57q6ijsvfs5r82masxgr319as92syi78lnl9lgdblpc6xigk")))) | |
1287 | (build-system gnu-build-system) | |
1288 | (native-inputs | |
1289 | `(("autoconf" ,autoconf) | |
1290 | ("automake" ,automake) | |
1291 | ("libtool" ,libtool))) | |
1292 | (propagated-inputs | |
1293 | `(("gmp" ,gmp))) ; gmp++.h includes gmpxx.h | |
f0fbb31d AE |
1294 | (synopsis "Algebraic computations with exact rings and fields") |
1295 | (description | |
1296 | "Givaro is a C++ library implementing the basic arithmetic of various | |
1297 | algebraic objects: prime fields, extension fields, finite fields, finite | |
1298 | rings, polynomials, algebraic numbers, arbitrary precision integers and | |
1299 | rationals (C++ wrappers over gmp), fixed precision integers. It also | |
1300 | provides data-structures and templated classes for the manipulation of | |
1301 | compound objects, such as vectors, matrices and univariate polynomials.") | |
1302 | (license license:cecill-b) | |
1303 | (home-page "https://github.com/linbox-team/givaro"))) | |
4bf9cb40 AE |
1304 | |
1305 | (define-public fflas-ffpack | |
1306 | (package | |
1307 | (name "fflas-ffpack") | |
1308 | (version "2.4.3") | |
1309 | (source (origin | |
1310 | (method git-fetch) | |
1311 | (uri (git-reference | |
1312 | (url "https://github.com/linbox-team/fflas-ffpack") | |
1313 | (commit version))) | |
1314 | (file-name (git-file-name name version)) | |
1315 | (sha256 | |
1316 | (base32 | |
1317 | "1ynbjd72qrwp0b4kpn0p5d7gddpvj8dlb5fwdxajr5pvkvi3if74")))) | |
1318 | (build-system gnu-build-system) | |
1319 | (native-inputs | |
1320 | `(("autoconf" ,autoconf) | |
1321 | ("automake" ,automake) | |
1322 | ("libtool" ,libtool) | |
1323 | ("pkg-config" ,pkg-config))) | |
1324 | (inputs | |
1325 | `(("openblas" ,openblas))) | |
1326 | (propagated-inputs | |
1327 | `(("givaro" ,givaro))) ; required according to the .pc file | |
1328 | (arguments | |
1329 | `(#:configure-flags | |
1330 | (list (string-append "--with-blas-libs=" | |
1331 | (assoc-ref %build-inputs "openblas") | |
778d6b52 | 1332 | "/lib/libopenblas.so")))) |
4bf9cb40 AE |
1333 | (synopsis "C++ library for linear algebra over finite fields") |
1334 | (description | |
1335 | "FFLAS-FFPACK is a C++ template library for basic linear algebra | |
1336 | operations over a finite field. | |
1337 | FFLAS (Finite Field Linear Algebra Subprograms) provides the implementation | |
1338 | of a subset of routines of the numerical BLAS; it also supports sparse | |
1339 | matrix-vector products. | |
1340 | FFPACK (Finite Field Linear Algebra Package) is inspired by the LAPACK | |
1341 | library to provide functionalities of higher level, using the kernel | |
1342 | of a BLAS. Additionally, it provides routines specific to exact linear | |
1343 | algebra, such as the row echelon form.") | |
1344 | (license license:lgpl2.1+) | |
1345 | (home-page "https://linbox-team.github.io/fflas-ffpack/"))) | |
a612f866 AE |
1346 | |
1347 | (define-public linbox | |
1348 | (package | |
1349 | (name "linbox") | |
1350 | (version "1.6.3") | |
1351 | (source (origin | |
1352 | (method git-fetch) | |
1353 | (uri (git-reference | |
1354 | (url "https://github.com/linbox-team/linbox") | |
1355 | (commit (string-append "v" version)))) | |
1356 | (file-name (git-file-name name version)) | |
1357 | (sha256 | |
1358 | (base32 | |
1359 | "10j6dspbsq7d2l4q3y0c1l1xwmaqqba2fxg59q5bhgk9h5d7q571")))) | |
1360 | (build-system gnu-build-system) | |
1361 | (native-inputs | |
1362 | `(("autoconf" ,autoconf) | |
1363 | ("automake" ,automake) | |
1364 | ("libtool" ,libtool) | |
1365 | ("pkg-config" ,pkg-config))) | |
1366 | (inputs | |
1367 | `(("fflas-ffpack" ,fflas-ffpack))) | |
a612f866 AE |
1368 | (synopsis "C++ library for linear algebra over exact rings") |
1369 | (description | |
1370 | "LinBox is a C++ template library for exact linear algebra computation | |
1371 | with dense, sparse, and structured matrices over the integers and over | |
1372 | finite fields.") | |
1373 | (license license:lgpl2.1+) | |
1374 | (home-page "https://linbox-team.github.io/linbox/"))) | |
37edfb0f AE |
1375 | |
1376 | (define-public m4ri | |
1377 | (package | |
1378 | (name "m4ri") | |
1379 | (version "20140914") | |
1380 | (source (origin | |
1381 | (method git-fetch) | |
1382 | (uri (git-reference | |
1383 | (url "https://bitbucket.org/malb/m4ri") | |
1384 | (commit (string-append "release-" version)))) | |
1385 | (file-name (git-file-name name version)) | |
1386 | (sha256 | |
1387 | (base32 | |
1388 | "0xfg6pffbn8r1s0y7bn9b8i55l00d41dkmhrpf7pwk53qa3achd3")))) | |
1389 | (build-system gnu-build-system) | |
1390 | (native-inputs | |
1391 | `(("autoconf" ,autoconf) | |
1392 | ("automake" ,automake) | |
1393 | ("libtool" ,libtool) | |
1394 | ("pkg-config" ,pkg-config))) | |
1395 | (inputs | |
1396 | `(("libpng" ,libpng))) | |
1397 | (synopsis "Arithmetic of dense matrices over F_2") | |
1398 | (description "M4RI is a library for fast arithmetic with dense matrices | |
1399 | over F2. The name M4RI comes from the first implemented algorithm: The | |
1400 | Method of the Four Russians inversion algorithm published by Gregory Bard. | |
1401 | This algorithm in turn is named after the Method of the Four Russians | |
1402 | multiplication algorithm.") | |
1403 | (license license:gpl2+) | |
1404 | (home-page "https://bitbucket.org/malb/m4ri/"))) | |
ab398380 | 1405 | |
75a73bb0 NG |
1406 | (define-public symmetrica |
1407 | (package | |
1408 | (name "symmetrica") | |
1409 | (version "2.0") | |
1410 | (source (origin | |
1411 | (method url-fetch/tarbomb) | |
1412 | (uri (let ((v (string-join (string-split version #\.) "_"))) | |
1413 | (string-append "http://www.algorithm.uni-bayreuth.de/" | |
1414 | "en/research/SYMMETRICA/" | |
1415 | "SYM" v "_tar.gz"))) | |
1416 | (sha256 | |
1417 | (base32 | |
1418 | "1qhfrbd5ybb0sinl9pad64rscr08qvlfzrzmi4p4hk61xn6phlmz")) | |
1419 | ;; Taken from <https://git.sagemath.org/sage.git/plain/build/pkgs/symmetrica/patches/> | |
1420 | (patches (search-patches "symmetrica-bruch.patch" | |
1421 | "symmetrica-int32.patch" | |
1422 | "symmetrica-return_values.patch" | |
1423 | "symmetrica-sort_sum_rename.patch")))) | |
1424 | (build-system gnu-build-system) | |
1425 | (arguments | |
1426 | `(#:tests? #f ;no test | |
1427 | #:phases | |
1428 | (modify-phases %standard-phases | |
1429 | (add-after 'unpack 'fix-makefile | |
1430 | (lambda _ | |
1431 | (substitute* "makefile" | |
e6eafd42 | 1432 | (("cc -c") "gcc -c -fPIC")) |
75a73bb0 NG |
1433 | #t)) |
1434 | (add-after 'fix-makefile 'turn-off-banner | |
1435 | (lambda _ | |
1436 | (substitute* "de.c" | |
1437 | (("(INT no_banner = )FALSE" _ pre) (string-append pre "TRUE"))) | |
1438 | #t)) | |
1439 | (delete 'configure) ;no configure script | |
1440 | (replace 'install ;no install target | |
1441 | (lambda* (#:key outputs #:allow-other-keys) | |
1442 | (let* ((out (assoc-ref outputs "out")) | |
1443 | (lib (string-append out "/lib")) | |
1444 | (inc (string-append out "/include/symmetrica")) | |
1445 | (doc (string-append out "/share/doc/symmetrica-" ,version)) | |
1446 | (static "libsymmetrica.a")) | |
1447 | ;; Build static library. | |
1448 | (apply invoke "ar" "crs" static (find-files "." "\\.o$")) | |
1449 | (invoke "ranlib" static) | |
1450 | ;; Install static library and headers. | |
1451 | (for-each (lambda (f) (install-file f inc)) | |
1452 | (find-files "." "\\.h$")) | |
1453 | (install-file "libsymmetrica.a" lib) | |
1454 | ;; Install documentation. | |
1455 | (for-each (lambda (f) (install-file f doc)) | |
1456 | (find-files "." "\\.doc$")) | |
1457 | #t)))))) | |
1458 | (home-page "http://www.algorithm.uni-bayreuth.de/en/research/SYMMETRICA/") | |
1459 | (synopsis "Combinatoric C Library") | |
1460 | (description "Symmetrica is a library for combinatorics. It has support | |
1461 | for the representation theory of the symmetric group and related groups, | |
1462 | combinatorics of tableaux, symmetric functions and polynomials, Schubert | |
1463 | polynomials, and the representation theory of Hecke algebras of type A_n.") | |
1464 | (license license:public-domain))) | |
6cbedbd2 AE |
1465 | |
1466 | (define-public m4rie | |
1467 | (package | |
1468 | (name "m4rie") | |
1469 | (version "20150908") | |
1470 | (source (origin | |
1471 | (method git-fetch) | |
1472 | (uri (git-reference | |
1473 | (url "https://bitbucket.org/malb/m4rie") | |
1474 | (commit (string-append "release-" version)))) | |
1475 | (file-name (git-file-name name version)) | |
1476 | (sha256 | |
1477 | (base32 | |
1478 | "0r8lv46qx5mkz5kp3ay2jnsp0mbhlqr5z2z220wdk73wdshcznss")))) | |
1479 | (build-system gnu-build-system) | |
1480 | (native-inputs | |
1481 | `(("autoconf" ,autoconf) | |
1482 | ("automake" ,automake) | |
1483 | ("libtool" ,libtool))) | |
1484 | (inputs | |
1485 | `(("m4ri" ,m4ri))) | |
1486 | (synopsis "Arithmetic of dense matrices over F_{2^e}") | |
1487 | (description "M4RI is a library for fast arithmetic with dense matrices | |
1488 | over finite fields of characteristic 2. So it extends the functionality | |
1489 | of M4RI from F_2 to F_{2^e}.") | |
1490 | (license license:gpl2+) | |
1491 | (home-page "https://bitbucket.org/malb/m4rie/"))) | |
66c67e7b AE |
1492 | |
1493 | (define-public eclib | |
1494 | (package | |
1495 | (name "eclib") | |
9a5f35fe | 1496 | (version "20190909") |
66c67e7b AE |
1497 | (source (origin |
1498 | (method git-fetch) | |
1499 | (uri (git-reference | |
1500 | (url "https://github.com/JohnCremona/eclib/") | |
1501 | (commit (string-append "v" version)))) | |
1502 | (file-name (git-file-name name version)) | |
1503 | (sha256 | |
1504 | (base32 | |
9a5f35fe | 1505 | "1gw27lqc3f525n8qdcmr2nyn16y9g10z9f6dnmckyyxcdzvhq35n")))) |
66c67e7b AE |
1506 | (build-system gnu-build-system) |
1507 | (native-inputs | |
1508 | `(("autoconf" ,autoconf) | |
1509 | ("automake" ,automake) | |
1510 | ("libtool" ,libtool))) | |
1511 | (inputs | |
d96ad7fa | 1512 | `(("ntl" ,ntl) |
66c67e7b AE |
1513 | ("pari-gp" ,pari-gp))) |
1514 | (synopsis "Ranks of elliptic curves and modular symbols") | |
1515 | (description "The eclib package includes mwrank (for 2-descent on | |
1516 | elliptic curves over Q) and modular symbol code; it has been written by | |
1517 | John Cremona to compute his elliptic curve database.") | |
1518 | (license license:gpl2+) | |
1519 | (home-page (string-append "http://homepages.warwick.ac.uk/staff/" | |
1520 | "J.E.Cremona/mwrank/index.html")))) | |
197ebc36 AE |
1521 | |
1522 | (define-public lrcalc | |
1523 | (package | |
1524 | (name "lrcalc") | |
1525 | (version "1.2") | |
1526 | (source (origin | |
1527 | (method git-fetch) | |
1528 | (uri (git-reference | |
1529 | (url "https://bitbucket.org/asbuch/lrcalc") | |
1530 | (commit (string-append "lrcalc-" version)))) | |
1531 | (file-name (git-file-name name version)) | |
1532 | (sha256 | |
1533 | (base32 | |
88f913e8 AE |
1534 | "1c12d04jdyxkkav4ak8d1aqrv594gzihwhpxvc6p9js0ry1fahss")) |
1535 | (patches (search-patches "lrcalc-includes.patch")))) | |
197ebc36 AE |
1536 | (build-system gnu-build-system) |
1537 | (native-inputs | |
1538 | `(("autoconf" ,autoconf) | |
1539 | ("automake" ,automake) | |
1540 | ("libtool" ,libtool))) | |
1541 | (arguments | |
1542 | `(#:phases | |
1543 | (modify-phases %standard-phases | |
1544 | (add-before 'build 'fix-permission | |
1545 | (lambda _ | |
1546 | (chmod "lrcalc.maple.src" #o644) | |
1547 | #t))))) | |
1548 | (synopsis "Littlewood-Richardson calculator in algebraic combinatorics") | |
1549 | (description "The Littlewood-Richardson Calculator (lrcalc) is a | |
1550 | program designed to compute Littlewood-Richardson coefficients. It computes | |
1551 | single Littlewood-Richardson coefficients, products of Schur functions, or | |
1552 | skew Schur functions. In addition it computes products in the small quantum | |
1553 | cohomology ring of a Grassmann variety. The software package also includes | |
1554 | a program that performs fast computation of the more general multiplicative | |
1555 | structure constants of Schubert polynomials.") | |
1556 | (license license:gpl2+) | |
1e30dff3 | 1557 | (home-page "https://sites.math.rutgers.edu/~asbuch/lrcalc/"))) |
eacf2983 AE |
1558 | |
1559 | (define-public iml | |
1560 | (package | |
1561 | (name "iml") | |
1562 | (version "1.0.5") | |
1563 | (source | |
1564 | (origin | |
1565 | (method url-fetch) | |
1566 | (uri (string-append "http://www.cs.uwaterloo.ca/~astorjoh/iml-" | |
1567 | version ".tar.bz2")) | |
1568 | (sha256 | |
1569 | (base32 | |
1570 | "0akwhhz9b40bz6lrfxpamp7r7wkk48p455qbn04mfnl9a1l6db8x")))) | |
1571 | (build-system gnu-build-system) | |
1572 | (inputs | |
1573 | `(("gmp", gmp) | |
1574 | ("cblas" ,openblas))) ; or any other BLAS library; the documentation | |
1575 | ; mentions ATLAS in particular | |
1576 | (arguments | |
1577 | `(#:configure-flags | |
1578 | (list | |
c68ec87c | 1579 | "--enable-shared" |
eacf2983 AE |
1580 | (string-append "--with-gmp-include=" |
1581 | (assoc-ref %build-inputs "gmp") "/include") | |
1582 | (string-append "--with-gmp-lib=" | |
1583 | (assoc-ref %build-inputs "gmp") "/lib") | |
1584 | "--with-cblas=-lopenblas" | |
1585 | (string-append "--with-cblas-include=" | |
1586 | (assoc-ref %build-inputs "cblas") "/include") | |
1587 | (string-append "--with-cblas-lib=" | |
1588 | (assoc-ref %build-inputs "cblas") "/lib")))) | |
1589 | (home-page "https://cs.uwaterloo.ca/~astorjoh/iml.html") | |
1590 | (synopsis | |
1591 | "Solver for systems of linear equations over the integers") | |
1592 | (description | |
1593 | "IML is a C library implementing algorithms for computing exact | |
1594 | solutions to dense systems of linear equations over the integers. | |
1595 | Currently, IML provides the following functionality: | |
1596 | ||
1597 | @itemize | |
1598 | @item Nonsingular rational system solving: | |
1599 | compute the unique rational solution X to the system AX=B, where A and B | |
1600 | are integer matrices, A nonsingular. | |
1601 | @item Compute the right nullspace or kernel of an integer matrix. | |
1602 | @item Certified linear system solving: | |
1603 | compute a minimal denominator solution x to a system Ax=b, where b is an | |
1604 | integer vector and A is an integer matrix with arbitrary shape and | |
1605 | rank profile. | |
1606 | @end itemize | |
1607 | ||
1608 | In addition, IML provides some low level routines for a variety of mod p | |
1609 | matrix operations: computing the row-echelon form, determinant, rank | |
1610 | profile, and inverse of a mod p matrix. These mod p routines are not | |
1611 | general purpose; they require that p satisfy some preconditions based on | |
1612 | the dimension of the input matrix (usually p should be prime and should be | |
1613 | no more than about 20 bits long).") | |
1614 | (license license:bsd-3))) |