algebra.scm 68 KB

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