Commit | Line | Data |
---|---|---|
adba6466 AE |
1 | ;;; GNU Guix --- Functional package management for GNU |
2 | ;;; Copyright © 2019 Andreas Enge <andreas@enge.fr> | |
a65f1e8e | 3 | ;;; Copyright © 2019 Nicolas Goaziou <mail@nicolasgoaziou.fr> |
078d2d0d | 4 | ;;; Copyright © 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr> |
5b9822cf | 5 | ;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net> |
6be27146 | 6 | ;;; Copyright © 2021 Efraim Flashner <efraim@flashner.co.il> |
adba6466 AE |
7 | ;;; |
8 | ;;; This file is part of GNU Guix. | |
9 | ;;; | |
10 | ;;; GNU Guix is free software; you can redistribute it and/or modify it | |
11 | ;;; under the terms of the GNU General Public License as published by | |
12 | ;;; the Free Software Foundation; either version 3 of the License, or (at | |
13 | ;;; your option) any later version. | |
14 | ;;; | |
15 | ;;; GNU Guix is distributed in the hope that it will be useful, but | |
16 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 | ;;; GNU General Public License for more details. | |
19 | ;;; | |
20 | ;;; You should have received a copy of the GNU General Public License | |
21 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | |
22 | ||
23 | (define-module (gnu packages sagemath) | |
24 | #:use-module ((guix licenses) #:prefix license:) | |
20caeea4 | 25 | #:use-module (guix build-system gnu) |
adba6466 | 26 | #:use-module (guix build-system python) |
972ef8f5 AE |
27 | #:use-module (guix download) |
28 | #:use-module (guix git-download) | |
29 | #:use-module (guix packages) | |
9fafb0d2 | 30 | #:use-module (guix utils) |
fedb9571 | 31 | #:use-module (gnu packages) |
adba6466 | 32 | #:use-module (gnu packages algebra) |
972ef8f5 | 33 | #:use-module (gnu packages autotools) |
4c32f116 | 34 | #:use-module (gnu packages bdw-gc) |
a1dcaacb | 35 | #:use-module (gnu packages boost) |
5e388a6e | 36 | #:use-module (gnu packages compression) |
a1dcaacb | 37 | #:use-module (gnu packages image) |
5b9822cf | 38 | #:use-module (gnu packages lisp) |
adba6466 | 39 | #:use-module (gnu packages multiprecision) |
3923e9d9 | 40 | #:use-module (gnu packages pkg-config) |
adba6466 AE |
41 | #:use-module (gnu packages python) |
42 | #:use-module (gnu packages python-xyz)) | |
43 | ||
44 | ||
45 | (define-public python-cypari2 | |
ff33c38c AE |
46 | (package |
47 | (name "python-cypari2") | |
6be27146 | 48 | (version "2.1.2") |
ff33c38c | 49 | (source |
adba6466 AE |
50 | (origin |
51 | (method url-fetch) | |
52 | (uri (pypi-uri "cypari2" version)) | |
53 | (sha256 | |
ff33c38c | 54 | (base32 |
6be27146 | 55 | "0ymc4i9y60aazscc1blivirkr1rflzz6akkmvfzyn5l7mgnlbk83")))) |
ff33c38c AE |
56 | (build-system python-build-system) |
57 | (native-inputs | |
adba6466 | 58 | `(("python-cython" ,python-cython))) |
ff33c38c | 59 | (propagated-inputs |
adba6466 | 60 | `(("python-cysignals" ,python-cysignals))) |
ff33c38c | 61 | (inputs |
adba6466 | 62 | `(("gmp" ,gmp) |
1628d57b | 63 | ("pari-gp" ,pari-gp))) |
ff33c38c AE |
64 | (home-page "https://cypari2.readthedocs.io/") |
65 | (synopsis | |
adba6466 | 66 | "Python interface to the number theory library libpari") |
ff33c38c | 67 | (description |
adba6466 AE |
68 | "Cypari2 provides a Python interface to the number theory library |
69 | PARI/GP. It has been spun off from the SageMath mathematics software system, | |
70 | but it can be used independently.") | |
ff33c38c | 71 | (license license:gpl2+))) |
adba6466 AE |
72 | |
73 | (define-public python2-cypari2 | |
74 | (package-with-python2 python-cypari2)) | |
75 | ||
5e388a6e | 76 | ;; The stable version of the following package is not young enough to be |
538230c9 AE |
77 | ;; used with Sage, since it does not support cython; so we use a beta |
78 | ;; release. | |
5e388a6e AE |
79 | (define-public python-gmpy2 |
80 | (package | |
af5ead8b | 81 | (name "python-gmpy2") |
538230c9 | 82 | (version "2.1.0b1") |
af5ead8b | 83 | (source (origin |
538230c9 AE |
84 | (method git-fetch) |
85 | (uri (git-reference | |
86 | (url "https://github.com/aleaxit/gmpy") | |
87 | (commit (string-append "gmpy2-" version)))) | |
88 | (file-name (git-file-name name version)) | |
af5ead8b MB |
89 | (sha256 |
90 | (base32 | |
538230c9 | 91 | "0ljvnmhxqdfsp0yy4c2hynhk5sggm63kkqsq4iwq4k9vsnx2xm97")))) |
af5ead8b MB |
92 | (build-system python-build-system) |
93 | (native-inputs | |
94 | `(("unzip" ,unzip))) | |
95 | (inputs | |
96 | `(("gmp" ,gmp) | |
97 | ("mpfr" ,mpfr) | |
98 | ("mpc" ,mpc))) | |
99 | (home-page "https://github.com/aleaxit/gmpy") | |
100 | (synopsis | |
5e388a6e | 101 | "GMP/MPIR, MPFR, and MPC interface to Python 2.6+ and 3.x") |
af5ead8b | 102 | (description |
ec6f1a0e AE |
103 | "This package provides a Python interface to the GNU multiprecision |
104 | libraries GMO, MPFR and MPC.") | |
af5ead8b | 105 | (license license:lgpl3+))) |
5e388a6e AE |
106 | |
107 | (define-public python2-gmpy2 | |
108 | (package-with-python2 python-gmpy2)) | |
20caeea4 AE |
109 | |
110 | (define-public cliquer | |
111 | (package | |
112 | (name "cliquer") | |
113 | (version "1.21") | |
114 | ;; The original source package is available from the home page and | |
115 | ;; has not seen any release since 2010; it comes with only a Makefile | |
116 | ;; without an "install" target. Instead, there is an autotoolized | |
117 | ;; tarball available from the Sage project. | |
118 | (source | |
119 | (origin | |
120 | (method url-fetch) | |
121 | (uri "http://users.ox.ac.uk/~coml0531/sage/cliquer-1.21.tar.gz") | |
122 | (sha256 | |
123 | (base32 | |
124 | "1hdzrmrx0nvvj8kbwxrs8swqgkd284khzl623jizixcv28xb77aq")))) | |
125 | (build-system gnu-build-system) | |
126 | (synopsis "C routines for finding cliques in weighted graphs") | |
127 | (description "Cliquer is a set of reentrant C routines for finding | |
128 | cliques in a weighted or unweighted graph. It uses an exact | |
129 | branch-and-bound algorithm. It can search for maximum or maximum-weight | |
130 | cliques or cliques with size or weight within a given range, restrict the | |
131 | search to maximal cliques, store cliques in memory and call a user-defined | |
132 | function for every found clique.") | |
133 | (license license:gpl2+) | |
134 | (home-page "https://users.aalto.fi/~pat/cliquer.html"))) | |
972ef8f5 AE |
135 | |
136 | (define-public libbraiding | |
137 | (package | |
138 | (name "libbraiding") | |
139 | (version "1.0") | |
140 | (source | |
141 | (origin | |
142 | (method git-fetch) | |
143 | (uri (git-reference | |
144 | (url (string-append "https://github.com/miguelmarco/" | |
145 | name)) | |
146 | (commit version))) | |
147 | (file-name (git-file-name name version)) | |
148 | (sha256 | |
149 | (base32 | |
150 | "0l68rikfr7k2l547gb3pp3g8cj5zzxwipm79xrb5r8ffj466ydxg")))) | |
151 | (build-system gnu-build-system) | |
152 | (native-inputs | |
153 | `(("autoconf" ,autoconf) | |
154 | ("automake" ,automake) | |
155 | ("libtool" ,libtool))) | |
156 | (synopsis "Computations with braid groups") | |
157 | (description "libbraiding performs computations with braid groups, | |
158 | in particular it computes normal forms of group elements.") | |
159 | (license license:gpl2+) | |
160 | (home-page "https://github.com/miguelmarco/libbraiding"))) | |
4c32f116 AE |
161 | |
162 | (define-public libhomfly | |
163 | (package | |
164 | (name "libhomfly") | |
165 | (version "1.02r6") | |
166 | (source | |
167 | (origin | |
168 | (method git-fetch) | |
169 | (uri (git-reference | |
170 | (url (string-append "https://github.com/miguelmarco/" | |
171 | name)) | |
172 | (commit version))) | |
173 | (file-name (git-file-name name version)) | |
174 | (sha256 | |
175 | (base32 | |
176 | "0sv3cwrf9v9sb5a8wbhjmarxvya13ma3j8y8592f9ymxlk5y0ldk")))) | |
177 | (build-system gnu-build-system) | |
178 | (native-inputs | |
179 | `(("autoconf" ,autoconf) | |
180 | ("automake" ,automake) | |
181 | ("libtool" ,libtool))) | |
182 | (inputs | |
183 | `(("libgc" ,libgc))) | |
184 | (synopsis "Computation of homfly polynomials of links") | |
185 | (description "libhomfly computes homfly polynomials of links, | |
186 | represented as strings.") | |
187 | (license license:public-domain) | |
188 | (home-page "https://github.com/miguelmarco/libhomfly"))) | |
80a70da7 | 189 | |
5b9822cf JK |
190 | ;; Sage 9.1 doesn't build with ECL 20. This won't be necessary once 9.2 is |
191 | ;; released. See https://trac.sagemath.org/ticket/22191 | |
192 | (define-public ecl-16 | |
193 | (package | |
194 | (inherit ecl) | |
195 | (version "16.1.3") | |
196 | (source | |
197 | (origin | |
198 | (method url-fetch) | |
199 | (uri (string-append | |
200 | "https://common-lisp.net/project/ecl/static/files/release/ecl" | |
201 | "-" version ".tgz")) | |
202 | (sha256 | |
203 | (base32 "0m0j24w5d5a9dwwqyrg0d35c0nys16ijb4r0nyk87yp82v38b9bn")) | |
204 | (patches (search-patches | |
205 | "ecl-16-libffi.patch" | |
206 | "ecl-16-ignore-stderr-write-error.patch" | |
207 | "ecl-16-format-directive-limit.patch")))) | |
208 | ;; Current ECL uses LGPL 2.1+ | |
209 | (license license:lgpl2.0+))) | |
210 | ||
3923e9d9 AE |
211 | (define-public pynac |
212 | (package | |
213 | (name "pynac") | |
1c49b94b | 214 | (version "0.7.26") |
3923e9d9 AE |
215 | (source |
216 | (origin | |
217 | (method git-fetch) | |
218 | (uri (git-reference | |
219 | (url "https://github.com/pynac/pynac/") | |
220 | (commit (string-append "pynac-" version)))) | |
221 | (file-name (git-file-name name version)) | |
222 | (sha256 | |
1c49b94b | 223 | (base32 "09d2p74x1arkydlxy6pw4p4byi7r8q7f29w373h4d8a215kadc6d")))) |
3923e9d9 AE |
224 | (build-system gnu-build-system) |
225 | (native-inputs | |
226 | `(("autoconf" ,autoconf) | |
227 | ("automake" ,automake) | |
228 | ("libtool" ,libtool) | |
229 | ("pkg-config" ,pkg-config))) | |
230 | (inputs | |
231 | `(("flint" ,flint) | |
232 | ("gmp" ,gmp) | |
233 | ("python" ,python) | |
234 | ("singular" ,singular))) | |
235 | (synopsis "Sage fork of GiNaC") | |
236 | (description "Pynac is a derivative of the C++ library GiNaC, which | |
237 | allows manipulation of symbolic expressions. It currently provides the | |
238 | backend for symbolic expressions in Sage. The main difference between | |
239 | Pynac and GiNaC is that Pynac relies on Sage to provide the operations | |
240 | on numerical types, while GiNaC depends on CLN for this purpose.") | |
241 | (license license:gpl2+) | |
242 | (home-page "http://pynac.org/"))) | |
01822e3e AE |
243 | |
244 | ;; Sage has become upstream of the following package. | |
80ee7c4a | 245 | (define-public zn-poly |
01822e3e | 246 | (package |
80ee7c4a | 247 | (name "zn-poly") |
3799d46c | 248 | (version "0.9.2") |
01822e3e AE |
249 | (source |
250 | (origin | |
251 | (method git-fetch) | |
252 | (uri (git-reference | |
253 | (url (string-append "https://gitlab.com/sagemath/" | |
80ee7c4a | 254 | "zn_poly.git/")) |
01822e3e | 255 | (commit version))) |
80ee7c4a | 256 | (file-name (git-file-name "zn_poly" version)) |
01822e3e | 257 | (sha256 |
3799d46c | 258 | (base32 "1wbc3apxcldxfcw1dnwnn7fvlfb6bwvlr8glvgv6hf79p9r2s4j0")))) |
01822e3e AE |
259 | (build-system gnu-build-system) |
260 | (native-inputs | |
261 | `(("python" ,python-2))) | |
262 | (inputs | |
263 | `(("gmp" ,gmp))) | |
264 | (arguments | |
265 | `(#:phases | |
266 | (modify-phases %standard-phases | |
267 | (replace 'configure | |
268 | ;; The configure script chokes on --enable-fast-install. | |
269 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
270 | (invoke "./configure" | |
271 | (string-append "--prefix=" (assoc-ref outputs "out")) | |
272 | "--cflags=-O3 -fPIC"))) | |
273 | (add-before 'build 'prepare-build | |
274 | (lambda _ | |
275 | (setenv "CC" "gcc") | |
276 | #t)) | |
277 | (add-after 'build 'build-so | |
278 | (lambda _ | |
279 | (invoke "make" "libzn_poly.so"))) | |
280 | (add-after 'install 'install-so | |
281 | (lambda* (#:key outputs #:allow-other-keys) | |
e6049c84 AE |
282 | (let* ((out (assoc-ref outputs "out")) |
283 | (lib (string-append out "/lib")) | |
284 | (soname (string-append "libzn_poly-" ,version ".so")) | |
285 | (target (string-append lib "/" soname))) | |
286 | (install-file "libzn_poly.a" lib) | |
287 | (install-file soname lib) | |
288 | (symlink target | |
289 | (string-append lib "/libzn_poly.so")) | |
290 | (symlink target | |
291 | (string-append lib "/libzn_poly-" | |
292 | ,(version-major+minor version) | |
293 | ".so"))) | |
294 | #t))))) | |
01822e3e AE |
295 | (synopsis "Arithmetic for polynomials over Z/NZ") |
296 | (description "zn_poly implements the arithmetic of polynomials the | |
297 | coefficients of which are modular integers.") | |
298 | (license (list license:gpl2 license:gpl3)) ; dual licensed | |
299 | (home-page "https://gitlab.com/sagemath/zn_poly"))) | |
a1dcaacb AE |
300 | |
301 | (define-public brial | |
302 | (package | |
303 | (name "brial") | |
707f15bc | 304 | (version "1.2.8") |
a1dcaacb AE |
305 | (source |
306 | (origin | |
307 | (method git-fetch) | |
308 | (uri (git-reference | |
309 | (url "https://github.com/BRiAl/BRiAl/") | |
310 | (commit version))) | |
311 | (file-name (git-file-name name version)) | |
312 | (sha256 | |
707f15bc | 313 | (base32 "0qhgckd4fvbs40jw14mvw89rccv94d3df27kipd27hxd4cx7y80y")))) |
a1dcaacb AE |
314 | (build-system gnu-build-system) |
315 | (native-inputs | |
316 | `(("autoconf" ,autoconf) | |
317 | ("automake" ,automake) | |
318 | ("libtool" ,libtool) | |
319 | ("pkg-config" ,pkg-config))) | |
320 | (inputs | |
321 | `(("boost" ,boost) | |
322 | ("libpng" ,libpng) | |
323 | ("m4ri" ,m4ri))) | |
324 | (arguments | |
325 | ;; We are missing the boost unit test framework. | |
326 | `(#:tests? #f | |
327 | #:configure-flags (list "--without-boost-unit-test-framework"))) | |
328 | (synopsis "Arithmetic of polynomials over boolean rings") | |
329 | (description "BRiAl is the successor to PolyBoRi maintained by the | |
330 | Sage community. Its core is a C++ library, which provides high-level data | |
331 | types for Boolean polynomials and monomials, exponent vectors, as well as | |
332 | for the underlying polynomial rings and subsets of the powerset of the | |
333 | Boolean variables. As a unique approach, binary decision diagrams are | |
334 | used as internal storage type for polynomial structures.") | |
335 | (license license:gpl2+) | |
e170faa8 | 336 | (home-page "https://github.com/BRiAl/BRiAl/"))) |
fedb9571 AE |
337 | |
338 | (define-public lcalc | |
339 | (package | |
340 | (name "lcalc") | |
341 | (version "1.23") | |
342 | ;; The original home page of the project has disappeared, as well as | |
343 | ;; code hosted by the original author on Google Code. The latter has | |
344 | ;; been copied to gitlab.com/sagemath and purportedly contains patches | |
345 | ;; for a never released version 1.3, that supposedly follows 1.23. | |
346 | ;; We use the tarball as well as the patches hosted inside the sage | |
347 | ;; package system distributed with the sage tarball. | |
348 | (source | |
349 | (origin | |
350 | (method url-fetch) | |
351 | (uri (string-append "ftp://ftp.fu-berlin.de/unix/misc/sage/spkg/" | |
352 | "upstream/lcalc/lcalc-1.23.tar.bz2")) | |
353 | (sha256 | |
354 | (base32 | |
355 | "1c6dsdshgxhqppjxvxhp8yhpxaqvnz3d1mlh26r571gkq8z2bm43")) | |
356 | (patches (search-patches "lcalc-lcommon-h.patch" | |
357 | "lcalc-default-parameters-1.patch" | |
358 | "lcalc-default-parameters-2.patch" | |
359 | "lcalc-using-namespace-std.patch")))) | |
360 | (build-system gnu-build-system) | |
361 | (arguments | |
362 | `(#:tests? #f ;no tests | |
363 | #:phases | |
364 | (modify-phases %standard-phases | |
365 | (delete 'configure) | |
366 | (add-before 'build 'prepare-build | |
367 | (lambda* (#:key outputs #:allow-other-keys) | |
368 | (chdir "src") | |
369 | (let ((out (assoc-ref outputs "out"))) | |
370 | (substitute* "Makefile" | |
371 | (("^INSTALL_DIR= /usr/local") | |
db7f74d2 | 372 | (string-append "INSTALL_DIR=" out)))) |
fedb9571 AE |
373 | #t)) |
374 | (add-before 'install 'make-output-dirs | |
375 | (lambda* (#:key outputs #:allow-other-keys) | |
376 | (let* ((out (assoc-ref outputs "out")) | |
377 | (bin (string-append out "/bin")) | |
378 | (lib (string-append out "/lib")) | |
379 | (include (string-append out "/include"))) | |
380 | (mkdir-p bin) | |
381 | (mkdir-p lib) | |
382 | (mkdir-p include)) | |
383 | #t))))) | |
384 | ;; FIXME: | |
385 | ;; We need to add pari-gp and probably pari related patches from the | |
386 | ;; sage project, as well as uncomment the line setting PARI_DEFINE in | |
387 | ;; the Makefile to get the full functionality of this package. | |
388 | ;; For the time being, we hope that sage can be compiled without. | |
389 | (synopsis "C++ library for L-functions") | |
390 | (description "Lcalc computes L-functions, in particular the Riemann | |
391 | zeta function and its twists by quadratic characters.") | |
392 | (license license:gpl2+) | |
393 | (home-page "https://gitlab.com/sagemath/sage"))) | |
a65f1e8e NG |
394 | |
395 | (define-public ratpoints | |
396 | (package | |
397 | (name "ratpoints") | |
398 | (version "2.1.3") | |
399 | (source (origin | |
400 | (method url-fetch) | |
401 | (uri (string-append | |
402 | "http://www.mathe2.uni-bayreuth.de/stoll/programs/" | |
403 | "ratpoints-" version ".tar.gz")) | |
404 | (sha256 | |
405 | (base32 | |
406 | "0zhad84sfds7izyksbqjmwpfw4rvyqk63yzdjd3ysd32zss5bgf4")) | |
407 | (patches | |
408 | ;; Taken from | |
409 | ;; <https://git.sagemath.org/sage.git/plain/build/pkgs/ratpoints/patches/> | |
410 | (search-patches "ratpoints-sturm_and_rp_private.patch")))) | |
411 | (build-system gnu-build-system) | |
412 | (arguments | |
413 | `(#:test-target "test" | |
414 | #:make-flags | |
415 | (list (string-append "INSTALL_DIR=" (assoc-ref %outputs "out")) | |
416 | "CCFLAGS=-fPIC") | |
417 | #:phases | |
418 | (modify-phases %standard-phases | |
419 | (delete 'configure) ;no configure script | |
420 | (add-before 'install 'create-install-directories | |
421 | (lambda* (#:key outputs #:allow-other-keys) | |
422 | (let ((out (assoc-ref outputs "out"))) | |
423 | (mkdir-p out) | |
424 | (with-directory-excursion out | |
425 | (for-each (lambda (d) (mkdir-p d)) | |
426 | '("bin" "include" "lib")))) | |
427 | #t))))) | |
428 | (inputs | |
429 | `(("gmp" ,gmp))) | |
430 | (home-page "http://www.mathe2.uni-bayreuth.de/stoll/programs/") | |
431 | (synopsis "Find rational points on hyperelliptic curves") | |
432 | (description "Ratpoints tries to find all rational points within | |
433 | a given height bound on a hyperelliptic curve in a very efficient way, | |
434 | by using an optimized quadratic sieve algorithm.") | |
435 | (license license:gpl2+))) |