algebra.scm 68 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724
  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-37")
  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 "1mzqf7r40ppmzixf4s6sjk76y0wpcf6xp7hklzrn2l1910ld61pz"))))
  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.8.1")
  419. (source
  420. (origin
  421. (method url-fetch)
  422. (uri (string-append "http://flintlib.org/flint-" version ".tar.gz"))
  423. (sha256
  424. (base32 "0zj2zgn3cbb08pxhfq38i62pgjfbb6938l70am7dnixqgixdmzgd"))))
  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.21.0")
  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. "0c7q8bbm2izh0j0342v0dkgg1lgd6f0fn3i9x9x80brjjhg65q7b"))))
  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.2.1")
  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. (let ((index (string-index version #\p)))
  601. (if index (string-take version index)
  602. version))
  603. #\.) "-")
  604. "/singular-" version ".tar.gz"))
  605. (sha256 (base32
  606. "13gy1gdng8zijwlr1fn5sixw53z0zf9czzlg0vh1dcc59zw6v998"))))
  607. (build-system gnu-build-system)
  608. (native-inputs
  609. `(("doxygen" ,doxygen)
  610. ("graphviz" ,graphviz)
  611. ("perl" ,perl)))
  612. (inputs
  613. `(("cddlib" ,cddlib)
  614. ("gmp" ,gmp)
  615. ("flint" ,flint)
  616. ("mpfr" ,mpfr)
  617. ("ntl" ,ntl)
  618. ("python" ,python-2)
  619. ("readline" ,readline)))
  620. (arguments
  621. `(#:configure-flags
  622. (list (string-append "--with-ntl="
  623. (assoc-ref %build-inputs "ntl")))))
  624. (synopsis "Computer algebra system for polynomial computations")
  625. (description
  626. "Singular is a computer algebra system for polynomial computations,
  627. with special emphasis on commutative and non-commutative algebra, algebraic
  628. geometry and singularity theory.")
  629. ;; Singular itself is dual licensed gpl2 or gpl3, but some of the
  630. ;; libraries with which it links are licensed under lgpl3+, so the
  631. ;; combined work becomes gpl3. See COPYING in the source code.
  632. (license license:gpl3)
  633. (home-page "https://www.singular.uni-kl.de/index.php")))
  634. (define-public gmp-ecm
  635. (package
  636. (name "gmp-ecm")
  637. (version "7.0.4")
  638. (source (origin
  639. (method url-fetch)
  640. (uri
  641. (let ((hash "00c4c691a1ef8605b65bdf794a71539d"))
  642. (string-append "https://gitlab.inria.fr/zimmerma/ecm/"
  643. "uploads/" hash "/ecm-" version
  644. ".tar.gz")))
  645. (sha256 (base32
  646. "0hxs24c2m3mh0nq1zz63z3sb7dhy1rilg2s1igwwcb26x3pb7xqc"))))
  647. (build-system gnu-build-system)
  648. (inputs
  649. `(("gmp" ,gmp)))
  650. (arguments
  651. `(#:configure-flags '("--enable-shared"
  652. ;; Disable specific assembly routines, which depend
  653. ;; on the subarchitecture of the build machine,
  654. ;; and use gmp instead.
  655. "--disable-asm-redc")))
  656. (synopsis "Integer factorization library using the elliptic curve method")
  657. (description
  658. "GMP-ECM factors integers using the elliptic curve method (ECM) as well
  659. as the P-1 and P+1 algorithms. It provides a library and a stand-alone
  660. binary.")
  661. ;; Most files are under lgpl3+, but some are under gpl3+ or gpl2+,
  662. ;; so the combined work is under gpl3+.
  663. (license license:gpl3+)
  664. (home-page "http://ecm.gforge.inria.fr/")))
  665. (define-public bc
  666. (package
  667. (name "bc")
  668. (version "1.07.1")
  669. (source (origin
  670. (method url-fetch)
  671. (uri (string-append "mirror://gnu/bc/bc-" version ".tar.gz"))
  672. (sha256
  673. (base32
  674. "0amh9ik44jfg66csyvf4zz1l878c4755kjndq9j0270akflgrbb2"))
  675. (patches (search-patches "bc-fix-cross-compilation.patch"))))
  676. (build-system gnu-build-system)
  677. (native-inputs
  678. `(("automake" ,automake)
  679. ("autoconf" ,autoconf)
  680. ("ed" ,ed)
  681. ("flex" ,flex)
  682. ("texinfo" ,texinfo)))
  683. (inputs
  684. `(("readline" ,readline)))
  685. (arguments
  686. '(#:configure-flags
  687. (list "--with-readline")
  688. #:phases
  689. (modify-phases %standard-phases
  690. (replace 'bootstrap
  691. (lambda _
  692. (invoke "autoreconf" "-vif"))))))
  693. (home-page "https://www.gnu.org/software/bc/")
  694. (synopsis "Arbitrary precision numeric processing language")
  695. (description
  696. "bc is an arbitrary precision numeric processing language. It includes
  697. an interactive environment for evaluating mathematical statements. Its
  698. syntax is similar to that of C, so basic usage is familiar. It also includes
  699. \"dc\", a reverse-polish calculator.")
  700. (license license:gpl2+)))
  701. ;; The original kiss-fft does not have a complete build system and does not
  702. ;; build any shared libraries. This is a fork used by Extempore.
  703. (define-public kiss-fft-for-extempore
  704. (package
  705. (name "kiss-fft-for-extempore")
  706. (version "1.3.0")
  707. (source (origin
  708. (method git-fetch)
  709. (uri (git-reference
  710. (url "https://github.com/extemporelang/kiss_fft")
  711. (commit version)))
  712. (file-name (git-file-name name version))
  713. (sha256
  714. (base32
  715. "0jasbmqy4wkqrqx3w64s1dfmj34875xmsl72mb26aa4hpyn14bi2"))))
  716. (build-system cmake-build-system)
  717. (arguments `(#:tests? #f)) ; no tests included
  718. ;; Extempore refuses to build on architectures other than x86_64
  719. (supported-systems '("x86_64-linux"))
  720. (home-page "https://github.com/extemporelang/kiss_fft")
  721. (synopsis "Mixed-radix Fast Fourier Transform")
  722. (description
  723. "Kiss FFT attempts to be a reasonably efficient, moderately useful FFT
  724. that can use fixed or floating data types and can easily be incorporated into
  725. a C program.")
  726. (license license:bsd-3)))
  727. (define-public fftw
  728. (package
  729. (name "fftw")
  730. (version "3.3.8")
  731. (source (origin
  732. (method url-fetch)
  733. (uri (string-append "ftp://ftp.fftw.org/pub/fftw/fftw-"
  734. version".tar.gz"))
  735. (sha256
  736. (base32
  737. "00z3k8fq561wq2khssqg0kallk0504dzlx989x3vvicjdqpjc4v1"))))
  738. (build-system gnu-build-system)
  739. (arguments
  740. `(#:configure-flags
  741. '("--enable-shared" "--enable-openmp" "--enable-threads"
  742. ,@(let ((system (or (%current-target-system) (%current-system))))
  743. ;; Enable SIMD extensions for codelets. See details at:
  744. ;; <http://fftw.org/fftw3_doc/Installation-on-Unix.html>.
  745. (cond
  746. ((string-prefix? "x86_64" system)
  747. '("--enable-sse2" "--enable-avx" "--enable-avx2"
  748. "--enable-avx512" "--enable-avx-128-fma"))
  749. ((string-prefix? "i686" system)
  750. '("--enable-sse2"))
  751. ((string-prefix? "aarch64" system)
  752. ;; Note that fftw supports NEON on 32-bit ARM only when
  753. ;; compiled for single-precision.
  754. '("--enable-neon"))
  755. (else
  756. '())))
  757. ;; By default '-mtune=native' is used. However, that may cause the
  758. ;; use of ISA extensions (e.g. AVX) that are not necessarily
  759. ;; available on the user's machine when that package is built on a
  760. ;; different machine.
  761. "ax_cv_c_flags__mtune_native=no")))
  762. (native-inputs `(("perl" ,perl)))
  763. (home-page "http://fftw.org")
  764. (synopsis "Computing the discrete Fourier transform")
  765. (description
  766. "FFTW is a C subroutine library for computing the discrete Fourier
  767. transform (DFT) in one or more dimensions, of arbitrary input size, and of
  768. both real and complex data (as well as of even/odd data---i.e. the discrete
  769. cosine/ sine transforms or DCT/DST).")
  770. (license license:gpl2+)))
  771. (define-public fftwf
  772. (package/inherit fftw
  773. (name "fftwf")
  774. (arguments
  775. (substitute-keyword-arguments (package-arguments fftw)
  776. ((#:configure-flags fftw-configure-flags)
  777. `(cons* "--enable-single"
  778. ,@(if (string-prefix? "arm" (or (%current-target-system)
  779. (%current-system)))
  780. ;; fftw supports NEON on 32-bit ARM only when compiled
  781. ;; for single-precision, so add it here.
  782. '("--enable-neon")
  783. '())
  784. ,fftw-configure-flags))))
  785. (description
  786. (string-append (package-description fftw)
  787. " Single-precision version."))))
  788. (define-public fftw-openmpi
  789. (package/inherit fftw
  790. (name "fftw-openmpi")
  791. (inputs
  792. `(("openmpi" ,openmpi)
  793. ,@(package-inputs fftw)))
  794. (arguments
  795. (substitute-keyword-arguments (package-arguments fftw)
  796. ((#:configure-flags cf)
  797. `(cons "--enable-mpi" ,cf))
  798. ((#:phases phases '%standard-phases)
  799. `(modify-phases ,phases
  800. (add-before 'check 'mpi-setup
  801. ,%openmpi-setup)))))
  802. (description
  803. (string-append (package-description fftw)
  804. " With OpenMPI parallelism support."))))
  805. (define-public java-la4j
  806. (package
  807. (name "java-la4j")
  808. (version "0.6.0")
  809. (source (origin
  810. (method git-fetch)
  811. (uri (git-reference
  812. (url "https://github.com/vkostyukov/la4j")
  813. (commit version)))
  814. (file-name (string-append name "-" version "-checkout"))
  815. (sha256
  816. (base32
  817. "1qir8dr978cfvz9k12m2kbdwpyf6cqdf1d0ilb7lnkhbgq5i53w3"))))
  818. (build-system ant-build-system)
  819. (arguments
  820. `(#:jar-name "la4j.jar"
  821. #:jdk ,icedtea-8
  822. #:test-exclude (list "**/Abstract*.java"
  823. "**/MatrixTest.java"
  824. "**/DenseMatrixTest.java"
  825. "**/SparseMatrixTest.java"
  826. "**/VectorTest.java"
  827. "**/SparseVectorTest.java"
  828. "**/DenseVectorTest.java")))
  829. (native-inputs
  830. `(("java-junit" ,java-junit)
  831. ("java-hamcrest-core" ,java-hamcrest-core)))
  832. (home-page "http://la4j.org/")
  833. (synopsis "Java library that provides Linear Algebra primitives and algorithms")
  834. (description "The la4j library is a Java library that provides Linear
  835. Algebra primitives (matrices and vectors) and algorithms. The key features of
  836. the la4j library are:
  837. @itemize
  838. @item No dependencies and tiny size
  839. @item Fluent object-oriented/functional API
  840. @item Sparse (CRS, CCS) and dense (1D/2D arrays) matrices
  841. @item Linear systems solving (Gaussian, Jacobi, Zeidel, Square Root, Sweep and other)
  842. @item Matrices decomposition (Eigenvalues/Eigenvectors, SVD, QR, LU, Cholesky and other)
  843. @item MatrixMarket/CSV IO formats support for matrices and vectors
  844. @end itemize\n")
  845. (license license:asl2.0)))
  846. (define-public java-jlargearrays
  847. (package
  848. (name "java-jlargearrays")
  849. (version "1.6")
  850. (source (origin
  851. (method url-fetch)
  852. (uri (string-append "https://repo1.maven.org/maven2/"
  853. "pl/edu/icm/JLargeArrays/"
  854. version "/JLargeArrays-" version
  855. "-sources.jar"))
  856. (file-name (string-append name "-" version ".jar"))
  857. (sha256
  858. (base32
  859. "0v05iphpxbjnd7f4jf1rlqq3m8hslhcm0imdbsgxr20pi3xkaf2a"))))
  860. (build-system ant-build-system)
  861. (arguments
  862. `(#:jar-name "jlargearrays.jar"
  863. #:tests? #f ; tests are not included in the release archive
  864. #:jdk ,icedtea-8))
  865. (propagated-inputs
  866. `(("java-commons-math3" ,java-commons-math3)))
  867. (home-page "https://gitlab.com/ICM-VisLab/JLargeArrays")
  868. (synopsis "Library of one-dimensional arrays that can store up to 263 elements")
  869. (description "JLargeArrays is a Java library of one-dimensional arrays
  870. that can store up to 263 elements.")
  871. (license license:bsd-2)))
  872. (define-public java-jtransforms
  873. (package
  874. (name "java-jtransforms")
  875. (version "3.1")
  876. (source (origin
  877. (method url-fetch)
  878. (uri (string-append "https://repo1.maven.org/maven2/"
  879. "com/github/wendykierp/JTransforms/"
  880. version "/JTransforms-" version "-sources.jar"))
  881. (sha256
  882. (base32
  883. "1haw5m8shv5srgcpwkl853dz8bv6h90bzlhcps6mdpb4cixjirsg"))))
  884. (build-system ant-build-system)
  885. (arguments
  886. `(#:jar-name "jtransforms.jar"
  887. #:tests? #f ; tests are not included in the release archive
  888. #:jdk ,icedtea-8))
  889. (propagated-inputs
  890. `(("java-commons-math3" ,java-commons-math3)
  891. ("java-jlargearrays" ,java-jlargearrays)))
  892. (home-page "https://github.com/wendykierp/JTransforms")
  893. (synopsis "Multithreaded FFT library written in pure Java")
  894. (description "JTransforms is a multithreaded FFT library written in pure
  895. Java. Currently, four types of transforms are available: @dfn{Discrete
  896. Fourier Transform} (DFT), @dfn{Discrete Cosine Transform} (DCT), @dfn{Discrete
  897. Sine Transform} (DST) and @dfn{Discrete Hartley Transform} (DHT).")
  898. (license license:bsd-2)))
  899. (define-public lmfit
  900. (package
  901. (name "lmfit")
  902. (version "8.2.2")
  903. (source (origin
  904. (method git-fetch)
  905. (uri (git-reference
  906. (url "https://jugit.fz-juelich.de/mlz/lmfit.git")
  907. (commit (string-append "v" version))))
  908. (file-name (git-file-name name version))
  909. (sha256
  910. (base32
  911. "00bch77a6qgnw6vzsjn2a42n8n683ih3xm0wpr454jxa15hw78vf"))))
  912. (build-system cmake-build-system)
  913. (native-inputs
  914. `(("perl" ,perl))) ; for pod2man
  915. (home-page "https://jugit.fz-juelich.de/mlz/lmfit")
  916. (synopsis "Levenberg-Marquardt minimization and least-squares fitting")
  917. (description "lmfit is a C library for Levenberg-Marquardt least-squares
  918. minimization and curve fitting. It is mature code, based on decades-old
  919. algorithms from the FORTRAN library MINPACK.")
  920. (license license:bsd-2)))
  921. (define-public symengine
  922. (package
  923. (name "symengine")
  924. (version "0.6.0")
  925. (source
  926. (origin
  927. (method git-fetch)
  928. (uri (git-reference
  929. (url "https://github.com/symengine/symengine")
  930. (commit (string-append "v" version))))
  931. (file-name (git-file-name name version))
  932. (sha256
  933. (base32 "129iv9maabmb42ylfdv0l0g94mcbf3y4q3np175008rcqdr8z6h1"))))
  934. (build-system cmake-build-system)
  935. (arguments
  936. '(#:configure-flags
  937. ;; These are the suggested build options in the README.
  938. '("-DCMAKE_BUILD_TYPE=Release"
  939. "-DWITH_GMP=on"
  940. "-DWITH_MPFR=on"
  941. "-DWITH_MPC=on"
  942. "-DINTEGER_CLASS=flint"
  943. "-DWITH_SYMENGINE_THREAD_SAFE=on"
  944. "-DBUILD_SHARED_LIBS=on"))) ;also build libsymengine
  945. (inputs
  946. `(("flint" ,flint)
  947. ("gmp" ,gmp)
  948. ("mpc" ,mpc)
  949. ("mpfr" ,mpfr)))
  950. (home-page "https://github.com/symengine/symengine")
  951. (synopsis "Fast symbolic manipulation library")
  952. (description
  953. "SymEngine is a standalone fast C++ symbolic manipulation library.
  954. Optional thin wrappers allow usage of the library from other languages.")
  955. (license (list license:expat ;SymEngine
  956. license:bsd-3)))) ;3rd party code
  957. (define-public eigen
  958. (package
  959. (name "eigen")
  960. (version "3.3.8")
  961. (source (origin
  962. (method url-fetch)
  963. (uri (list
  964. (string-append "https://bitbucket.org/eigen/eigen/get/"
  965. version ".tar.bz2")
  966. (string-append "mirror://debian/pool/main/e/eigen3/eigen3_"
  967. version ".orig.tar.bz2")))
  968. (sha256
  969. (base32
  970. "1vxrsncfnkyq6gwxpsannpryp12mk7lc8f42ybvz3saf7icwc582"))
  971. (file-name (string-append name "-" version ".tar.bz2"))
  972. (patches (search-patches "eigen-remove-openmp-error-counting.patch"
  973. "eigen-stabilise-sparseqr-test.patch"))
  974. (modules '((guix build utils)))
  975. (snippet
  976. ;; There are 3 test failures in the "unsupported" directory,
  977. ;; but maintainers say it's a known issue and it's unsupported
  978. ;; anyway, so just skip them.
  979. '(begin
  980. (substitute* "unsupported/CMakeLists.txt"
  981. (("add_subdirectory\\(test.*")
  982. "# Do not build the tests for unsupported features.\n"))
  983. #t))))
  984. (build-system cmake-build-system)
  985. (arguments
  986. '(;; Turn off debugging symbols to save space.
  987. #:build-type "Release"
  988. #:phases (modify-phases %standard-phases
  989. (replace 'check
  990. (lambda _
  991. (let* ((cores (parallel-job-count))
  992. (dash-j (format #f "-j~a" cores)))
  993. (setenv "EIGEN_SEED" "1") ;for reproducibility
  994. ;; First build the tests, in parallel. See
  995. ;; <http://eigen.tuxfamily.org/index.php?title=Tests>.
  996. (invoke "make" "buildtests" dash-j)
  997. ;; Then run 'CTest' with -V so we get more
  998. ;; details upon failure.
  999. (invoke "ctest" "-V" dash-j)))))))
  1000. (home-page "https://eigen.tuxfamily.org")
  1001. (synopsis "C++ template library for linear algebra")
  1002. (description
  1003. "Eigen is a C++ template library for linear algebra: matrices, vectors,
  1004. numerical solvers, and related algorithms. It provides an elegant API based
  1005. on \"expression templates\". It is versatile: it supports all matrix sizes,
  1006. all standard numeric types, various matrix decompositions and geometry
  1007. features, and more.")
  1008. ;; Most of the code is MPLv2, with a few files under LGPLv2.1+ or BSD-3.
  1009. ;; See 'COPYING.README' for details.
  1010. (license license:mpl2.0)))
  1011. (define-public eigen-for-tensorflow
  1012. (let ((changeset "fd6845384b86")
  1013. (revision "1"))
  1014. (package (inherit eigen)
  1015. (name "eigen-for-tensorflow")
  1016. (version (string-append "3.3.5-" revision "." changeset))
  1017. (source (origin
  1018. (method hg-fetch)
  1019. (uri (hg-reference
  1020. (url "https://bitbucket.org/eigen/eigen")
  1021. (changeset changeset)))
  1022. (sha256
  1023. (base32
  1024. "12cwgah63wqwb66xji048hcxc1z5zjg8a7701zlia5zbilnnk1n5"))
  1025. (file-name (string-append name "-" version "-checkout"))
  1026. (modules '((guix build utils)))
  1027. (snippet
  1028. ;; There are 3 test failures in the "unsupported" directory,
  1029. ;; but maintainers say it's a known issue and it's unsupported
  1030. ;; anyway, so just skip them.
  1031. '(begin
  1032. (substitute* "unsupported/CMakeLists.txt"
  1033. (("add_subdirectory\\(test.*")
  1034. "# Do not build the tests for unsupported features.\n"))
  1035. #t)))))))
  1036. (define-public eigen-for-tensorflow-lite
  1037. ;; This commit was taken from
  1038. ;; tensorflow/lite/tools/cmake/modules/eigen.cmake
  1039. (let ((commit "d10b27fe37736d2944630ecd7557cefa95cf87c9")
  1040. (revision "1"))
  1041. (package (inherit eigen)
  1042. (name "eigen-for-tensorflow-lite")
  1043. (version (git-version "3.3.7" revision commit))
  1044. (source (origin
  1045. (method git-fetch)
  1046. (uri (git-reference
  1047. (url "https://gitlab.com/libeigen/eigen")
  1048. (commit commit)))
  1049. (sha256
  1050. (base32
  1051. "0v8a20cwvwmp3hw4275b37frw33v92z0mr8f4dn6y8k0rz92hrrf"))
  1052. (file-name (git-file-name name version))
  1053. (modules '((guix build utils)))
  1054. (snippet
  1055. ;; Ther are test failures in the "unsupported" directory, but
  1056. ;; maintainers say it's unsupported anyway, so just skip
  1057. ;; them.
  1058. '(begin
  1059. (substitute* "unsupported/CMakeLists.txt"
  1060. (("add_subdirectory\\(test.*")
  1061. "# Do not build the tests for unsupported features.\n")))))))))
  1062. (define-public xtensor
  1063. (package
  1064. (name "xtensor")
  1065. (version "0.20.10")
  1066. (source (origin
  1067. (method git-fetch)
  1068. (uri (git-reference
  1069. (url "https://github.com/xtensor-stack/xtensor")
  1070. (commit version)))
  1071. (sha256
  1072. (base32
  1073. "1fmv2hpx610xwhxrndfsfvlbqfyk4l3gi5q5d7pa9m82kblxjj9l"))
  1074. (file-name (git-file-name name version))))
  1075. (build-system cmake-build-system)
  1076. (native-inputs
  1077. `(("googletest" ,googletest)
  1078. ("xtl" ,xtl)))
  1079. (arguments
  1080. `(#:configure-flags
  1081. '("-DBUILD_TESTS=ON")
  1082. #:test-target "xtest"))
  1083. (home-page "https://xtensor.readthedocs.io/en/latest/")
  1084. (synopsis "C++ tensors with broadcasting and lazy computing")
  1085. (description "xtensor is a C++ library meant for numerical analysis with
  1086. multi-dimensional array expressions.
  1087. xtensor provides:
  1088. @itemize
  1089. @item an extensible expression system enabling lazy broadcasting.
  1090. @item an API following the idioms of the C++ standard library.
  1091. @item tools to manipulate array expressions and build upon xtensor.
  1092. @end itemize")
  1093. (license license:bsd-3)))
  1094. (define-public gap
  1095. (package
  1096. (name "gap")
  1097. (version "4.11.0")
  1098. (source
  1099. (origin
  1100. (method url-fetch)
  1101. (uri (string-append "https://files.gap-system.org/gap-"
  1102. (version-major+minor version)
  1103. "/tar.bz2/gap-"
  1104. version
  1105. ".tar.bz2"))
  1106. (sha256
  1107. (base32 "00l6hvy4iggnlrib4vp805sxdm3j7n3hzpv5zs9hbiiavh80l1xz"))
  1108. (modules '((guix build utils) (ice-9 ftw) (srfi srfi-1)))
  1109. (snippet
  1110. '(begin
  1111. ;; Delete the external gmp and zlib libraries
  1112. ;; and a subdirectory not needed for our build.
  1113. (for-each delete-file-recursively
  1114. '("extern" "hpcgap"))
  1115. ;; Delete a failing test.
  1116. ;; FIXME: This might be fixed in the next release, see
  1117. ;; https://github.com/gap-system/gap/issues/3292
  1118. (delete-file "tst/testinstall/dir.tst")
  1119. ;; Delete all packages except for a fixed list,
  1120. ;; given by their names up to version numbers.
  1121. (with-directory-excursion "pkg"
  1122. (for-each delete-file-recursively
  1123. (lset-difference
  1124. (lambda (all keep) (string-prefix? keep all))
  1125. (scandir ".")
  1126. '("." ".."
  1127. ;; Necessary packages.
  1128. "GAPDoc-"
  1129. "primgrp-"
  1130. "SmallGrp-" ; artistic2.0
  1131. "transgrp" ; artistic2.0 for data,
  1132. ; gpl2 or gpl3 for code
  1133. ;; Recommended package.
  1134. "io-" ; gpl3+
  1135. ;; Optional packages, searched for at start,
  1136. ;; and their depedencies.
  1137. "alnuth-"
  1138. "autpgrp-"
  1139. "crisp-" ; bsd-2
  1140. "ctbllib" ; gpl3+, clarified in the next release;
  1141. ; see
  1142. ; http://www.math.rwth-aachen.de/~Thomas.Breuer/ctbllib/README.md
  1143. "FactInt-"
  1144. "fga"
  1145. "irredsol-" ; bsd-2
  1146. "laguna-"
  1147. "polenta-"
  1148. "polycyclic-"
  1149. "radiroot-"
  1150. "resclasses-"
  1151. "sophus-"
  1152. "tomlib-"
  1153. "utils-"))))
  1154. #t))))
  1155. (build-system gnu-build-system)
  1156. (inputs
  1157. `(("gmp" ,gmp)
  1158. ("readline" ,readline)
  1159. ("zlib" ,zlib)))
  1160. (arguments
  1161. `(#:modules ((ice-9 ftw)
  1162. (srfi srfi-26)
  1163. (guix build gnu-build-system)
  1164. (guix build utils))
  1165. #:phases
  1166. (modify-phases %standard-phases
  1167. (add-after 'build 'build-packages
  1168. ;; Compile all packages that have not been deleted by the
  1169. ;; code snippet above.
  1170. (lambda _
  1171. (setenv "CONFIG_SHELL" (which "bash"))
  1172. (with-directory-excursion "pkg"
  1173. (invoke "../bin/BuildPackages.sh")
  1174. #t)))
  1175. (add-after 'build-packages 'build-doc
  1176. ;; The documentation is bundled, but we create it from source.
  1177. (lambda _
  1178. (with-directory-excursion "doc"
  1179. (invoke "./make_doc"))
  1180. #t))
  1181. (replace 'install
  1182. (lambda* (#:key outputs #:allow-other-keys)
  1183. (let* ((out (assoc-ref outputs "out"))
  1184. (bin (string-append out "/bin"))
  1185. (prog (string-append bin "/gap"))
  1186. (prog-real (string-append bin "/.gap-real"))
  1187. (share (string-append out "/share/gap")))
  1188. ;; Install only the gap binary; the gac compiler is left
  1189. ;; for maybe later. "Wrap" it in a shell script that calls
  1190. ;; the binary with the correct parameter.
  1191. ;; The make target install-bin is supposed to do that, but
  1192. ;; is not currently working.
  1193. (mkdir-p bin)
  1194. (copy-file "gap" prog-real)
  1195. (call-with-output-file prog
  1196. (lambda (port)
  1197. (format port
  1198. "#!~a~%exec ~a -l ~a \"$@\"~%"
  1199. (which "bash")
  1200. prog-real
  1201. share)))
  1202. (chmod prog #o755)
  1203. ;; Install the headers and library, which are needed by Sage.
  1204. (invoke "make" "install-headers")
  1205. (invoke "make" "install-libgap")
  1206. ;; Remove information on the build directory from sysinfo.gap.
  1207. (substitute* "sysinfo.gap"
  1208. (("GAP_BIN_DIR=\".*\"") "GAP_BIN_DIR=\"\"")
  1209. (("GAP_LIB_DIR=\".*\"") "GAP_LIB_DIR=\"\"")
  1210. (("GAP_CPPFLAGS=\".*\"") "GAP_CPPFLAGS=\"\""))
  1211. (invoke "make" "install-gaproot")
  1212. ;; Copy the directory of compiled packages; the make target
  1213. ;; install-pkg is currently empty.
  1214. (copy-recursively "pkg" (string-append share "/pkg")))
  1215. #t)))))
  1216. (home-page "https://www.gap-system.org/")
  1217. (synopsis
  1218. "System for computational group theory")
  1219. (description
  1220. "GAP is a system for computational discrete algebra, with particular
  1221. emphasis on computational group theory. It provides a programming language,
  1222. a library of thousands of functions implementing algebraic algorithms
  1223. written in the GAP language as well as large data libraries of algebraic
  1224. objects.")
  1225. ;; Some packages have different licenses (effectively forcing the
  1226. ;; combined work to be licensed as gpl3+); if this is the case, this
  1227. ;; is mentioned above next to their name.
  1228. ;; Some packages have no license mentioned explicitly; supposedly this
  1229. ;; means that the gpl2+ licence of GAP itself applies, but to be on the
  1230. ;; safe side, we drop them for now.
  1231. (license license:gpl2+)))
  1232. (define-public gappa
  1233. (package
  1234. (name "gappa")
  1235. (version "1.3.5")
  1236. (source (origin
  1237. (method url-fetch)
  1238. (uri (string-append "https://gforge.inria.fr/frs/download.php/latestfile/"
  1239. "2699/gappa-" version ".tar.gz"))
  1240. (sha256
  1241. (base32
  1242. "0q1wdiwqj6fsbifaayb1zkp20bz8a1my81sqjsail577jmzwi07w"))))
  1243. (build-system gnu-build-system)
  1244. (inputs
  1245. `(("boost" ,boost)
  1246. ("gmp" ,gmp)
  1247. ("mpfr" ,mpfr)))
  1248. (arguments
  1249. `(#:phases
  1250. (modify-phases %standard-phases
  1251. (add-after 'unpack 'patch-remake-shell
  1252. (lambda _
  1253. (substitute* "remake.cpp"
  1254. (("/bin/sh") (which "sh")))
  1255. #t))
  1256. (replace 'build
  1257. (lambda _ (invoke "./remake" "-s" "-d")))
  1258. (replace 'install
  1259. (lambda _ (invoke "./remake" "-s" "-d" "install")))
  1260. (replace 'check
  1261. (lambda _ (invoke "./remake" "check"))))))
  1262. (home-page "http://gappa.gforge.inria.fr/")
  1263. (synopsis "Proof generator for arithmetic properties")
  1264. (description "Gappa is a tool intended to help verifying and formally
  1265. proving properties on numerical programs dealing with floating-point or
  1266. fixed-point arithmetic. It has been used to write robust floating-point
  1267. filters for CGAL and it is used to certify elementary functions in CRlibm.
  1268. While Gappa is intended to be used directly, it can also act as a backend
  1269. prover for the Why3 software verification platform or as an automatic tactic
  1270. for the Coq proof assistant.")
  1271. (license (list license:gpl3+ license:cecill-c)))) ; either/or
  1272. (define-public givaro
  1273. (package
  1274. (name "givaro")
  1275. (version "4.1.1")
  1276. (source (origin
  1277. (method git-fetch)
  1278. (uri (git-reference
  1279. (url "https://github.com/linbox-team/givaro")
  1280. (commit (string-append "v" version))))
  1281. (file-name (git-file-name name version))
  1282. (sha256
  1283. (base32
  1284. "11wz57q6ijsvfs5r82masxgr319as92syi78lnl9lgdblpc6xigk"))))
  1285. (build-system gnu-build-system)
  1286. (native-inputs
  1287. `(("autoconf" ,autoconf)
  1288. ("automake" ,automake)
  1289. ("libtool" ,libtool)))
  1290. (propagated-inputs
  1291. `(("gmp" ,gmp))) ; gmp++.h includes gmpxx.h
  1292. (synopsis "Algebraic computations with exact rings and fields")
  1293. (description
  1294. "Givaro is a C++ library implementing the basic arithmetic of various
  1295. algebraic objects: prime fields, extension fields, finite fields, finite
  1296. rings, polynomials, algebraic numbers, arbitrary precision integers and
  1297. rationals (C++ wrappers over gmp), fixed precision integers. It also
  1298. provides data-structures and templated classes for the manipulation of
  1299. compound objects, such as vectors, matrices and univariate polynomials.")
  1300. (license license:cecill-b)
  1301. (home-page "https://github.com/linbox-team/givaro")))
  1302. (define-public fflas-ffpack
  1303. (package
  1304. (name "fflas-ffpack")
  1305. (version "2.4.3")
  1306. (source (origin
  1307. (method git-fetch)
  1308. (uri (git-reference
  1309. (url "https://github.com/linbox-team/fflas-ffpack")
  1310. (commit version)))
  1311. (file-name (git-file-name name version))
  1312. (sha256
  1313. (base32
  1314. "1ynbjd72qrwp0b4kpn0p5d7gddpvj8dlb5fwdxajr5pvkvi3if74"))))
  1315. (build-system gnu-build-system)
  1316. (native-inputs
  1317. `(("autoconf" ,autoconf)
  1318. ("automake" ,automake)
  1319. ("libtool" ,libtool)
  1320. ("pkg-config" ,pkg-config)))
  1321. (inputs
  1322. `(("openblas" ,openblas)))
  1323. (propagated-inputs
  1324. `(("givaro" ,givaro))) ; required according to the .pc file
  1325. (arguments
  1326. `(#:configure-flags
  1327. (list (string-append "--with-blas-libs="
  1328. (assoc-ref %build-inputs "openblas")
  1329. "/lib/libopenblas.so"))))
  1330. (synopsis "C++ library for linear algebra over finite fields")
  1331. (description
  1332. "FFLAS-FFPACK is a C++ template library for basic linear algebra
  1333. operations over a finite field.
  1334. FFLAS (Finite Field Linear Algebra Subprograms) provides the implementation
  1335. of a subset of routines of the numerical BLAS; it also supports sparse
  1336. matrix-vector products.
  1337. FFPACK (Finite Field Linear Algebra Package) is inspired by the LAPACK
  1338. library to provide functionalities of higher level, using the kernel
  1339. of a BLAS. Additionally, it provides routines specific to exact linear
  1340. algebra, such as the row echelon form.")
  1341. (license license:lgpl2.1+)
  1342. (home-page "https://linbox-team.github.io/fflas-ffpack/")))
  1343. (define-public linbox
  1344. (package
  1345. (name "linbox")
  1346. (version "1.6.3")
  1347. (source (origin
  1348. (method git-fetch)
  1349. (uri (git-reference
  1350. (url "https://github.com/linbox-team/linbox")
  1351. (commit (string-append "v" version))))
  1352. (file-name (git-file-name name version))
  1353. (sha256
  1354. (base32
  1355. "10j6dspbsq7d2l4q3y0c1l1xwmaqqba2fxg59q5bhgk9h5d7q571"))
  1356. (patches (search-patches "linbox-fix-pkgconfig.patch"))))
  1357. (build-system gnu-build-system)
  1358. (native-inputs
  1359. `(("autoconf" ,autoconf)
  1360. ("automake" ,automake)
  1361. ("libtool" ,libtool)
  1362. ("pkg-config" ,pkg-config)))
  1363. (propagated-inputs
  1364. `(("fflas-ffpack" ,fflas-ffpack)))
  1365. (synopsis "C++ library for linear algebra over exact rings")
  1366. (description
  1367. "LinBox is a C++ template library for exact linear algebra computation
  1368. with dense, sparse, and structured matrices over the integers and over
  1369. finite fields.")
  1370. (license license:lgpl2.1+)
  1371. (home-page "https://linbox-team.github.io/linbox/")))
  1372. (define-public m4ri
  1373. (package
  1374. (name "m4ri")
  1375. (version "20140914")
  1376. (source (origin
  1377. (method git-fetch)
  1378. (uri (git-reference
  1379. (url "https://bitbucket.org/malb/m4ri")
  1380. (commit (string-append "release-" version))))
  1381. (file-name (git-file-name name version))
  1382. (sha256
  1383. (base32
  1384. "0xfg6pffbn8r1s0y7bn9b8i55l00d41dkmhrpf7pwk53qa3achd3"))))
  1385. (build-system gnu-build-system)
  1386. (native-inputs
  1387. `(("autoconf" ,autoconf)
  1388. ("automake" ,automake)
  1389. ("libtool" ,libtool)
  1390. ("pkg-config" ,pkg-config)))
  1391. (inputs
  1392. `(("libpng" ,libpng)))
  1393. (synopsis "Arithmetic of dense matrices over F_2")
  1394. (description "M4RI is a library for fast arithmetic with dense matrices
  1395. over F2. The name M4RI comes from the first implemented algorithm: The
  1396. Method of the Four Russians inversion algorithm published by Gregory Bard.
  1397. This algorithm in turn is named after the Method of the Four Russians
  1398. multiplication algorithm.")
  1399. (license license:gpl2+)
  1400. (home-page "https://bitbucket.org/malb/m4ri/")))
  1401. (define-public symmetrica
  1402. (package
  1403. (name "symmetrica")
  1404. (version "2.0")
  1405. (source (origin
  1406. (method url-fetch/tarbomb)
  1407. (uri (let ((v (string-join (string-split version #\.) "_")))
  1408. (string-append "http://www.algorithm.uni-bayreuth.de/"
  1409. "en/research/SYMMETRICA/"
  1410. "SYM" v "_tar.gz")))
  1411. (sha256
  1412. (base32
  1413. "1qhfrbd5ybb0sinl9pad64rscr08qvlfzrzmi4p4hk61xn6phlmz"))
  1414. ;; Taken from <https://git.sagemath.org/sage.git/plain/build/pkgs/symmetrica/patches/>
  1415. (patches (search-patches "symmetrica-bruch.patch"
  1416. "symmetrica-int32.patch"
  1417. "symmetrica-return_values.patch"
  1418. "symmetrica-sort_sum_rename.patch"))))
  1419. (build-system gnu-build-system)
  1420. (arguments
  1421. `(#:tests? #f ;no test
  1422. #:phases
  1423. (modify-phases %standard-phases
  1424. (add-after 'unpack 'fix-makefile
  1425. (lambda _
  1426. (substitute* "makefile"
  1427. (("cc -c") "gcc -c -fPIC"))
  1428. #t))
  1429. (add-after 'fix-makefile 'turn-off-banner
  1430. (lambda _
  1431. (substitute* "de.c"
  1432. (("(INT no_banner = )FALSE" _ pre) (string-append pre "TRUE")))
  1433. #t))
  1434. (delete 'configure) ;no configure script
  1435. (replace 'install ;no install target
  1436. (lambda* (#:key outputs #:allow-other-keys)
  1437. (let* ((out (assoc-ref outputs "out"))
  1438. (lib (string-append out "/lib"))
  1439. (inc (string-append out "/include/symmetrica"))
  1440. (doc (string-append out "/share/doc/symmetrica-" ,version))
  1441. (static "libsymmetrica.a"))
  1442. ;; Build static library.
  1443. (apply invoke "ar" "crs" static (find-files "." "\\.o$"))
  1444. (invoke "ranlib" static)
  1445. ;; Install static library and headers.
  1446. (for-each (lambda (f) (install-file f inc))
  1447. (find-files "." "\\.h$"))
  1448. (install-file "libsymmetrica.a" lib)
  1449. ;; Install documentation.
  1450. (for-each (lambda (f) (install-file f doc))
  1451. (find-files "." "\\.doc$"))
  1452. #t))))))
  1453. (home-page "http://www.algorithm.uni-bayreuth.de/en/research/SYMMETRICA/")
  1454. (synopsis "Combinatoric C Library")
  1455. (description "Symmetrica is a library for combinatorics. It has support
  1456. for the representation theory of the symmetric group and related groups,
  1457. combinatorics of tableaux, symmetric functions and polynomials, Schubert
  1458. polynomials, and the representation theory of Hecke algebras of type A_n.")
  1459. (license license:public-domain)))
  1460. (define-public m4rie
  1461. (package
  1462. (name "m4rie")
  1463. (version "20150908")
  1464. (source (origin
  1465. (method git-fetch)
  1466. (uri (git-reference
  1467. (url "https://bitbucket.org/malb/m4rie")
  1468. (commit (string-append "release-" version))))
  1469. (file-name (git-file-name name version))
  1470. (sha256
  1471. (base32
  1472. "0r8lv46qx5mkz5kp3ay2jnsp0mbhlqr5z2z220wdk73wdshcznss"))))
  1473. (build-system gnu-build-system)
  1474. (native-inputs
  1475. `(("autoconf" ,autoconf)
  1476. ("automake" ,automake)
  1477. ("libtool" ,libtool)))
  1478. (inputs
  1479. `(("m4ri" ,m4ri)))
  1480. (synopsis "Arithmetic of dense matrices over F_{2^e}")
  1481. (description "M4RI is a library for fast arithmetic with dense matrices
  1482. over finite fields of characteristic 2. So it extends the functionality
  1483. of M4RI from F_2 to F_{2^e}.")
  1484. (license license:gpl2+)
  1485. (home-page "https://bitbucket.org/malb/m4rie/")))
  1486. (define-public eclib
  1487. (package
  1488. (name "eclib")
  1489. (version "20190909")
  1490. (source (origin
  1491. (method git-fetch)
  1492. (uri (git-reference
  1493. (url "https://github.com/JohnCremona/eclib/")
  1494. (commit (string-append "v" version))))
  1495. (file-name (git-file-name name version))
  1496. (sha256
  1497. (base32
  1498. "1gw27lqc3f525n8qdcmr2nyn16y9g10z9f6dnmckyyxcdzvhq35n"))))
  1499. (build-system gnu-build-system)
  1500. (native-inputs
  1501. `(("autoconf" ,autoconf)
  1502. ("automake" ,automake)
  1503. ("libtool" ,libtool)))
  1504. (inputs
  1505. `(("ntl" ,ntl)
  1506. ("pari-gp" ,pari-gp)))
  1507. (synopsis "Ranks of elliptic curves and modular symbols")
  1508. (description "The eclib package includes mwrank (for 2-descent on
  1509. elliptic curves over Q) and modular symbol code; it has been written by
  1510. John Cremona to compute his elliptic curve database.")
  1511. (license license:gpl2+)
  1512. (home-page (string-append "http://homepages.warwick.ac.uk/staff/"
  1513. "J.E.Cremona/mwrank/index.html"))))
  1514. (define-public lrcalc
  1515. (package
  1516. (name "lrcalc")
  1517. (version "1.2")
  1518. (source (origin
  1519. (method git-fetch)
  1520. (uri (git-reference
  1521. (url "https://bitbucket.org/asbuch/lrcalc")
  1522. (commit (string-append "lrcalc-" version))))
  1523. (file-name (git-file-name name version))
  1524. (sha256
  1525. (base32
  1526. "1c12d04jdyxkkav4ak8d1aqrv594gzihwhpxvc6p9js0ry1fahss"))
  1527. (patches (search-patches "lrcalc-includes.patch"))))
  1528. (build-system gnu-build-system)
  1529. (native-inputs
  1530. `(("autoconf" ,autoconf)
  1531. ("automake" ,automake)
  1532. ("libtool" ,libtool)))
  1533. (arguments
  1534. `(#:phases
  1535. (modify-phases %standard-phases
  1536. (add-before 'build 'fix-permission
  1537. (lambda _
  1538. (chmod "lrcalc.maple.src" #o644)
  1539. #t)))))
  1540. (synopsis "Littlewood-Richardson calculator in algebraic combinatorics")
  1541. (description "The Littlewood-Richardson Calculator (lrcalc) is a
  1542. program designed to compute Littlewood-Richardson coefficients. It computes
  1543. single Littlewood-Richardson coefficients, products of Schur functions, or
  1544. skew Schur functions. In addition it computes products in the small quantum
  1545. cohomology ring of a Grassmann variety. The software package also includes
  1546. a program that performs fast computation of the more general multiplicative
  1547. structure constants of Schubert polynomials.")
  1548. (license license:gpl2+)
  1549. (home-page "https://sites.math.rutgers.edu/~asbuch/lrcalc/")))
  1550. (define-public iml
  1551. (package
  1552. (name "iml")
  1553. (version "1.0.5")
  1554. (source
  1555. (origin
  1556. (method url-fetch)
  1557. (uri (string-append "http://www.cs.uwaterloo.ca/~astorjoh/iml-"
  1558. version ".tar.bz2"))
  1559. (sha256
  1560. (base32
  1561. "0akwhhz9b40bz6lrfxpamp7r7wkk48p455qbn04mfnl9a1l6db8x"))))
  1562. (build-system gnu-build-system)
  1563. (inputs
  1564. `(("gmp" ,gmp)
  1565. ("cblas" ,openblas))) ; or any other BLAS library; the documentation
  1566. ; mentions ATLAS in particular
  1567. (arguments
  1568. `(#:configure-flags
  1569. (list
  1570. "--enable-shared"
  1571. (string-append "--with-gmp-include="
  1572. (assoc-ref %build-inputs "gmp") "/include")
  1573. (string-append "--with-gmp-lib="
  1574. (assoc-ref %build-inputs "gmp") "/lib")
  1575. "--with-cblas=-lopenblas"
  1576. (string-append "--with-cblas-include="
  1577. (assoc-ref %build-inputs "cblas") "/include")
  1578. (string-append "--with-cblas-lib="
  1579. (assoc-ref %build-inputs "cblas") "/lib"))))
  1580. (home-page "https://cs.uwaterloo.ca/~astorjoh/iml.html")
  1581. (synopsis
  1582. "Solver for systems of linear equations over the integers")
  1583. (description
  1584. "IML is a C library implementing algorithms for computing exact
  1585. solutions to dense systems of linear equations over the integers.
  1586. Currently, IML provides the following functionality:
  1587. @itemize
  1588. @item Nonsingular rational system solving:
  1589. compute the unique rational solution X to the system AX=B, where A and B
  1590. are integer matrices, A nonsingular.
  1591. @item Compute the right nullspace or kernel of an integer matrix.
  1592. @item Certified linear system solving:
  1593. compute a minimal denominator solution x to a system Ax=b, where b is an
  1594. integer vector and A is an integer matrix with arbitrary shape and
  1595. rank profile.
  1596. @end itemize
  1597. In addition, IML provides some low level routines for a variety of mod p
  1598. matrix operations: computing the row-echelon form, determinant, rank
  1599. profile, and inverse of a mod p matrix. These mod p routines are not
  1600. general purpose; they require that p satisfy some preconditions based on
  1601. the dimension of the input matrix (usually p should be prime and should be
  1602. no more than about 20 bits long).")
  1603. (license license:bsd-3)))
  1604. (define-public r-dtt
  1605. (package
  1606. (name "r-dtt")
  1607. (version "0.1-2")
  1608. (source
  1609. (origin
  1610. (method url-fetch)
  1611. (uri (cran-uri "dtt" version))
  1612. (sha256
  1613. (base32
  1614. "0n8gj5iylfagdbaqirpykb01a9difsy4zl6qq55f0ghvazxqdvmn"))))
  1615. (properties `((upstream-name . "dtt")))
  1616. (build-system r-build-system)
  1617. (home-page "http://www.r-project.org")
  1618. (synopsis "Discrete Trigonometric Transforms")
  1619. (description
  1620. "This package provides functions for 1D and 2D Discrete Cosine Transform
  1621. (@dfn{DCT}), Discrete Sine Transform (@dfn{DST}) and Discrete Hartley Transform
  1622. (@dfn{DHT}).")
  1623. (license license:gpl2+)))
  1624. (define-public sollya
  1625. (package
  1626. (name "sollya")
  1627. (version "7.0")
  1628. (source (origin
  1629. (method url-fetch)
  1630. (uri (string-append "https://www.sollya.org/releases/"
  1631. "sollya-" version "/sollya-" version ".tar.bz2"))
  1632. (sha256
  1633. (base32
  1634. "11290ivi9h665cxi8f1shlavhy10vzb8s28m57hrcgnxyxqmhx0m"))))
  1635. (build-system gnu-build-system)
  1636. (inputs
  1637. `(("fplll" ,fplll)
  1638. ("gmp" ,gmp)
  1639. ("gnuplot" ,gnuplot)
  1640. ("libxml2" ,libxml2)
  1641. ("mpfi" ,mpfi)
  1642. ("mpfr" ,mpfr)))
  1643. (arguments
  1644. `(#:configure-flags
  1645. (list (string-append "--docdir=${datadir}/doc/sollya-" ,version))
  1646. #:phases
  1647. (modify-phases %standard-phases
  1648. (add-after 'unpack 'patch-test-shebang
  1649. (lambda _
  1650. (substitute* (list "tests-tool/Makefile.in"
  1651. "tests-lib/Makefile.in")
  1652. (("#!/bin/sh") (string-append "#!" (which "sh"))))
  1653. #t))
  1654. (add-before 'build 'patch-gnuplot-reference
  1655. (lambda _
  1656. (substitute* "general.c"
  1657. (("\"gnuplot\"") (string-append "\"" (which "gnuplot") "\"")))
  1658. #t)))))
  1659. (home-page "https://www.sollya.org")
  1660. (synopsis "Development environment for safe floating-point code")
  1661. (description "Sollya is a computer program whose purpose is to
  1662. provide an environment for safe floating-point code development. It
  1663. is particularly targeted to the automated implementation of
  1664. mathematical floating-point libraries (libm). Amongst other features,
  1665. it offers a certified infinity norm, an automatic polynomial
  1666. implementer, and a fast Remez algorithm.")
  1667. (license license:cecill-c)))