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