gnu: Add linux-libre-arm64-generic at version 5.8.
[jackhill/guix/guix.git] / gnu / packages / maths.scm
CommitLineData
8f8b2451 1;;; GNU Guix --- Functional package management for GNU
b457f3cc 2;;; Copyright © 2013, 2014, 2015, 2016, 2019, 2020 Andreas Enge <andreas@enge.fr>
da95c817 3;;; Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org>
a53d6719 4;;; Copyright © 2014, 2016, 2017 John Darrington <jmd@gnu.org>
aa2e83cc 5;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020 Eric Bavier <bavier@posteo.net>
df354a77 6;;; Copyright © 2014 Federico Beffa <beffa@fbengineering.ch>
182d6311 7;;; Copyright © 2014 Mathieu Lirzin <mathieu.lirzin@openmailbox.org>
0b2c8838 8;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020 Ricardo Wurmus <rekado@elephly.net>
32158110 9;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com>
df129041 10;;; Copyright © 2015, 2018 Mark H Weaver <mhw@netris.org>
f0a9cb9c 11;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020 Efraim Flashner <efraim@flashner.co.il>
45147b0c 12;;; Copyright © 2015 Fabian Harfert <fhmgufs@web.de>
ec8c7e47 13;;; Copyright © 2016 Roel Janssen <roel@gnu.org>
1d3c6a31 14;;; Copyright © 2016, 2018, 2020 Kei Kebreau <kkebreau@posteo.net>
ba40ce5b 15;;; Copyright © 2016, 2017, 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
d7cff656 16;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
2fd26d05 17;;; Copyright © 2016, 2017 Thomas Danckaert <post@thomasdanckaert.be>
f1cc312e 18;;; Copyright © 2017, 2018, 2019, 2020 Paul Garlick <pgarlick@tourbillion-technology.com>
3c986a7d 19;;; Copyright © 2017 Nikita <nikita@n0.is>
ba1be533 20;;; Copyright © 2017 Ben Woodcroft <donttrustben@gmail.com>
d109b1e8 21;;; Copyright © 2017 Theodoros Foradis <theodoros@foradis.org>
b18b9d20 22;;; Copyright © 2017, 2019 Arun Isaac <arunisaac@systemreboot.net>
0fe654eb 23;;; Copyright © 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
dc7d6d4e 24;;; Copyright © 2017 Dave Love <me@fx@gnu.org>
abe3c5ed 25;;; Copyright © 2018, 2019, 2020 Jan Nieuwenhuizen <janneke@gnu.org>
41835f94 26;;; Copyright © 2018 Joshua Sierles, Nextjournal <joshua@nextjournal.com>
910deec6 27;;; Copyright © 2018 Nadya Voronova <voronovank@gmail.com>
07254d8b 28;;; Copyright © 2018 Adam Massmann <massmannak@gmail.com>
c745b6f6 29;;; Copyright © 2018, 2020 Marius Bakke <mbakke@fastmail.com>
daa6036f 30;;; Copyright © 2018 Eric Brown <brown@fastmail.com>
564cf93f 31;;; Copyright © 2018 Julien Lepiller <julien@lepiller.eu>
c2cf286c 32;;; Copyright © 2018 Amin Bandali <bandali@gnu.org>
6f8c4195 33;;; Copyright © 2019 Nicolas Goaziou <mail@nicolasgoaziou.fr>
4cb5d251 34;;; Copyright © 2019 Steve Sprang <scs@stevesprang.com>
3b7828cc 35;;; Copyright © 2019 Robert Smith <robertsmith@posteo.net>
f6b4d395 36;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
aac148a8 37;;; Copyright © 2020 Felix Gruber <felgru@posteo.net>
70c98efa 38;;; Copyright © 2020 R Veera Kumar <vkor@vkten.in>
525e83ec 39;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
b60e2d48 40;;; Copyright © 2020 Nicolò Balzarotti <nicolo@nixo.xyz>
d277c00e 41;;; Copyright © 2020 B. Wilson <elaexuotee@wilsonb.com>
c1f38577 42;;; Copyright © 2020 Vinicius Monego <monego@posteo.net>
8f8b2451
AE
43;;;
44;;; This file is part of GNU Guix.
45;;;
46;;; GNU Guix is free software; you can redistribute it and/or modify it
47;;; under the terms of the GNU General Public License as published by
48;;; the Free Software Foundation; either version 3 of the License, or (at
49;;; your option) any later version.
50;;;
51;;; GNU Guix is distributed in the hope that it will be useful, but
52;;; WITHOUT ANY WARRANTY; without even the implied warranty of
53;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
54;;; GNU General Public License for more details.
55;;;
56;;; You should have received a copy of the GNU General Public License
57;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
58
59(define-module (gnu packages maths)
ec322be2 60 #:use-module (ice-9 regex)
a6b9ebc2 61 #:use-module (ice-9 match)
8f8b2451 62 #:use-module (gnu packages)
b5b73a82 63 #:use-module ((guix licenses) #:prefix license:)
8f8b2451
AE
64 #:use-module (guix packages)
65 #:use-module (guix download)
54052a54 66 #:use-module (guix git-download)
0e2672ae 67 #:use-module (guix utils)
fa574a6d 68 #:use-module ((guix build utils) #:select (alist-replace))
da95c817 69 #:use-module (guix build-system cmake)
72c71d24 70 #:use-module (guix build-system glib-or-gtk)
c9dfa3c7 71 #:use-module (guix build-system gnu)
560acf25 72 #:use-module (guix build-system python)
63e07468 73 #:use-module (guix build-system ruby)
3de01d3f 74 #:use-module (gnu packages algebra)
ab5f3f21 75 #:use-module (gnu packages audio)
5143517c 76 #:use-module (gnu packages autotools)
fa574a6d 77 #:use-module (gnu packages base)
3de01d3f 78 #:use-module (gnu packages bison)
a17d4564 79 #:use-module (gnu packages boost)
e73b49fb 80 #:use-module (gnu packages check)
3de01d3f 81 #:use-module (gnu packages cmake)
c9dfa3c7 82 #:use-module (gnu packages compression)
668c06ac 83 #:use-module (gnu packages curl)
b7b27a8f 84 #:use-module (gnu packages cyrus-sasl)
8a0dd289 85 #:use-module (gnu packages dbm)
528bb464 86 #:use-module (gnu packages documentation)
57e544e8 87 #:use-module (gnu packages elf)
70c98efa 88 #:use-module (gnu packages file)
3de01d3f 89 #:use-module (gnu packages flex)
668c06ac 90 #:use-module (gnu packages fltk)
f3929800 91 #:use-module (gnu packages fontutils)
1dba6407 92 #:use-module (gnu packages gettext)
da95c817 93 #:use-module (gnu packages gcc)
73fed4f8 94 #:use-module (gnu packages gd)
668c06ac 95 #:use-module (gnu packages ghostscript)
70c98efa 96 #:use-module (gnu packages glib)
889187a4 97 #:use-module (gnu packages graphviz)
f3929800 98 #:use-module (gnu packages gtk)
70c98efa 99 #:use-module (gnu packages icu4c)
45147b0c 100 #:use-module (gnu packages image)
2fd26d05 101 #:use-module (gnu packages java)
668c06ac 102 #:use-module (gnu packages less)
8731e527 103 #:use-module (gnu packages lisp)
ab5f3f21 104 #:use-module (gnu packages linux)
bc3a2e35 105 #:use-module (gnu packages logging)
6e64766a 106 #:use-module (gnu packages lua)
5698b8b8 107 #:use-module (gnu packages gnome)
1b39a196 108 #:use-module (gnu packages guile)
668c06ac
JD
109 #:use-module (gnu packages xorg)
110 #:use-module (gnu packages gl)
9f913401 111 #:use-module (gnu packages imagemagick)
8731e527 112 #:use-module (gnu packages m4)
d8c7eeb9 113 #:use-module (gnu packages mpi)
b92eee75 114 #:use-module (gnu packages multiprecision)
528bb464 115 #:use-module (gnu packages netpbm)
bd3d71cb 116 #:use-module (gnu packages onc-rpc)
668c06ac 117 #:use-module (gnu packages pcre)
5698b8b8 118 #:use-module (gnu packages popt)
c9dfa3c7
AE
119 #:use-module (gnu packages perl)
120 #:use-module (gnu packages pkg-config)
ab5f3f21 121 #:use-module (gnu packages pulseaudio)
da95c817 122 #:use-module (gnu packages python)
589e3f4e 123 #:use-module (gnu packages python-web)
44d10b1f 124 #:use-module (gnu packages python-xyz)
5b05dce7 125 #:use-module (gnu packages qt)
c9dfa3c7 126 #:use-module (gnu packages readline)
63e07468 127 #:use-module (gnu packages ruby)
2742f87e 128 #:use-module (gnu packages tbb)
479c4273 129 #:use-module (gnu packages scheme)
b7194849 130 #:use-module (gnu packages shells)
df354a77 131 #:use-module (gnu packages tcl)
668c06ac 132 #:use-module (gnu packages texinfo)
8f9ac901 133 #:use-module (gnu packages tex)
b7b27a8f 134 #:use-module (gnu packages tls)
5b05dce7 135 #:use-module (gnu packages version-control)
9aafbc0c 136 #:use-module (gnu packages wxwidgets)
c12efc72 137 #:use-module (gnu packages xml)
a17d4564 138 #:use-module (srfi srfi-1))
8f8b2451 139
193abc82
JD
140(define-public aris
141 (package
1f45f18a
JD
142 (name "aris")
143 (version "2.2")
144 (source (origin
145 (method url-fetch)
146 (uri (string-append "mirror://gnu/" name "/" name "-" version ".tar.gz"))
147 (sha256 (base32
148 "1q1887ryqdr9sn0522hc7p16kqwlxxyz5dkmma8ar2nxplhgll7q"))))
149 (build-system gnu-build-system)
150 (inputs `(("gtk+" ,gtk+)
151 ("libxml2" ,libxml2)))
152 (native-inputs `(("pkg-config" ,pkg-config)))
153 (synopsis "Natural deduction first-order logic interface")
154 (description "Aris is a program for performing logical proofs. It supports
155propositional and predicate logic, as well as Boolean algebra and
156arithmetical logic. In addition to its predefined inference and equivalence
157rules, Aris also supports references to older proofs. Its use of standard
158logical symbols and its natural deduction interface make it easy to use for
159beginners.")
160 (license license:gpl3+)
6fd52309 161 (home-page "https://www.gnu.org/software/aris/")))
193abc82 162
9c45c519
JD
163(define-public c-graph
164 (package
165 (name "c-graph")
0ef54303 166 (version "2.0.1")
9c45c519
JD
167 (source (origin
168 (method url-fetch)
169 (uri (string-append "mirror://gnu/c-graph/c-graph-" version
170 ".tar.gz"))
171 (sha256 (base32
0ef54303 172 "092412jzxy6wdvpk96pfj499hpmaww8xllavbvlqspfpr7ips9id"))))
9c45c519
JD
173 (build-system gnu-build-system)
174 (inputs
0ef54303 175 `(("fortran" ,gfortran)))
a3947cb1 176 (synopsis "Visualizing and demonstrating convolution")
9c45c519 177 (description
0ef54303 178 "GNU C-Graph is a tool for demonstrating the theory of convolution.
a3947cb1
LC
179Thus, it can serve as an excellent aid to students of signal and systems
180theory in visualizing the convolution process. Rather than forcing the
181student to write code, the program offers an intuitive interface with
182interactive dialogs to guide them.")
9c45c519 183 (license license:gpl3+)
6fd52309 184 (home-page "https://www.gnu.org/software/c-graph/")))
9c45c519 185
d91025e3
TD
186(define-public coda
187 (package
188 (name "coda")
9285f8bb 189 (version "2.19")
d91025e3
TD
190 (source
191 (origin
192 (method url-fetch)
193 (uri (string-append "https://github.com/stcorp/coda/releases/download/"
194 version "/coda-" version ".tar.gz"))
195 (sha256
9285f8bb 196 (base32 "1fbxd2afm7dshd92p10yy8dwbr9gc1h1fmnnnmr7d0c5lnw80245"))
4b12fe5c
TD
197 (patches (search-patches "coda-use-system-libs.patch"))
198 (modules '((guix build utils)))
199 (snippet
200 ;; Make sure we don't use the bundled software.
6cbee49d
MW
201 '(begin
202 (for-each (lambda (d)
203 (delete-file-recursively (string-append "libcoda/" d)))
204 '("zlib" "pcre" "expat"))
205 #t))))
d91025e3
TD
206 (native-inputs
207 `(("fortran" ,gfortran)
208 ("python" ,python)
209 ("python-numpy" ,python-numpy)))
210 (inputs
211 `(("zlib" ,zlib)
4b12fe5c
TD
212 ("pcre" ,pcre)
213 ("expat" ,expat)
d91025e3
TD
214 ("hdf4" ,hdf4-alt)
215 ("hdf5" ,hdf5)))
216 (build-system gnu-build-system)
217 (arguments
4b12fe5c
TD
218 '(#:configure-flags '("--with-hdf4" "--with-hdf5" "--enable-python"
219 "LIBS= -lz -lpcre -lexpat")))
d91025e3
TD
220 (synopsis "A common interface to various earth observation data formats")
221 (description
222 "The Common Data Access toolbox (CODA) provides a set of interfaces for
223reading remote sensing data from earth observation data files. It consists of
224command line applications and interfaces to the C, Fortran, Python, and Java
225programming languages.")
226 (home-page "https://stcorp.nl/coda")
227 (license license:gpl2+)))
228
d65f0661
KK
229(define-public qhull
230 (package
231 (name "qhull")
9e919830 232 (version "2019.1")
d65f0661
KK
233 (source (origin
234 (method url-fetch)
235 (uri (string-append "http://www.qhull.org/download/qhull-"
236 (car (string-split version #\.))
9e919830 237 "-src-7.3.2.tgz"))
d65f0661
KK
238 (sha256
239 (base32
9e919830 240 "1ys3vh3qq0v9lh452xb932vp63advds1pxk42lk7cc1niiar0y9b"))))
d65f0661
KK
241 (build-system cmake-build-system)
242 (synopsis "Calculate convex hulls and related structures")
243 (description
244 "@code{Qhull} computes the convex hull, Delaunay triangulation, Voronoi
245diagram, halfspace intersection about a point, furthest-site Delaunay
246triangulation, and furthest-site Voronoi diagram. The source code runs in 2-d,
2473-d, 4-d, and higher dimensions. @code{Qhull} implements the Quickhull
248algorithm for computing the convex hull. It handles roundoff errors from
249floating point arithmetic. It computes volumes, surface areas, and
250approximations to the convex hull.
251
252@code{Qhull} does not support triangulation of non-convex surfaces, mesh
253generation of non-convex objects, medium-sized inputs in 9-D and higher, alpha
254shapes, weighted Voronoi diagrams, Voronoi volumes, or constrained Delaunay
255triangulations.")
256 (home-page "http://qhull.org")
257 (license (license:non-copyleft "file://COPYING.txt"
258 "See COPYING in the distribution."))))
259
a8fa86c4
RW
260(define-public python-cvxopt
261 (package
262 (name "python-cvxopt")
a7c7015a 263 (version "1.2.3")
a8fa86c4
RW
264 (source (origin
265 (method git-fetch)
266 (uri (git-reference
b0e7b699 267 (url "https://github.com/cvxopt/cvxopt")
a8fa86c4
RW
268 (commit version)))
269 (file-name (git-file-name name version))
270 (sha256
271 (base32
a7c7015a 272 "1kiy2m62xgs2d5id6dnnwy4vap85cd70p7pgkb9nh23qf9xnak7b"))))
a8fa86c4
RW
273 (build-system python-build-system)
274 (arguments
275 `(#:phases
276 (modify-phases %standard-phases
277 (add-after 'unpack 'find-libraries
278 (lambda* (#:key inputs #:allow-other-keys)
279 (setenv "CVXOPT_BLAS_LIB" "openblas")
280 (setenv "CVXOPT_BUILD_FFTW" "1")
281 (setenv "CVXOPT_BUILD_GLPK" "1")
282 (setenv "CVXOPT_BUILD_GSL" "1")
283 #t)))))
284 (inputs
285 `(("fftw" ,fftw)
286 ("glpk" ,glpk)
287 ("gsl" ,gsl)
288 ("lapack" ,lapack)
289 ("openblas" ,openblas)
290 ("suitesparse" ,suitesparse)))
291 (home-page "https://www.cvxopt.org")
292 (synopsis "Python library for convex optimization")
293 (description
294 "CVXOPT is a package for convex optimization based on the Python
295programming language. Its main purpose is to make the development of software
296for convex optimization applications straightforward by building on Python’s
297extensive standard library and on the strengths of Python as a high-level
298programming language.")
299 (license license:gpl3+)))
300
301(define-public python2-cvxopt
302 (package-with-python2 python-cvxopt))
303
8f8b2451
AE
304(define-public units
305 (package
306 (name "units")
494a8cd0 307 (version "2.19")
8f8b2451
AE
308 (source (origin
309 (method url-fetch)
310 (uri (string-append "mirror://gnu/units/units-" version
311 ".tar.gz"))
312 (sha256 (base32
494a8cd0 313 "0mk562g7dnidjgfgvkxxpvlba66fh1ykmfd9ylzvcln1vxmi6qj2"))))
8f8b2451 314 (build-system gnu-build-system)
0498d248 315 (inputs
a2549713
EB
316 `(("readline" ,readline)
317 ("python" ,python-wrapper) ;for 'units_cur' script
0498d248
EB
318 ("python-requests" ,python-requests)))
319 (arguments
320 `(#:phases (modify-phases %standard-phases
321 (add-after 'install 'wrap-units_cur
322 (lambda* (#:key outputs #:allow-other-keys)
323 (let* ((out (assoc-ref outputs "out"))
324 (bin (string-append out "/bin")))
325 (wrap-program (string-append bin "/units_cur")
326 `("PYTHONPATH" ":" prefix
327 ,(search-path-as-string->list (getenv "PYTHONPATH"))))
328 #t))))))
8f8b2451
AE
329 (synopsis "Conversion between thousands of scales")
330 (description
574e86f9 331 "GNU Units converts numeric quantities between units of measure. It
7c125ce0
AK
332can handle scale changes through adaptive usage of standard scale
333prefixes (micro-, kilo-, etc.). It can also handle nonlinear
334conversions such as Fahrenheit to Celsius. Its interpreter is powerful
335enough to be used effectively as a scientific calculator.")
8f8b2451 336 (license license:gpl3+)
6fd52309 337 (home-page "https://www.gnu.org/software/units/")))
c9dfa3c7 338
61a529b4
RW
339(define-public double-conversion
340 (package
341 (name "double-conversion")
1c7d7f3f 342 (version "3.1.5")
b343850e 343 (home-page "https://github.com/google/double-conversion")
61a529b4 344 (source (origin
2bdc73fb 345 (method git-fetch)
a4de1a65
MB
346 (uri (git-reference (url home-page)
347 (commit (string-append "v" version))))
2bdc73fb 348 (file-name (git-file-name name version))
61a529b4
RW
349 (sha256
350 (base32
1c7d7f3f 351 "0csy4pjw1p8rp6g5qxi2h0ychhhp1fldv7gb761627fs2mclw9gv"))))
61a529b4
RW
352 (build-system cmake-build-system)
353 (arguments
354 '(#:test-target "test"
355 #:configure-flags '("-DBUILD_SHARED_LIBS=ON"
356 "-DBUILD_TESTING=ON")))
61a529b4
RW
357 (synopsis "Conversion routines for IEEE doubles")
358 (description
359 "The double-conversion library provides binary-decimal and decimal-binary
360routines for IEEE doubles. The library consists of efficient conversion
361routines that have been extracted from the V8 JavaScript engine.")
362 (license license:bsd-3)))
363
182d6311
ML
364(define-public dionysus
365 (package
366 (name "dionysus")
bd041e7f 367 (version "1.4.0")
182d6311
ML
368 (source (origin
369 (method url-fetch)
370 (uri (string-append "mirror://gnu/dionysus/dionysus-" version
bd041e7f 371 ".tar.xz"))
182d6311
ML
372 (sha256
373 (base32
bd041e7f 374 "194pzs1mlsj4ww6v37qq3961h5hckm5h805cv0r14xj3g9wfx2sk"))))
182d6311
ML
375 (build-system gnu-build-system)
376 (inputs `(("tcl" ,tcl))) ;for 'tclsh'
377 (synopsis "Local search for universal constants and scientific values")
378 (description
379 "GNU Dionysus is a convenient system for quickly retrieving the values of
380mathematical constants used in science and engineering. Values can be
381searched using a simple command-line tool, choosing from three databases:
382universal constants, atomic numbers, and constants related to
383semiconductors.")
384 (license license:gpl3+)
6fd52309 385 (home-page "https://www.gnu.org/software/dionysus/")))
182d6311 386
b60e2d48
NB
387(define-public dsfmt
388 (package
389 (name "dsfmt")
390 (version "2.2.3")
391 (source
392 (origin
393 (method url-fetch)
394 (uri
395 (string-append
396 "http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/"
397 "dSFMT-src-" version ".tar.gz"))
398 (sha256
399 (base32
400 "03kaqbjbi6viz0n33dk5jlf6ayxqlsq4804n7kwkndiga9s4hd42"))
401 (modules '((guix build utils)))
402 ;; Don't distribute html documentation with bundled jquery.
403 (snippet
404 '(begin
405 (delete-file-recursively "html") #t))
406 ;; Add patches borrowed from Julia.
407 (patches
408 (list
409 (origin
410 (method url-fetch)
411 (uri (string-append
412 "https://raw.githubusercontent.com/JuliaLang/julia/"
413 "v1.3.0/deps/patches/dSFMT.c.patch"))
414 (sha256 (base32
415 "09mhv11bms8jsmkmdqvlcgljwhzw3b6n9nncpi2b6dla9798hw2y"))
416 (file-name "dSFMT.c.patch"))
417 (origin
418 (method url-fetch)
419 (uri (string-append
420 "https://raw.githubusercontent.com/JuliaLang/julia/"
421 "v1.3.0/deps/patches/dSFMT.h.patch"))
422 (sha256 (base32
423 "1py5rd0yxic335lzka23f6x2dhncrpizpyrk57gi2f28c0p98y5n"))
424 (file-name "dSFMT.h.patch"))))))
425 (build-system gnu-build-system)
426 (arguments
427 `(#:phases
428 (modify-phases %standard-phases
429 (delete 'configure) ; no configure script
430 (replace 'build
431 ;; Upstream Makefile does not build a shared library. Borrow from Julia
432 ;; https://github.com/JuliaLang/julia/blob/v1.3.0/deps/dsfmt.mk
433 (lambda _
434 (invoke
435 "gcc" "-DNDEBUG" "-DDSFMT_MEXP=19937"
436 "-fPIC" "-DDSFMT_DO_NOT_USE_OLD_NAMES"
437 "-O3" "-finline-functions" "-fomit-frame-pointer"
438 "-fno-strict-aliasing" "--param" "max-inline-insns-single=1800"
439 "-Wmissing-prototypes" "-Wall" "-std=c99" "-shared" "dSFMT.c"
440 "-o" "libdSFMT.so")))
441 (replace 'install ; no "install" target
442 (lambda* (#:key outputs #:allow-other-keys)
443 (let* ((out (assoc-ref outputs "out"))
444 (lib (string-append out "/lib"))
445 (inc (string-append out "/include"))
446 (doc (string-append out "/share/doc/" ,name "-" ,version)))
447 (install-file "libdSFMT.so" lib)
448 (install-file "dSFMT.h" inc)
449 (install-file "LICENSE.txt" doc)
450 #t))))))
451 (synopsis "Double precision SIMD-oriented Fast Mersenne Twister")
452 (description
453 "The dSMFT package speeds up Fast Mersenne Twister generation by avoiding
454the expensive conversion of integer to double (floating point). dSFMT directly
455generates double precision floating point pseudorandom numbers which have the
456IEEE Standard for Binary Floating-Point Arithmetic (ANSI/IEEE Std 754-1985)
457format. dSFMT is only available on the CPUs which use IEEE 754 format double
458precision floating point numbers.")
459 (home-page "http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/")
460 (license license:bsd-3)))
461
88bd1804
AE
462(define-public gsl
463 (package
464 (name "gsl")
7ad3c812 465 (version "2.6")
ab2cc5cd
LC
466 (source (origin
467 (method url-fetch)
468 (uri (string-append "mirror://gnu/gsl/gsl-"
469 version ".tar.gz"))
470 (sha256
471 (base32
7ad3c812 472 "1a460zj9xmbgvcymkdhqh313c4l29mn9cffbi5vf33x3qygk70mp"))))
88bd1804 473 (build-system gnu-build-system)
71e0f288 474 (arguments
c745b6f6
MB
475 (let ((system (%current-system)))
476 (cond
f0a9cb9c
EF
477 ((or (string-prefix? "aarch64" system)
478 (string-prefix? "powerpc" system))
479 ;; Some sparse matrix tests are failing on AArch64 and PowerPC:
c745b6f6
MB
480 ;; https://lists.gnu.org/archive/html/bug-gsl/2020-04/msg00001.html
481 '(#:phases (modify-phases %standard-phases
482 (add-before 'check 'disable-failing-tests
483 (lambda _
484 (substitute* "spmatrix/test.c"
485 ((".*test_complex.*") "\n"))
486 #t)))))
0ad05c15 487 ((string-prefix? "i686" system)
c745b6f6
MB
488 ;; There are rounding issues with these tests on i686:
489 ;; https://lists.gnu.org/archive/html/bug-gsl/2016-10/msg00000.html
490 ;; https://lists.gnu.org/archive/html/bug-gsl/2020-04/msg00000.html
491 '(#:phases (modify-phases %standard-phases
492 (add-before 'check 'disable-failing-tests
493 (lambda _
494 (substitute* "linalg/test.c"
495 ((".*gsl_test\\(test_LU_decomp.*") "\n")
496 ((".*gsl_test\\(test_LUc_decomp.*") "\n")
497 ((".*gsl_test\\(test_cholesky_decomp.*") "\n")
498 ((".*gsl_test\\(test_COD_lssolve2.*") "\n"))
499 (substitute* "spmatrix/test.c"
500 ((".*test_all.*") "\n")
501 ((".*test_float.*") "\n")
502 ((".*test_complex.*") "\n"))
503 #t)))))
504 (else '()))))
6f766069 505 (home-page "https://www.gnu.org/software/gsl/")
88bd1804
AE
506 (synopsis "Numerical library for C and C++")
507 (description
a22dc0c4
LC
508 "The GNU Scientific Library is a library for numerical analysis in C
509and C++. It includes a wide range of mathematical routines, with over 1000
510functions in total. Subject areas covered by the library include:
511differential equations, linear algebra, Fast Fourier Transforms and random
512numbers.")
88bd1804
AE
513 (license license:gpl3+)))
514
c1f38577
VM
515(define-public sleef
516 (package
517 (name "sleef")
518 (version "3.4.1")
519 (source
520 (origin
521 (method git-fetch)
522 (uri (git-reference
523 (url "https://github.com/shibatch/sleef")
524 (commit version)))
525 (file-name (git-file-name name version))
526 (sha256
527 (base32 "1gvf7cfvszmgjrsqivwmyy1jnp3hy80dmszxx827lhjz8yqq5019"))))
528 (build-system cmake-build-system)
529 (arguments
530 '(#:configure-flags (list "-DCMAKE_BUILD_TYPE=Release"
531 (string-append "-DCMAKE_INSTALL_LIBDIR="
532 (assoc-ref %outputs "out")
533 "/lib")
534 (string-append "-DCMAKE_INSTALL_PREFIX="
535 (assoc-ref %outputs "out")))
536 #:phases
537 (modify-phases %standard-phases
538 ;; SLEEF generates a header library during the build process and writes
539 ;; to it via shell redirection. Make the checkout writable so the
540 ;; build can succeed.
541 (add-after 'unpack 'make-git-checkout-writable
542 (lambda _
543 (for-each make-file-writable (find-files "."))
544 #t)))))
545 (inputs
546 `(("fftw" ,fftw)
547 ("gmp" ,gmp)
548 ("mpfr" ,mpfr)
549 ("openssl" ,openssl)))
550 (home-page "https://sleef.org/")
551 (synopsis "SIMD library for evaluating elementary functions and DFT")
552 (description
553 "SLEEF (SIMD Library for Evaluating Elementary Functions) is a library that
554implements vectorized versions of all C99 real floating point math functions.
555It can utilize SIMD instructions that are available on modern processors.")
556 (license (list license:boost1.0 ;sleef
557 license:cc-by4.0)))) ;simplex algorithm
558
b92eee75
AE
559(define-public glpk
560 (package
561 (name "glpk")
445929e0 562 (version "4.65")
b92eee75
AE
563 (source
564 (origin
565 (method url-fetch)
566 (uri (string-append "mirror://gnu/glpk/glpk-"
567 version ".tar.gz"))
568 (sha256
569 (base32
445929e0 570 "040sfaa9jclg2nqdh83w71sv9rc1sznpnfiripjdyr48cady50a2"))))
b92eee75
AE
571 (build-system gnu-build-system)
572 (inputs
573 `(("gmp" ,gmp)))
574 (arguments
575 `(#:configure-flags '("--with-gmp")))
82110ef6 576 (home-page "https://www.gnu.org/software/glpk/")
79c311b8 577 (synopsis "GNU Linear Programming Kit, supporting the MathProg language")
b92eee75
AE
578 (description
579 "GLPK is a C library for solving large-scale linear programming (LP),
580mixed integer programming (MIP), and other related problems. It supports the
581GNU MathProg modeling language, a subset of the AMPL language, and features a
582translator for the language. In addition to the C library, a stand-alone
583LP/MIP solver is included in the package.")
584 (license license:gpl3+)))
585
b146763a
AE
586(define-public 4ti2
587 (package
588 (name "4ti2")
eea4a091 589 (version "1.6.9")
b146763a
AE
590 (source
591 (origin
eea4a091
TGR
592 (method url-fetch)
593 (uri (string-append "https://github.com/4ti2/4ti2/releases/download/"
594 "Release_"
595 (string-map (lambda (c) (if (char=? c #\.) #\_ c))
596 version)
597 "/4ti2-" version ".tar.gz"))
598 (sha256
599 (base32 "0rj92x6p9m3la5gasjbj7sa569im527ffmka5y2sv1amgd3fflrh"))))
b146763a
AE
600 (build-system gnu-build-system)
601 (native-inputs
602 `(("which" ,(@ (gnu packages base) which)))) ; for the tests
603 (inputs
604 `(("glpk" ,glpk)
605 ("gmp" ,gmp)))
606 (home-page "http://www.4ti2.de/")
607 (synopsis "Mathematical tool suite for problems on linear spaces")
608 (description
609 "4ti2 implements algorithms for solving algebraic, geometric and
610combinatorial problems on linear spaces. Among others, it solves systems
611of linear equations, computes extreme rays of polyhedral cones, solves
612integer programming problems and computes Markov bases for statistics.")
613 (license license:gpl2+)))
614
53696f10
AE
615(define-public cddlib
616 (package
617 (name "cddlib")
7fe491fb 618 (version "0.94i")
53696f10
AE
619 (source
620 (origin
621 (method url-fetch)
182dde82 622 (uri (string-append "ftp://ftp.math.ethz.ch/users/fukudak/cdd/cddlib-"
53696f10
AE
623 (string-delete #\. version) ".tar.gz"))
624 (sha256
625 (base32
7fe491fb 626 "00zdgiqb91vx6gd2103h3ijij0llspsxc6zz3iw2bll39fvkl4xq"))))
53696f10
AE
627 (build-system gnu-build-system)
628 (inputs
629 `(("gmp" ,gmp)))
630 (home-page "https://www.inf.ethz.ch/personal/fukudak/cdd_home/index.html")
631 (synopsis "Library for convex hulls and extreme rays of polyhedra")
632 (description
633 "The C-library cddlib implements the Double Description Method of
634Motzkin et al. for generating all vertices (i.e. extreme points) and extreme
635rays of a general convex polyhedron given by a system of linear inequalities
636in arbitrary dimension. It can also be used for the converse operation of
637computing convex hulls.")
638 (license license:gpl2+)))
639
0ffc2d53
AE
640(define-public lrslib
641 (package
642 (name "lrslib")
643 (version "7.0a")
644 (source
645 (origin
646 (method url-fetch)
647 (uri (string-append "http://cgm.cs.mcgill.ca/~avis/C/lrslib/archive/"
648 "lrslib-0"
649 (string-delete #\. version) ".tar.gz"))
650 (sha256
651 (base32
652 "034fa45r9hwx6ljmgpxk2872q34nklkalpdkc6s9hqw57rivi36k"))))
653 (build-system gnu-build-system)
654 (inputs
655 `(("gmp" ,gmp)))
656 (arguments
657 `(#:tests? #f ; no check phase
658 #:make-flags `("CC=gcc"
659 ,(string-append "prefix=" (assoc-ref %outputs "out"))
660 "all-shared")
661 #:phases
662 (modify-phases %standard-phases
663 (replace 'configure
664 (lambda _
665 (substitute* "makefile"
666 (("-L \\.") "-L . -Wl,-rpath='$$ORIGIN/../lib'"))
667 #t)))))
668 (home-page "http://cgm.cs.mcgill.ca/~avis/C/lrs.html")
669 (synopsis "Convex hulls of polyhedra with exact arithmetic")
670 (description
671 "The C code of lrslib implements the reverse search algorithm for
672vertex enumeration and convex hull problems. Its input file format is
673compatible with cddlib. All computations are done exactly in either
674multiple precision or fixed integer arithmetic. Output is not stored
675in memory, so even problems with very large output sizes can sometimes
676be solved.")
677 (license license:gpl2+)))
678
b457f3cc
AE
679(define-public vinci
680 (package
681 (name "vinci")
682 (version "1.0.5")
683 (source
684 (origin
685 (method url-fetch)
686 (uri (string-append "https://www.math.u-bordeaux.fr/~aenge/software/"
687 "vinci/vinci-" version ".tar.gz"))
688 (sha256
689 (base32
690 "1aq0qc1y27iw9grhgnyji3290wwfznsrk3sg6ynqpxwjdda53h4m"))))
691 (build-system gnu-build-system)
692 (inputs
693 `(("lrslib" ,lrslib)))
694 (arguments
695 `(#:tests? #f ; no check phase
696 #:phases
697 (modify-phases %standard-phases
698 (replace 'configure
699 ;; register the lrs location in the config file
700 (lambda* (#:key inputs #:allow-other-keys)
701 (let* ((lrs (assoc-ref inputs "lrslib"))
702 (lrsexec (string-append lrs "/bin/lrs")))
703 (substitute* "vinci.h"
704 (("#define LRS_EXEC \"lrs\"")
705 (string-append "#define LRS_EXEC \"" lrsexec "\""))))
706 #t))
707 (replace 'install
708 (lambda* (#:key outputs #:allow-other-keys)
709 (let* ((out (assoc-ref outputs "out"))
710 (bin (string-append out "/bin")))
711 (install-file "vinci" bin))
712 #t)))))
713 (home-page
714 "https://www.math.u-bordeaux.fr/~aenge/?category=software&page=vinci")
715 (synopsis "Volume computation for polytopes")
716 (description
717 "Vinci implements a number of volume computation algorithms for convex
718polytopes in arbitrary dimension. The polytopes can be given by their
719V-representation (as the convex hull of a finite number of vertices), by
720their H-representation (as the bounded intersection of a finite number of
721halfspaces) or by their double description with both representations.")
722 (license license:gpl2+)))
723
865a69dd
RW
724(define-public arpack-ng
725 (package
726 (name "arpack-ng")
f03c4ec6 727 (version "3.6.3")
c0edb5b5 728 (home-page "https://github.com/opencollab/arpack-ng")
622ef2b9
MB
729 (source (origin
730 (method git-fetch)
731 (uri (git-reference (url home-page) (commit version)))
732 (file-name (git-file-name name version))
733 (sha256
734 (base32
f03c4ec6 735 "1wljl96yqxc9v8r49c37lscwkdp58kaacfb9p6s6nvpm31haax4y"))))
865a69dd 736 (build-system gnu-build-system)
c0edb5b5
LC
737 (native-inputs
738 `(("autoconf" ,autoconf)
739 ("automake" ,automake)
740 ("libtool" ,libtool)))
865a69dd
RW
741 (inputs
742 `(("lapack" ,lapack)
19afbea1 743 ("fortran" ,gfortran)))
865a69dd
RW
744 (synopsis "Fortran subroutines for solving eigenvalue problems")
745 (description
746 "ARPACK-NG is a collection of Fortran77 subroutines designed to solve
747large scale eigenvalue problems.")
166191b3 748 (license (license:non-copyleft "file://COPYING"
865a69dd
RW
749 "See COPYING in the distribution."))))
750
c0edb5b5
LC
751(define-public arpack-ng-3.3.0
752 (package
753 (inherit arpack-ng)
754 (version "3.3.0")
755 (name (package-name arpack-ng))
756 (home-page (package-home-page arpack-ng))
757 (source
758 (origin
759 (method url-fetch)
760 (uri (string-append home-page "/archive/" version ".tar.gz"))
761 (file-name (string-append name "-" version ".tar.gz"))
762 (sha256
763 (base32
764 "1cz53wqzcf6czmcpfb3vb61xi0rn5bwhinczl65hpmbrglg82ndd"))))))
765
8c94c886
EB
766(define-public arpack-ng-openmpi
767 (package (inherit arpack-ng)
768 (name "arpack-ng-openmpi")
769 (inputs
770 `(("mpi" ,openmpi)
771 ,@(package-inputs arpack-ng)))
4f387541
LC
772 (arguments
773 (substitute-keyword-arguments (package-arguments arpack-ng)
774 ((#:configure-flags _ '())
aa82260b
PG
775 ''("--enable-mpi"))
776 ((#:phases phases '%standard-phases)
777 `(modify-phases ,phases
bbe46a4a
EB
778 (add-before 'check 'mpi-setup
779 ,%openmpi-setup)))))
8c94c886
EB
780 (synopsis "Fortran subroutines for solving eigenvalue problems with MPI")))
781
da95c817
NK
782(define-public lapack
783 (package
784 (name "lapack")
e6de152d 785 (version "3.9.0")
da95c817
NK
786 (source
787 (origin
788 (method url-fetch)
789 (uri (string-append "http://www.netlib.org/lapack/lapack-"
790 version ".tgz"))
791 (sha256
792 (base32
e6de152d 793 "1155qixp26c12yrxc76z9mlfw2h3xxymxxv5znpgzh5gaykpndgj"))))
da95c817
NK
794 (build-system cmake-build-system)
795 (home-page "http://www.netlib.org/lapack/")
19afbea1 796 (inputs `(("fortran" ,gfortran)
e6de152d 797 ("python" ,python-wrapper)))
da95c817 798 (arguments
3ab869b6 799 `(#:configure-flags (list
3ab869b6
LC
800 "-DBUILD_SHARED_LIBS:BOOL=YES"
801 "-DLAPACKE=ON"
3ab869b6 802 ;; Build the 'LAPACKE_clatms' functions.
e6de152d
KH
803 "-DLAPACKE_WITH_TMG=ON"
804 "-DBUILD_TESTING=ON")))
da95c817
NK
805 (synopsis "Library for numerical linear algebra")
806 (description
807 "LAPACK is a Fortran 90 library for solving the most commonly occurring
808problems in numerical linear algebra.")
166191b3 809 (license (license:non-copyleft "file://LICENSE"
da95c817 810 "See LICENSE in the distribution."))))
73fed4f8 811
e1ff597a
EB
812(define-public scalapack
813 (package
814 (name "scalapack")
815 (version "2.0.2")
816 (source
817 (origin
818 (method url-fetch)
819 (uri (string-append "http://www.netlib.org/scalapack/scalapack-"
820 version ".tgz"))
821 (sha256
822 (base32
f73750e6
EB
823 "0p1r61ss1fq0bs8ynnx7xq4wwsdvs32ljvwjnx6yxr8gd6pawx0c"))
824 (patches (search-patches "scalapack-blacs-mpi-deprecations.patch"))))
e1ff597a
EB
825 (build-system cmake-build-system)
826 (inputs
827 `(("mpi" ,openmpi)
828 ("fortran" ,gfortran)
829 ("lapack" ,lapack))) ;for testing only
830 (arguments
6df2a50a
LC
831 `(#:configure-flags `("-DBUILD_SHARED_LIBS:BOOL=YES")
832 #:phases (modify-phases %standard-phases
bbe46a4a
EB
833 (add-before 'check 'mpi-setup
834 ,%openmpi-setup))))
e1ff597a
EB
835 (home-page "http://www.netlib.org/scalapack/")
836 (synopsis "Library for scalable numerical linear algebra")
837 (description
838 "ScaLAPACK is a Fortran 90 library of high-performance linear algebra
839routines on parallel distributed memory machines. ScaLAPACK solves dense and
840banded linear systems, least squares problems, eigenvalue problems, and
841singular value problems.")
adb223b8
LC
842 (license (license:non-copyleft "file://LICENSE"
843 "See LICENSE in the distribution."))))
e1ff597a 844
73fed4f8 845(define-public gnuplot
5f800540
KK
846 (package
847 (name "gnuplot")
cb1d8aee 848 (version "5.2.7")
5f800540
KK
849 (source (origin
850 (method url-fetch)
851 (uri (string-append "mirror://sourceforge/gnuplot/gnuplot/"
852 version "/gnuplot-"
853 version ".tar.gz"))
854 (sha256
cb1d8aee 855 (base32 "1vglp4la40f5dpj0zdj63zprrkyjgzy068p35bz5dqxjyczm1zlp"))))
5f800540
KK
856 (build-system gnu-build-system)
857 (inputs `(("readline" ,readline)
858 ("cairo" ,cairo)
859 ("pango" ,pango)
6e64766a
DM
860 ("gd" ,gd)
861 ("lua" ,lua)))
612a387f
RW
862 (native-inputs
863 `(("pkg-config" ,pkg-config)
864 ("texlive" ,texlive-tiny)))
07254d8b
AM
865 (arguments `(#:configure-flags (list (string-append
866 "--with-texdir=" %output
867 "/texmf-local/tex/latex/gnuplot"))))
5f800540
KK
868 (home-page "http://www.gnuplot.info")
869 (synopsis "Command-line driven graphing utility")
870 (description "Gnuplot is a portable command-line driven graphing
35b9e423 871utility. It was originally created to allow scientists and students to
73fed4f8 872visualize mathematical functions and data interactively, but has grown to
35b9e423 873support many non-interactive uses such as web scripting. It is also used as a
73fed4f8 874plotting engine by third-party applications like Octave.")
5f800540
KK
875 ;; X11 Style with the additional restriction that derived works may only be
876 ;; distributed as patches to the original.
877 (license (license:fsf-free
878 "http://gnuplot.cvs.sourceforge.net/gnuplot/gnuplot/Copyright"))))
668c06ac 879
32f70e1f
TD
880(define-public gctp
881 (package
882 (name "gctp")
883 (version "2.0.0")
884 (source
885 (origin
5db874d1
TGR
886 (method git-fetch)
887 (uri (git-reference
b0e7b699 888 (url "https://github.com/OkoSanto/GCTP")
5db874d1
TGR
889 (commit (string-append "v" version))))
890 (file-name (git-file-name name version))
32f70e1f 891 (sha256
5db874d1 892 (base32 "11wqmd443b4nksdbzp1msdws3av948nmwq1xz80w6hka3ss2aigd"))))
32f70e1f
TD
893 (native-inputs
894 `(("fortran" ,gfortran)))
895 (build-system gnu-build-system)
896 (synopsis "General Cartographic Transformation Package (GCTP)")
897 (description
898 "The General Cartographic Transformation Package (GCTP) is a system of
899software routines designed to permit the transformation of coordinate pairs
900from one map projection to another. The GCTP is the standard computer
901software used by the National Mapping Division for map projection
902computations.")
903 (home-page "https://github.com/OkoSanto/GCTP")
0f7cd95b 904 (license license:public-domain))) ;https://www2.usgs.gov/laws/info_policies.html
32f70e1f 905
becbbefc
TD
906(define-public hdf4
907 (package
908 (name "hdf4")
c959d99f 909 (version "4.2.14")
becbbefc
TD
910 (source
911 (origin
912 (method url-fetch)
913 (uri (string-append "https://support.hdfgroup.org/ftp/HDF/releases/HDF"
914 version "/src/hdf-" version ".tar.bz2"))
915 (sha256
c959d99f 916 (base32 "0n29klrrbwan9307np0d9hr128dlpc4nnlf57a140080ll3jmp8l"))
15ca49b2
AE
917 (patches (search-patches "hdf4-architectures.patch"
918 "hdf4-reproducibility.patch"
bd3d71cb
MB
919 "hdf4-shared-fortran.patch"
920 "hdf4-tirpc.patch"))))
becbbefc
TD
921 (build-system gnu-build-system)
922 (native-inputs
923 `(("gfortran" ,gfortran)
924 ("bison" ,bison)
925 ("flex" ,flex)))
926 (inputs
927 `(("zlib" ,zlib)
4bd428a7 928 ("libjpeg" ,libjpeg-turbo)
bd3d71cb 929 ("libtirpc" ,libtirpc)))
becbbefc
TD
930 (arguments
931 `(#:parallel-tests? #f
bd3d71cb
MB
932 #:configure-flags (list "--enable-shared"
933 (string-append "CPPFLAGS=-I"
934 (assoc-ref %build-inputs "libtirpc")
935 "/include/tirpc"))
becbbefc
TD
936 #:phases
937 (modify-phases %standard-phases
953a12fa
EF
938 ;; This is inspired by two of Debian's patches.
939 (add-before 'configure 'add-more-aarch64-support
940 (lambda _
941 (substitute* '("mfhdf/ncgen/ncgen.l"
942 "mfhdf/ncgen/ncgenyy.c"
943 "mfhdf/libsrc/netcdf.h.in")
944 (("AIX5L64") "__aarch64__"))
945 #t))
becbbefc
TD
946 (add-before 'configure 'patchbuild
947 (lambda _
948 (substitute*
949 '("mfhdf/hdfimport/testutil.sh.in" "hdf/util/testutil.sh.in")
950 (("/bin/rm") "rm")
951 (("/bin/mkdir") "mkdir"))
952 (substitute* (find-files "." "^Makefile\\.in$")
953 (("@HDF_BUILD_XDR_TRUE@XDR_ADD = \
954-R\\$\\(abs_top_builddir\\)/mfhdf/xdr/\\.libs") "")
955 (("@HDF_BUILD_SHARED_TRUE@AM_LDFLAGS = \
956-R\\$\\(abs_top_builddir\\)/mfhdf/libsrc/\\.libs \
953a12fa 957-R\\$\\(abs_top_builddir\\)/hdf/src/\\.libs \\$\\(XDR_ADD\\)") ""))
e464b455
TD
958 #t))
959 (add-after 'configure 'patch-settings
960 (lambda _
961 ;; libhdf4.settings contains the full path of the
962 ;; compilers used, and its contents are included in
963 ;; .so-files. We truncate the hashes to avoid
964 ;; unnecessary store references to those compilers:
965 (substitute* "libhdf4.settings"
966 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
967 (string-append prefix (string-take hash 10) "...")))
968 #t))
fadd962f
MB
969 (add-after 'install 'provide-absolute-libjpeg-reference
970 (lambda* (#:key inputs outputs #:allow-other-keys)
971 (let ((out (assoc-ref outputs "out"))
972 (libjpeg (assoc-ref inputs "libjpeg")))
973 ;; libjpeg-turbo does not provide a .la file, so libtool is
974 ;; unable to add an absolute reference for -ljpeg in the .la
975 ;; files. Fix it manually to avoid having to propagate it.
976 (substitute* (find-files (string-append out "/lib") "\\.la$")
977 (("-ljpeg")
978 (string-append "-L" libjpeg "/lib -ljpeg")))
979 #t))))))
becbbefc
TD
980 (home-page "https://www.hdfgroup.org/products/hdf4/")
981 (synopsis
982 "Library and multi-object file format for storing and managing data")
983 (description "HDF4 is a library and multi-object file format for storing
984and managing data between machines. HDF4 is an older hierarchical data format,
985incompatible with HDF5.")
986 (license
987 (license:non-copyleft
988 "https://www.hdfgroup.org/ftp/HDF/HDF_Current/src/unpacked/COPYING"))))
989
990(define-public hdf4-alt
991 (package
992 (inherit hdf4)
993 (name "hdf4-alt")
994 (arguments
995 (substitute-keyword-arguments (package-arguments hdf4)
996 ((#:configure-flags flags) `(cons* "--disable-netcdf" ,flags))))
997 (synopsis
998 "HDF4 without netCDF API, can be combined with the regular netCDF library")))
999
7ee3f1a2
JD
1000(define-public hdf5
1001 (package
1002 (name "hdf5")
7b84610e 1003 (version "1.8.21")
7ee3f1a2
JD
1004 (source
1005 (origin
1006 (method url-fetch)
2da63064
TD
1007 (uri (list (string-append "https://support.hdfgroup.org/ftp/HDF5/releases/"
1008 "hdf5-" (version-major+minor version)
1009 "/hdf5-" version "/src/hdf5-"
dcd9d163
LF
1010 version ".tar.bz2")
1011 (string-append "https://support.hdfgroup.org/ftp/HDF5/"
1012 "current"
7b84610e
EB
1013 (match (string-split version #\.)
1014 ((major minor _ ...)
1015 (string-append major minor)))
dcd9d163 1016 "/src/hdf5-" version ".tar.bz2")))
7ee3f1a2 1017 (sha256
7b84610e 1018 (base32 "03glk4w4wyb1jyb443g53y3y1ncnf6mj2cqwm6avfr2awkgb3cg5"))
7fedc3fd
EB
1019 (patches (search-patches "hdf5-config-date.patch"
1020 "hdf5-1.8-mpi-deprecations.patch"))))
7ee3f1a2 1021 (build-system gnu-build-system)
12ed1216
AE
1022 (inputs
1023 `(("zlib" ,zlib)))
e3a1a1de 1024 (native-inputs
3ea420f3
LC
1025 `(("gfortran" ,gfortran)
1026 ("perl" ,perl))) ;part of the test machinery needs Perl
e3a1a1de
TD
1027 (outputs '("out" ; core library
1028 "fortran")) ; fortran interface
7ee3f1a2 1029 (arguments
62126576 1030 `(;; Some of the users, notably Flann, need the C++ interface.
e3a1a1de
TD
1031 #:configure-flags '("--enable-cxx"
1032 "--enable-fortran"
549d1571
LC
1033 "--enable-fortran2003"
1034
1035 ;; Build a thread-safe library. Unfortunately,
1036 ;; 'configure' invites you to either turn off C++,
1037 ;; Fortran, and the high-level interface (HL), or
1038 ;; to pass '--enable-unsupported'. Debian
1039 ;; packagers chose to pass '--enable-unsupported'
1040 ;; and we follow their lead here.
1041 "--enable-threadsafe"
1042 "--with-pthread"
1043 "--enable-unsupported")
4dba441c
RW
1044 ;; Use -fPIC to allow the R bindings to link with the static libraries
1045 #:make-flags (list "CFLAGS=-fPIC"
1046 "CXXFLAGS=-fPIC")
62126576 1047 #:phases
f622e212
EB
1048 (modify-phases %standard-phases
1049 (add-before 'configure 'patch-configure
e3a1a1de 1050 (lambda* (#:key outputs #:allow-other-keys)
f622e212 1051 (substitute* "configure"
b8d9c93b 1052 (("/bin/mv") "mv"))
e3a1a1de
TD
1053 (substitute* "fortran/src/Makefile.in"
1054 (("libhdf5_fortran_la_LDFLAGS =")
1055 (string-append "libhdf5_fortran_la_LDFLAGS = -Wl-rpath="
1056 (assoc-ref outputs "fortran") "/lib")))
1057 (substitute* "hl/fortran/src/Makefile.in"
1058 (("libhdf5hl_fortran_la_LDFLAGS =")
1059 (string-append "libhdf5hl_fortran_la_LDFLAGS = -Wl,-rpath="
1060 (assoc-ref outputs "fortran") "/lib")))
b8d9c93b 1061 #t))
fd0378a1
TD
1062 (add-after 'configure 'patch-settings
1063 (lambda _
1064 ;; libhdf5.settings contains the full path of the
1065 ;; compilers used, and its contents are included in
1066 ;; libhdf5.so. We truncate the hashes to avoid
1067 ;; unnecessary store references to those compilers:
1068 (substitute* "src/libhdf5.settings"
1069 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
d8f46d52
RW
1070 (string-append prefix (string-take hash 10) "..."))
1071 ;; Don't record the build-time kernel version to make the
1072 ;; settings file reproducible.
1073 (("Uname information:.*")
1074 "Uname information: Linux\n"))
b8d9c93b 1075 #t))
f622e212
EB
1076 (add-after 'install 'patch-references
1077 (lambda* (#:key inputs outputs #:allow-other-keys)
1078 (let ((bin (string-append (assoc-ref outputs "out") "/bin"))
1079 (zlib (assoc-ref inputs "zlib")))
1080 (substitute* (find-files bin "h5p?cc")
1081 (("-lz" lib)
1082 (string-append "-L" zlib "/lib " lib)))
e3a1a1de
TD
1083 #t)))
1084 (add-after 'install 'split
1085 (lambda* (#:key inputs outputs #:allow-other-keys)
1086 ;; Move all fortran-related files
1087 (let* ((out (assoc-ref outputs "out"))
1088 (bin (string-append out "/bin"))
1089 (lib (string-append out "/lib"))
1090 (inc (string-append out "/include"))
1091 (ex (string-append out "/share/hdf5_examples/fortran"))
1092 (fort (assoc-ref outputs "fortran"))
1093 (fbin (string-append fort "/bin"))
1094 (flib (string-append fort "/lib"))
1095 (finc (string-append fort "/include"))
1096 (fex (string-append fort "/share/hdf5_examples/fortran")))
1097 (mkdir-p fbin)
1098 (mkdir-p flib)
1099 (mkdir-p finc)
1100 (mkdir-p fex)
b0d1e60f
PG
1101 ;; Note: When built with --enable-parallel, the 'h5fc' file
1102 ;; doesn't exist, hence this condition.
1103 (when (file-exists? (string-append bin "/h5fc"))
1104 (rename-file (string-append bin "/h5fc")
1105 (string-append fbin "/h5fc")))
e3a1a1de
TD
1106 (for-each (lambda (file)
1107 (rename-file file
1108 (string-append flib "/" (basename file))))
1109 (find-files lib ".*fortran.*"))
1110 (for-each (lambda (file)
1111 (rename-file file
1112 (string-append finc "/" (basename file))))
1113 (find-files inc ".*mod"))
1114 (for-each (lambda (file)
1115 (rename-file file
1116 (string-append fex "/" (basename file))))
1117 (find-files ex ".*"))
1118 (delete-file-recursively ex))
1119 #t)))))
0a44f9c4 1120 (home-page "https://www.hdfgroup.org")
516e93f8 1121 (synopsis "Management suite for extremely large and complex data")
7ee3f1a2
JD
1122 (description "HDF5 is a suite that makes possible the management of
1123extremely large and complex data collections.")
d4bf49b1 1124 (license (license:x11-style
0a44f9c4 1125 "https://www.hdfgroup.org/ftp/HDF5/current/src/unpacked/COPYING"))))
7ee3f1a2 1126
bb47aca5
RW
1127(define-public hdf5-1.10
1128 (package (inherit hdf5)
cb169aae 1129 (version "1.10.6")
bb47aca5
RW
1130 (source
1131 (origin
1132 (method url-fetch)
1133 (uri (list (string-append "https://support.hdfgroup.org/ftp/HDF5/releases/"
1134 "hdf5-" (version-major+minor version)
1135 "/hdf5-" version "/src/hdf5-"
1136 version ".tar.bz2")
1137 (string-append "https://support.hdfgroup.org/ftp/HDF5/"
1138 "current"
1139 (apply string-append
1140 (take (string-split version #\.) 2))
1141 "/src/hdf5-" version ".tar.bz2")))
1142 (sha256
cb169aae 1143 (base32 "1gf38x51128hn00744358w27xgzjk0ff4wra4yxh2lk804ck1mh9"))
94fea21b 1144 (patches (search-patches "hdf5-config-date.patch"))))))
bb47aca5 1145
2fd26d05
TD
1146(define-public hdf-java
1147 (package
2a509880
RW
1148 (name "hdf-java")
1149 (version "3.3.2")
1150 (source
1151 (origin
1152 (method url-fetch)
1153 (uri (string-append
0a44f9c4 1154 "https://www.hdfgroup.org/ftp/HDF5/releases/HDF-JAVA/hdfjni-"
2a509880
RW
1155 version "/src/CMake-hdfjava-" version ".tar.gz"))
1156 (sha256
1157 (base32 "0m1gp2aspcblqzmpqbdpfp6giskws85ds6p5gz8sx7asyp7wznpr"))
1158 (modules '((guix build utils)))
1159 (snippet ; Make sure we don't use the bundled sources and binaries.
1160 `(begin
1161 (for-each delete-file
1162 (list "SZip.tar.gz" "ZLib.tar.gz" "JPEG8d.tar.gz"
1163 "HDF4.tar.gz" "HDF5.tar.gz"))
1164 (delete-file-recursively ,(string-append "hdfjava-" version "/lib"))
1165 #t))))
1166 (build-system gnu-build-system)
1167 (native-inputs
1168 `(("jdk" ,icedtea "jdk")
1169 ("automake" ,automake) ; For up to date 'config.guess' and 'config.sub'.
1170 ;; For tests:
1171 ("hamcrest-core" ,java-hamcrest-core)
1172 ("junit" ,java-junit)
1173 ("slf4j-simple" ,java-slf4j-simple)))
1174 (inputs
1175 `(("hdf4" ,hdf4)
1176 ("hdf5" ,hdf5)
1177 ("zlib" ,zlib)
4bd428a7 1178 ("libjpeg" ,libjpeg-turbo)
2a509880
RW
1179 ("slf4j-api" ,java-slf4j-api)))
1180 (arguments
1181 `(#:configure-flags
1182 (list (string-append "--target=" ,(or (%current-target-system) (%current-system)))
1183 (string-append "--with-jdk=" (assoc-ref %build-inputs "jdk") "/include,"
1184 (assoc-ref %build-inputs "jdk") "/lib" )
1185 (string-append "--with-hdf4=" (assoc-ref %build-inputs "hdf4") "/lib")
1186 (string-append "--with-hdf5=" (assoc-ref %build-inputs "hdf5") "/lib"))
2fd26d05 1187
2a509880
RW
1188 #:make-flags
1189 (list (string-append "HDFLIB=" (assoc-ref %build-inputs "hdf4") "/lib")
1190 (string-append "HDF5LIB=" (assoc-ref %build-inputs "hdf5") "/lib")
1191 (string-append "ZLIB=" (assoc-ref %build-inputs "zlib") "/lib/libz.so")
1192 (string-append "JPEGLIB="
1193 (assoc-ref %build-inputs "libjpeg") "/lib/libjpeg.so")
1194 "LLEXT=so")
2fd26d05 1195
2a509880
RW
1196 #:phases
1197 (modify-phases %standard-phases
1198 (add-before 'configure 'chdir-to-source
1199 (lambda _ (chdir ,(string-append "hdfjava-" version)) #t))
1200 (add-before 'configure 'patch-build
1201 (lambda* (#:key inputs outputs #:allow-other-keys)
1202 (substitute* "configure"
1203 (("COPT=\"") "COPT=\"-O2 ") ; CFLAGS is ignored in Makefiles
1204 (("/bin/cat") (which "cat")))
1205 ;; Set classpath for compilation
1206 (substitute* '("hdf/hdf5lib/Makefile.in"
1207 "hdf/hdf5lib/exceptions/Makefile.in"
1208 "hdf/hdflib/Makefile.in")
1209 (("\\$\\(TOP\\)/lib/slf4j-api-1\\.7\\.5\\.jar")
1210 (string-append (assoc-ref inputs "slf4j-api")
1211 "/share/java/slf4j-api.jar")))
1212 ;; Replace outdated config.sub and config.guess:
1213 (with-directory-excursion "config"
1214 (for-each (lambda (file)
1215 (install-file
1216 (string-append (assoc-ref inputs "automake")
1217 "/share/automake-"
1218 ,(version-major+minor (package-version automake))
1219 "/" file) "."))
1220 '("config.sub" "config.guess")))
64dc8b0b 1221
2a509880
RW
1222 ;; Fix embedded version number
1223 (let ((hdf5version (list ,@(string-split (package-version hdf5) #\.))))
1224 (substitute* "hdf/hdf5lib/H5.java"
1225 (("1, 8, 19")
1226 (string-join hdf5version ", "))))
64dc8b0b 1227
2a509880
RW
1228 (mkdir-p (string-append (assoc-ref outputs "out")))
1229 ;; Set classpath for tests
1230 (let* ((build-dir (getcwd))
1231 (lib (string-append build-dir "/lib"))
1232 (jhdf (string-append lib "/jhdf.jar"))
1233 (jhdf5 (string-append lib "/jhdf5.jar"))
1234 (testjars
fff4fcc4
JL
1235 (append
1236 (map (lambda (i)
1237 (string-append (assoc-ref inputs i)
1238 "/share/java/" i ".jar"))
1239 '("slf4j-api" "slf4j-simple"))
1240 (list
1241 (car (find-files (assoc-ref inputs "junit") "jar$"))
1242 (car (find-files (assoc-ref inputs "hamcrest-core")
1243 "jar$")))))
2a509880
RW
1244 (class-path
1245 (string-join `("." ,build-dir ,jhdf ,jhdf5 ,@testjars) ":")))
2fd26d05 1246
2a509880
RW
1247 (substitute* '("test/hdf5lib/Makefile.in"
1248 "test/hdf5lib/junit.sh.in"
1249 "examples/runExample.sh.in")
1250 (("/usr/bin/test")
1251 (string-append (assoc-ref inputs "coreutils")
1252 "/bin/test"))
1253 (("/usr/bin/uname")
1254 (string-append (assoc-ref inputs "coreutils")
1255 "/bin/uname"))
1256 (("CLASSPATH=[^\n]*")
1257 (string-append "CLASSPATH=" class-path)))
1258 (setenv "CLASSPATH" class-path))
1259 #t))
1260 (add-before 'check 'build-examples
1261 (lambda _
1262 (apply invoke `("javac"
1263 ,@(find-files "examples" ".*\\.java"))))))
2fd26d05 1264
2a509880 1265 #:parallel-build? #f
2fd26d05 1266
2a509880
RW
1267 #:parallel-tests? #f ))
1268 (home-page "https://support.hdfgroup.org/products/java")
1269 (synopsis "Java interface for the HDF4 and HDF5 libraries")
1270 (description "Java HDF Interface (JHI) and Java HDF5 Interface (JHI5) use
2fd26d05
TD
1271the Java Native Interface to wrap the HDF4 and HDF5 libraries, which are
1272implemented in C.")
1273
2a509880
RW
1274 ;; BSD-style license:
1275 (license (license:x11-style
1276 "https://support.hdfgroup.org/ftp/HDF5/hdf-java\
2fd26d05
TD
1277/current/src/unpacked/COPYING"))))
1278
d3c4f3bb
TD
1279(define-public hdf-eos2
1280 (package
1281 (name "hdf-eos2")
1282 (version "19.1.0")
1283 (source
1284 (origin
1285 (method url-fetch)
1286 (uri "ftp://edhs1.gsfc.nasa.gov\
1287/edhs/hdfeos/latest_release/HDF-EOS2.19v1.00.tar.Z")
1288 (sha256
1289 (base32 "0c9fcz25s292ldap12wxmlrvnyz99z24p63d8fwx51bf8s0s1zrz"))
1290 (patches (search-patches "hdf-eos2-remove-gctp.patch"
1291 "hdf-eos2-build-shared.patch"
1292 "hdf-eos2-fortrantests.patch"))))
1293 (build-system gnu-build-system)
1294 (native-inputs
1295 `(("gfortran" ,gfortran)))
1296 (inputs
1297 `(("hdf4" ,hdf4-alt) ; assume most HDF-EOS2 users won't use the HDF4 netCDF API
25bdbb61 1298 ;; XXX: These inputs are really dependencies of hdf4.
d3c4f3bb 1299 ("zlib" ,zlib)
4bd428a7 1300 ("libjpeg" ,libjpeg-turbo)
25bdbb61
MB
1301 ("libtirpc" ,libtirpc)
1302
d3c4f3bb
TD
1303 ("gctp" ,gctp)))
1304 (arguments
1305 `( #:configure-flags '("--enable-install-include" "--enable-shared"
1306 "CC=h4cc -Df2cFortran" "LIBS=-lgctp")
1307 #:parallel-tests? #f))
2aaa09f1 1308 (home-page "https://hdfeos.org/software/library.php#HDF-EOS2")
d3c4f3bb
TD
1309 (synopsis "HDF4-based data format for NASA's Earth Observing System")
1310 (description "HDF-EOS2 is a software library built on HDF4 which supports
1311the construction of data structures used in NASA's Earth Observing
1312System (Grid, Point and Swath).")
1313
1314 ;; Source files carry a permissive license header.
1315 (license (license:non-copyleft home-page))))
1316
0f43f835
TD
1317(define-public hdf-eos5
1318 (package
1319 (name "hdf-eos5")
1320 (version "1.15")
1321 (source (origin
1322 (method url-fetch)
1323 (uri (string-append "ftp://edhs1.gsfc.nasa.gov\
1324/edhs/hdfeos5/latest_release/HDF-EOS5." version ".tar.Z"))
1325 (sha256
1326 (base32
1327 "1p83333nzzy8rn5chxlm0hrkjjnhh2w1ji8ac0f9q4xzg838i58i"))
1328 (patches (search-patches "hdf-eos5-build-shared.patch"
1329 "hdf-eos5-remove-gctp.patch"
1330 "hdf-eos5-fix-szip.patch"
1331 "hdf-eos5-fortrantests.patch"))))
1332 (native-inputs
1333 `(("gfortran" ,gfortran)))
1334 (build-system gnu-build-system)
1335 (inputs
1336 `(("hdf5" ,hdf5)
1337 ("zlib" ,zlib)
1338 ("gctp" ,gctp)))
1339 (arguments
1340 `(#:configure-flags '("--enable-install-include" "--enable-shared"
1341 "CC=h5cc -Df2cFortran" "LIBS=-lgctp")
1342 #:parallel-tests? #f))
1343 (synopsis "HDF5-based data format for NASA's Earth Observing System")
1344 (description
1345 "HDF-EOS5 is a software library built on HDF5 to support the construction
1346of data structures used in NASA's Earth Observing System (Grid, Point and
1347Swath).")
1348 (home-page "http://www.hdfeos.org/software/library.php#HDF-EOS5")
1349
1350 ;; Source files carry a permissive license header.
1351 (license (license:non-copyleft home-page))))
1352
c8378eea
EB
1353(define-public hdf5-parallel-openmpi
1354 (package (inherit hdf5)
1355 (name "hdf5-parallel-openmpi")
1356 (inputs
1357 `(("mpi" ,openmpi)
1358 ,@(package-inputs hdf5)))
1359 (arguments
45201bf2
PG
1360 (substitute-keyword-arguments (package-arguments hdf5)
1361 ((#:configure-flags flags)
549d1571
LC
1362 ``("--enable-parallel"
1363 ,@(delete "--enable-cxx"
1364 (delete "--enable-threadsafe" ,flags))))
c8378eea
EB
1365 ((#:phases phases)
1366 `(modify-phases ,phases
45201bf2
PG
1367 (add-after 'build 'mpi-setup
1368 ,%openmpi-setup)
c8378eea
EB
1369 (add-before 'check 'patch-tests
1370 (lambda _
1371 ;; OpenMPI's mpirun will exit with non-zero status if it
1372 ;; detects an "abnormal termination", i.e. any process not
784c3da1 1373 ;; calling MPI_Finalize(). Since the test is explicitly
c8378eea
EB
1374 ;; avoiding MPI_Finalize so as not to have at_exit and thus
1375 ;; H5C_flush_cache from being called, mpirun will always
1376 ;; complain, so turn this test off.
1377 (substitute* "testpar/Makefile"
1378 (("(^TEST_PROG_PARA.*)t_pflush1(.*)" front back)
1379 (string-append front back "\n")))
1380 (substitute* "tools/h5diff/testph5diff.sh"
1381 (("/bin/sh") (which "sh")))
1382 #t))))))
1383 (synopsis "Management suite for data with parallel IO support")))
1384
0b2c8838
RW
1385(define-public hdf5-blosc
1386 (package
1387 (name "hdf5-blosc")
1388 (version "1.0.0")
1389 (source
1390 (origin
1391 (method git-fetch)
1392 (uri (git-reference
b0e7b699 1393 (url "https://github.com/Blosc/hdf5-blosc")
0b2c8838
RW
1394 (commit (string-append "v" version))))
1395 (file-name (git-file-name name version))
1396 (sha256
1397 (base32 "1nj2bm1v6ymm3fmyvhbn6ih5fgdiapavlfghh1pvbmhw71cysyqs"))))
1398 (build-system cmake-build-system)
1399 (arguments
1400 `(#:configure-flags
1401 (list (string-append "-DBLOSC_INSTALL_DIR="
1402 (assoc-ref %build-inputs "c-blosc"))
1403 (string-append "-DPLUGIN_INSTALL_PATH="
1404 (assoc-ref %outputs "out")
1405 "/hdf5/lib/plugin"))
1406 #:phases
1407 (modify-phases %standard-phases
1408 (add-after 'unpack 'do-not-build-blosc
1409 (lambda _
1410 (substitute* "CMakeLists.txt"
1411 (("set\\(BLOSC_INSTALL_DIR.*") "")
1412 (("ExternalProject_Add\\(project_blosc") "message("))
1413 #t)))))
1414 (inputs
1415 `(("c-blosc" ,c-blosc)
1416 ("hdf5" ,hdf5-1.10)))
1417 (home-page "https://github.com/Blosc/hdf5-blosc")
1418 (synopsis "Filter for HDF5 using the Blosc compressor")
1419 (description "This is a filter for HDF5 that uses the Blosc compressor; by
1420installing this filter, you can read and write HDF5 files with
1421Blosc-compressed datasets.")
1422 (license license:expat)))
c8378eea 1423
00775104
EB
1424(define-public h5check
1425 (package
1426 (name "h5check")
1427 (version "2.0.1")
1428 (source
1429 (origin
1430 (method url-fetch)
0a44f9c4 1431 (uri (string-append "https://www.hdfgroup.org/ftp/HDF5/tools/"
00775104
EB
1432 "h5check/src/h5check-" version ".tar.gz"))
1433 (sha256
1434 (base32
1435 "1gm76jbwhz9adbxgn14zx8cj33dmjdr2g5xcy0m9c2gakp8w59kj"))))
1436 (build-system gnu-build-system)
1437 (inputs `(("hdf5" ,hdf5))) ;h5cc for tests
1438 (home-page "https://www.hdfgroup.org/products/hdf5_tools/h5check.html")
1439 (synopsis "HDF5 format checker")
1440 (description "@code{h5check} is a validation tool for verifying that an
1441HDF5 file is encoded according to the HDF File Format Specification.")
1442 (license (license:x11-style "file://COPYING"))))
1443
a53d6719
JD
1444(define-public itpp
1445 (package
1446 (name "itpp")
1447 (version "4.3.1")
1448 (source (origin
1449 (method url-fetch)
1450 (uri (string-append "mirror://sourceforge/itpp/itpp/"
1451 version "/itpp-"
1452 version ".tar.gz"))
1453 (sha256
1454 (base32
1455 "14ddy2xnb6sgp4hiax9v5sv4pr4l4dd4ps76nfha3nrpr1ikhcqm"))))
1456 (build-system cmake-build-system)
1457 (arguments `(#:tests? #f)) ; Tests require googletest *sources*
1458 (inputs `(("lapack" ,lapack)
1459 ("fftw" ,fftw)))
3a4d5df2
RW
1460 ;; FIXME: Even though the fonts are available dvips complains:
1461 ;; "Font cmmi10 not found; characters will be left blank."
1462 (native-inputs
1463 `(("texlive" ,texlive-tiny)
1464 ("ghostscript" ,ghostscript)
1465 ("doxygen" ,doxygen)))
a53d6719
JD
1466 (home-page "http://itpp.sourceforge.net")
1467 (synopsis "C++ library of maths, signal processing and communication classes")
1468 (description "IT++ is a C++ library of mathematical, signal processing and
1469communication classes and functions. Its main use is in simulation of
1470communication systems and for performing research in the area of
1471communications. The kernel of the library consists of generic vector and
1472matrix classes, and a set of accompanying routines. Such a kernel makes IT++
1473similar to MATLAB, GNU Octave or SciPy.")
1474 (license license:gpl3+)))
1475
889187a4
EB
1476(define-public netcdf
1477 (package
1478 (name "netcdf")
a4b0bfb1 1479 (version "4.4.1.1")
889187a4
EB
1480 (source
1481 (origin
1482 (method url-fetch)
1483 (uri (string-append "ftp://ftp.unidata.ucar.edu/pub/netcdf/"
1484 "netcdf-" version ".tar.gz"))
1485 (sha256
1486 (base32
a4b0bfb1
EB
1487 "1blc7ik5yin7i0ls2kag0a9xjk12m0dzx6v1x88az3ras3scci2d"))
1488 (patches (search-patches "netcdf-date-time.patch"
1489 "netcdf-tst_h_par.patch"))))
889187a4
EB
1490 (build-system gnu-build-system)
1491 (native-inputs
1492 `(("m4" ,m4)
1493 ("doxygen" ,doxygen)
1494 ("graphviz" ,graphviz)))
1495 (inputs
db825570
TD
1496 `(("hdf4" ,hdf4-alt)
1497 ("hdf5" ,hdf5)
1498 ("zlib" ,zlib)
4bd428a7 1499 ("libjpeg" ,libjpeg-turbo)))
889187a4 1500 (arguments
db825570 1501 `(#:configure-flags '("--enable-doxygen" "--enable-dot" "--enable-hdf4")
43d01672
TD
1502
1503 #:phases (modify-phases %standard-phases
1504 (add-before 'configure 'fix-source-date
1505 (lambda _
1506 ;; As we ${SOURCE_DATE_EPOCH} evaluates to "1" in the build
1507 ;; environment, `date -u -d ${SOURCE_DATE_EPOCH}` will evaluate
1508 ;; to '1st hour of the current day', and therefore makes the
1509 ;; package not reproducible.
1510 (substitute* "./configure"
1511 (("date -u -d \"\\$\\{SOURCE_DATE_EPOCH\\}\"")
1512 "date --date='@0'"))
1513 #t))
1514 (add-after 'configure 'patch-settings
1515 (lambda _
1516 ;; libnetcdf.settings contains the full filename of the compilers
1517 ;; used to build the library. We truncate the hashes of those
1518 ;; filenames to avoid unnecessary references to the corresponding
1519 ;; store items.
1520 (substitute* "libnetcdf.settings"
1521 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
1522 (string-append prefix (string-take hash 10) "...")))
1523 #t)))
1524
889187a4 1525 #:parallel-tests? #f)) ;various race conditions
821aa687 1526 (home-page "https://www.unidata.ucar.edu/software/netcdf/")
889187a4
EB
1527 (synopsis "Library for scientific data")
1528 (description "NetCDF is an interface for scientific data access and a
1529software library that provides an implementation of the interface. The netCDF
1530library defines a machine-independent format for representing scientific data.
1531Together, the interface, library, and format support the creation, access, and
1532sharing of scientific data.")
1533 (license (license:x11-style "file://COPYRIGHT"))))
1534
1535(define-public netcdf-parallel-openmpi
1536 (package (inherit netcdf)
1537 (name "netcdf-parallel-openmpi")
1538 (inputs
1539 `(("mpi" ,openmpi)
1540 ,@(alist-replace "hdf5" (list hdf5-parallel-openmpi)
1541 (package-inputs netcdf))))
1542 ;; TODO: Replace pkg-config references in nc-config with absolute references
1543 (arguments
1544 (substitute-keyword-arguments (package-arguments netcdf)
1545 ((#:configure-flags flags)
1546 `(cons* "CC=mpicc" "CXX=mpicxx"
1547 "--enable-parallel-tests"
1548 ;; Shared libraries not supported with parallel IO.
1549 "--disable-shared" "--with-pic"
1550 ,flags))))))
1551
300200b6
TD
1552(define-public netcdf-fortran
1553 (package
1554 (name "netcdf-fortran")
1555 (version "4.4.4")
1556 (source (origin
1557 (method url-fetch)
1558 (uri (string-append
1559 "ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-fortran-"
1560 version ".tar.gz"))
1561 (sha256
1562 (base32
1563 "0xaxdcg1p83zmypwml3swsnr3ccn38inwldyr1l3wa4dbwbrblxj"))))
1564 (build-system gnu-build-system)
1565 (arguments
1566 `(#:parallel-tests? #f))
1567 (inputs
1568 `(("netcdf" ,netcdf)))
1569 (native-inputs
1570 `(("gfortran" ,gfortran)))
1571 (synopsis "Fortran interface for the netCDF library")
1572 (description (package-description netcdf))
1573 (home-page (package-home-page netcdf))
1574 (license (package-license netcdf))))
1575
1b39a196
RJ
1576(define-public nlopt
1577 (package
1578 (name "nlopt")
1579 (version "2.4.2")
1580 (source (origin
1581 (method url-fetch)
1582 (uri (string-append "http://ab-initio.mit.edu/nlopt/nlopt-"
1583 version ".tar.gz"))
1584 (sha256
1585 (base32 "12cfkkhcdf4zmb6h7y6qvvdvqjs2xf9sjpa3rl3bq76px4yn76c0"))))
1586 (build-system gnu-build-system)
1587 (arguments
1588 `(;; Shared libraries are not built by default. They are required to
1589 ;; build the Guile, Octave, and Python bindings.
1590 #:configure-flags '("--enable-shared")
1591
1592 #:phases
1593 (modify-phases %standard-phases
1594 (add-before 'configure 'set-libnlopt-file-name
1595 (lambda* (#:key outputs #:allow-other-keys)
1596 ;; Make sure the Scheme module refers to the library by its
1597 ;; absolute file name (we cannot do that from a snippet
1598 ;; because the expansion of @libdir@ contains
1599 ;; ${exec_prefix}.)
1600 (let ((out (assoc-ref outputs "out")))
1601 (substitute* "swig/nlopt.scm.in"
1602 (("libnlopt")
1603 (string-append out "/lib/libnlopt")))
1604 #t))))))
1605 (inputs `(("guile" ,guile-2.0)))
1606 (native-inputs `(("pkg-config" ,pkg-config)))
1607 (home-page "http://ab-initio.mit.edu/wiki/")
1608 (synopsis "Library for nonlinear optimization")
1609 (description "NLopt is a library for nonlinear optimization, providing a
1610common interface for a number of different free optimization routines available
1611online as well as original implementations of various other algorithms.")
1612 (license license:lgpl2.1+)))
1613
005c787d
LC
1614(define-public ipopt
1615 (package
1616 (name "ipopt")
98a5cd51 1617 (version "3.12.12")
005c787d
LC
1618 (source (origin
1619 (method url-fetch)
1620 (uri (string-append
58cb52a3 1621 "https://www.coin-or.org/download/source/Ipopt/Ipopt-"
005c787d
LC
1622 version".tgz"))
1623 (sha256
1624 (base32
98a5cd51 1625 "07yn9rzdswjk8n246qq6ci9ssf2bcplkifcpsfz9j6cdxw9vgbkv"))
005c787d
LC
1626 (modules '((guix build utils)))
1627 (snippet
1628 ;; Make sure we don't use the bundled software.
6cbee49d
MW
1629 '(begin
1630 (delete-file-recursively "ThirdParty")
1631 #t))))
005c787d 1632 (build-system gnu-build-system)
ad1c4537
LC
1633 (arguments
1634 '(#:phases (modify-phases %standard-phases
1635 (add-after 'install 'add--L-flags-in-ipopt.pc
1636 (lambda* (#:key inputs outputs #:allow-other-keys)
1637 ;; The '.pc' file lists '-llapack -lblas' in "Libs";
1638 ;; move it to "Libs.private" where it belongs, and add a
1639 ;; '-L' flag for LAPACK.
1640 (let ((out (assoc-ref outputs "out"))
1641 (lapack (assoc-ref inputs "lapack")))
1642 (substitute* (string-append out "/lib/pkgconfig/"
1643 "ipopt.pc")
1644 (("Libs: (.*)-llapack -lblas(.*)$" _ before after)
1645 (string-append "Libs: " before " " after "\n"
1646 "Libs.private: " before
1647 "-L" lapack "/lib -llapack -lblas "
1648 after "\n")))
1649 #t))))))
005c787d
LC
1650 (native-inputs
1651 `(("gfortran" ,gfortran)))
1652 (inputs
1653 ;; TODO: Maybe add dependency on COIN-MUMPS, ASL, and HSL.
ad1c4537 1654 `(("lapack" ,lapack))) ;for both libblas and liblapack
d5fd9c72 1655 (home-page "https://www.coin-or.org")
005c787d
LC
1656 (synopsis "Large-scale nonlinear optimizer")
1657 (description
1658 "The Interior Point Optimizer (IPOPT) is a software package for
1659large-scale nonlinear optimization. It provides C++, C, and Fortran
1660interfaces.")
1661 (license license:epl1.0)))
1662
ecfbc51f
RW
1663(define-public clp
1664 (package
1665 (name "clp")
bb9f9e1d 1666 (version "1.17.6")
ecfbc51f
RW
1667 (source (origin
1668 (method url-fetch)
1669 (uri (string-append "https://www.coin-or.org/download/source/"
1670 "Clp/Clp-" version ".tgz"))
1671 (sha256
1672 (base32
bb9f9e1d 1673 "0ap1f0lxppa6pnbc4bg7ih7a96avwaki482nig8w5fr3vg9wvkzr"))
ecfbc51f
RW
1674 (modules '((guix build utils)))
1675 (snippet
1676 ;; Make sure we don't use the bundled software.
1677 '(begin
1678 (delete-file-recursively "ThirdParty")
1679 #t))))
1680 (build-system gnu-build-system)
1681 (native-inputs
1682 `(("gfortran" ,gfortran)
1683 ("pkg-config" ,pkg-config)))
1684 (inputs
1685 `(("openblas" ,openblas)))
1686 (home-page "https://www.coin-or.org")
1687 (synopsis "Linear programming solver")
1688 (description
1689 "CLP is a high quality linear programming solver. Its main strengths are
1690its dual and primal Simplex algorithms. It also has a barrier algorithm for
1691linear and quadratic objectives. There are limited facilities for nonlinear
1692and quadratic objectives using the Simplex algorithm.")
1693 (license license:epl1.0)))
1694
f9940ef1
LC
1695(define-public ceres
1696 (package
1697 (name "ceres-solver")
e0bee0de 1698 (version "1.14.0")
f9940ef1
LC
1699 (home-page "http://ceres-solver.org/")
1700 (source (origin
1701 (method url-fetch)
1702 (uri (string-append home-page "ceres-solver-"
1703 version ".tar.gz"))
1704 (sha256
1705 (base32
e0bee0de 1706 "13lfxy8x58w8vprr0nkbzziaijlh0vvqshgahvcgw0mrqdgh0i27"))))
f9940ef1
LC
1707 (build-system cmake-build-system)
1708 (arguments
1709 ;; TODO: Build HTML user documentation and install separately.
bc3a2e35 1710 '(#:configure-flags '("-DBUILD_EXAMPLES=OFF"
f9940ef1
LC
1711 "-DBUILD_SHARED_LIBS=ON")
1712
1713 #:phases (modify-phases %standard-phases
1714 (add-before 'configure 'set-library-directory
1715 (lambda _
1716 ;; Install libraries to lib/, not lib64/.
1717 (substitute* "internal/ceres/CMakeLists.txt"
1718 (("set\\(LIB_SUFFIX \"64\"\\)")
1719 "set(LIB_SUFFIX \"\")"))
1720 #t)))))
1721 (native-inputs
1722 `(("pkg-config" ,pkg-config)))
468e0b18
LC
1723 (propagated-inputs
1724 `(("glog" ,glog))) ;for #include <glog/glog.h>
f9940ef1
LC
1725 (inputs
1726 `(("eigen" ,eigen)
1727 ("blas" ,openblas)
1728 ("lapack" ,lapack)
1729 ("suitesparse" ,suitesparse)
1730 ("gflags" ,gflags)))
1731 (synopsis "C++ library for solving large optimization problems")
1732 (description
1733 "Ceres Solver is a C++ library for modeling and solving large,
1734complicated optimization problems. It is a feature rich, mature and
1735performant library which has been used in production since 2010. Ceres Solver
1736can solve two kinds of problems:
1737@enumerate
1738@item non-linear least squares problems with bounds constraints;
1739@item general unconstrained optimization problems.
1740@end enumerate\n")
1741 (license license:bsd-3)))
1742
b66741ed 1743;; For a fully featured Octave, users are strongly recommended also to install
5ca4fe96 1744;; the following packages: less, ghostscript, gnuplot.
5537603f 1745(define-public octave-cli
668c06ac 1746 (package
5537603f 1747 (name "octave-cli")
8a0dd289 1748 (version "5.2.0")
668c06ac
JD
1749 (source
1750 (origin
1751 (method url-fetch)
1752 (uri (string-append "mirror://gnu/octave/octave-"
f5a077b1 1753 version ".tar.lz"))
668c06ac
JD
1754 (sha256
1755 (base32
8a0dd289 1756 "1848dq6nxzal8gwjrcp6xhi5gq96w89nss9d9rz75q408gb3mbl6"))))
668c06ac
JD
1757 (build-system gnu-build-system)
1758 (inputs
697df13f
EF
1759 `(("alsa-lib" ,alsa-lib)
1760 ("arpack" ,arpack-ng)
8a0dd289 1761 ("bdb" ,bdb)
697df13f 1762 ("curl" ,curl)
1ec78e9d
EB
1763 ("fftw" ,fftw)
1764 ("fftwf" ,fftwf)
668c06ac
JD
1765 ("fltk" ,fltk)
1766 ("fontconfig" ,fontconfig)
1767 ("freetype" ,freetype)
697df13f
EF
1768 ("gl2ps" ,gl2ps)
1769 ("glpk" ,glpk)
1ec78e9d 1770 ("glu" ,glu)
ab5f3f21 1771 ("graphicsmagick" ,graphicsmagick)
a533c5a1
MB
1772
1773 ;; TODO: libjpeg-turbo is indirectly required through libtiff. In
1774 ;; the next rebuild cycle, add an absolute reference for -ljpeg in
1775 ;; libtiff.la instead of having to provide it here.
1776 ("libjpeg" ,libjpeg-turbo)
1777
697df13f
EF
1778 ("hdf5" ,hdf5)
1779 ("lapack" ,lapack)
ab5f3f21 1780 ("libsndfile" ,libsndfile)
697df13f
EF
1781 ("libxft" ,libxft)
1782 ("mesa" ,mesa)
1783 ("pcre" ,pcre)
ab5f3f21 1784 ("portaudio" ,portaudio)
697df13f
EF
1785 ("qhull" ,qhull)
1786 ("readline" ,readline)
1787 ("suitesparse" ,suitesparse)
1788 ("texinfo" ,texinfo)
1789 ("zlib" ,zlib)))
668c06ac 1790 (native-inputs
f5a077b1
EF
1791 `(("lzip" ,lzip)
1792 ("gfortran" ,gfortran)
668c06ac
JD
1793 ("pkg-config" ,pkg-config)
1794 ("perl" ,perl)
1ec78e9d
EB
1795 ;; The following inputs are not actually used in the build process.
1796 ;; However, the ./configure gratuitously tests for their existence and
1797 ;; assumes that programs not present at build time are also not, and
1798 ;; can never be, available at run time! If these inputs are therefore
1799 ;; not present, support for them will be built out. However, Octave
1800 ;; will still run without them, albeit without the features they
668c06ac
JD
1801 ;; provide.
1802 ("less" ,less)
668c06ac
JD
1803 ("ghostscript" ,ghostscript)
1804 ("gnuplot" ,gnuplot)))
116af86f
KK
1805 ;; Octave code uses this variable to detect directories holding multiple CA
1806 ;; certificates to verify peers with. This is required for the networking
1807 ;; functions that require encryption to work properly.
1808 (native-search-paths
1809 (list (search-path-specification
1810 (variable "CURLOPT_CAPATH")
1811 (files '("etc/ssl/certs")))))
668c06ac 1812 (arguments
b7b27a8f
KY
1813 `(#:configure-flags
1814 (list (string-append "--with-shell="
1815 (assoc-ref %build-inputs "bash")
a533c5a1
MB
1816 "/bin/sh")
1817
1818 ;; XXX: Without this flag, linking octave-cli fails with
1819 ;; undefined references to 'logf@GLIBCXX_3.4' et.al. due to
1820 ;; not pulling in liboctinterp.la for -lstdc++.
1821 "--enable-link-all-dependencies")
5ca4fe96
AI
1822 #:phases
1823 (modify-phases %standard-phases
1824 (add-after 'configure 'configure-makeinfo
1825 (lambda* (#:key inputs #:allow-other-keys)
b18b9d20
AI
1826 (substitute* "libinterp/corefcn/help.h"
1827 (("\"makeinfo\"")
1828 (string-append
1829 "\"" (assoc-ref inputs "texinfo") "/bin/makeinfo\"")))
5ca4fe96 1830 #t)))))
f5a077b1 1831 (home-page "https://www.gnu.org/software/octave/")
668c06ac 1832 (synopsis "High-level language for numerical computation")
1ec78e9d
EB
1833 (description "GNU Octave is a high-level interpreted language that is
1834specialized for numerical computations. It can be used for both linear and
1835non-linear applications and it provides great support for visualizing results.
1836Work may be performed both at the interactive command-line as well as via
1837script files.")
668c06ac 1838 (license license:gpl3+)))
3de01d3f 1839
e0ae7e73 1840(define-public octave
5537603f 1841 (package (inherit octave-cli)
e0ae7e73 1842 (name "octave")
7a3772b3 1843 (source (origin
5537603f 1844 (inherit (package-source octave-cli))))
36ce25f0
KK
1845 (inputs
1846 `(("qscintilla" ,qscintilla)
1847 ("qt" ,qtbase)
5537603f 1848 ,@(package-inputs octave-cli)))
36ce25f0
KK
1849 (native-inputs
1850 `(("qttools" , qttools) ;for lrelease
70bb5d88 1851 ("texlive" ,(texlive-union (list texlive-epsf))) ; for texi2dvi
5537603f 1852 ,@(package-native-inputs octave-cli)))
36ce25f0 1853 (arguments
5537603f 1854 (substitute-keyword-arguments (package-arguments octave-cli)
36ce25f0
KK
1855 ((#:phases phases)
1856 `(modify-phases ,phases
1857 (add-before 'configure 'patch-qscintilla-library-name
1858 (lambda* (#:key inputs #:allow-other-keys)
1859 ;; The QScintilla library that the Octave configure script tries
1860 ;; to link with should be named libqscintilla-qt5.so, but the
1861 ;; QScintilla input provides the shared library as
1862 ;; libqscintilla2_qt5.so.
1863 (substitute* "configure"
1864 (("qscintilla2-qt5")
1865 "qscintilla2_qt5"))
1866 #t))))))))
1867
5d4bd4cc
PG
1868(define-public opencascade-oce
1869 (package
1870 (name "opencascade-oce")
1871 (version "0.17.2")
1872 (source
1873 (origin
830971bf
TGR
1874 (method git-fetch)
1875 (uri (git-reference
b0e7b699 1876 (url "https://github.com/tpaviot/oce")
830971bf
TGR
1877 (commit (string-append "OCE-" version))))
1878 (file-name (git-file-name name version))
a4f393b7 1879 (patches (search-patches "opencascade-oce-glibc-2.26.patch"))
5d4bd4cc 1880 (sha256
830971bf 1881 (base32 "0rg5wzkvfmzfl6v2amyryb8dnjad0nn9kyr607wy2gch6rciah69"))))
5d4bd4cc
PG
1882 (build-system cmake-build-system)
1883 (arguments
1884 '(#:configure-flags
1885 (list "-DOCE_TESTING:BOOL=ON"
1886 "-DOCE_USE_TCL_TEST_FRAMEWORK:BOOL=ON"
1887 "-DOCE_DRAW:BOOL=ON"
1888 (string-append "-DOCE_INSTALL_PREFIX:PATH="
1889 (assoc-ref %outputs "out"))
1890 "-UCMAKE_INSTALL_RPATH")))
1891 (inputs
1892 `(("freetype" ,freetype)
1893 ("glu" ,glu)
1894 ("libxmu" ,libxmu)
1895 ("mesa" ,mesa)
1896 ("tcl" ,tcl)
1897 ("tk" ,tk)))
1898 (native-inputs
1899 `(("python" ,python-wrapper)))
1900 (home-page "https://github.com/tpaviot/oce")
1901 (synopsis "Libraries for 3D modeling and numerical simulation")
1902 (description
1903 "Open CASCADE is a set of libraries for the development of applications
1904dealing with 3D CAD data or requiring industrial 3D capabilities. It includes
1905C++ class libraries providing services for 3D surface and solid modeling, CAD
1906data exchange, and visualization. It is used for development of specialized
1907software dealing with 3D models in design (CAD), manufacturing (CAM),
1908numerical simulation (CAE), measurement equipment (CMM), and quality
1909control (CAQ) domains.
1910
1911This is the ``Community Edition'' (OCE) of Open CASCADE, which gathers
1912patches, improvements, and experiments contributed by users over the official
1913Open CASCADE library.")
1914 (license (list license:lgpl2.1; OCE libraries, with an exception for the
1915 ; use of header files; see
1916 ; OCCT_LGPL_EXCEPTION.txt
1917 license:public-domain; files
1918 ; src/Standard/Standard_StdAllocator.hxx and
1919 ; src/NCollection/NCollection_StdAllocator.hxx
1920 license:expat; file src/OpenGl/OpenGl_glext.h
1921 license:bsd-3)))); test framework gtest
1922
37dc2920
PG
1923(define-public opencascade-occt
1924 (package
1925 (name "opencascade-occt")
1926 (version "7.3.0p3")
1927 (source
1928 (origin
1929 (method git-fetch)
1930 (uri (git-reference
1931 (url "https://git.dev.opencascade.org/repos/occt.git")
1932 (commit
1933 (string-append "V"
1934 (string-map (lambda (x) (if (eq? x #\.) #\_ x))
1935 version)))))
1936 (file-name (git-file-name name version))
1937 (sha256
1938 (base32 "0bdywwxb6mk0ykbiajlvsb37295akqjp0a60y672qjfa67k0ljv4"))
1939 (modules '((guix build utils)))
1940 (snippet
1941 '(begin
1942 ;; Remove files specific to non-free operating systems.
1943 (delete-file-recursively "samples/ios")
1944 (delete-file-recursively "samples/mfc")
1945 (delete-file-recursively "samples/qt/FuncDemo")
1946 (delete-file "genconf.bat")
1947 (delete-file "gendoc.bat")
1948 (delete-file "genproj.bat")
1949 (delete-file "upgrade.bat")
1950 ;; Remove references to deleted files.
1951 (substitute* "dox/FILES_HTML.txt"
1952 ((".*standard.*") "" )
1953 ((".*UIKitSample.*") ""))
1954 #t))))
1955 (build-system cmake-build-system)
1956 (arguments
1957 '(;; There is no test target for make. OCCT provides an
1958 ;; 'Automated Testing System', which may be accessed after
1959 ;; installation via the draw.sh script. draw.sh is located in
1960 ;; the bin directory. For details see:
1961 ;; https://www.opencascade.com/doc/occt-7.3.0/overview/html/\
1962 ;; occt_dev_guides__tests.html
1963 #:tests? #f
1964 ;; Configure without freeimage: attempting to link against the
1965 ;; freeimage version 3.17 library leads to 'undefined
1966 ;; reference' errors.
1967 #:configure-flags
1968 (list "-DUSE_FREEIMAGE:BOOL=OFF"
1969 "-DUSE_TBB:BOOL=ON"
1970 "-DUSE_VTK:BOOL=OFF"
1971 "-DBUILD_DOC_Overview:BOOL=OFF"
1972 "-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON"
1973 "-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON"
1974 "-UCMAKE_INSTALL_LIBDIR")))
1975 (inputs
1976 `(("doxygen" ,doxygen)
1977 ;("freeimage" ,freeimage)
1978 ("freetype" ,freetype)
1979 ("glu" ,glu)
1980 ("libxext" ,libxext)
1981 ("libxi" ,libxi)
1982 ("libxmu" ,libxmu)
1983 ("mesa" ,mesa)
1984 ("tbb" ,tbb)
1985 ("tcl" ,tcl)
1986 ("tk" ,tk)))
1987 ;; TODO: build Overview documentation and add 'doc' output.
1988 (home-page "https://www.opencascade.com")
1989 (synopsis "Libraries for 3D modeling and numerical simulation")
1990 (description
1991 "Open CASCADE is a set of libraries for the development of applications
1992dealing with 3D CAD data or requiring industrial 3D capabilities. It includes
1993C++ class libraries providing services for 3D surface and solid modeling, CAD
1994data exchange, and visualization. It is used for development of specialized
1995software dealing with 3D models in design (CAD), manufacturing (CAM),
1996numerical simulation (CAE), measurement equipment (CMM), and quality
1997control (CAQ) domains.
1998
1999This is the certified version of the Open Cascade Technology (OCCT) library.")
2000 (license (list ;; OCCT library:
2001 license:lgpl2.1; with an exception for the use of header
2002 ; files, see OCCT_LGPL_EXCEPTION.txt.
2003 ;; Files src/OpenGl/glext.h, adm/cmake/cotire.cmake and
2004 ;; src/OpenGl/OpenGl_HaltonSampler.hxx:
2005 license:expat
2006 ;; Files src/ExprIntrp/ExprIntrp.tab.* and
2007 ;; src/StepFile/step.tab.*:
2008 license:gpl3+ ; with Bison 2.2 exception.
2009 ;; File src/NCollection/NCollection_UtfIterator.lxx:
2010 (license:non-copyleft
2011 "https://www.unicode.org/license.html")
2012 ;; File src/NCollection/NCollection_StdAllocator.hxx:
2013 license:public-domain))))
2014
3de01d3f
EB
2015(define-public gmsh
2016 (package
2017 (name "gmsh")
8a4d14fa 2018 (version "2.16.0")
3de01d3f
EB
2019 (source
2020 (origin
abed5df7
PG
2021 (method git-fetch)
2022 (uri (git-reference
2023 (url "https://gitlab.onelab.info/gmsh/gmsh.git")
2024 (commit
2025 (string-append "gmsh_"
2026 (string-map (lambda (x) (if (eq? x #\.) #\_ x))
2027 version)))))
2028 (file-name (git-file-name name version))
3de01d3f 2029 (sha256
abed5df7 2030 (base32 "08rq4jajwmlpivnm9yifz2jhaivnz065lnk0h2zv773nwl9wf162"))
3de01d3f
EB
2031 (modules '((guix build utils)))
2032 (snippet
2033 ;; Remove non-free METIS code
6cbee49d
MW
2034 '(begin
2035 (delete-file-recursively "contrib/Metis")
2036 #t))))
3de01d3f 2037 (build-system cmake-build-system)
3de01d3f
EB
2038 (propagated-inputs
2039 `(("fltk" ,fltk)
19afbea1 2040 ("gfortran" ,gfortran)
3de01d3f 2041 ("gmp" ,gmp)
40029cbe 2042 ("hdf5" ,hdf5)
3de01d3f
EB
2043 ("lapack" ,lapack)
2044 ("mesa" ,mesa)
85f41902 2045 ("glu" ,glu)
45548139 2046 ("opencascade-oce" ,opencascade-oce)
3de01d3f
EB
2047 ("libx11" ,libx11)
2048 ("libxext" ,libxext)))
66395a61
EF
2049 (inputs
2050 `(("fontconfig" ,fontconfig)
2051 ("libxft" ,libxft)))
3de01d3f
EB
2052 (arguments
2053 `(#:configure-flags `("-DENABLE_METIS:BOOL=OFF"
2054 "-DENABLE_BUILD_SHARED:BOOL=ON"
45548139 2055 "-DENABLE_BUILD_DYNAMIC:BOOL=ON")))
0746c33e 2056 (home-page "http://gmsh.info/")
3de01d3f 2057 (synopsis "3D finite element grid generator")
edf684ef
EB
2058 (description "Gmsh is a 3D finite element grid generator with a built-in
2059CAD engine and post-processor. Its design goal is to provide a fast, light
2060and user-friendly meshing tool with parametric input and advanced
2061visualization capabilities. Gmsh is built around four modules: geometry,
2062mesh, solver and post-processing. The specification of any input to these
2063modules is done either interactively using the graphical user interface or in
2064ASCII text files using Gmsh's own scripting language.")
3de01d3f 2065 (license license:gpl2+)))
b9100e2f 2066
6d5f63b6
JD
2067(define-public maxflow
2068 (package
2069 (name "maxflow")
0af12a13
TGR
2070 ;; Versioning is ambiguous: the git tag matching this commit is ‘3.0.5’,
2071 ;; which matches CMakeLists.txt, but README.md and CHANGES say ‘3.04’.
2072 (version "3.0.5")
6d5f63b6
JD
2073 (source (origin
2074 (method git-fetch)
2075 (uri (git-reference
b0e7b699 2076 (url "https://github.com/gerddie/maxflow")
0af12a13 2077 (commit version)))
2dc0a6cf 2078 (file-name (git-file-name name version))
6d5f63b6
JD
2079 (sha256
2080 (base32
2081 "0rll38whw55h0vcjrrwdnh9ascvxby0ph7n1l0d12z17cg215kkb"))))
2082 (build-system cmake-build-system)
0be9038c 2083 (home-page "https://pub.ist.ac.at/~vnk/software.html")
6d5f63b6
JD
2084 (synopsis "Library implementing Maxflow algorithm")
2085 (description "An implementation of the maxflow algorithm described in
2086@cite{An Experimental Comparison of Min-Cut/Max-Flow Algorithms for
2087Energy Minimization in Computer Vision.\n
2088Yuri Boykov and Vladimir Kolmogorov.\n
2089In IEEE Transactions on Pattern Analysis and Machine Intelligence,\n
2090September 2004}")
2091 (license license:gpl3+)))
2092
b9100e2f
EB
2093(define-public petsc
2094 (package
2095 (name "petsc")
4f7a4a06 2096 (version "3.11.2")
b9100e2f
EB
2097 (source
2098 (origin
2099 (method url-fetch)
2100 ;; The *-lite-* tarball does not contain the *large* documentation
2101 (uri (string-append "http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/"
2102 "petsc-lite-" version ".tar.gz"))
2103 (sha256
4f7a4a06 2104 (base32 "1645nwwcp9bcnfnxikk480mhbbacdvhsay2c401818hk97dqj5nx"))))
b2c52fc9
TGR
2105 (outputs '("out" ; libraries and headers
2106 "examples")) ; ~30MiB of examples
b9100e2f
EB
2107 (build-system gnu-build-system)
2108 (native-inputs
6fec298d 2109 `(("python" ,python-2)))
b9100e2f 2110 (inputs
19afbea1 2111 `(("gfortran" ,gfortran)
b9100e2f 2112 ("lapack" ,lapack)
f258212d 2113 ("superlu" ,superlu)
b9100e2f
EB
2114 ;; leaving out hdf5 and fftw, as petsc expects them to be built with mpi
2115 ;; leaving out opengl, as configuration seems to only be for mac
2116 ))
2117 (arguments
2118 `(#:test-target "test"
b2c52fc9 2119 #:parallel-build? #f ; build is parallel by default
b9100e2f
EB
2120 #:configure-flags
2121 `("--with-mpi=0"
f258212d 2122 "--with-openmp=1"
c15be128 2123 "--with-superlu=1")
9731c412
EB
2124 #:make-flags
2125 ;; Honor (parallel-job-count) for build. Do not use --with-make-np,
2126 ;; whose value is dumped to $out/lib/petsc/conf/petscvariables.
2127 (list (format #f "MAKE_NP=~a" (parallel-job-count)))
b9100e2f 2128 #:phases
64dcc289
EB
2129 (modify-phases %standard-phases
2130 (replace 'configure
2131 ;; PETSc's configure script is actually a python script, so we can't
2132 ;; run it with bash.
2133 (lambda* (#:key outputs (configure-flags '())
2134 #:allow-other-keys)
2135 (let* ((prefix (assoc-ref outputs "out"))
2136 (flags `(,(string-append "--prefix=" prefix)
2137 ,@configure-flags)))
2138 (format #t "build directory: ~s~%" (getcwd))
2139 (format #t "configure flags: ~s~%" flags)
49fdd357 2140 (apply invoke "./configure" flags))))
64dcc289 2141 (add-after 'configure 'clean-local-references
9731c412 2142 (lambda* (#:key outputs #:allow-other-keys)
64dcc289
EB
2143 (let ((out (assoc-ref outputs "out")))
2144 (substitute* (find-files "." "^petsc(conf|machineinfo).h$")
b730b437
EB
2145 ;; Prevent build directory from leaking into compiled code
2146 (((getcwd)) out)
2147 ;; Scrub timestamp for reproducibility
fafd623e 2148 ((".*Libraries compiled on.*") ""))
9731c412
EB
2149 (substitute* (find-files "." "petscvariables")
2150 ;; Do not expose build machine characteristics, set to defaults.
2151 (("MAKE_NP = [:digit:]+") "MAKE_NP = 2")
2152 (("NPMAX = [:digit:]+") "NPMAX = 2"))
fafd623e 2153 #t)))
64dcc289 2154 (add-after 'install 'clean-install
10b11968
EB
2155 ;; Try to keep installed files from leaking build directory names.
2156 (lambda* (#:key inputs outputs #:allow-other-keys)
64dcc289 2157 (let ((out (assoc-ref outputs "out")))
10b11968 2158 (substitute* (map (lambda (file)
9a899cce 2159 (string-append out "/lib/petsc/conf/" file))
fafd623e 2160 '("petscvariables"))
10b11968
EB
2161 (((getcwd)) out))
2162 ;; Make compiler references point to the store
9a899cce 2163 (substitute* (string-append out "/lib/petsc/conf/petscvariables")
dfdf5716
EB
2164 (("= (gcc|g\\+\\+|gfortran)" _ compiler)
2165 (string-append "= " (which compiler))))
10b11968
EB
2166 ;; PETSc installs some build logs, which aren't necessary.
2167 (for-each (lambda (file)
9a899cce 2168 (let ((f (string-append out "/lib/petsc/conf/" file)))
10b11968
EB
2169 (when (file-exists? f)
2170 (delete-file f))))
9a899cce
EB
2171 '("configure.log" "make.log" "gmake.log"
2172 "test.log" "error.log" "RDict.db"
fafd623e 2173 "PETScBuildInternal.cmake"
10b11968 2174 ;; Once installed, should uninstall with Guix
fafd623e 2175 "uninstall.py"))
a3a99e27
EB
2176 #t)))
2177 (add-after 'install 'move-examples
2178 (lambda* (#:key outputs #:allow-other-keys)
2179 (let* ((out (assoc-ref outputs "out"))
2180 (examples (assoc-ref outputs "examples"))
2181 (exdir (string-append out "/share/petsc/examples"))
2182 (exdir' (string-append examples "/share/petsc/examples")))
2183 (copy-recursively exdir exdir')
2184 (delete-file-recursively exdir)
fafd623e 2185 #t))))))
2299d83e 2186 (home-page "https://www.mcs.anl.gov/petsc")
16ecf3ff 2187 (synopsis "Library to solve PDEs")
b9100e2f
EB
2188 (description "PETSc, pronounced PET-see (the S is silent), is a suite of
2189data structures and routines for the scalable (parallel) solution of
2190scientific applications modeled by partial differential equations.")
166191b3 2191 (license (license:non-copyleft
2299d83e 2192 "https://www.mcs.anl.gov/petsc/documentation/copyright.html"))))
b9100e2f
EB
2193
2194(define-public petsc-complex
2195 (package (inherit petsc)
2196 (name "petsc-complex")
2197 (arguments
2198 (substitute-keyword-arguments (package-arguments petsc)
2199 ((#:configure-flags cf)
2200 `(cons "--with-scalar-type=complex" ,cf))))
16ecf3ff 2201 (synopsis "Library to solve PDEs (with complex scalars)")))
183e44ae 2202
d8c7eeb9
EB
2203(define-public petsc-openmpi
2204 (package (inherit petsc)
2205 (name "petsc-openmpi")
2206 (inputs
9e2aa70b 2207 `(("hdf5" ,hdf5-parallel-openmpi)
af523673 2208 ("hypre" ,hypre-openmpi)
9e2aa70b
PG
2209 ("metis" ,metis)
2210 ("mumps" ,mumps-openmpi)
2211 ("openmpi" ,openmpi)
2212 ("scalapack" ,scalapack)
72f95783 2213 ("scotch" ,pt-scotch32)
d8c7eeb9
EB
2214 ,@(package-inputs petsc)))
2215 (arguments
2216 (substitute-keyword-arguments (package-arguments petsc)
2217 ((#:configure-flags cf)
af523673
PG
2218 ``("--with-hypre=1"
2219 "--with-mpiexec=mpirun"
9e2aa70b
PG
2220 "--with-metis=1"
2221 "--with-mumps=1"
2222 "--with-scalapack=1"
2223 "--with-ptscotch=1"
d8c7eeb9
EB
2224 ,(string-append "--with-mpi-dir="
2225 (assoc-ref %build-inputs "openmpi"))
71ca16b5
PG
2226 ,(string-append "--with-hdf5-include="
2227 (assoc-ref %build-inputs "hdf5") "/include")
2228 ,(string-append "--with-hdf5-lib="
2229 (assoc-ref %build-inputs "hdf5") "/lib/libhdf5.a")
2230 ,@(delete "--with-mpi=0" ,cf)))
2231 ((#:phases phases)
2232 `(modify-phases ,phases
9e2aa70b 2233 (add-before 'configure 'mpi-setup
bbe46a4a 2234 ,%openmpi-setup)))))
9e2aa70b 2235 (synopsis "Library to solve PDEs (with MUMPS and MPI support)")))
d8c7eeb9
EB
2236
2237(define-public petsc-complex-openmpi
2238 (package (inherit petsc-complex)
2239 (name "petsc-complex-openmpi")
2240 (inputs
2241 `(("openmpi" ,openmpi)
2242 ,@(package-inputs petsc-complex)))
2243 (arguments
2244 (substitute-keyword-arguments (package-arguments petsc-complex)
2245 ((#:configure-flags cf)
2246 ``("--with-mpiexec=mpirun"
2247 ,(string-append "--with-mpi-dir="
2248 (assoc-ref %build-inputs "openmpi"))
e586c6fa
EB
2249 ,@(delete "--with-mpi=0" ,cf)))
2250 ((#:phases phases)
2251 `(modify-phases ,phases
2252 (add-before 'configure 'mpi-setup
2253 ,%openmpi-setup)))))
16ecf3ff 2254 (synopsis "Library to solve PDEs (with complex scalars and MPI support)")))
d8c7eeb9 2255
90ff2874
PG
2256(define-public python-petsc4py
2257 (package
2258 (name "python-petsc4py")
f1cc312e 2259 (version "3.11.0")
90ff2874
PG
2260 (source
2261 (origin
2262 (method url-fetch)
2263 (uri (pypi-uri "petsc4py" version))
2264 (sha256
2265 (base32
f1cc312e 2266 "1rm1qj5wlkhxl39by9n78lh3gbmii31wsnb8j1rr5hvfr5xgbx2q"))))
90ff2874
PG
2267 (build-system python-build-system)
2268 (arguments
2269 `(#:phases
2270 (modify-phases %standard-phases
2271 (add-before 'build 'pre-build
2272 (lambda _
2273 ;; Define path to PETSc installation.
2274 (setenv "PETSC_DIR" (assoc-ref %build-inputs "petsc"))
2275 #t))
2276 (add-before 'check 'mpi-setup
2277 ,%openmpi-setup))))
2278 (inputs
2279 `(("petsc" ,petsc-openmpi)
2280 ("python-numpy" ,python-numpy)))
2281 (home-page "https://bitbucket.org/petsc/petsc4py/")
2282 (synopsis "Python bindings for PETSc")
2283 (description "PETSc, the Portable, Extensible Toolkit for
2284Scientific Computation, is a suite of data structures and routines for
2285the scalable (parallel) solution of scientific applications modeled by
2286partial differential equations. It employs the MPI standard for all
2287message-passing communication. @code{petsc4py} provides Python
2288bindings to almost all functions of PETSc.")
2289 (license license:bsd-3)))
2290
560acf25
MB
2291(define-public python-kiwisolver
2292 (package
2293 (name "python-kiwisolver")
2294 (version "1.0.1")
2295 (source (origin
2296 (method url-fetch)
2297 (uri (pypi-uri "kiwisolver" version))
2298 (sha256
2299 (base32
2300 "0y22ci86znwwwfhbmvbgdfnbi6lv5gv2xkdlxvjw7lml43ayafyf"))))
2301 (build-system python-build-system)
2302 (home-page "https://github.com/nucleic/kiwi")
2303 (synopsis "Fast implementation of the Cassowary constraint solver")
2304 (description
2305 "Kiwi is an efficient C++ implementation of the Cassowary constraint
2306solving algorithm. Kiwi has been designed from the ground up to be
2307lightweight and fast. Kiwi ranges from 10x to 500x faster than the original
2308Cassowary solver with typical use cases gaining a 40x improvement. Memory
2309savings are consistently > 5x.")
2310 (license license:bsd-3)))
2311
2312(define-public python2-kiwisolver
2313 (package-with-python2 python-kiwisolver))
2314
a7f01414
EB
2315(define-public slepc
2316 (package
2317 (name "slepc")
a13e0f3d 2318 (version "3.11.1")
a7f01414
EB
2319 (source
2320 (origin
2321 (method url-fetch)
baeaf882
EB
2322 (uri (string-append "http://slepc.upv.es/download/distrib/slepc-"
2323 version ".tar.gz"))
a7f01414
EB
2324 (sha256
2325 (base32
a13e0f3d 2326 "1yq84q9wannc8xwapxpay4ypdd675picwi395hhsdvng9q6hf5j8"))))
a7f01414
EB
2327 (build-system gnu-build-system)
2328 (native-inputs
a13e0f3d
EB
2329 `(("python" ,python-2)
2330 ("petsc:examples" ,petsc "examples"))) ;for gmakegen.py script
a7f01414
EB
2331 (inputs
2332 `(("arpack" ,arpack-ng)
2333 ("gfortran" ,gfortran)))
2334 (propagated-inputs
2335 `(("petsc" ,petsc)))
2336 (arguments
2337 `(#:parallel-build? #f ;build is parallel by default
2338 #:configure-flags
2339 `(,(string-append "--with-arpack-dir="
9cf52454 2340 (assoc-ref %build-inputs "arpack") "/lib"))
9731c412 2341 #:make-flags ;honor (parallel-job-count)
a13e0f3d
EB
2342 `(,(format #f "MAKE_NP=~a" (parallel-job-count))
2343 ,(string-append "PETSCCONFIGDIR="
2344 (assoc-ref %build-inputs "petsc:examples")
2345 "/share/petsc/examples/config"))
a7f01414
EB
2346 #:phases
2347 (modify-phases %standard-phases
8787c555 2348 (replace 'configure
a7f01414
EB
2349 ;; configure is a python script, so we can't run it with bash.
2350 (lambda* (#:key inputs outputs (configure-flags '())
2351 #:allow-other-keys)
2352 (let* ((prefix (assoc-ref outputs "out"))
2353 (flags `(,(string-append "--prefix=" prefix)
2354 ,@configure-flags)))
2355 (format #t "build directory: ~s~%" (getcwd))
2356 (format #t "configure flags: ~s~%" flags)
2357 (setenv "SLEPC_DIR" (getcwd))
9cf52454 2358 (setenv "PETSC_DIR" (assoc-ref inputs "petsc"))
c6840089 2359 (apply invoke "./configure" flags))))
8787c555 2360 (add-after 'install 'delete-doc
a7f01414
EB
2361 ;; TODO: SLEPc installs HTML documentation alongside headers in
2362 ;; $out/include. We'd like to move them to share/doc, but delete
2363 ;; them for now, as they are incomplete and installing the complete
2364 ;; documentation is difficult.
2365 (lambda* (#:key outputs #:allow-other-keys)
2366 (let* ((out (assoc-ref outputs "out")))
0f6dc120
TGR
2367 (for-each delete-file (find-files out "\\.html$"))
2368 #t)))
8787c555 2369 (add-after 'install 'clean-install
a7f01414
EB
2370 ;; Clean up unnecessary build logs from installation.
2371 (lambda* (#:key outputs #:allow-other-keys)
2372 (let ((out (assoc-ref outputs "out")))
2373 (for-each (lambda (file)
2374 (let ((f (string-append out "/lib/slepc/conf/" file)))
2375 (when (file-exists? f)
2376 (delete-file f))))
2377 '("configure.log" "make.log" "gmake.log"
2378 "test.log" "error.log" "RDict.db"
0f6dc120
TGR
2379 "uninstall.py"))
2380 #t))))))
a7f01414
EB
2381 (home-page "http://slepc.upv.es")
2382 (synopsis "Scalable library for eigenproblems")
2383 (description "SLEPc is a software library for the solution of large sparse
2384eigenproblems on parallel computers. It can be used for the solution of
2385linear eigenvalue problems formulated in either standard or generalized form,
2386as well as other related problems such as the singular value decomposition.
2387The emphasis of the software is on methods and techniques appropriate for
2388problems in which the associated matrices are sparse, for example, those
2389arising after the discretization of partial differential equations.")
3c524f21 2390 (license license:bsd-2)))
a7f01414
EB
2391
2392(define-public slepc-complex
2393 (package (inherit slepc)
2394 (name "slepc-complex")
2395 (propagated-inputs
2396 `(("petsc" ,petsc-complex)
2397 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
2398 (synopsis "Scalable library for eigenproblems (with complex scalars)")))
2399
2400(define-public slepc-openmpi
2401 (package (inherit slepc)
2402 (name "slepc-openmpi")
6df2a50a
LC
2403 (arguments
2404 (substitute-keyword-arguments (package-arguments slepc)
2405 ((#:phases phases '%standard-phases)
2406 `(modify-phases ,phases
bbe46a4a
EB
2407 (add-before 'check 'mpi-setup
2408 ,%openmpi-setup)))))
a7f01414
EB
2409 (inputs
2410 `(("mpi" ,openmpi)
2411 ("arpack" ,arpack-ng-openmpi)
2412 ,@(alist-delete "arpack" (package-inputs slepc))))
2413 (propagated-inputs
2414 `(("petsc" ,petsc-openmpi)
2415 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
2416 (synopsis "Scalable library for eigenproblems (with MPI support)")))
2417
2418(define-public slepc-complex-openmpi
2419 (package (inherit slepc-openmpi)
2420 (name "slepc-complex-openmpi")
2421 (propagated-inputs
2422 `(("petsc" ,petsc-complex-openmpi)
2423 ,@(alist-delete "petsc" (package-propagated-inputs slepc-openmpi))))
2424 (synopsis "Scalable library for eigenproblems (with complex scalars and MPI support)")))
2425
6b5687d0
PG
2426(define-public python-slepc4py
2427 (package
2428 (name "python-slepc4py")
09bad3cd 2429 (version "3.11.0")
6b5687d0
PG
2430 (source
2431 (origin
2432 (method url-fetch)
2433 (uri (pypi-uri "slepc4py" version))
2434 (sha256
2435 (base32
09bad3cd 2436 "1ksp08kxf4wg408b9nn39z3qfhy643j22d4rfbl30vzxk2rxh4lq"))))
6b5687d0
PG
2437 (build-system python-build-system)
2438 (arguments
2439 `(#:phases
2440 (modify-phases %standard-phases
2441 (add-before 'build 'pre-build
2442 (lambda _
2443 ;; Define path to PETSc installation.
2444 (setenv "PETSC_DIR" (assoc-ref %build-inputs "petsc"))
2445 ;; Define path to SLEPc installation.
2446 (setenv "SLEPC_DIR" (assoc-ref %build-inputs "slepc"))
2447 #t))
2448 (add-before 'check 'mpi-setup
2449 ,%openmpi-setup))))
2450 (inputs
2451 `(("python-numpy" ,python-numpy)
2452 ("python-petsc4py" ,python-petsc4py)
2453 ("slepc" ,slepc-openmpi)))
2454 (home-page "https://bitbucket.org/slepc/slepc4py/")
2455 (synopsis "Python bindings for SLEPc")
2456 (description "SLEPc, the Scalable Library for Eigenvalue Problem
2457Computations, is based on PETSc, the Portable, Extensible Toolkit for
2458Scientific Computation. It employs the MPI standard for all
2459message-passing communication. @code{slepc4py} provides Python
2460bindings to almost all functions of SLEPc.")
2461 (license license:bsd-3)))
2462
d277c00e 2463(define-public metamath
6667576b
W
2464 (package
2465 (name "metamath")
2466 (version "0.183")
2467 (source
2468 (origin
2469 (method git-fetch)
2470 (uri (git-reference
b0e7b699 2471 (url "https://github.com/metamath/metamath-exe")
6667576b
W
2472 (commit (string-append "v" version))))
2473 (file-name (git-file-name name version))
2474 (sha256
2475 (base32 "1jjf4fy6j53i40dh0yv0f9sngnw4gs24cig99vsg3q0303pwrhg7"))))
2476 (build-system gnu-build-system)
2477 (native-inputs
2478 `(("autoconf" ,autoconf)
2479 ("automake" ,automake)))
2480 (home-page "http://us.metamath.org/")
2481 (synopsis "Proof verifier based on a minimalistic formalism")
2482 (description
2483 "Metamath is a tiny formal language and that can express theorems in
d277c00e
W
2484abstract mathematics, with an accompyaning @command{metamath} executable that
2485verifies databases of these proofs. There is a public database,
2486@url{https://github.com/metamath/set.mm, set.mm}, implementing first-order
2487logic and Zermelo-Frenkel set theory with Choice, along with a large swath of
2488associated, high-level theorems, e.g.@: the fundamental theorem of arithmetic,
2489the Cauchy-Schwarz inequality, Stirling's formula, etc. See the Metamath
2490book.")
6667576b 2491 (license license:gpl2+)))
d277c00e 2492
cec86422
EB
2493(define-public mumps
2494 (package
2495 (name "mumps")
5dbc79eb 2496 (version "5.2.1")
cec86422
EB
2497 (source
2498 (origin
2499 (method url-fetch)
2500 (uri (string-append "http://mumps.enseeiht.fr/MUMPS_"
2501 version ".tar.gz"))
2502 (sha256
2503 (base32
5dbc79eb 2504 "0jklh54x4y3ik1zkw6db7766kakjm5910diyaghfxxf8vwsgr26r"))
06e12395
MB
2505 (patches (search-patches "mumps-build-parallelism.patch"
2506 "mumps-shared-libseq.patch"
2507 "mumps-shared-mumps.patch"
2508 "mumps-shared-pord.patch"))))
cec86422
EB
2509 (build-system gnu-build-system)
2510 (inputs
2511 `(("fortran" ,gfortran)
2512 ;; These are required for linking against mumps, but we let the user
2513 ;; declare the dependency.
2514 ("blas" ,openblas)
2515 ("metis" ,metis)
2516 ("scotch" ,scotch)))
2517 (arguments
2518 `(#:modules ((ice-9 match)
2519 (ice-9 popen)
2520 (srfi srfi-1)
2521 ,@%gnu-build-system-modules)
2522 #:phases
2523 (modify-phases %standard-phases
fba78d18 2524 (replace 'configure
cec86422
EB
2525 (lambda* (#:key inputs #:allow-other-keys)
2526 (call-with-output-file "Makefile.inc"
2527 (lambda (port)
2528 (format port "
2529PLAT =
2530LIBEXT = .a
2531OUTC = -o
2532OUTF = -o
2533RM = rm -f~:[
2534CC = gcc
2535FC = gfortran
2536FL = gfortran
2537INCSEQ = -I$(topdir)/libseq
06e12395 2538LIBSEQ = $(topdir)/libseq/libmpiseq.a
cec86422
EB
2539LIBSEQNEEDED = libseqneeded~;
2540CC = mpicc
2541FC = mpifort
2542FL = mpifort~]
2543AR = ar vr # rules require trailing space, ugh...
2544RANLIB = ranlib
06e12395
MB
2545BLASDIR = ~a
2546LIBBLAS = -Wl,-rpath=$(BLASDIR) -Wl,-rpath='$$ORIGIN' -L$(BLASDIR) -lopenblas~@[
2547SCALAPDIR = ~a
2548SCALAP = -Wl,-rpath=$(SCALAPDIR) -Wl,-rpath='$$ORIGIN' -L$(SCALAPDIR) -lscalapack~]
cec86422
EB
2549LIBOTHERS = -pthread
2550CDEFS = -DAdd_
2551PIC = -fPIC
2552OPTF = -O2 -DALLOW_NON_INIT $(PIC)
2553OPTL = -O2 $(PIC)
2554OPTC = -O2 $(PIC)
2555INCS = $(INCSEQ)
2556LIBS = $(SCALAP) $(LIBSEQ)
2557LPORDDIR = $(topdir)/PORD/lib
2558IPORD = -I$(topdir)/PORD/include
06e12395 2559LPORD = $(LPORDDIR)/libpord.a
cec86422
EB
2560ORDERINGSF = -Dpord~@[
2561METISDIR = ~a
2562IMETIS = -I$(METISDIR)/include
06e12395 2563LMETIS = -Wl,-rpath $(METISDIR)/lib -L$(METISDIR)/lib -lmetis
cec86422
EB
2564ORDERINGSF += -Dmetis~]~@[~:{
2565SCOTCHDIR = ~a
2566ISCOTCH = -I$(SCOTCHDIR)/include
06e12395 2567LSCOTCH = -Wl,-rpath $(SCOTCHDIR)/lib -L$(SCOTCHDIR)/lib ~a-lesmumps -lscotch -lscotcherr
cec86422
EB
2568ORDERINGSF += ~a~}~]
2569ORDERINGSC = $(ORDERINGSF)
06e12395 2570LORDERINGS = $(LPORD) $(LMETIS) $(LSCOTCH) $(LIBSEQ)
cec86422
EB
2571IORDERINGSF = $(ISCOTCH)
2572IORDERINGSC = $(IPORD) $(IMETIS) $(ISCOTCH)"
2573 (assoc-ref inputs "mpi")
2574 (assoc-ref inputs "blas")
2575 (assoc-ref inputs "scalapack")
2576 (assoc-ref inputs "metis")
2577 (match (list (assoc-ref inputs "pt-scotch")
2578 (assoc-ref inputs "scotch"))
2579 ((#f #f)
2580 #f)
2581 ((#f scotch)
2582 `((,scotch "" "-Dscotch")))
2583 ((ptscotch _)
2584 `((,ptscotch
2585 "-lptesmumps -lptscotch -lptscotcherr "
2586 "-Dptscotch")))))))))
fba78d18 2587 (replace 'build
cec86422
EB
2588 ;; By default only the d-precision library is built. Make with "all"
2589 ;; target so that all precision libraries and examples are built.
2590 (lambda _
b414cf52
TGR
2591 (invoke "make" "all"
2592 (format #f "-j~a" (parallel-job-count)))))
fba78d18 2593 (replace 'check
cec86422
EB
2594 ;; Run the simple test drivers, which read test input from stdin:
2595 ;; from the "real" input for the single- and double-precision
2596 ;; testers, and from the "cmplx" input for complex-precision
2597 ;; testers. The EXEC-PREFIX key is used by the mumps-openmpi
2598 ;; package to prefix execution with "mpirun".
2599 (lambda* (#:key (exec-prefix '()) #:allow-other-keys)
2600 (with-directory-excursion "examples"
2601 (every
2602 (lambda (prec type)
2603 (let ((tester (apply open-pipe*
2604 `(,OPEN_WRITE
2605 ,@exec-prefix
2606 ,(string-append "./" prec
2607 "simpletest"))))
2608 (input (open-input-file
2609 (string-append "input_simpletest_" type))))
2610 (begin
2611 (dump-port input tester)
2612 (close-port input)
2613 (zero? (close-pipe tester)))))
2614 '("s" "d" "c" "z")
2615 '("real" "real" "cmplx" "cmplx")))))
fba78d18
EB
2616 (replace 'install
2617 (lambda* (#:key outputs #:allow-other-keys)
2618 (let* ((out (assoc-ref outputs "out"))
2619 (libdir (string-append out "/lib")))
2620 (copy-recursively "lib" libdir)
2621 (copy-recursively "include" (string-append out "/include"))
2622 (when (file-exists? "libseq/libmpiseq.a")
2623 (install-file "libseq/libmpiseq.a" libdir))
06e12395
MB
2624 (when (file-exists? "libseq/libmpiseq.so")
2625 (install-file "libseq/libmpiseq.so" libdir))
fba78d18 2626 #t))))))
cec86422
EB
2627 (home-page "http://mumps.enseeiht.fr")
2628 (synopsis "Multifrontal sparse direct solver")
2629 (description
2630 "MUMPS (MUltifrontal Massively Parallel sparse direct Solver) solves a
57e69c1d 2631sparse system of linear equations A x = b using Gaussian elimination.")
cec86422
EB
2632 (license license:cecill-c)))
2633
2634(define-public mumps-metis
2635 (package (inherit mumps)
2636 (name "mumps-metis")
2637 (inputs
2638 (alist-delete "scotch" (package-inputs mumps)))))
2639
2640(define-public mumps-openmpi
2641 (package (inherit mumps)
2642 (name "mumps-openmpi")
2643 (inputs
2644 `(("mpi" ,openmpi)
2645 ("scalapack" ,scalapack)
2646 ("pt-scotch" ,pt-scotch)
2647 ,@(alist-delete "scotch" (package-inputs mumps))))
2648 (arguments
2649 (substitute-keyword-arguments (package-arguments mumps)
2650 ((#:phases phases)
2651 `(modify-phases ,phases
bbe46a4a
EB
2652 (add-before 'check 'mpi-setup
2653 ,%openmpi-setup)
6df2a50a
LC
2654 (replace 'check
2655 (lambda _
2656 ((assoc-ref ,phases 'check)
2657 #:exec-prefix '("mpirun" "-n" "2"))))))))
cec86422
EB
2658 (synopsis "Multifrontal sparse direct solver (with MPI)")))
2659
2660(define-public mumps-metis-openmpi
2661 (package (inherit mumps-openmpi)
2662 (name "mumps-metis-openmpi")
2663 (inputs
2664 (alist-delete "pt-scotch" (package-inputs mumps-openmpi)))))
2665
63e07468
BW
2666(define-public ruby-asciimath
2667 (package
2668 (name "ruby-asciimath")
b17a48d0 2669 (version "2.0.1")
63e07468
BW
2670 (source
2671 (origin
2672 (method url-fetch)
2673 (uri (rubygems-uri "asciimath" version))
2674 (sha256
2675 (base32
b17a48d0 2676 "1aapydwwkydbwgz07n7ma3a5jy9n3v0shy6q6j8mi4wr3crhx45a"))))
63e07468 2677 (build-system ruby-build-system)
63e07468 2678 (native-inputs
b17a48d0 2679 `(("ruby-nokogiri" ,ruby-nokogiri)
63e07468
BW
2680 ("ruby-rspec" ,ruby-rspec)))
2681 (synopsis "AsciiMath parsing and conversion library")
2682 (description
2683 "A pure Ruby AsciiMath parsing and conversion library. AsciiMath is an
2684easy-to-write markup language for mathematics.")
2685 (home-page "https://github.com/asciidoctor/asciimath")
2686 (license license:expat)))
2687
183e44ae
EB
2688(define-public superlu
2689 (package
2690 (name "superlu")
995a09e0 2691 (version "5.2.1")
183e44ae
EB
2692 (source
2693 (origin
2694 (method url-fetch)
48fe5c36 2695 (uri (string-append "https://portal.nersc.gov/project/sparse/superlu/"
183e44ae
EB
2696 "superlu_" version ".tar.gz"))
2697 (sha256
995a09e0
EB
2698 (base32 "0qzlb7cd608q62kyppd0a8c65l03vrwqql6gsm465rky23b6dyr8"))
2699 (modules '((guix build utils)))
2700 (snippet
2701 ;; Replace the non-free implementation of MC64 with a stub adapted
2702 ;; from Debian
2703 '(begin
2704 (use-modules (ice-9 regex)
2705 (ice-9 rdelim))
2706 (call-with-output-file "SRC/mc64ad.c"
2707 (lambda (port)
2708 (display "
2709#include <stdio.h>
2710#include <stdlib.h>
2711void mc64id_(int *a) {
2712 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
2713 abort ();
2714}
2715void mc64ad_ (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
2716 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
2717 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
2718 abort ();
2719}\n" port)))
2720 ;; Remove the corresponding license verbiage. MC64 license follows
2721 ;; a "------" line separator.
2722 (with-atomic-file-replacement "License.txt"
2723 (let ((rx (make-regexp "-{8}")))
2724 (lambda (in out)
2725 (let loop ()
2726 (let ((line (read-line in 'concat)))
2727 (unless (regexp-exec rx line)
2728 (display line out)
6cbee49d
MW
2729 (loop))))
2730 #t)))))))
995a09e0 2731 (build-system cmake-build-system)
183e44ae
EB
2732 (native-inputs
2733 `(("tcsh" ,tcsh)))
2734 (inputs
995a09e0 2735 `(("blas" ,openblas)
19afbea1 2736 ("gfortran" ,gfortran)))
183e44ae 2737 (arguments
995a09e0
EB
2738 `(#:configure-flags '("-Denable_blaslib:BOOL=NO" ;do not use internal cblas
2739 "-DTPL_BLAS_LIBRARIES=openblas"
677bc34d 2740 "-DBUILD_SHARED_LIBS:BOOL=YES")))
48fe5c36 2741 (home-page "https://portal.nersc.gov/project/sparse/superlu/")
183e44ae
EB
2742 (synopsis "Supernodal direct solver for sparse linear systems")
2743 (description
2744 "SuperLU is a general purpose library for the direct solution of large,
2745sparse, nonsymmetric systems of linear equations on high performance machines.
2746The library is written in C and is callable from either C or Fortran. The
2747library routines perform an LU decomposition with partial pivoting and
2748triangular system solves through forward and back substitution. The library
2749also provides threshold-based ILU factorization preconditioners.")
995a09e0
EB
2750 (license (list license:bsd-3
2751 license:gpl2+ ;EXAMPLE/*fgmr.c
2752 (license:fsf-free "file://SRC/colamd.h")))))
f8ed036a 2753
a54aefea
EB
2754(define-public superlu-dist
2755 (package
2756 (name "superlu-dist")
aa2e83cc 2757 (version "6.2.0")
a54aefea
EB
2758 (source
2759 (origin
2760 (method url-fetch)
aa2e83cc 2761 (uri (string-append "https://portal.nersc.gov/project/sparse/superlu/"
a54aefea
EB
2762 "superlu_dist_" version ".tar.gz"))
2763 (sha256
aa2e83cc 2764 (base32 "1ynmwqajc9sc3my2hssa5k9s58ggvizqv9rdss0j7w99pbh5mnvw"))
0921eff2 2765 (modules '((guix build utils)))
29080870
EB
2766 (snippet
2767 ;; Replace the non-free implementation of MC64 with a stub
2768 '(begin
0921eff2 2769 (call-with-output-file "SRC/mc64ad_dist.c"
29080870
EB
2770 (lambda (port)
2771 (display "
2772#include <stdio.h>
2773#include <stdlib.h>
0921eff2 2774void mc64id_dist(int *a) {
29080870
EB
2775 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
2776 abort ();
2777}
0921eff2 2778void mc64ad_dist (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
29080870
EB
2779 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
2780 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
2781 abort ();
2782}\n" port)))
29080870 2783 (substitute* "SRC/util.c" ;adjust default algorithm
6161141e
EB
2784 (("RowPerm[[:blank:]]*=[[:blank:]]*LargeDiag_MC64;")
2785 ;; TODO: set to "LargeDiag_AWPM" once combinatorial-blas has
2786 ;; general (i.e. non-square) processor-grid support.
2787 "RowPerm = NOROWPERM;"))
6cbee49d 2788 #t))
6161141e 2789 (patches (search-patches "superlu-dist-scotchmetis.patch"
aa2e83cc 2790 "superlu-dist-awpm-grid.patch"))))
6161141e 2791 (build-system cmake-build-system)
a54aefea
EB
2792 (native-inputs
2793 `(("tcsh" ,tcsh)))
2794 (inputs
6161141e
EB
2795 `(("gfortran" ,gfortran)
2796 ("blas" ,openblas)
2797 ("lapack" ,lapack)
2798 ("combblas" ,combinatorial-blas)))
a54aefea 2799 (propagated-inputs
6161141e
EB
2800 `(("mpi" ,openmpi) ;headers include MPI heades
2801 ("parmetis" ,pt-scotch32 "metis")
2802 ("pt-scotch" ,pt-scotch32)))
a54aefea 2803 (arguments
6161141e
EB
2804 `(#:parallel-tests? #f ;tests use MPI and OpenMP
2805 #:configure-flags (list "-DBUILD_SHARED_LIBS:BOOL=YES"
2806 "-DTPL_ENABLE_COMBBLASLIB=YES"
2807 "-DTPL_BLAS_LIBRARIES=-lopenblas"
2808 "-DTPL_LAPACK_LIBRARIES=-llapack"
2809 (string-append "-DTPL_PARMETIS_LIBRARIES="
2810 (string-join
2811 '("ptscotchparmetis" "ptscotch" "ptscotcherr"
2812 "scotchmetis" "scotch" "scotcherr")
2813 ";"))
2814 (string-append "-DTPL_PARMETIS_INCLUDE_DIRS="
2815 (assoc-ref %build-inputs "parmetis")
2816 "/include")
2817 "-DTPL_ENABLE_COMBBLASLIB=ON"
2818 (string-append "-DTPL_COMBBLAS_INCLUDE_DIRS="
2819 (assoc-ref %build-inputs "combblas")
2820 "/include/CombBLAS;"
2821 (assoc-ref %build-inputs "combblas")
2822 "/include/BipartiteMatchings")
2823 "-DTPL_COMBBLAS_LIBRARIES=CombBLAS")
a54aefea 2824 #:phases
dc1d3cde 2825 (modify-phases %standard-phases
6161141e 2826 (add-before 'configure 'set-c++-standard
dc1d3cde 2827 (lambda _
6161141e
EB
2828 (substitute* "CMakeLists.txt"
2829 ;; AWPM headers require C++14
2830 (("CMAKE_CXX_STANDARD 11") "CMAKE_CXX_STANDARD 14"))))
bbe46a4a
EB
2831 (add-before 'check 'mpi-setup
2832 ,%openmpi-setup)
6161141e
EB
2833 (add-before 'check 'omp-setup
2834 (lambda _ (setenv "OMP_NUM_THREADS" "1") #t)))))
a54aefea
EB
2835 (home-page (package-home-page superlu))
2836 (synopsis "Parallel supernodal direct solver")
2837 (description
2838 "SuperLU_DIST is a parallel extension to the serial SuperLU library.
2839It is targeted for distributed memory parallel machines. SuperLU_DIST is
2840implemented in ANSI C, and MPI for communications.")
2841 (license license:bsd-3)))
2842
f8ed036a
EB
2843(define-public scotch
2844 (package
2845 (name "scotch")
fd373343 2846 (version "6.0.6")
f8ed036a
EB
2847 (source
2848 (origin
2849 (method url-fetch)
1dc31097
TGR
2850 (uri (string-append "https://gforge.inria.fr/frs/download.php/"
2851 "latestfile/298/scotch_" version ".tar.gz"))
f8ed036a 2852 (sha256
fd373343
EB
2853 (base32 "1ky4k9r6jvajhqaqnnx6h8fkmds2yxgp70dpr1qzwcyhi2nhqvv8"))
2854 (patches (search-patches "scotch-build-parallelism.patch"
2855 "scotch-integer-declarations.patch"))))
f8ed036a
EB
2856 (build-system gnu-build-system)
2857 (inputs
525e83ec
VL
2858 `(("zlib" ,zlib)))
2859 (native-inputs
2860 `(("flex" ,flex)
f8ed036a 2861 ("bison" ,bison)))
fd373343 2862 (outputs '("out" "metis"))
f8ed036a 2863 (arguments
fd373343
EB
2864 `(#:make-flags (list (string-append "prefix=" %output))
2865 #:phases
d6602ee9
EB
2866 (modify-phases %standard-phases
2867 (add-after
2868 'unpack 'chdir-to-src
d67a7e9e 2869 (lambda _ (chdir "src") #t))
d6602ee9
EB
2870 (replace
2871 'configure
2872 (lambda _
2873 (call-with-output-file "Makefile.inc"
2874 (lambda (port)
2875 (format port "
f8ed036a
EB
2876EXE =
2877LIB = .a
2878OBJ = .o
2879MAKE = make
2880AR = ar
2881ARFLAGS = -ruv
cf0ec6c4 2882CAT = cat
f8ed036a
EB
2883CCS = gcc
2884CCP = mpicc
2885CCD = gcc
2886CPPFLAGS =~{ -D~a~}
6c798540 2887CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
f8ed036a
EB
2888LDFLAGS = -lz -lm -lrt -lpthread
2889CP = cp
2890LEX = flex -Pscotchyy -olex.yy.c
2891LN = ln
2892MKDIR = mkdir
2893MV = mv
2894RANLIB = ranlib
2895YACC = bison -pscotchyy -y -b y
2896"
d6602ee9
EB
2897 '("COMMON_FILE_COMPRESS_GZ"
2898 "COMMON_PTHREAD"
2899 "COMMON_RANDOM_FIXED_SEED"
fd373343 2900 "INTSIZE64" ;use 'int64_t'
cf0ec6c4
EB
2901 ;; Prevents symbolc clashes with libesmumps
2902 "SCOTCH_RENAME"
d6602ee9
EB
2903 ;; XXX: Causes invalid frees in superlu-dist tests
2904 ;; "SCOTCH_PTHREAD"
2905 ;; "SCOTCH_PTHREAD_NUMBER=2"
d67a7e9e
TGR
2906 "restrict=__restrict"))))
2907 #t))
bbe46a4a 2908 (add-after 'build 'build-esmumps
cf0ec6c4 2909 (lambda _
d67a7e9e
TGR
2910 (invoke "make"
2911 (format #f "-j~a" (parallel-job-count))
2912 "esmumps")))
fd373343
EB
2913 (add-before 'install 'make-install-dirs
2914 (lambda* (#:key outputs #:allow-other-keys)
2915 (mkdir (assoc-ref outputs "out"))))
2916 (add-after 'install 'install-metis
2917 (lambda* (#:key outputs #:allow-other-keys)
2918 (let ((out (assoc-ref outputs "metis")))
2919 (mkdir out)
2920 ;; metis files are not installed with 'make install'
2921 (for-each (lambda (f)
2922 (install-file f (string-append out "/include")))
2923 (find-files "../include/" ".*metis\\.h"))
2924 (for-each (lambda (f)
2925 (install-file f (string-append out "/lib")))
2926 (find-files "../lib/" ".*metis\\..*"))
2927 #t))))))
d5730000 2928 (home-page "https://www.labri.fr/perso/pelegrin/scotch/")
f8ed036a
EB
2929 (synopsis "Programs and libraries for graph algorithms")
2930 (description "SCOTCH is a set of programs and libraries which implement
2931the static mapping and sparse matrix reordering algorithms developed within
2932the SCOTCH project. Its purpose is to apply graph theory, with a divide and
2933conquer approach, to scientific computing problems such as graph and mesh
2934partitioning, static mapping, and sparse matrix ordering, in application
2935domains ranging from structural mechanics to operating systems or
2936bio-chemistry.")
2937 ;; See LICENSE_en.txt
2938 (license license:cecill-c)))
6acb4adb 2939
1c39f3b8
PG
2940(define-public scotch32
2941 ;; This is the 'INTSIZE32' variant, which uses 32-bit integers, as needed by
2942 ;; some applications.
2943 (package (inherit scotch)
2944 (name "scotch32")
2945 (arguments
2946 (substitute-keyword-arguments (package-arguments scotch)
2947 ((#:phases scotch-phases)
2948 `(modify-phases ,scotch-phases
2949 (replace
2950 'configure
2951 (lambda _
2952 (call-with-output-file "Makefile.inc"
2953 (lambda (port)
2954 (format port "
2955EXE =
2956LIB = .a
2957OBJ = .o
2958MAKE = make
2959AR = ar
2960ARFLAGS = -ruv
2961CAT = cat
2962CCS = gcc
2963CCP = mpicc
2964CCD = gcc
2965CPPFLAGS =~{ -D~a~}
2966CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
2967LDFLAGS = -lz -lm -lrt -lpthread
2968CP = cp
2969LEX = flex -Pscotchyy -olex.yy.c
2970LN = ln
2971MKDIR = mkdir
2972MV = mv
2973RANLIB = ranlib
2974YACC = bison -pscotchyy -y -b y
2975"
2976 '("COMMON_FILE_COMPRESS_GZ"
2977 "COMMON_PTHREAD"
2978 "COMMON_RANDOM_FIXED_SEED"
2979 "INTSIZE32" ;use 32-bit integers. See INSTALL.txt
2980 ;; Prevents symbolc clashes with libesmumps
2981 "SCOTCH_RENAME"
2982 ;; XXX: Causes invalid frees in superlu-dist tests
2983 ;; "SCOTCH_PTHREAD"
2984 ;; "SCOTCH_PTHREAD_NUMBER=2"
2985 "restrict=__restrict"))))))))))
2986 (synopsis
2987 "Programs and libraries for graph algorithms (32-bit integers)")))
2988
6acb4adb
EB
2989(define-public pt-scotch
2990 (package (inherit scotch)
2991 (name "pt-scotch")
2992 (propagated-inputs
2993 `(("openmpi" ,openmpi))) ;Headers include MPI headers
2994 (arguments
2995 (substitute-keyword-arguments (package-arguments scotch)
2996 ((#:phases scotch-phases)
d6602ee9
EB
2997 `(modify-phases ,scotch-phases
2998 (replace
2999 'build
d6602ee9 3000 (lambda _
c491f7f8
LC
3001 (invoke "make" (format #f "-j~a" (parallel-job-count))
3002 "ptscotch" "ptesmumps")
3003
3004 ;; Install the serial metis compatibility library
3005 (invoke "make" "-C" "libscotchmetis" "install")))
3006 (add-before 'check 'mpi-setup
3007 ,%openmpi-setup)
3008 (replace 'check
3009 (lambda _
3010 (invoke "make" "ptcheck")))))))
6acb4adb 3011 (synopsis "Programs and libraries for graph algorithms (with MPI)")))
5698b8b8 3012
1c25a52c
PG
3013(define-public pt-scotch32
3014 (package (inherit scotch32)
3015 (name "pt-scotch32")
3016 (propagated-inputs
3017 `(("openmpi" ,openmpi))) ;headers include MPI headers
3018 (arguments
c4d4a779
PG
3019 (substitute-keyword-arguments (package-arguments scotch32)
3020 ((#:phases scotch32-phases)
3021 `(modify-phases ,scotch32-phases
1c25a52c
PG
3022 (replace 'build
3023 (lambda _
c491f7f8
LC
3024 (invoke "make" (format #f "-j~a" (parallel-job-count))
3025 "ptscotch" "ptesmumps")
3026 ;; Install the serial metis compatibility library
3027 (invoke "make" "-C" "libscotchmetis" "install")))
3028 (add-before 'check 'mpi-setup
3029 ,%openmpi-setup)
1c25a52c
PG
3030 (replace 'check
3031 (lambda _
c491f7f8 3032 (invoke "make" "ptcheck")))))))
1c25a52c
PG
3033 (synopsis
3034 "Programs and libraries for graph algorithms (with MPI and 32-bit integers)")))
3035
aa75ad00
EB
3036(define-public metis
3037 (package
3038 (name "metis")
3039 (version "5.1.0")
3040 (source
3041 (origin
3042 (method url-fetch)
3043 (uri (string-append "http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/"
3044 "metis-" version ".tar.gz"))
3045 (sha256
3046 (base32
3047 "1cjxgh41r8k6j029yxs8msp3z6lcnpm16g5pvckk35kc7zhfpykn"))))
3048 (build-system cmake-build-system)
3049 (inputs
3050 `(("blas" ,openblas)))
3051 (arguments
3052 `(#:tests? #f ;no tests
3053 #:configure-flags `("-DSHARED=ON"
3054 ,(string-append "-DGKLIB_PATH=" (getcwd)
3055 "/metis-" ,version "/GKlib"))))
3056 (home-page "http://glaros.dtc.umn.edu/gkhome/metis/metis/overview")
3057 (synopsis "Graph partitioning and fill-reducing matrix ordering library")
3058 (description
3059 "METIS is a set of serial programs for partitioning graphs, partitioning
3060finite element meshes, and producing fill-reducing orderings for sparse
3061matrices. The algorithms implemented in METIS are based on the multilevel
3062recursive-bisection, multilevel k-way, and multi-constraint partitioning
3063schemes.")
3064 (license license:asl2.0))) ;As of version 5.0.3
3065
700ff222
EB
3066(define-public p4est
3067 (package
3068 (name "p4est")
4150da63 3069 (version "2.0")
700ff222
EB
3070 (source
3071 (origin
3072 (method url-fetch)
3073 (uri (string-append "http://p4est.github.io/release/p4est-"
3074 version ".tar.gz"))
3075 (sha256
3076 (base32
4150da63 3077 "16h267z256kxcxfjs390qqzv19hr58vrj4x8lndb7alnk2vca8n5"))))
700ff222
EB
3078 (build-system gnu-build-system)
3079 (inputs
3080 `(("fortran" ,gfortran)
3081 ("blas" ,openblas)
3082 ("lapack" ,lapack)
3083 ("zlib" ,zlib)))
3084 (arguments
3085 `(#:configure-flags `(,(string-append "BLAS_LIBS=-L"
3086 (assoc-ref %build-inputs "blas")
3087 " -lopenblas")
3088 ,(string-append "LAPACK_LIBS=-L"
3089 (assoc-ref %build-inputs "lapack")
6df2a50a
LC
3090 " -llapack"))
3091 #:phases (modify-phases %standard-phases
bbe46a4a
EB
3092 (add-before 'check 'mpi-setup
3093 ,%openmpi-setup))))
700ff222
EB
3094 (home-page "http://www.p4est.org")
3095 (synopsis "Adaptive mesh refinement on forests of octrees")
3096 (description
3097 "The p4est software library enables the dynamic management of a
3098collection of adaptive octrees, conveniently called a forest of octrees.
3099p4est is designed to work in parallel and scales to hundreds of thousands of
3100processor cores.")
3101 (license license:gpl2+)))
3102
3103(define-public p4est-openmpi
3104 (package (inherit p4est)
3105 (name "p4est-openmpi")
3106 (inputs
3107 `(("mpi" ,openmpi)
3108 ,@(package-inputs p4est)))
3109 (arguments
3110 (substitute-keyword-arguments (package-arguments p4est)
3111 ((#:configure-flags cf)
3112 ``("--enable-mpi" ,@,cf))))
3113 (synopsis "Parallel adaptive mesh refinement on forests of octrees")))
3114
5698b8b8
JD
3115(define-public gsegrafix
3116 (package
3117 (name "gsegrafix")
3118 (version "1.0.6")
3119 (source
3120 (origin
3121 (method url-fetch)
3122 (uri (string-append "mirror://gnu/" name "/" name "-"
3123 version ".tar.gz"))
3124 (sha256
3125 (base32
3126 "1b13hvx063zv970y750bx41wpx6hwd5ngjhbdrna8w8yy5kmxcda"))))
3127 (build-system gnu-build-system)
3128 (arguments
3129 `(#:configure-flags '("LDFLAGS=-lm")))
3130 (inputs
3131 `(("libgnomecanvas" ,libgnomecanvas)
3132 ("libbonoboui" ,libbonoboui)
3133 ("libgnomeui" ,libgnomeui)
3134 ("libgnomeprintui" ,libgnomeprintui)
3135 ("popt" ,popt)))
3136 (native-inputs
3137 `(("pkg-config" ,pkg-config)))
6fd52309 3138 (home-page "https://www.gnu.org/software/gsegrafix/")
5698b8b8
JD
3139 (synopsis "GNOME application to create scientific and engineering plots")
3140 (description "GSEGrafix is an application which produces high-quality graphical
3141plots for science and engineering. Plots are specified via simple ASCII
3142parameter files and data files and are presented in an anti-aliased GNOME
3143canvas. The program supports rectangular two-dimensional plots, histograms,
3144polar-axis plots and three-dimensional plots. Plots can be printed or saved
3145to BMP, JPEG or PNG image formats.")
3146 (license license:gpl3+)))
8731e527
JD
3147
3148(define-public maxima
3149 (package
3150 (name "maxima")
21131e9c 3151 (version "5.44.0")
8731e527
JD
3152 (source
3153 (origin
3154 (method url-fetch)
3155 (uri (string-append "mirror://sourceforge/maxima/Maxima-source/"
3156 version "-source/" name "-" version ".tar.gz"))
3157 (sha256
3158 (base32
21131e9c 3159 "1v6jr5s6hhj6r18gfk6hgxk2qd6z1dxkrjq9ss2z1y6sqi45wgyr"))
fc1adab1 3160 (patches (search-patches "maxima-defsystem-mkdir.patch"))))
8731e527 3161 (build-system gnu-build-system)
df354a77 3162 (inputs
6b2eafaa 3163 `(("gcl" ,gcl)
df354a77 3164 ("gnuplot" ,gnuplot) ;for plots
fc9c47bd 3165 ("sed" ,sed)
f36afe4d 3166 ("tk" ,tk))) ;Tcl/Tk is used by 'xmaxima'
df354a77
FB
3167 (native-inputs
3168 `(("texinfo" ,texinfo)
ccbc5758
KK
3169 ("perl" ,perl)
3170 ("python" ,python)))
8731e527 3171 (arguments
df354a77
FB
3172 `(#:configure-flags
3173 (list "--enable-gcl"
3174 (string-append "--with-posix-shell="
3175 (assoc-ref %build-inputs "bash")
3176 "/bin/sh")
3177 (string-append "--with-wish="
3178 (assoc-ref %build-inputs "tk")
3179 "/bin/wish"
3180 (let ((v ,(package-version tk)))
3181 (string-take v (string-index-right v #\.)))))
df354a77 3182 ;; By default Maxima attempts to write temporary files to
77af7b24
MW
3183 ;; '/tmp/nix-build-maxima-*', which won't exist at run time.
3184 ;; Work around that.
df354a77 3185 #:make-flags (list "TMPDIR=/tmp")
0093b126
KK
3186 #:phases
3187 (modify-phases %standard-phases
fc9c47bd
KK
3188 (add-after 'unpack 'patch-paths
3189 (lambda* (#:key inputs #:allow-other-keys)
3190 (let* ((sed (string-append (assoc-ref inputs "sed") "/bin/sed"))
3191 (coreutils (assoc-ref inputs "coreutils"))
3192 (dirname (string-append coreutils "/bin/dirname"))
ccc963d5
KK
3193 (head (string-append coreutils "/bin/head"))
3194 (perl (string-append (assoc-ref inputs "perl") "/bin/perl"))
3195 (python (string-append (assoc-ref inputs "python")
3196 "/bin/python3")))
fc9c47bd
KK
3197 (substitute* "src/maxima.in"
3198 (("sed ") (string-append sed " "))
3199 (("dirname") dirname)
3200 (("head") head))
ccc963d5
KK
3201 (substitute* "doc/info/Makefile.in"
3202 (("/usr/bin/env perl") perl))
3203 (substitute* "doc/info/build_html.sh.in"
3204 (("python") python))
fc9c47bd 3205 #t)))
0093b126
KK
3206 (add-before 'check 'pre-check
3207 (lambda _
3208 (chmod "src/maxima" #o555)
3209 #t))
1472d19a
KK
3210 (replace 'check
3211 (lambda _
3212 ;; This is derived from the testing code in the "debian/rules" file
3213 ;; of Debian's Maxima package.
3214 ;; If Maxima can successfully run this, the binary to be installed
3215 ;; should be fine.
df129041
MW
3216 (invoke "sh" "-c"
3217 (string-append
3218 "./maxima-local "
3219 "--lisp=gcl "
3220 "--batch-string=\"run_testsuite();\" "
3221 "| grep -q \"No unexpected errors found\""))))
0093b126
KK
3222 ;; Make sure the doc and emacs files are found in the
3223 ;; standard location. Also configure maxima to find gnuplot
3224 ;; without having it on the PATH.
3225 (add-after 'install 'post-install
3226 (lambda* (#:key outputs inputs #:allow-other-keys)
3227 (let* ((gnuplot (assoc-ref inputs "gnuplot"))
3228 (out (assoc-ref outputs "out"))
3229 (datadir (string-append out "/share/maxima/" ,version))
3230 (binutils (string-append (assoc-ref inputs "binutils")
3231 "/bin")))
3232 (with-directory-excursion out
3233 (mkdir-p "share/emacs")
3234 (mkdir-p "share/doc")
0093b126
KK
3235 (symlink
3236 (string-append datadir "/doc/")
3237 (string-append out "/share/doc/maxima"))
3238 (with-atomic-file-replacement
3239 (string-append datadir "/share/maxima-init.lisp")
3240 (lambda (in out)
3241 (format out "~a ~s~a~%"
3242 "(setf $gnuplot_command "
3243 (string-append gnuplot "/bin/gnuplot") ")")
3244 (dump-port in out))))
3245 ;; Ensure that Maxima will have access to the GNU binutils
3246 ;; components at runtime.
3247 (wrap-program (string-append out "/bin/maxima")
3248 `("PATH" prefix (,binutils))))
3249 #t)))))
8731e527
JD
3250 (home-page "http://maxima.sourceforge.net")
3251 (synopsis "Numeric and symbolic expression manipulation")
3252 (description "Maxima is a system for the manipulation of symbolic and
3253numerical expressions. It yields high precision numeric results by using
3254exact fractions, arbitrary precision integers, and variable precision floating
e881752c 3255point numbers.")
8731e527
JD
3256 ;; Some files are lgpl2.1+. Some are gpl2+. Some explicitly state gpl1+.
3257 ;; Others simply say "GNU General Public License" without stating a
3258 ;; version (which implicitly means gpl1+).
3259 ;; At least one file (src/maxima.asd) says "version 2."
3260 ;; GPLv2 only is therefore the smallest subset.
f36afe4d 3261 (license license:gpl2)))
ec322be2 3262
9aafbc0c
MW
3263(define-public wxmaxima
3264 (package
3265 (name "wxmaxima")
1bbf7e13 3266 (version "20.04.0")
9aafbc0c
MW
3267 (source
3268 (origin
c93b77ad
KK
3269 (method git-fetch)
3270 (uri (git-reference
b0e7b699 3271 (url "https://github.com/wxMaxima-developers/wxmaxima")
c93b77ad
KK
3272 (commit (string-append "Version-" version))))
3273 (file-name (git-file-name name version))
9aafbc0c 3274 (sha256
1bbf7e13 3275 (base32 "0vrjxzfgmjdzm1rgl0crz4b4badl14jwh032y3xkcdvjl5j67lp3"))))
0181df53 3276 (build-system cmake-build-system)
5143517c 3277 (native-inputs
1d3c6a31
KK
3278 `(("gettext" ,gettext-minimal)
3279 ("xorg-server" ,xorg-server-for-tests)))
3280 ;; TODO: Add libomp for multithreading support.
3281 ;; As of right now, enabling libomp causes the imageCells.wxm test to fail.
9aafbc0c
MW
3282 (inputs
3283 `(("wxwidgets" ,wxwidgets)
de477809
SB
3284 ("maxima" ,maxima)
3285 ;; Runtime support.
3286 ("adwaita-icon-theme" ,adwaita-icon-theme)
3287 ("gtk+" ,gtk+)
3288 ("shared-mime-info" ,shared-mime-info)))
9aafbc0c 3289 (arguments
1d3c6a31 3290 `(#:test-target "test"
0181df53 3291 #:phases
ac2ddcc6 3292 (modify-phases %standard-phases
1d3c6a31
KK
3293 (add-before 'check 'pre-check
3294 (lambda _
3295 ;; Tests require a running X server.
3296 (system "Xvfb :1 &")
3297 (setenv "DISPLAY" ":1")
3298 (setenv "HOME" (getcwd))
3299 #t))
ac2ddcc6
KK
3300 (add-after 'install 'wrap-program
3301 (lambda* (#:key inputs outputs #:allow-other-keys)
3302 (wrap-program (string-append (assoc-ref outputs "out")
3303 "/bin/wxmaxima")
3304 `("PATH" ":" prefix
3305 (,(string-append (assoc-ref inputs "maxima")
3306 "/bin")))
3307 ;; For GtkFileChooserDialog.
3308 `("GSETTINGS_SCHEMA_DIR" =
3309 (,(string-append (assoc-ref inputs "gtk+")
3310 "/share/glib-2.0/schemas")))
3311 `("XDG_DATA_DIRS" ":" prefix
3312 (;; Needed by gdk-pixbuf to know supported icon formats.
3313 ,(string-append
3314 (assoc-ref inputs "shared-mime-info") "/share")
3315 ;; The default icon theme of GTK+.
3316 ,(string-append
3317 (assoc-ref inputs "adwaita-icon-theme") "/share"))))
3318 #t)))))
48446f0f 3319 (home-page "https://wxmaxima-developers.github.io/wxmaxima/")
9aafbc0c
MW
3320 (synopsis "Graphical user interface for the Maxima computer algebra system")
3321 (description
3322 "wxMaxima is a graphical user interface for the Maxima computer algebra
3323system. It eases the use of Maxima by making most of its commands available
3324through a menu system and by providing input dialogs for commands that require
3325more than one argument. It also implements its own display engine that
3326outputs mathematical symbols directly instead of depicting them with ASCII
3327characters.
3328
3329wxMaxima also features 2D and 3D inline plots, simple animations, mixing of
3330text and mathematical calculations to create documents, exporting of input and
3331output to TeX, and a browser for Maxima's manual including command index and
3332full text searching.")
3333 (license license:gpl2+)))
3334
b15e47f9
RW
3335(define-public armadillo
3336 (package
3337 (name "armadillo")
f133e244 3338 (version "9.100.5")
b15e47f9
RW
3339 (source (origin
3340 (method url-fetch)
3341 (uri (string-append "mirror://sourceforge/arma/armadillo-"
7397cd9e 3342 version ".tar.xz"))
b15e47f9
RW
3343 (sha256
3344 (base32
f133e244 3345 "1ka1vd9fcmvp12qkcm4888dkfqwnalvv00x04wy29f3nx3qwczby"))))
b15e47f9 3346 (build-system cmake-build-system)
e405c0bc 3347 (arguments `(#:tests? #f)) ; no test target
b15e47f9
RW
3348 (inputs
3349 `(("openblas" ,openblas)
3350 ("lapack" ,lapack)
3351 ("arpack" ,arpack-ng)))
3352 (home-page "http://arma.sourceforge.net/")
3353 (synopsis "C++ linear algebra library")
3354 (description
3355 "Armadillo is a C++ linear algebra library, aiming towards a good balance
3356between speed and ease of use. It is useful for algorithm development
3357directly in C++, or quick conversion of research code into production
3358environments. It can be used for machine learning, pattern recognition,
3359signal processing, bioinformatics, statistics, econometrics, etc. The library
3360provides efficient classes for vectors, matrices and cubes, as well as 150+
255fb17b 3361associated functions (e.g., contiguous and non-contiguous submatrix views).")
fe418cc5 3362 (license license:asl2.0)))
b15e47f9 3363
279663ef 3364(define-public muparser
d7cff656
LF
3365 ;; When switching download sites, muparser re-issued a 2.2.5 release with a
3366 ;; different hash. In order to make `guix package --upgrade` work correctly,
3367 ;; we set a Guix packaging revision.
3368 ;; When the next version of muparser is released, we can remove
3369 ;; UPSTREAM-VERSION and REVISION and use the plain VERSION.
3370 (let ((upstream-version "2.2.5")
3371 (revision "2"))
3372 (package
3373 (name "muparser")
3374 (version (string-append upstream-version "-" revision))
3375 (source
3376 (origin
67f1db38
TGR
3377 (method git-fetch)
3378 (uri (git-reference
b0e7b699 3379 (url "https://github.com/beltoforion/muparser")
67f1db38
TGR
3380 (commit (string-append "v" upstream-version))))
3381 (file-name (git-file-name name version))
d7cff656 3382 (sha256
67f1db38 3383 (base32 "0f0g4995xngf1pp3zr4p6ai2f8v6f8bxwa0k8ayjjiv1l8h44m24"))))
d7cff656
LF
3384 (build-system gnu-build-system)
3385 (arguments
3386 `(#:configure-flags '("--enable-samples=no")
3387 #:tests? #f)) ;no "check" target
3388 (home-page "http://muparser.beltoforion.de/")
3389 (synopsis "Fast parser library for mathematical expressions")
3390 (description
3391 "muParser is an extensible high performance math parser library. It is
3392based on transforming an expression into a bytecode and precalculating constant
3393parts of it.")
3394 (license license:expat))))
279663ef 3395
e73b49fb
RW
3396(define-public openblas
3397 (package
3398 (name "openblas")
df5a2e4f 3399 (version "0.3.9")
e73b49fb
RW
3400 (source
3401 (origin
3402 (method url-fetch)
a617fd55
MB
3403 (uri (string-append "mirror://sourceforge/openblas/v" version "/OpenBLAS%20"
3404 version "%20version.tar.gz"))
e73b49fb
RW
3405 (file-name (string-append name "-" version ".tar.gz"))
3406 (sha256
3407 (base32
df5a2e4f 3408 "14iz9xnrb9xiwgj84j94mc74gg0zn2vsy9fmsijxxma1n7dck4w3"))))
e73b49fb
RW
3409 (build-system gnu-build-system)
3410 (arguments
5789566a 3411 `(#:test-target "test"
bd0b4379
RW
3412 ;; DYNAMIC_ARCH is only supported on x86. When it is disabled and no
3413 ;; TARGET is specified, OpenBLAS will tune itself to the build host, so
3414 ;; we need to disable substitutions.
71923a91
AE
3415 #:substitutable?
3416 ,(let ((system (or (%current-target-system) (%current-system))))
3417 (or (string-prefix? "x86_64" system)
bd0b4379 3418 (string-prefix? "i686" system)
83a34647
EF
3419 (string-prefix? "mips" system)
3420 (string-prefix? "aarch64" system)))
e73b49fb
RW
3421 #:make-flags
3422 (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
3423 "SHELL=bash"
5855756c 3424 "MAKE_NB_JOBS=0" ;use jobserver for submakes
a4384dc9
MB
3425
3426 ;; This is the maximum number of threads OpenBLAS will ever use (that
3427 ;; is, if $OPENBLAS_NUM_THREADS is greater than that, then NUM_THREADS
3428 ;; is used.) If we don't set it, the makefile sets it to the number
3429 ;; of cores of the build machine, which is obviously wrong.
3430 "NUM_THREADS=128"
3431
af5b817e
RW
3432 ;; Build the library for all supported CPUs. This allows
3433 ;; switching CPU targets at runtime with the environment variable
3434 ;; OPENBLAS_CORETYPE=<type>, where "type" is a supported CPU type.
71923a91
AE
3435 ;; Unfortunately, this is not supported on non-x86 architectures,
3436 ;; where it leads to failed builds.
3437 ,@(let ((system (or (%current-target-system) (%current-system))))
8a637e79
RW
3438 (cond
3439 ((or (string-prefix? "x86_64" system)
71923a91 3440 (string-prefix? "i686" system))
8a637e79
RW
3441 '("DYNAMIC_ARCH=1"))
3442 ;; On MIPS we force the "SICORTEX" TARGET, as for the other
3443 ;; two available MIPS targets special extended instructions
3444 ;; for Loongson cores are used.
3445 ((string-prefix? "mips" system)
3446 '("TARGET=SICORTEX"))
83a34647
EF
3447 ;; On aarch64 force the generic 'armv8-a' target
3448 ((string-prefix? "aarch64" system)
3449 '("TARGET=ARMV8"))
8a637e79 3450 (else '()))))
e73b49fb 3451 ;; no configure script
493937ae
DL
3452 #:phases
3453 (modify-phases %standard-phases
3454 (delete 'configure)
3455 (add-before 'build 'set-extralib
3456 (lambda* (#:key inputs #:allow-other-keys)
3457 ;; Get libgfortran found when building in utest.
3458 (setenv "FEXTRALIB"
3459 (string-append "-L" (assoc-ref inputs "fortran-lib")
3460 "/lib"))
3461 #t)))))
e73b49fb 3462 (inputs
493937ae 3463 `(("fortran-lib" ,gfortran "lib")))
e73b49fb
RW
3464 (native-inputs
3465 `(("cunit" ,cunit)
493937ae 3466 ("fortran" ,gfortran)
e73b49fb 3467 ("perl" ,perl)))
59695981 3468 (home-page "https://www.openblas.net/")
e73b49fb
RW
3469 (synopsis "Optimized BLAS library based on GotoBLAS")
3470 (description
3471 "OpenBLAS is a BLAS library forked from the GotoBLAS2-1.13 BSD version.")
3472 (license license:bsd-3)))
3473
daa6036f 3474(define-public openblas-ilp64
ba05be22 3475 (package/inherit openblas
daa6036f
EB
3476 (name "openblas-ilp64")
3477 (supported-systems '("x86_64-linux" "aarch64-linux" "mips64el-linux"))
3478 (arguments
3479 (substitute-keyword-arguments (package-arguments openblas)
3480 ((#:make-flags flags '())
3481 `(append (list "INTERFACE64=1" "LIBNAMESUFFIX=ilp64")
3482 ,flags))))
3483 (synopsis "Optimized BLAS library based on GotoBLAS (ILP64 version)")
3484 (license license:bsd-3)))
3485
5a7deb11
LC
3486(define* (make-blis implementation #:optional substitutable?)
3487 "Return a BLIS package with the given IMPLEMENTATION (see config/ in the
3488source tree for a list of implementations.)
3489
3490SUBSTITUTABLE? determines whether the package is made available as a
3491substitute.
3492
3493Currently the specialization must be selected at configure-time, but work is
3494underway to allow BLIS to select the right optimized kernels at run time:
3495<https://github.com/flame/blis/issues/129>."
3496 (package
3497 (name (if (string=? implementation "reference")
3498 "blis"
3499 (string-append "blis-" implementation)))
3500 (version "0.2.2")
3501 (home-page "https://github.com/flame/blis")
3502 (source (origin
3503 (method git-fetch)
3504 (uri (git-reference (url home-page) (commit version)))
3505 (sha256
3506 (base32
3507 "1wr79a50nm4abhw8w3sn96nmwp5mrzifcigk7khw9qcgyyyqayfh"))
3508 (file-name (git-file-name "blis" version))))
3509 (build-system gnu-build-system)
3510 (arguments
3511 `(#:test-target "test"
3512
3513 #:substitutable? ,substitutable?
3514
3515 #:phases (modify-phases %standard-phases
3516 (replace 'configure
3517 (lambda* (#:key outputs #:allow-other-keys)
3518 ;; This is a home-made 'configure' script.
3519 (let ((out (assoc-ref outputs "out")))
1ec17821
RW
3520 (invoke "./configure" "-p" out
3521 "-d" "opt"
3522 "--disable-static"
3523 "--enable-shared"
3524 "--enable-threading=openmp"
5a7deb11 3525
1ec17821 3526 ,implementation))))
5a7deb11
LC
3527 (add-before 'check 'show-test-output
3528 (lambda _
3529 ;; By default "make check" is silent. Make it verbose.
3530 (system "tail -F output.testsuite &")
3531 #t)))))
3532 (synopsis "High-performance basic linear algebra (BLAS) routines")
3533 (description
3534 "BLIS is a portable software framework for instantiating high-performance
3535BLAS-like dense linear algebra libraries. The framework was designed to
3536isolate essential kernels of computation that, when optimized, immediately
3537enable optimized implementations of most of its commonly used and
3538computationally intensive operations. While BLIS exports a new BLAS-like API,
3539it also includes a BLAS compatibility layer which gives application developers
3540access to BLIS implementations via traditional BLAS routine calls.")
3541 (license license:bsd-3)))
3542
3543(define-public blis
3544 ;; This is the "reference" implementation, which is the non-optimized but
3545 ;; portable variant (no assembly).
3546 (make-blis "reference" #t))
3547
3548(define ignorance blis)
3549
3550(define-syntax-rule (blis/x86_64 processor)
3551 "Expand to a package specialized for PROCESSOR."
3552 (package
3553 (inherit (make-blis processor))
3554 (supported-systems '("x86_64-linux"))))
3555
3556(define-public blis-sandybridge
3557 ;; BLIS specialized for Sandy Bridge processors (launched 2011):
3558 ;; <http://ark.intel.com/products/codename/29900/Sandy-Bridge>.
3559 (blis/x86_64 "sandybridge"))
3560
3561(define-public blis-haswell
3562 ;; BLIS specialized for Haswell processors (launched 2013):
3563 ;; <http://ark.intel.com/products/codename/42174/Haswell>.
3564 (blis/x86_64 "haswell"))
3565
3566(define-public blis-knl
3567 ;; BLIS specialized for Knights Landing processor (launched 2016):
3568 ;; <http://ark.intel.com/products/series/92650/Intel-Xeon-Phi-x200-Product-Family>.
3569 (blis/x86_64 "knl"))
3570
3571
e1605e36
RW
3572(define-public openlibm
3573 (package
3574 (name "openlibm")
48d7ac17 3575 (version "0.6.0")
e1605e36
RW
3576 (source
3577 (origin
ca72dd2c
TGR
3578 (method git-fetch)
3579 (uri (git-reference
b0e7b699 3580 (url "https://github.com/JuliaLang/openlibm")
ca72dd2c
TGR
3581 (commit (string-append "v" version))))
3582 (file-name (git-file-name name version))
e1605e36 3583 (sha256
ca72dd2c 3584 (base32 "08wfchmmr5200fvmn1kwq9byc1fhsq46hn0y5k8scdl74771c7gh"))))
e1605e36
RW
3585 (build-system gnu-build-system)
3586 (arguments
3587 `(#:make-flags
3588 (list (string-append "prefix=" (assoc-ref %outputs "out")))
3589 #:phases
3590 ;; no configure script
dc1d3cde 3591 (modify-phases %standard-phases (delete 'configure))
e1605e36 3592 #:tests? #f)) ;the tests are part of the default target
d3be5220 3593 (home-page "https://openlibm.org/")
e1605e36
RW
3594 (synopsis "Portable C mathematical library (libm)")
3595 (description
3596 "OpenLibm is an effort to have a high quality, portable, standalone C
3597mathematical library (libm). It can be used standalone in applications and
3598programming language implementations. The project was born out of a need to
e881752c 3599have a good libm for the Julia programming language that worked consistently
e1605e36
RW
3600across compilers and operating systems, and in 32-bit and 64-bit
3601environments.")
538c0e3b
EF
3602 ;; Each architecture has its own make target, and there is none for mips.
3603 (supported-systems (delete "mips64el-linux" %supported-systems))
e1605e36
RW
3604 ;; See LICENSE.md for details.
3605 (license (list license:expat
3606 license:isc
3607 license:bsd-2
3608 license:public-domain
3609 license:lgpl2.1+))))
3610
e62be58f
RW
3611(define-public openspecfun
3612 (package
3613 (name "openspecfun")
59cd0ba4 3614 (version "0.5.3")
e62be58f
RW
3615 (source
3616 (origin
90cea671
TGR
3617 (method git-fetch)
3618 (uri (git-reference
b0e7b699 3619 (url "https://github.com/JuliaLang/openspecfun")
90cea671
TGR
3620 (commit (string-append "v" version))))
3621 (file-name (git-file-name name version))
e62be58f 3622 (sha256
90cea671 3623 (base32 "0pfw6l3ch7isz403llx7inxlvavqh01jh1hb9dpidi86sjjx9kfh"))))
e62be58f
RW
3624 (build-system gnu-build-system)
3625 (arguments
59cd0ba4 3626 '(#:tests? #f ; no "check" target
e62be58f
RW
3627 #:make-flags
3628 (list (string-append "prefix=" (assoc-ref %outputs "out")))
59cd0ba4
TGR
3629 #:phases
3630 (modify-phases %standard-phases
3631 (delete 'configure)))) ; no configure script
e62be58f 3632 (inputs
19afbea1 3633 `(("fortran" ,gfortran)))
e62be58f
RW
3634 (home-page "https://github.com/JuliaLang/openspecfun")
3635 (synopsis "Collection of special mathematical functions")
3636 (description
3637 "Openspecfun provides AMOS and Faddeeva. AMOS (from Netlib) is a
3638portable package for Bessel Functions of a Complex Argument and Nonnegative
3639Order; it contains subroutines for computing Bessel functions and Airy
3640functions. Faddeeva allows computing the various error functions of arbitrary
3641complex arguments (Faddeeva function, error function, complementary error
3642function, scaled complementary error function, imaginary error function, and
3643Dawson function); given these, one can also easily compute Voigt functions,
3644Fresnel integrals, and similar related functions as well.")
3645 ;; Faddeeva is released under the Expat license; AMOS is included as
3646 ;; public domain software.
3647 (license (list license:expat license:public-domain))))
3648
2742f87e
RW
3649(define-public suitesparse
3650 (package
3651 (name "suitesparse")
aac148a8 3652 (version "5.7.1")
2742f87e
RW
3653 (source
3654 (origin
aac148a8
FG
3655 (method git-fetch)
3656 (uri (git-reference
b0e7b699 3657 (url "https://github.com/DrTimothyAldenDavis/SuiteSparse")
aac148a8
FG
3658 (commit (string-append "v" version))))
3659 (file-name (git-file-name name version))
2742f87e
RW
3660 (sha256
3661 (base32
aac148a8
FG
3662 "174p3l78kv9gaa0i5hflyai2ydwnjzh34k9938sl4aa3li0543s8"))
3663 (patches (search-patches "suitesparse-mongoose-cmake.patch"))
bd5b5ac0
EB
3664 (modules '((guix build utils)))
3665 (snippet
3666 ;; Remove bundled metis source
6cbee49d
MW
3667 '(begin
3668 (delete-file-recursively "metis-5.1.0")
3669 #t))))
2742f87e
RW
3670 (build-system gnu-build-system)
3671 (arguments
bd5b5ac0 3672 '(#:tests? #f ;no "check" target
2742f87e
RW
3673 #:make-flags
3674 (list "CC=gcc"
3675 "BLAS=-lblas"
3676 "TBB=-ltbb"
bd5b5ac0 3677 "MY_METIS_LIB=-lmetis"
aac148a8
FG
3678 ;; Flags for cmake (required to build GraphBLAS and Mongoose)
3679 (string-append "CMAKE_OPTIONS=-DCMAKE_INSTALL_PREFIX="
3680 (assoc-ref %outputs "out")
3681 " -DCMAKE_VERBOSE_MAKEFILE=ON"
3682 " -DCMAKE_C_FLAGS_RELEASE=\"$(CFLAGS) $(CPPFLAGS)\""
3683 " -DCMAKE_CXX_FLAGS_RELEASE=\"$(CXXFLAGS) $(CPPFLAGS)\""
3684 " -DCMAKE_SKIP_RPATH=TRUE"
3685 " -DCMAKE_BUILD_TYPE=Release")
2742f87e
RW
3686 (string-append "INSTALL_LIB="
3687 (assoc-ref %outputs "out") "/lib")
3688 (string-append "INSTALL_INCLUDE="
bd5b5ac0
EB
3689 (assoc-ref %outputs "out") "/include")
3690 "library")
2742f87e 3691 #:phases
2509522c 3692 (modify-phases %standard-phases
bd5b5ac0 3693 (delete 'configure)))) ;no configure script
2742f87e
RW
3694 (inputs
3695 `(("tbb" ,tbb)
bd5b5ac0
EB
3696 ("lapack" ,lapack)
3697 ("metis" ,metis)))
aac148a8 3698 (native-inputs
b471337d 3699 `(("cmake" ,cmake-minimal)
aac148a8 3700 ("m4" ,m4)))
2742f87e
RW
3701 (home-page "http://faculty.cse.tamu.edu/davis/suitesparse.html")
3702 (synopsis "Suite of sparse matrix software")
3703 (description
3704 "SuiteSparse is a suite of sparse matrix algorithms, including: UMFPACK,
3705multifrontal LU factorization; CHOLMOD, supernodal Cholesky; SPQR,
3706multifrontal QR; KLU and BTF, sparse LU factorization, well-suited for circuit
3707simulation; ordering methods (AMD, CAMD, COLAMD, and CCOLAMD); CSparse and
3708CXSparse, a concise sparse Cholesky factorization package; and many other
3709packages.")
3710 ;; LGPLv2.1+:
3711 ;; AMD, CAMD, BTF, COLAMD, CCOLAMD, CSparse, CXSparse, KLU, LDL
3712 ;; GPLv2+:
3713 ;; GPUQREngine, RBio, SuiteSparse_GPURuntime, SuiteSparseQR, UMFPACK
3714 (license (list license:gpl2+ license:lgpl2.1+))))
3715
ec322be2
FB
3716(define-public atlas
3717 (package
3718 (name "atlas")
3c98ac02 3719 (version "3.10.3")
ec322be2
FB
3720 (source (origin
3721 (method url-fetch)
de67e922
LF
3722 (uri (string-append "mirror://sourceforge/math-atlas/Stable/"
3723 version "/atlas" version ".tar.bz2"))
ec322be2
FB
3724 (sha256
3725 (base32
3c98ac02 3726 "1dyjlq3fiparvm8ypwk6rsmjzmnwk81l88gkishphpvc79ryp216"))))
ec322be2
FB
3727 (build-system gnu-build-system)
3728 (home-page "http://math-atlas.sourceforge.net/")
19afbea1 3729 (inputs `(("gfortran" ,gfortran)
ec322be2
FB
3730 ("lapack-tar" ,(package-source lapack))))
3731 (outputs '("out" "doc"))
01480b9e
FB
3732 ;; For the moment we drop support for MIPS at it fails to compile. See
3733 ;; https://lists.gnu.org/archive/html/guix-devel/2014-11/msg00516.html
3734 (supported-systems (delete "mips64el-linux" %supported-systems))
ec322be2
FB
3735 (arguments
3736 `(#:parallel-build? #f
3737 #:parallel-tests? #f
f15615b1
LC
3738
3739 ;; ATLAS tunes itself for the machine it is built on, as explained at
3740 ;; <http://lists.gnu.org/archive/html/guix-devel/2014-10/msg00305.html>.
3741 ;; For this reason, we want users to build it locally instead of using
3742 ;; substitutes.
3743 #:substitutable? #f
3744
ec322be2 3745 #:modules ((srfi srfi-26)
ec322be2
FB
3746 (guix build gnu-build-system)
3747 (guix build utils))
40029cbe 3748 #:configure-flags
ec322be2
FB
3749 `(;; Generate position independent code suitable for dynamic libraries
3750 ;; and use WALL timer to get more accurate timing.
3751 "-Fa" "alg" "-fPIC" "-D" "c" "-DWALL"
3752 ;; Set word width.
3753 "-b"
3754 ,,(if (string-match "64" (%current-system))
3755 "64"
3756 "32")
3757 ;; Disable parallel build as it gives errors: atlas_pthread.h is
3758 ;; needed to compile C files before it is generated.
3759 "-Ss" "pmake" "make -j 1"
af89a667
FB
3760 ;; Probe is failing for MIPS. We therefore define the system
3761 ;; architecture explicitly by setting (-A) MACHINETYPE = 49
3762 ;; 'MIPSR1xK' and (-V) ISA = 1 'none'.
3763 ,,@(if (string-prefix? "mips" (%current-system))
3764 (list "-A" "49" "-V" "1")
3765 (list))
ec322be2
FB
3766 ;; Generate shared libraries.
3767 "--shared"
3768 ;; Build a full LAPACK library.
3769 ,(string-append "--with-netlib-lapack-tarfile="
3770 (assoc-ref %build-inputs "lapack-tar")))
3771 #:phases
e5b4b96b
EF
3772 (modify-phases %standard-phases
3773 (add-after 'install 'install-doc
3774 (lambda* (#:key outputs inputs #:allow-other-keys)
3775 (let ((doc (string-append (assoc-ref outputs "doc")
3776 "/share/doc/atlas")))
3777 (mkdir-p doc)
cb6f44d4
RW
3778 (for-each (cut install-file <> doc)
3779 (find-files "../ATLAS/doc" ".*"))
3780 #t)))
e5b4b96b 3781 (add-after 'check 'check-pt
cb6f44d4 3782 (lambda _ (invoke "make" "ptcheck")))
e5b4b96b
EF
3783 ;; Fix files required to run configure.
3784 (add-before 'configure 'fix-/bin/sh
ec322be2
FB
3785 (lambda _
3786 ;; Use `sh', not `/bin/sh'.
3787 (substitute* (find-files "." "Makefile|configure|SpewMakeInc\\.c")
3788 (("/bin/sh")
5b786db8
EF
3789 "sh"))
3790 #t))
e5b4b96b
EF
3791 ;; Fix /bin/sh in generated make files.
3792 (add-after 'configure 'fix-/bin/sh-in-generated-files
3793 (lambda _
3794 (substitute* (find-files "." "^[Mm]ake\\.inc.*")
3795 (("/bin/sh")
5b786db8
EF
3796 "sh"))
3797 #t))
e5b4b96b
EF
3798 ;; ATLAS configure program does not accepts the default flags
3799 ;; passed by the 'gnu-build-system'.
3800 (replace 'configure
3801 (lambda* (#:key native-inputs inputs outputs
3802 (configure-flags '())
3803 #:allow-other-keys #:rest args)
3804 (let* ((prefix (assoc-ref outputs "out"))
3805 (bash (or (and=> (assoc-ref
3806 (or native-inputs inputs) "bash")
3807 (cut string-append <> "/bin/bash"))
3808 "/bin/sh"))
3809 (flags `(,(string-append "--prefix=" prefix)
3810 ,@configure-flags))
3811 (abs-srcdir (getcwd))
3812 (srcdir (string-append "../" (basename abs-srcdir))))
3813 (format #t "source directory: ~s (relative from build: ~s)~%"
3814 abs-srcdir srcdir)
3815 (mkdir "../build")
3816 (chdir "../build")
3817 (format #t "build directory: ~s~%" (getcwd))
3818 (format #t "configure flags: ~s~%" flags)
cb6f44d4
RW
3819 (apply invoke bash
3820 (string-append srcdir "/configure")
3821 flags)))))))
ec322be2
FB
3822 (synopsis "Automatically Tuned Linear Algebra Software")
3823 (description
3824 "ATLAS is an automatically tuned linear algebra software library
3825providing C and Fortran77 interfaces to a portably efficient BLAS
3826implementation, as well as a few routines from LAPACK.
3827
f15615b1
LC
3828Optimization occurs at build time. For this reason, the library is built on
3829the machine where it is installed, without resorting to pre-built substitutes.
ec322be2 3830
f15615b1 3831Before building the library, CPU throttling should be disabled. This can be
d97c429a 3832done in the BIOS, or, on GNU/Linux, with the following command:
ec322be2 3833
8e9ba611 3834@example
d97c429a 3835# cpupower --governor performance
8e9ba611 3836@end example
ec322be2 3837
d97c429a 3838Failure to do so will result in a library with poor performance.")
ec322be2 3839 (license license:bsd-3)))
c12efc72
AE
3840
3841(define-public glm
3842 (package
3843 (name "glm")
1a75fc84 3844 (version "0.9.9.8")
c12efc72
AE
3845 (source
3846 (origin
3847 (method url-fetch)
5ea4b594
MB
3848 (uri (string-append "https://github.com/g-truc/glm/releases/download/"
3849 version "/glm-" version ".zip"))
c12efc72 3850 (sha256
1a75fc84 3851 (base32 "0k6yk9v46h690rshdx49x98y5qspkzibld1wb51jwcm35vba7qip"))))
c12efc72 3852 (build-system cmake-build-system)
1a75fc84
MB
3853 (arguments
3854 `(#:phases (modify-phases %standard-phases
3855 (replace 'install
3856 (lambda* (#:key outputs #:allow-other-keys)
3857 ;; Since version 0.9.9.6, 'make install' is not supported
3858 ;; and we have to do it "manually". Upstream discussion:
3859 ;; <https://github.com/g-truc/glm/pull/968>.
3860 (let* ((source (string-append "../glm"))
3861 (out (assoc-ref outputs "out"))
3862 (inc (string-append out "/include"))
3863 (lib (string-append out "/lib"))
3864 (pkgconfig (string-append lib "/pkgconfig")))
3865 (with-directory-excursion source
3866 (mkdir-p inc)
3867 (mkdir-p pkgconfig)
3868 (copy-recursively "glm" (string-append inc "/glm"))
3869 (copy-recursively "cmake" (string-append lib "/cmake"))
3870 (call-with-output-file (string-append pkgconfig "/glm.pc")
3871 (lambda (port)
3872 (format port
3873 "prefix=~a
3874includedir=${prefix}/include
3875
3876Name: GLM
3877Description: OpenGL Mathematics
3878Version: ~a
3879Cflags: -I${includedir}~%" out ,(version-prefix version 3)))))
3880 #t))))))
c12efc72
AE
3881 (native-inputs
3882 `(("unzip" ,unzip)))
46bda5eb 3883 (home-page "https://glm.g-truc.net/")
c12efc72
AE
3884 (synopsis "OpenGL Mathematics library")
3885 (description "OpenGL Mathematics (GLM) is a header-only C++ mathematics
3886library for graphics software based on the OpenGL Shading Language (GLSL)
3887specifications.")
3888 (license license:expat)))
7f18257b
AE
3889
3890(define-public lpsolve
3891 (package
3892 (name "lpsolve")
a89e0cf5 3893 (version "5.5.2.5")
7f18257b
AE
3894 (source
3895 (origin
3896 (method url-fetch)
3897 (uri (string-append "mirror://sourceforge/lpsolve/lpsolve/" version
3898 "/lp_solve_" version "_source.tar.gz"))
3899 (sha256
3900 (base32
a89e0cf5 3901 "12pj1idjz31r7c2mb5w03vy1cmvycvbkx9z29s40qdmkp1i7q6i0"))
7f18257b
AE
3902 (modules '((guix build utils)))
3903 (snippet
6cbee49d
MW
3904 '(begin
3905 (substitute* (list "lp_solve/ccc" "lpsolve55/ccc")
3906 (("^c=cc") "c=gcc")
3907 ;; Pretend to be on a 64 bit platform to obtain a common directory
3908 ;; name for the build results on all architectures; nothing else
3909 ;; seems to depend on it.
3910 (("^PLATFORM=.*$") "PLATFORM=ux64\n")
3911
3912 ;; The check for 'isnan' as it is written fails with
3913 ;; "non-floating-point argument in call to function
3914 ;; ‘__builtin_isnan’", which leads to the 'NOISNAN' cpp macro
3915 ;; definition, which in turn leads to bad things. Fix the feature
3916 ;; test.
3917 (("isnan\\(0\\)") "isnan(0.)"))
3918 #t))))
7f18257b
AE
3919 (build-system gnu-build-system)
3920 (arguments
6c96b545 3921 `(#:tests? #f ; no check target
7f18257b
AE
3922 #:phases
3923 (modify-phases %standard-phases
6c96b545 3924 (delete 'configure) ; no configure script
7f18257b
AE
3925 (replace 'build
3926 (lambda _
6c96b545
TGR
3927 (with-directory-excursion "lpsolve55"
3928 (invoke "bash" "ccc"))
3929 (with-directory-excursion "lp_solve"
3930 (invoke "bash" "ccc"))
3931 #t))
7f18257b
AE
3932 (replace 'install
3933 (lambda* (#:key outputs #:allow-other-keys)
3934 (let* ((out (assoc-ref outputs "out"))
3935 (bin (string-append out "/bin"))
3936 (lib (string-append out "/lib"))
3937 ;; This is where LibreOffice expects to find the header
3938 ;; files, and where they are installed by Debian.
3939 (include (string-append out "/include/lpsolve")))
6c96b545
TGR
3940 (install-file "lpsolve55/bin/ux64/liblpsolve55.a" lib)
3941 (install-file "lpsolve55/bin/ux64/liblpsolve55.so" lib)
96c46210
LC
3942 (install-file "lp_solve/bin/ux64/lp_solve" bin)
3943
7f18257b
AE
3944 ;; Install a subset of the header files as on Debian
3945 ;; (plus lp_bit.h, which matches the regular expression).
96c46210
LC
3946 (for-each (lambda (name)
3947 (install-file name include))
3948 (find-files "." "lp_[HMSa-z].*\\.h$"))
7f18257b 3949 (with-directory-excursion "shared"
96c46210
LC
3950 (for-each (lambda (name)
3951 (install-file name include))
3952 (find-files "." "\\.h$")))
7f18257b
AE
3953 #t))))))
3954 (home-page "http://lpsolve.sourceforge.net/")
3955 (synopsis "Mixed integer linear programming (MILP) solver")
3956 (description
3957 "lp_solve is a mixed integer linear programming solver based on the
3958revised simplex and the branch-and-bound methods.")
3959 (license license:lgpl2.1+)))
a17d4564
EB
3960
3961(define-public dealii
3962 (package
3963 (name "dealii")
ba567cae 3964 (version "9.1.1")
a17d4564
EB
3965 (source
3966 (origin
3967 (method url-fetch)
3968 (uri (string-append "https://github.com/dealii/dealii/releases/"
3969 "download/v" version "/dealii-" version ".tar.gz"))
3970 (sha256
3971 (base32
ba567cae 3972 "0xhjv0gzswpjbc43xbrpwfc5848g508l01855nszx3g5gwzlhnzw"))
a17d4564
EB
3973 (modules '((guix build utils)))
3974 (snippet
3975 ;; Remove bundled sources: UMFPACK, TBB, muParser, and boost
6cbee49d
MW
3976 '(begin
3977 (delete-file-recursively "bundled")
3978 #t))))
a17d4564
EB
3979 (build-system cmake-build-system)
3980 (inputs
3981 `(("tbb" ,tbb)
3982 ("zlib" ,zlib)
3983 ("boost" ,boost)
3984 ("p4est" ,p4est)
3985 ("blas" ,openblas)
3986 ("lapack" ,lapack)
3987 ("arpack" ,arpack-ng)
3988 ("muparser" ,muparser)
3989 ("gfortran" ,gfortran)
3990 ("suitesparse" ,suitesparse))) ;for UMFPACK
3991 (arguments
3992 `(#:build-type "DebugRelease" ;only supports Release, Debug, or DebugRelease
d84b09e9
EB
3993 #:configure-flags
3994 ;; Work around a bug in libsuitesparseconfig linking
3995 ;; see https://github.com/dealii/dealii/issues/4745
3996 '("-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON")))
a17d4564
EB
3997 (home-page "https://www.dealii.org")
3998 (synopsis "Finite element library")
3999 (description
4000 "Deal.II is a C++ program library targeted at the computational solution
4001of partial differential equations using adaptive finite elements. The main
4002aim of deal.II is to enable rapid development of modern finite element codes,
4003using among other aspects adaptive meshes and a wide array of tools often used
4004in finite element programs.")
4005 (license license:lgpl2.1+)))
4006
4007(define-public dealii-openmpi
4008 (package (inherit dealii)
4009 (name "dealii-openmpi")
4010 (inputs
4011 `(("mpi" ,openmpi)
4012 ;;Supported only with MPI:
4d44bcad 4013 ("hdf5" ,hdf5-parallel-openmpi) ;TODO: have petsc-openmpi propagate?
a17d4564
EB
4014 ("p4est" ,p4est-openmpi)
4015 ("petsc" ,petsc-openmpi)
4016 ("slepc" ,slepc-openmpi)
4017 ("metis" ,metis) ;for MUMPS
4018 ("scalapack" ,scalapack) ;for MUMPS
4019 ("mumps" ,mumps-metis-openmpi) ;configure supports only metis orderings
4020 ("arpack" ,arpack-ng-openmpi)
4021 ,@(fold alist-delete (package-inputs dealii)
4022 '("p4est" "arpack"))))
4023 (arguments
4024 (substitute-keyword-arguments (package-arguments dealii)
4025 ((#:configure-flags cf)
40b114c0
EB
4026 `(cons "-DDEAL_II_WITH_MPI:BOOL=ON"
4027 ,cf))
7e309e8a
EB
4028 ((#:phases phases '%standard-phases)
4029 `(modify-phases ,phases
4030 (add-before 'check 'mpi-setup
4031 ,%openmpi-setup)))))
a17d4564 4032 (synopsis "Finite element library (with MPI support)")))
194c7f95
AE
4033
4034(define-public flann
4035 (package
4036 (name "flann")
ba40ce5b
LC
4037 (version "1.9.1")
4038 (home-page "https://github.com/mariusmuja/flann/")
194c7f95
AE
4039 (source
4040 (origin
ba40ce5b
LC
4041 (method git-fetch)
4042 (uri (git-reference (url home-page) (commit version)))
4043 (file-name (git-file-name name version))
194c7f95
AE
4044 (sha256
4045 (base32
ba40ce5b 4046 "0p56fl2yx1r86ds1mgjq40926jdcgq3hka7p3l1hv2acv9jxp15x"))
b5edc479 4047 (patches (search-patches "flann-cmake-3.11.patch"))))
194c7f95 4048 (build-system cmake-build-system)
f8bb53ca 4049 (outputs '("out"))
194c7f95
AE
4050 (native-inputs
4051 `(("unzip" ,unzip)))
4052 (inputs
4053 `(("hdf5" ,hdf5)
f8bb53ca
LC
4054 ;; FIXME: 'mkoctfile' fails with a linker error:
4055 ;; ld: cannot find -loctinterp
4056 ;; ld: cannot find -loctave
4057 ;; Disable it for now.
4058 ;;("octave" ,octave-cli)
194c7f95
AE
4059 ("python" ,python-2) ; print syntax
4060 ;; ("python2-numpy" ,python2-numpy) ; only required for the tests
4061 ("zlib" ,zlib)))
4062 (arguments
39b30337
LC
4063 `(;; The 'share/flann/octave' contains a .mex file, which is an ELF file
4064 ;; taken 46 MiB unstripped, and 6 MiB stripped.
4065 #:strip-directories '("lib" "lib64" "libexec"
4066 "bin" "sbin" "share/flann/octave")
4067
9684e30b
LC
4068 ;; Save 12 MiB by not installing .a files. Passing
4069 ;; '-DBUILD_STATIC_LIBS=OFF' has no effect.
4070 #:phases (modify-phases %standard-phases
4071 (add-after 'install 'remove-static-libraries
4072 (lambda* (#:key outputs #:allow-other-keys)
4073 (let* ((out (assoc-ref outputs "out"))
4074 (lib (string-append out "/lib")))
4075 (for-each delete-file
4076 (find-files lib "\\.a$"))
4077 #t))))
4078
39b30337 4079 #:tests? #f)) ; The test data are downloaded from the Internet.
194c7f95
AE
4080 (synopsis "Library for approximate nearest neighbors computation")
4081 (description "FLANN is a library for performing fast approximate
4082nearest neighbor searches in high dimensional spaces. It implements a
4083collection of algorithms and a system for automatically choosing the best
4084algorithm and optimum parameters depending on the dataset.
4085
4086FLANN is written in C++ and contains bindings for C, Octave and Python.")
4087 (license (license:non-copyleft "file://COPYING"
4088 "See COPYING in the distribution."))))
d8c97beb
EF
4089
4090(define-public wcalc
4091 (package
4092 (name "wcalc")
4093 (version "2.5")
4094 (source
4095 (origin
4096 (method url-fetch)
de67e922
LF
4097 (uri (string-append "mirror://sourceforge/w-calc/Wcalc/" version "/"
4098 "wcalc-" version ".tar.bz2"))
d8c97beb
EF
4099 (sha256
4100 (base32
4101 "1vi8dl6rccqiq1apmpwawyg2ywx6a1ic1d3cvkf2hlwk1z11fb0f"))))
4102 (build-system gnu-build-system)
4103 (inputs
4104 `(("mpfr" ,mpfr)
4105 ("readline" ,readline)))
4106 (home-page "http://w-calc.sourceforge.net/index.php")
4107 (synopsis "Flexible command-line scientific calculator")
4108 (description "Wcalc is a very capable calculator. It has standard functions
4109(sin, asin, and sinh for example, in either radians or degrees), many
4110pre-defined constants (pi, e, c, etc.), support for using variables, \"active\"
4111variables, a command history, hex/octal/binary input and output, unit
4112conversions, embedded comments, and an expandable expression entry field. It
4113evaluates expressions using the standard order of operations.")
4114 (license license:gpl2+)))
45147b0c
FH
4115
4116(define-public xaos
4117 (package
4118 (name "xaos")
49de3274 4119 (version "4.0")
45147b0c 4120 (source (origin
49de3274
KK
4121 (method git-fetch)
4122 (uri (git-reference
4123 (url "https://github.com/xaos-project/XaoS")
4124 (commit (string-append "release-" version))))
352e09a5 4125 (file-name (git-file-name name version))
45147b0c
FH
4126 (sha256
4127 (base32
49de3274 4128 "00110p5xscjsmn7avfqgydn656zbmdj3l3y2fpv9b4ihzpid8n7a"))))
45147b0c 4129 (build-system gnu-build-system)
49de3274
KK
4130 (native-inputs `(("gettext" ,gettext-minimal)
4131 ("qtbase" ,qtbase)
4132 ("qttools" ,qttools)))
45147b0c
FH
4133 (inputs `(("libx11" ,libx11)
4134 ("zlib" ,zlib)
4135 ("libpng" ,libpng)
4136 ("gsl" ,gsl)))
49de3274
KK
4137 ;; The upstream project file ("XaoS.pro") and the Makefile it generates are
4138 ;; not enough for this package to install properly. These phases fix that.
45147b0c
FH
4139 (arguments
4140 `(#:tests? #f ;no "check" target
49de3274
KK
4141 #:phases
4142 (modify-phases %standard-phases
4143 (add-before 'configure 'make-qt-deterministic
4144 (lambda _
4145 ;; Make Qt deterministic.
4146 (setenv "QT_RCC_SOURCE_DATE_OVERRIDE" "1")
4147 #t))
4148 (replace 'configure
4149 (lambda* (#:key outputs #:allow-other-keys)
4150 (let ((out (assoc-ref outputs "out")))
4151 ;; The DESTDIR is originally set to install the xaos binary to
4152 ;; the "bin" folder inside the build directory. Setting make
4153 ;; flags doesn't seem to change this.
4154 (substitute* "XaoS.pro"
4155 (("DESTDIR.*$")
4156 (string-append "DESTDIR=" out "/bin")))
4157 (substitute* "src/include/config.h"
4158 (("/usr/share/XaoS")
4159 (string-append out "/share/XaoS")))
4160 (invoke "qmake"))))
4161 (add-after 'install 'install-data
4162 (lambda* (#:key outputs #:allow-other-keys)
4163 (let* ((out (assoc-ref outputs "out"))
4164 (share (string-append out "/share")))
4165 (mkdir-p share)
4166 (for-each
4167 (lambda (folder)
4168 (copy-recursively folder
4169 (string-append share "/XaoS/" folder)))
4170 '("catalogs" "examples" "tutorial"))
4171 (install-file "xdg/xaos.png"
4172 (string-append share "/pixmaps"))
4173 (install-file "xdg/xaos.desktop"
4174 (string-append share "/applications")))
4175 #t)))))
45147b0c
FH
4176 (synopsis "Real-time fractal zoomer")
4177 (description "GNU XaoS is a graphical program that generates fractal
4178patterns and allows you to zoom in and out of them infinitely in a fluid,
4179continuous manner. It also includes tutorials that help to explain how fractals
4180are built. It can generate many different fractal types such as the Mandelbrot
4181set.")
49de3274 4182 (home-page "https://xaos-project.github.io/")
45147b0c 4183 (license license:gpl2+)))
528bb464
EB
4184
4185(define-public hypre
4186 (package
4187 (name "hypre")
be099727 4188 (version "2.15.1")
fabcbf32
TGR
4189 (source
4190 (origin
4191 (method git-fetch)
4192 (uri (git-reference
b0e7b699 4193 (url "https://github.com/LLNL/hypre")
fabcbf32
TGR
4194 (commit (string-append "v" version))))
4195 (file-name (git-file-name name version))
4196 (sha256
be099727 4197 (base32 "1lvh4ybqkriyqfg2zmic6mrg1981qv1i9vry1fdgsabn81hb71g4"))
fabcbf32
TGR
4198 (modules '((guix build utils)))
4199 (snippet
4200 '(begin
4201 ;; Remove use of __DATE__ and __TIME__ for reproducibility;
be099727 4202 ;; substitute the release date.
fabcbf32
TGR
4203 (substitute* "src/utilities/HYPRE_utilities.h"
4204 (("Date Compiled: .*$")
be099727 4205 "Date Compiled: Oct 19 2018 15:23:00 +0000\"\n"))
fabcbf32 4206 #t))))
528bb464 4207 (build-system gnu-build-system)
be099727
TGR
4208 (outputs '("out" ; 6.1 MiB of headers and libraries
4209 "doc")) ; 4.8 MiB of documentation
528bb464
EB
4210 (native-inputs
4211 `(("doc++" ,doc++)
4212 ("netpbm" ,netpbm)
be099727 4213 ("perl" ,perl) ; needed to run 'ppmquant' during tests
8b35c8cd
RW
4214 ("texlive" ,(texlive-union (list texlive-xypic
4215 texlive-cm
9b405aea 4216 texlive-latex-hyperref
9b405aea 4217 texlive-bibtex)))
528bb464
EB
4218 ("ghostscript" ,ghostscript)))
4219 (inputs
4220 `(("blas" ,openblas)
4221 ("lapack" ,lapack)))
4222 (arguments
4223 `(#:modules ((srfi srfi-1)
4224 ,@%gnu-build-system-modules)
4225 #:configure-flags '("--enable-shared"
4226 "--disable-fortran"
4227 "--without-MPI"
4228 "--with-openmp"
4229 "--with-fei"
4230 "--with-lapack"
4231 "--with-blas")
4232 #:phases
4233 (modify-phases %standard-phases
9b405aea
PN
4234 (add-before 'build 'set-HOME
4235 (lambda _
4236 ;; FIXME: texlive-union does not find the built
4237 ;; metafonts, so it tries to generate them in HOME.
4238 (setenv "HOME" "/tmp")
4239 #t))
528bb464
EB
4240 (add-before 'configure 'chdir-src
4241 (lambda _ (chdir "src")))
4242 (replace 'configure
4243 (lambda* (#:key build target configure-flags
4244 #:allow-other-keys #:rest args)
4245 (let* ((configure (assoc-ref %standard-phases 'configure)))
4246 (apply configure
4247 (append args
4248 (list #:configure-flags
4249 (cons (string-append
4250 "--host=" (or target build))
4251 configure-flags)))))))
4252 (add-after 'build 'build-docs
4253 (lambda _
9b405aea 4254 (invoke "make" "-Cdocs" "pdf" "html")))
528bb464
EB
4255 (replace 'check
4256 (lambda _
4257 (setenv "LD_LIBRARY_PATH" (string-append (getcwd) "/hypre/lib"))
4258 (setenv "PATH" (string-append "." ":" (getenv "PATH")))
6b1c7ac8
RW
4259 (invoke "make" "check" "CHECKRUN=")
4260 (for-each (lambda (filename)
4261 (let ((size (stat:size (stat filename))))
4262 (when (positive? size)
4263 (error (format #f "~a size ~d; error indication~%"
4264 filename size)))))
4265 (find-files "test" ".*\\.err$"))
4266 #t))
528bb464
EB
4267 (add-after 'install 'install-docs
4268 (lambda* (#:key outputs #:allow-other-keys)
4269 ;; Custom install because docs/Makefile doesn't honor ${docdir}.
4270 (let* ((doc (assoc-ref outputs "doc"))
4271 (docdir (string-append doc "/share/doc/hypre-" ,version)))
528bb464
EB
4272 (with-directory-excursion "docs"
4273 (for-each (lambda (base)
4274 (install-file (string-append base ".pdf") docdir)
be099727 4275 (copy-recursively base docdir)) ; html docs
528bb464
EB
4276 '("HYPRE_usr_manual"
4277 "HYPRE_ref_manual")))
4278 #t))))))
4279 (home-page "http://www.llnl.gov/casc/hypre/")
4280 (synopsis "Library of solvers and preconditioners for linear equations")
4281 (description
4282 "HYPRE is a software library of high performance preconditioners and
4283solvers for the solution of large, sparse linear systems of equations. It
4284features multigrid solvers for both structured and unstructured grid
4285problems.")
4286 (license license:lgpl2.1)))
4287
4288(define-public hypre-openmpi
4289 (package (inherit hypre)
4290 (name "hypre-openmpi")
4291 (inputs
4292 `(("mpi" ,openmpi)
4293 ,@(package-inputs hypre)))
4294 (arguments
4295 (substitute-keyword-arguments (package-arguments hypre)
4296 ((#:configure-flags flags)
4297 ``("--with-MPI"
6df2a50a
LC
4298 ,@(delete "--without-MPI" ,flags)))
4299 ((#:phases phases)
4300 `(modify-phases ,phases
bbe46a4a
EB
4301 (add-before 'check 'mpi-setup
4302 ,%openmpi-setup)))))
528bb464
EB
4303 (synopsis "Parallel solvers and preconditioners for linear equations")
4304 (description
4305 "HYPRE is a software library of high performance preconditioners and
4306solvers for the solution of large, sparse linear systems of equations on
4307parallel computers. It features parallel multigrid solvers for both
4308structured and unstructured grid problems.")))
6c90e183
EB
4309
4310(define-public matio
4311 (package
4312 (name "matio")
4313 (version "1.5.6")
4314 (source
4315 (origin
4316 (method url-fetch)
de67e922 4317 (uri (string-append "mirror://sourceforge/matio/matio/" version "/"
6c90e183
EB
4318 "matio-" version ".tar.gz"))
4319 (sha256
4320 (base32
4321 "0y2qymgxank8wdiwc68ap8bxdzrhvyw86i29yh3xgn4z1njfd9ir"))))
4322 (build-system gnu-build-system)
4323 (inputs
4324 `(("zlib" ,zlib)
4325 ("hdf5" ,hdf5)))
4326 (home-page "http://matio.sourceforge.net/")
4327 (synopsis "Library for reading and writing MAT files")
4328 (description "Matio is a library for reading and writing MAT files. It
4329supports compressed MAT files, as well as newer (version 7.3) MAT files.")
4330 (license license:bsd-2)))
d721c83a 4331
517318ad
LF
4332(define-public vc
4333 (package
4334 (name "vc")
9d731fb6 4335 (version "1.4.1")
517318ad
LF
4336 (source
4337 (origin (method url-fetch)
4338 (uri (string-append "https://github.com/VcDevel/Vc/releases/"
4339 "download/" version "/Vc-" version ".tar.gz"))
4340 (sha256
4341 (base32
9d731fb6 4342 "17qili8bf8r78cng65yf4qmgna8kiqjqbgcqbric6v9j6nkhkrk8"))))
517318ad
LF
4343 (build-system cmake-build-system)
4344 (arguments
4345 '(#:configure-flags
33d82486
MB
4346 '("-DBUILD_TESTING=ON"
4347 ;; By default, Vc will optimize for the CPU of the build machine.
4348 ;; Setting this to "none" makes it create portable binaries. See
4349 ;; "cmake/OptimizeForArchitecture.cmake".
9d731fb6
MB
4350 "-DTARGET_ARCHITECTURE=none")
4351 #:phases (modify-phases %standard-phases
4352 (add-after 'unpack 'copy-testdata
4353 (lambda* (#:key inputs native-inputs #:allow-other-keys)
4354 (let ((testdata (assoc-ref (or native-inputs inputs)
4355 "testdata")))
4356 (copy-recursively testdata "tests/testdata")
4357 #t))))))
4358 (native-inputs
4359 `(("virtest" ,virtest)
4360
4361 ;; This is a submodule in the git project, but not part of the
4362 ;; released sources. See the git branch for the commit to take.
4363 ("testdata" ,(let ((commit "9ada1f34d6a41f1b5553d6223f277eae72c039d3"))
4364 (origin
4365 (method git-fetch)
4366 (uri (git-reference
4367 (url "https://github.com/VcDevel/vc-testdata")
4368 (commit "9ada1f34d6a41f1b5553d6223f277eae72c039d3")))
4369 (file-name (git-file-name "vc-testdata"
4370 (string-take commit 7)))
4371 (sha256
4372 (base32
4373 "1hkhqib03qlcq412ym2dciynfxcdr2ygqhnplz4l1vissr1wnqn2")))))))
517318ad
LF
4374 (synopsis "SIMD vector classes for C++")
4375 (description "Vc provides portable, zero-overhead C++ types for explicitly
4376data-parallel programming. It is a library designed to ease explicit
4377vectorization of C++ code. Its types enable explicitly stating data-parallel
4378operations on multiple values. The parallelism is therefore added via the type
4379system. Vc has an intuitive API and provides portability between different
4380compilers and compiler versions as well as portability between different vector
4381instruction sets. Thus, an application written with Vc can be compiled for:
4382@enumerate
4383@item AVX and AVX2
d1e4ad1b 4384@item SSE2 up to SSE4.2 or SSE4a
517318ad
LF
4385@item Scalar
4386@item MIC
4387@item NEON (in development)
4388@item NVIDIA GPUs / CUDA (in development)
4389@end enumerate\n")
4390 (home-page "https://github.com/VcDevel/Vc")
a8ead6f9
EF
4391 ;; "No support_???.cpp file exists for this architecture."
4392 (supported-systems '("x86_64-linux" "i686-linux"))
517318ad 4393 (license license:bsd-3)))
54052a54 4394
4395(define-public reducelcs
4396 ;; This is the last commit which is available upstream, no
4397 ;; release happened since 2010.
4398 (let ((commit "474f88deb968061abe8cf11c959e02319b8ae5c0")
4399 (revision "1"))
4400 (package
4401 (name "reducelcs")
4402 (version (string-append "1.0-" revision "." (string-take commit 7)))
4403 (source
4404 (origin
4405 (method git-fetch)
4406 (uri (git-reference
4407 (url "https://github.com/gdv/Reduce-Expand-for-LCS")
4408 (commit commit)))
4409 (file-name (string-append name "-" version "-checkout"))
4410 (sha256
4411 (base32
4412 "1rllzcfwc042c336mhq262a8ha90x6afq30kvk60r7i4761j4yjm"))))
4413 (build-system gnu-build-system)
4414 (inputs
4415 `(("openlibm" ,openlibm)))
4416 (arguments
4417 `(#:tests? #f ; no tests
4418 #:phases
4419 (modify-phases %standard-phases
4420 (delete 'configure) ; No configure script exists.
4421 (replace 'install ; No install phase exists.
4422 (lambda* (#:key outputs #:allow-other-keys)
4423 (let* ((out (assoc-ref outputs "out"))
4424 (bin (string-append out "/bin")))
4425 (install-file "Approximation" bin)
4426 (install-file "CollectResults" bin)
4427 (install-file "GenerateInstances" bin)
4428 #t))))))
4429 (synopsis "Approximate Longest Commons Subsequence computation tool")
4430 (description
4431 "@code{reduceLCS} is an implementation of the Reduce-Expand
4432algorithm for LCS. It is a fast program to compute the approximate
4433Longest Commons Subsequence of a set of strings.")
4434 (home-page "https://github.com/gdv/Reduce-Expand-for-LCS")
c000b6b1 4435 (license license:gpl3+))))
479c4273
JD
4436
4437(define-public jacal
4438 (package
4439 (name "jacal")
4440 (version "1c4")
4441 (source (origin
4442 (method url-fetch)
4443 (uri (string-append
4444 "http://groups.csail.mit.edu/mac/ftpdir/scm/jacal-"
4445 version ".zip"))
4446 (sha256 (base32
4447 "055zrn12a1dmy0dqkwrkq3fklbhg3yir6vn0lacp4mvbg8573a3q"))
4448 (patches (search-patches "jacal-fix-texinfo.patch"))))
4449 (build-system gnu-build-system)
4450 (arguments
4451 `(#:phases
4452 (modify-phases %standard-phases
4453 (add-before 'build 'pre-build
4454 ;; Don't use upstream's script - it really doesn't fit into
4455 ;; Guix's functional paradigm.
4456 (lambda* (#:key inputs outputs #:allow-other-keys)
4457 (substitute* "Makefile"
4458 (("^install: install-script") "install: "))))
4459 (add-after 'install 'post-install
4460 ;; Instead, we provide our own simplified script.
4461 (lambda* (#:key inputs outputs #:allow-other-keys)
4462 (let ((wrapper (string-append (assoc-ref outputs "out")
4463 "/bin/jacal")))
4464 (format (open wrapper (logior O_WRONLY O_CREAT))
4465 (string-append "#!~a\nexec ~a/bin/scm -ip1 "
4466 "-e '(slib:load \"~a/lib/jacal/math\") "
4467 "(math)' \"$@\"\n")
4468 (which "bash")
4469 (assoc-ref inputs "scm")
4470 (assoc-ref outputs "out"))
4471 (chmod wrapper #o555))))
4472 (replace 'configure
9cd82b1c
RW
4473 (lambda* (#:key outputs #:allow-other-keys)
4474 (invoke "./configure"
4475 (string-append "--prefix="
4476 (assoc-ref outputs "out"))))))))
479c4273
JD
4477 (inputs `(("scm" ,scm)))
4478 (native-inputs `(("unzip" ,unzip)
4479 ("texinfo" ,texinfo)))
4480 (synopsis "Symbolic mathematics system")
4481 (description "GNU JACAL is an interactive symbolic mathematics program based on
4482Scheme. It manipulate and simplify a range of mathematical expressions such
4483as equations, scalars, vectors, and matrices.")
6fd52309 4484 (home-page "https://www.gnu.org/software/jacal/")
479c4273
JD
4485 (license license:gpl3+)))
4486
313844d9
TF
4487(define-public z3
4488 (package
4489 (name "z3")
0fe654eb 4490 (version "4.8.8")
fb525bfd 4491 (home-page "https://github.com/Z3Prover/z3")
313844d9 4492 (source (origin
fb525bfd
MB
4493 (method git-fetch)
4494 (uri (git-reference (url home-page)
4495 (commit (string-append "z3-" version))))
2d7b99b3 4496 (file-name (git-file-name name version))
313844d9
TF
4497 (sha256
4498 (base32
0fe654eb 4499 "1rn538ghqwxq0v8i6578j8mflk6fyv0cp4hjfqynzvinjbps56da"))))
fa574a6d 4500 (build-system gnu-build-system)
313844d9 4501 (arguments
f6b4d395
JK
4502 `(#:imported-modules ((guix build python-build-system)
4503 ,@%gnu-build-system-modules)
4504 #:modules (((guix build python-build-system) #:select (site-packages))
4505 (guix build gnu-build-system)
4506 (guix build utils))
4507 #:phases
313844d9 4508 (modify-phases %standard-phases
8b87d095
JK
4509 (add-after 'unpack 'enable-bytecode-determinism
4510 (lambda _
4511 (setenv "PYTHONHASHSEED" "0")
4512 #t))
ad6c6a5b
EF
4513 (add-after 'unpack 'fix-compatability
4514 ;; Versions after 4.8.3 have immintrin.h IFDEFed for Windows only.
4515 (lambda _
4516 (substitute* "src/util/mpz.cpp"
4517 (("#include <immintrin.h>") ""))
4518 #t))
cf684d87
TF
4519 (add-before 'configure 'bootstrap
4520 (lambda _
32d5360f 4521 (invoke "python" "scripts/mk_make.py")))
fa574a6d
AB
4522 ;; work around gnu-build-system's setting --enable-fast-install
4523 ;; (z3's `configure' is a wrapper around the above python file,
4524 ;; which fails when passed --enable-fast-install)
4525 (replace 'configure
4526 (lambda* (#:key inputs outputs #:allow-other-keys)
4527 (invoke "./configure"
f6b4d395
JK
4528 "--python"
4529 (string-append "--prefix=" (assoc-ref outputs "out"))
4530 (string-append "--pypkgdir=" (site-packages inputs outputs)))))
fa574a6d
AB
4531 (add-after 'configure 'change-directory
4532 (lambda _
4533 (chdir "build")
4534 #t))
cf684d87 4535 (add-before 'check 'make-test-z3
313844d9 4536 (lambda _
cf684d87 4537 ;; Build the test suite executable.
32d5360f
RW
4538 (invoke "make" "test-z3" "-j"
4539 (number->string (parallel-job-count)))))
cf684d87
TF
4540 (replace 'check
4541 (lambda _
4542 ;; Run all the tests that don't require arguments.
32d5360f 4543 (invoke "./test-z3" "/a"))))))
313844d9 4544 (native-inputs
fa574a6d
AB
4545 `(("which" ,which)
4546 ("python" ,python-wrapper)))
313844d9
TF
4547 (synopsis "Theorem prover")
4548 (description "Z3 is a theorem prover and @dfn{satisfiability modulo
cf684d87 4549theories} (SMT) solver. It provides a C/C++ API, as well as Python bindings.")
313844d9 4550 (license license:expat)))
3d5d87a3 4551
6d433d6e
EB
4552(define-public elpa
4553 (package
4554 (name "elpa")
4555 (version "2018.11.001")
4556 (source (origin
4557 (method url-fetch)
4558 (uri (string-append "http://elpa.mpcdf.mpg.de/html/Releases/"
4559 version "/elpa-" version ".tar.gz"))
4560 (sha256
4561 (base32
4562 "05hv3v5i6xmziaizw350ff72y1c3k662r85fm3xfdrkclj5zw9yc"))))
4563 (build-system gnu-build-system)
4564 (native-inputs
4565 `(("fortran" ,gfortran)
4566 ("perl" ,perl))) ;for configure and deps
4567 (inputs
4568 `(("blas" ,openblas)))
4569 (arguments
4570 `(#:configure-flags
4571 `("--enable-openmp"
4572 "--with-mpi=no"
4573 ;; ELPA unfortunately does not support runtime dispatch, so we can
4574 ;; only enable the "generic" kernels. See the "Cross compilation"
4575 ;; section of INSTALL.md.
4576 "--enable-generic"
4577 "--disable-sse" "--disable-sse-assembly" ;Require SSE3
4578 "--disable-avx" "--disable-avx2" "--disable-avx512"
4579 ,(string-append "CFLAGS=-O3 "
4580 "-funsafe-loop-optimizations -funsafe-math-optimizations "
4581 "-ftree-vect-loop-version -ftree-vectorize "
4582 ,(let ((system (or (%current-target-system)
4583 (%current-system))))
4584 (cond
4585 ((or (string-prefix? "x86_64" system)
4586 (string-prefix? "i686" system))
4587 "-msse2")
4588 (else "")))))
4589 #:parallel-tests? #f ;tests are multi-threaded, via BLAS
4590 #:phases
4591 (modify-phases %standard-phases
4592 (add-before 'configure 'patch-header-generation
4593 (lambda _
4594 (substitute* "configure"
4595 (("^ *make.*top_srcdir=\"\\$srcdir\"" &)
4596 (string-append & " CPP=\"$CPP\"")))
4597 #t))
4598 (add-before 'check 'setup-tests
4599 (lambda _
4600 ;; Decrease test time and RAM use by computing fewer eigenvalues.
4601 ;; The flags are (MATRIX-SIZE, EIGENVALUES, BLOCK-SIZE), where
4602 ;; the default is (500, 250, 16) for C tests and (5000, 150, 16)
4603 ;; for Fortran. This also causes several tests to pass that
4604 ;; otherwise would otherwise fail with matrix size 5000; possibly
4605 ;; due to floating point tolerances that are too tight.
4606 (setenv "TEST_FLAGS" "1500 50 16") ;from elpa.spec
4607 (setenv "OMP_NUM_THREADS" (number->string (parallel-job-count)))
4608 (substitute* "Makefile"
4609 ;; Test scripts are generated, patch the shebang
4610 (("#!/bin/bash") (string-append "#!" (which "sh"))))
4611 #t)))))
4612 (home-page "http://elpa.mpcdf.mpg.de")
4613 (synopsis "Eigenvalue solvers for symmetric matrices")
4614 (description
4615 "The ELPA library provides efficient and scalable direct eigensolvers for
4616symmetric matrices.")
4617 (license license:lgpl3)))
4618
4619(define-public elpa-openmpi
4620 (package (inherit elpa)
4621 (name "elpa-openmpi")
4622 (inputs
4623 `(("mpi" ,openmpi)
4624 ("scalapack" ,scalapack)
4625 ,@(package-inputs elpa)))
4626 (arguments
4627 (substitute-keyword-arguments (package-arguments elpa)
4628 ((#:configure-flags cf '())
4629 `(cons "--with-mpi=yes" (delete "--with-mpi=no" ,cf)))
4630 ((#:phases phases '%standard-phases)
4631 `(modify-phases ,phases
4632 (add-before 'check 'mpi-setup
4633 (lambda _
4634 ;; Tests use 2 mpi tasks by default, use our remaining build
4635 ;; cores as OpenMP threads.
4636 (setenv "OMP_NUM_THREADS" (number->string
4637 (max (quotient (parallel-job-count) 2)
4638 1)))
4639 (,%openmpi-setup)))))))
4640 (synopsis "Eigenvalue solvers for symmetric matrices (with MPI support)")))
4641
e01397b4
EB
4642(define-public elemental
4643 (package
4644 (name "elemental")
4645 (version "0.87.7")
4646 (source (origin
5c0b6d1b
EF
4647 (method git-fetch)
4648 (uri (git-reference
b0e7b699 4649 (url "https://github.com/elemental/Elemental")
5c0b6d1b
EF
4650 (commit (string-append "v" version))))
4651 (file-name (git-file-name name version))
e01397b4
EB
4652 (sha256
4653 (base32
5c0b6d1b 4654 "1687xpjjzig27y2pnqv7hv09smpijyfdpz7qjgmcxf4shfajlfkc"))))
e01397b4 4655 (build-system cmake-build-system)
1e05e837 4656 (home-page "https://github.com/elemental/Elemental")
e01397b4
EB
4657 (native-inputs
4658 `(("gfortran" ,gfortran)))
4659 (inputs
4660 `(("blas" ,openblas)
4661 ("gfortran:lib" ,gfortran "lib")
4662 ("gmp" ,gmp)
4663 ("lapack" ,lapack)
4664 ("metis" ,metis)
4665 ("mpc" ,mpc)
4666 ("mpfr" ,mpfr)
4667 ("mpi" ,openmpi)
4668 ("qd" ,qd)))
4669 (arguments
4670 `(#:build-type "Release" ;default RelWithDebInfo not supported
4671 #:configure-flags `("-DEL_DISABLE_PARMETIS:BOOL=YES"
4672 "-DEL_AVOID_COMPLEX_MPI:BOOL=NO"
4673 "-DEL_CACHE_WARNINGS:BOOL=YES"
4674 "-DEL_TESTS:BOOL=YES"
4675 "-DCMAKE_INSTALL_LIBDIR=lib"
4676 "-DGFORTRAN_LIB=gfortran")
4677 #:phases (modify-phases %standard-phases
3b42e2be
EF
4678 (add-before 'check 'mpi-setup
4679 ,%openmpi-setup)
e01397b4
EB
4680 (add-before 'check 'setup-tests
4681 (lambda _
4682 ;; Parallelism is done at the MPI layer.
4683 (setenv "OMP_NUM_THREADS" "1")
4684 #t))
4685 (add-after 'install 'remove-tests
4686 (lambda* (#:key outputs #:allow-other-keys)
4687 ;; Tests are installed, with no easy configuration
4688 ;; switch to prevent this, so delete them.
4689 (delete-file-recursively
3b42e2be 4690 (string-append (assoc-ref outputs "out") "/bin"))
e01397b4
EB
4691 #t)))))
4692 (synopsis "Dense and sparse-direct linear algebra and optimization")
4693 (description "Elemental is a modern C++ library for distributed-memory
4694dense and sparse-direct linear algebra, conic optimization, and lattice
4695reduction.")
4696 (license license:bsd-2)))
5b05dce7
JN
4697
4698(define-public mcrl2
4699 (package
4700 (name "mcrl2")
abe3c5ed 4701 (version "202006.0")
5b05dce7
JN
4702 (source (origin
4703 (method url-fetch)
185152e3
JN
4704 (uri (string-append
4705 "https://www.mcrl2.org/download/release/mcrl2-"
4706 version ".tar.gz"))
5b05dce7
JN
4707 (sha256
4708 (base32
abe3c5ed 4709 "167ryrzk1a2j53c2j198jlxa98amcaym070gkcj730619gymv5zl"))))
5b05dce7
JN
4710 (inputs
4711 `(("boost" ,boost)
4712 ("glu" ,glu)
4713 ("mesa" ,mesa)
077d66ed 4714 ("qtbase" ,qtbase)))
5b05dce7 4715 (build-system cmake-build-system)
ed0c5d3c 4716 (synopsis "Toolset for the mCRL2 formal specification language")
5b05dce7 4717 (description
ed0c5d3c
TGR
4718 "@dfn{mCRL2} (micro Common Representation Language 2) is a formal
4719specification language for describing concurrent discrete event systems. Its
4720toolset supports analysis and automatic verification, linearisation, simulation,
4721state-space exploration and generation, and tools to optimise and analyse
5b05dce7
JN
4722specifications. Also, state spaces can be manipulated, visualised and
4723analysed.")
b3882709 4724 (home-page "https://mcrl2.org")
5b05dce7 4725 (license license:boost1.0)))
41835f94 4726
e03b9126
JN
4727(define-public mcrl2-minimal
4728 (package
4729 (inherit mcrl2)
4730 (name "mcrl2-minimal")
4731 (inputs
4732 `(("boost" ,boost)))
4733 (arguments
4734 '(#:configure-flags '("-DMCRL2_ENABLE_GUI_TOOLS=OFF")))))
4735
910deec6
NV
4736(define-public tcalc
4737 (package
4738 (name "tcalc")
4739 (version "2.0")
4740 (source
4741 (origin
4742 (method url-fetch)
4743 (uri (string-append "https://sites.google.com/site/mohammedisam2000/tcalc/tcalc-"
4744 version ".tar.gz"))
4745 (sha256
4746 (base32
4747 "0jq806m4dqfia85nppfm75mml9w57g0cgv4cdw9bp3zymda83s0m"))))
4748 (build-system gnu-build-system)
4749 (synopsis "The terminal calculator")
4750 (description
4751 "The terminal calculator is a small program to help users of the GNU/Linux
4752terminal do calculations simply and quickly. The formula to be calculated can
4753be fed to @command{tcalc} through the command line.")
4754 (home-page "https://sites.google.com/site/mohammedisam2000/tcalc")
4755 (license license:gpl3+)))
b26e4f26
EB
4756
4757(define-public sundials
4758 (package
4759 (name "sundials")
4760 (version "3.1.1")
4761 (source
4762 (origin
4763 (method url-fetch)
4764 (uri (string-append "https://computation.llnl.gov/projects/sundials/download/"
4765 "sundials-" version ".tar.gz"))
4766 (sha256
4767 (base32
4768 "090s8ymhd0g1s1d44fa73r5yi32hb4biwahhbfi327zd64yn8kd2"))))
4769 (build-system cmake-build-system)
4770 (native-inputs
4771 `(("python" ,python-2))) ;for tests; syntax incompatible with python 3
4772 (inputs
4773 `(("fortran" ,gfortran) ;for fcmix
4774 ("blas" ,openblas)
4775 ("suitesparse" ,suitesparse))) ;TODO: Add hypre
4776 (arguments
4777 `(#:configure-flags `("-DEXAMPLES_ENABLE_C:BOOL=ON"
4778 "-DEXAMPLES_ENABLE_CXX:BOOL=ON"
4779 "-DEXAMPLES_ENABLE_F77:BOOL=ON"
4780 "-DEXAMPLES_ENABLE_F90:BOOL=ON"
4781 "-DEXAMPLES_INSTALL:BOOL=OFF"
4782
4783 "-DFCMIX_ENABLE:BOOL=ON"
4784
4785 "-DKLU_ENABLE:BOOL=ON"
4786 ,(string-append "-DKLU_INCLUDE_DIR="
4787 (assoc-ref %build-inputs "suitesparse")
4788 "/include")
4789 ,(string-append "-DKLU_LIBRARY_DIR="
4790 (assoc-ref %build-inputs "suitesparse")
4791 "/lib"))))
4792 (home-page "https://computation.llnl.gov/projects/sundials")
4793 (synopsis "Suite of nonlinear and differential/algebraic equation solvers")
4794 (description "SUNDIALS is a family of software packages implemented with
4795the goal of providing robust time integrators and nonlinear solvers that can
4796easily be incorporated into existing simulation codes.")
4797 (license license:bsd-3)))
4798
4799(define-public sundials-openmpi
4800 (package (inherit sundials)
4801 (name "sundials-openmpi")
4802 (inputs
4803 `(("mpi" ,openmpi)
4804 ("petsc" ,petsc-openmpi) ;support in SUNDIALS requires MPI
4805 ,@(package-inputs sundials)))
4806 (arguments
4807 (substitute-keyword-arguments (package-arguments sundials)
4808 ((#:configure-flags flags '())
4809 `(cons* "-DMPI_ENABLE:BOOL=ON"
4810 "-DPETSC_ENABLE:BOOL=ON"
4811 (string-append "-DPETSC_INCLUDE_DIR="
4812 (assoc-ref %build-inputs "petsc")
4813 "/include")
4814 (string-append "-DPETSC_LIBRARY_DIR="
4815 (assoc-ref %build-inputs "petsc")
4816 "/lib")
4817 ,flags))
4818 ((#:phases phases '%standard-phases)
4819 `(modify-phases ,phases
bbe46a4a
EB
4820 (add-before 'check 'mpi-setup
4821 ,%openmpi-setup)))))
b26e4f26 4822 (synopsis "SUNDIALS with OpenMPI support")))
a6b9ebc2
EB
4823
4824(define-public combinatorial-blas
4825 (package
4826 (name "combinatorial-blas")
4827 (version "1.6.2")
4828 (source
4829 (origin
4830 (method url-fetch)
4831 (uri (string-append "http://eecs.berkeley.edu/~aydin/CombBLAS_FILES/"
4832 "CombBLAS_beta_"
4833 (match (string-split version #\.)
4834 ((major minor patch)
4835 (string-append major minor "_" patch))) ;e.g. "16_2"
4836 ".tgz"))
4837 (sha256
4838 (base32
4839 "1a9wbgdqyy1whhfc0yl0yqkax3amnqa6iihhq48d063gc0jwfd9a"))
4840 (patches (search-patches "combinatorial-blas-awpm.patch"
4841 "combinatorial-blas-io-fix.patch"))))
4842 (build-system cmake-build-system)
4843 (inputs
4844 `(("mpi" ,openmpi)
4845 ("test-data" ,(origin
4846 (method url-fetch)
4847 (uri (string-append "https://people.eecs.berkeley.edu/~aydin/"
4848 "CombBLAS_FILES/testdata_combblas1.6.1.tgz"))
4849 (sha256
4850 (base32
4851 "01y2781cy3fww7znmidrp85mf8zx0c905w5vzvk1mgrmhhynim87"))))))
4852 (arguments
4853 `(#:configure-flags '("-DBUILD_SHARED_LIBS:BOOL=YES"
4854 "-DCMAKE_CXX_FLAGS=-DUSE_FUNNEL")
4855 #:parallel-tests? #f ;tests use 'mpiexec -n4'
4856 #:phases
4857 (modify-phases %standard-phases
4858 (add-before 'check 'mpi-setup
4859 ,%openmpi-setup)
4860 (add-before 'check 'test-setup
4861 (lambda* (#:key inputs #:allow-other-keys)
4862 (setenv "OMP_NUM_THREADS" "2")
4863 (invoke "tar" "xf" (assoc-ref inputs "test-data")))))))
4864 (home-page "https://people.eecs.berkeley.edu/~aydin/CombBLAS/html/")
4865 (synopsis "Linear algebra primitives for graph analytics")
4866 (description "The Combinatorial BLAS (CombBLAS) is an extensible
4867distributed-memory parallel graph library offering a small but powerful set of
4868linear algebra primitives specifically targeting graph analytics.")
4869 (license (list
4870 license:gpl2+ ;include/psort/(funnel|sort)*.h
4871 license:x11 ;usort and psort
4872 license:bsd-3)))) ;CombBLAS and MersenneTwister.h
3847d1f2
RW
4873
4874(define-public dune-common
4875 (package
4876 (name "dune-common")
6ca2d7da 4877 (version "2.7.0")
3847d1f2
RW
4878 (source
4879 (origin
4880 (method url-fetch)
4881 (uri (string-append "https://dune-project.org/download/"
4882 version "/dune-common-" version ".tar.gz"))
4883 (sha256
4884 (base32
6ca2d7da 4885 "140q1zh44cr5yrjwg4b5ga803rkqv55vk30l2cqm29aklj1wb0rw"))))
3847d1f2
RW
4886 (build-system cmake-build-system)
4887 (arguments
4888 `(#:phases
4889 (modify-phases %standard-phases
4890 (add-after 'build 'build-tests
4891 (lambda* (#:key make-flags #:allow-other-keys)
393dc1cc 4892 (apply invoke "make" "build_tests" make-flags))))))
3847d1f2
RW
4893 (inputs
4894 `(("gmp" ,gmp)
4895 ("metis" ,metis)
3847d1f2
RW
4896 ("openblas" ,openblas)
4897 ("python" ,python)
4898 ("superlu" ,superlu)))
4899 (native-inputs
4900 `(("gfortran" ,gfortran)
4901 ("pkg-config" ,pkg-config)))
4902 (home-page "https://dune-project.org/")
4903 (synopsis "Distributed and Unified Numerics Environment")
4904 (description "DUNE, the Distributed and Unified Numerics Environment is a
4905modular toolbox for solving @dfn{partial differential equations} (PDEs) with
4906grid-based methods. It supports the easy implementation of methods like
4907@dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
4908Differences} (FD).")
4909 ;; GPL version 2 with "runtime exception" to make it behave like LGPLv2.
4910 (license license:gpl2)))
242dbd8e
RW
4911
4912(define-public dune-geometry
4913 (package
4914 (name "dune-geometry")
6ca2d7da 4915 (version "2.7.0")
242dbd8e
RW
4916 (source
4917 (origin
4918 (method url-fetch)
4919 (uri (string-append "https://dune-project.org/download/"
4920 version "/dune-geometry-" version ".tar.gz"))
4921 (sha256
4922 (base32
6ca2d7da 4923 "1cicvlwbyyw76npicnblxckyvhbfn3ip8isydiv3hlrlz8zcg5nr"))))
242dbd8e
RW
4924 (build-system cmake-build-system)
4925 (arguments
4926 `(#:phases
4927 (modify-phases %standard-phases
4928 (add-after 'build 'build-tests
4929 (lambda* (#:key make-flags #:allow-other-keys)
4930 (apply invoke "make" "build_tests" make-flags))))))
4931 (inputs
4932 `(("dune-common" ,dune-common)
242dbd8e
RW
4933 ;; Optional
4934 ("openblas" ,openblas)
4935 ("gmp" ,gmp)
4936 ("python" ,python)))
4937 (native-inputs
4938 `(("gfortran" ,gfortran)
4939 ("pkg-config" ,pkg-config)))
4940 (home-page "https://dune-project.org/")
4941 (synopsis "Distributed and Unified Numerics Environment")
4942 (description "DUNE, the Distributed and Unified Numerics Environment is a
4943modular toolbox for solving @dfn{partial differential equations} (PDEs) with
4944grid-based methods. It supports the easy implementation of methods like
4945@dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
4946Differences} (FD).
4947
4948This package contains the basic DUNE geometry classes.")
4949 ;; GPL version 2 with "runtime exception"
4950 (license license:gpl2)))
ef6e69fd 4951
07ebb75d
FG
4952(define-public dune-uggrid
4953 (package
4954 (name "dune-uggrid")
6ca2d7da 4955 (version "2.7.0")
07ebb75d
FG
4956 (source
4957 (origin
6ca2d7da
FG
4958 (method git-fetch)
4959 (uri (git-reference
4960 (url "https://gitlab.dune-project.org/staging/dune-uggrid.git")
4961 (commit (string-append "v" version))))
4962 (file-name (git-file-name name version))
07ebb75d
FG
4963 (sha256
4964 (base32
6ca2d7da 4965 "192miqgmfj6jwk969gydzpbv9ki7jg5nky3ydnrwa2nq29b5xkh0"))))
07ebb75d
FG
4966 (build-system cmake-build-system)
4967 (arguments
4968 `(#:phases
4969 (modify-phases %standard-phases
4970 (add-after 'build 'build-tests
4971 (lambda* (#:key make-flags #:allow-other-keys)
4972 (apply invoke "make" "build_tests" make-flags))))))
4973 (inputs
393dc1cc 4974 `(("dune-common" ,dune-common)))
07ebb75d
FG
4975 (native-inputs
4976 `(("gfortran" ,gfortran)
4977 ("pkg-config" ,pkg-config)))
4978 (home-page "https://dune-project.org/")
4979 (synopsis "Distributed and Unified Numerics Environment")
4980 (description "DUNE, the Distributed and Unified Numerics Environment is a
4981modular toolbox for solving @dfn{partial differential equations} (PDEs) with
4982grid-based methods. It supports the easy implementation of methods like
4983@dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
4984Differences} (FD).
4985
4986This package contains the DUNE UG grid classes.")
4987 (license license:lgpl2.1)))
4988
ef6e69fd
RW
4989(define-public dune-grid
4990 (package
4991 (name "dune-grid")
6ca2d7da 4992 (version "2.7.0")
ef6e69fd
RW
4993 (source
4994 (origin
4995 (method url-fetch)
4996 (uri (string-append "https://dune-project.org/download/"
4997 version "/dune-grid-" version ".tar.gz"))
4998 (sha256
4999 (base32
6ca2d7da 5000 "17fjz30qazjgl11sryyxnw9klai4yz1ji4bs68013xcxc5hdv27s"))))
ef6e69fd
RW
5001 (build-system cmake-build-system)
5002 (arguments
5003 `(#:phases
5004 (modify-phases %standard-phases
5005 (add-after 'build 'build-tests
5006 (lambda* (#:key make-flags #:allow-other-keys)
393dc1cc 5007 (apply invoke "make" "build_tests" make-flags))))))
ef6e69fd
RW
5008 (inputs
5009 `(("dune-common" ,dune-common)
5010 ("dune-geometry" ,dune-geometry)
5011 ("gmp" ,gmp)
5012 ("metis" ,metis)
5013 ("openblas" ,openblas)
ef6e69fd 5014 ("python" ,python)))
07ebb75d
FG
5015 (propagated-inputs
5016 `(("dune-uggrid" ,dune-uggrid)))
ef6e69fd
RW
5017 (native-inputs
5018 `(("gfortran" ,gfortran)
5019 ("pkg-config" ,pkg-config)))
5020 (home-page "https://dune-project.org/")
5021 (synopsis "Distributed and Unified Numerics Environment")
5022 (description "DUNE, the Distributed and Unified Numerics Environment is a
5023modular toolbox for solving @dfn{partial differential equations} (PDEs) with
5024grid-based methods. It supports the easy implementation of methods like
5025@dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
5026Differences} (FD).
5027
5028This package contains the basic DUNE grid classes.")
5029 ;; GPL version 2 with "runtime exception"
5030 (license license:gpl2)))
ea51d357
RW
5031
5032(define-public dune-istl
5033 (package
5034 (name "dune-istl")
6ca2d7da 5035 (version "2.7.0")
ea51d357
RW
5036 (source
5037 (origin
5038 (method url-fetch)
5039 (uri (string-append "https://dune-project.org/download/"
5040 version "/dune-istl-" version ".tar.gz"))
5041 (sha256
5042 (base32
6ca2d7da
FG
5043 "0gl3wgz5rs6sb4m83440ny45sbx7z7lnbi3gx6r9nm3rvy5j33f9"))
5044 (patches (search-patches "dune-istl-2.7-fix-non-mpi-tests.patch"))))
ea51d357
RW
5045 (build-system cmake-build-system)
5046 (arguments
5047 `(#:phases
5048 (modify-phases %standard-phases
f7cbf403
MB
5049 ;; XXX: istl/test/matrixtest.cc includes <fenv.h> and fails to find
5050 ;; the stdlib types when the gfortran header is used. Remove gfortran
5051 ;; from CPLUS_INCLUDE_PATH as a workaround.
5052 (add-after 'set-paths 'hide-gfortran
5053 (lambda* (#:key inputs #:allow-other-keys)
5054 (let ((gfortran (assoc-ref inputs "gfortran")))
5055 (setenv "CPLUS_INCLUDE_PATH"
5056 (string-join
5057 (delete (string-append gfortran "/include/c++")
5058 (string-split (getenv "CPLUS_INCLUDE_PATH") #\:))
5059 ":"))
5060 #t)))
ea51d357
RW
5061 (add-after 'build 'build-tests
5062 (lambda* (#:key make-flags #:allow-other-keys)
393dc1cc 5063 (apply invoke "make" "build_tests" make-flags))))))
ea51d357
RW
5064 (inputs
5065 `(("dune-common" ,dune-common)
ea51d357
RW
5066 ;; Optional
5067 ("metis" ,metis)
0a703c04 5068 ("suitesparse" ,suitesparse)
ea51d357
RW
5069 ("superlu" ,superlu)
5070 ("openblas" ,openblas)
5071 ("gmp" ,gmp)
5072 ("python" ,python)))
5073 (native-inputs
5074 `(("gfortran" ,gfortran)
5075 ("pkg-config" ,pkg-config)))
5076 (home-page "https://dune-project.org/")
5077 (synopsis "Distributed and Unified Numerics Environment")
5078 (description "DUNE, the Distributed and Unified Numerics Environment is a
5079modular toolbox for solving @dfn{partial differential equations} (PDEs) with
5080grid-based methods.
5081
5082This is the iterative solver template library which provides generic sparse
5083matrix/vector classes and a variety of solvers based on these classes. A
5084special feature is the use of templates to exploit the recursive block
5085structure of finite element matrices at compile time. Available solvers
5086include Krylov methods, (block-) incomplete decompositions and
5087aggregation-based algebraic multigrid.")
5088 ;; GPL version 2 with "runtime exception"
5089 (license license:gpl2)))
5a70aa7d
RW
5090
5091(define-public dune-localfunctions
5092 (package
5093 (name "dune-localfunctions")
6ca2d7da 5094 (version "2.7.0")
5a70aa7d
RW
5095 (source
5096 (origin
5097 (method url-fetch)
5098 (uri (string-append "https://dune-project.org/download/"
5099 version "/dune-localfunctions-" version ".tar.gz"))
5100 (sha256
5101 (base32
6ca2d7da 5102 "1yih59h6vngii696bx1c2vil02lriij4kz0nc583mjn9kiaqxfqd"))))
5a70aa7d
RW
5103 (build-system cmake-build-system)
5104 (arguments
5105 `(#:phases
5106 (modify-phases %standard-phases
109bf6a0
MB
5107 ;; XXX: localfunctions/test/lagrangeshapefunctiontest.cc includes <fenv.h>
5108 ;; and fails to find the stdlib types when the gfortran header is used.
5109 ;; Hide gfortran from CPLUS_INCLUDE_PATH to ensure we get the GCC header.
5110 (add-after 'set-paths 'hide-gfortran
5111 (lambda* (#:key inputs #:allow-other-keys)
5112 (let ((gfortran (assoc-ref inputs "gfortran")))
5113 (setenv "CPLUS_INCLUDE_PATH"
5114 (string-join
5115 (delete (string-append gfortran "/include/c++")
5116 (string-split (getenv "CPLUS_INCLUDE_PATH") #\:))
5117 ":"))
5118 #t)))
5a70aa7d
RW
5119 (add-after 'build 'build-tests
5120 (lambda* (#:key make-flags #:allow-other-keys)
5121 (apply invoke "make" "build_tests" make-flags))))))
5122 (inputs
5123 `(("dune-common" ,dune-common)
5124 ("dune-geometry" ,dune-geometry)
5a70aa7d
RW
5125 ;; Optional
5126 ("metis" ,metis)
5127 ("superlu" ,superlu)
5128 ("gmp" ,gmp)))
5129 (native-inputs
5130 `(("gfortran" ,gfortran)
5131 ("pkg-config" ,pkg-config)))
5132 (home-page "https://dune-project.org/")
5133 (synopsis "Distributed and Unified Numerics Environment") ; TODO
5134 (description "This DUNE module provides interface and implementation for
5135shape functions defined on the DUNE reference elements. In addition to the
5136shape function, interpolation operators and special keys are provided which
5137can be used to assemble global function spaces on finite-element grids.
5138
5139This package provides an interface and implementation for shape functions
5140defined on the DUNE reference elements. In addition to the shape function,
5141interpolation operators and special keys are provided which can be used to
5142assemble global function spaces on finite-element grids.")
5143 ;; GPL version 2 with "runtime exception"
5144 (license license:gpl2)))
ab03d899
RW
5145
5146(define-public dune-alugrid
5147 (package
5148 (name "dune-alugrid")
6ca2d7da 5149 (version "2.7.0-git-81d35682")
ab03d899
RW
5150 (source
5151 (origin
6ca2d7da
FG
5152 (method git-fetch)
5153 (uri (git-reference
5154 (url "https://gitlab.dune-project.org/extensions/dune-alugrid.git")
5155 (commit "81d356827c84454b971937db02c02b90bbcd7fe5")))
5156 (file-name (git-file-name name version))
ab03d899
RW
5157 (sha256
5158 (base32
6ca2d7da 5159 "0z54lwfp53prcrs94k8gwh047l9z642jll3l56xlyfr69z0b2zz1"))))
ab03d899
RW
5160 (build-system cmake-build-system)
5161 (arguments
a669f6e2 5162 `(#:phases
ab03d899
RW
5163 (modify-phases %standard-phases
5164 (add-after 'unpack 'patch-include
5165 (lambda _
5166 (substitute* "dune/alugrid/test/test-alugrid.cc"
5167 (("doc/grids/gridfactory/testgrids")
5168 "doc/dune-grid/grids/gridfactory/testgrids"))
5169 #t))
5170 (add-after 'build 'build-tests
5171 (lambda* (#:key inputs make-flags #:allow-other-keys)
5172 (setenv "CPLUS_INCLUDE_PATH"
97149c57 5173 (string-append (assoc-ref inputs "dune-grid") "/share"))
393dc1cc 5174 (apply invoke "make" "build_tests" make-flags))))))
ab03d899
RW
5175 (inputs
5176 `(("dune-common" ,dune-common)
5177 ("dune-geometry" ,dune-geometry)
5178 ("dune-grid" ,dune-grid)
ab03d899
RW
5179 ;; Optional
5180 ("metis" ,metis)
5181 ("openblas" ,openblas)
5182 ("python" ,python)
5183 ("superlu" ,superlu)
5184 ("gmp" ,gmp)
5185 ("zlib" ,zlib)))
5186 (native-inputs
5187 `(("gfortran" ,gfortran)
5188 ("pkg-config" ,pkg-config)))
5189 (home-page "https://dune-project.org/")
5190 (synopsis "Distributed and Unified Numerics Environment")
5191 (description "ALUGrid is an adaptive, loadbalancing, unstructured
5192implementation of the DUNE grid interface supporting either simplices or
5193cubes.")
5194 (license license:gpl2+)))
0e50630f 5195
f1f9466e
FG
5196(define-public dune-subgrid
5197 (package
5198 (name "dune-subgrid")
6ca2d7da 5199 (version "2.7.0-git-2103a363")
f1f9466e
FG
5200 (source
5201 (origin
5202 (method git-fetch)
5203 (uri (git-reference
5204 (url "https://git.imp.fu-berlin.de/agnumpde/dune-subgrid")
6ca2d7da 5205 (commit "2103a363f32e8d7b60e66eee7ddecf969f6cf762")))
f1f9466e
FG
5206 (file-name (git-file-name name version))
5207 (sha256
5208 (base32
6ca2d7da 5209 "1wsjlypd3835c3arqjkw836cxx5q67zy447wa65q634lf6f6v9ia"))))
f1f9466e
FG
5210 (build-system cmake-build-system)
5211 (arguments
5212 `(#:phases
5213 (modify-phases %standard-phases
5214 (add-after 'build 'build-tests
5215 (lambda* (#:key make-flags #:allow-other-keys)
393dc1cc 5216 (apply invoke "make" "build_tests" make-flags))))))
f1f9466e
FG
5217 (inputs
5218 `(("dune-common" ,dune-common)
5219 ("dune-geometry" ,dune-geometry)
5220 ("dune-grid" ,dune-grid)
f1f9466e
FG
5221 ;; Optional
5222 ("metis" ,metis)
5223 ("openblas" ,openblas)
5224 ("gmp" ,gmp)))
5225 (native-inputs
5226 `(("gfortran" ,gfortran)
5227 ("pkg-config" ,pkg-config)))
5228 (home-page "http://numerik.mi.fu-berlin.de/dune-subgrid/index.php")
5229 (synopsis "Distributed and Unified Numerics Environment")
48b0d9c0 5230 (description "The dune-subgrid module marks elements of
f1f9466e
FG
5231another hierarchical dune grid. The set of marked elements can then be
5232accessed as a hierarchical dune grid in its own right. Dune-Subgrid
5233provides the full grid interface including adaptive mesh refinement.")
5234 (license license:gpl2+)))
5235
0e50630f
RW
5236(define-public dune-typetree
5237 (package
5238 (name "dune-typetree")
6ca2d7da 5239 (version "2.7.0")
0e50630f
RW
5240 (source
5241 (origin
5242 (method git-fetch)
5243 (uri (git-reference
5244 (url "https://gitlab.dune-project.org/staging/dune-typetree.git")
5245 (commit (string-append "v" version))))
5246 (file-name (git-file-name name version))
5247 (sha256
5248 (base32
6ca2d7da 5249 "1rhv25yg0q1hw50c8wlfqhgwrjl4mh62zq9v14ilwgzbfgxmpiy7"))))
0e50630f
RW
5250 (build-system cmake-build-system)
5251 (arguments
5252 `(#:phases
5253 (modify-phases %standard-phases
5254 (add-after 'build 'build-tests
5255 (lambda* (#:key make-flags #:allow-other-keys)
5256 (apply invoke "make" "build_tests" make-flags))))))
5257 (inputs
5258 `(("dune-common" ,dune-common)
0e50630f
RW
5259 ;; Optional
5260 ("openblas" ,openblas)
5261 ("python" ,python)
5262 ("metis" ,metis)
5263 ("superlu" ,superlu)
5264 ("gmp" ,gmp)))
5265 (native-inputs
5266 `(("gfortran" ,gfortran)
5267 ("pkg-config" ,pkg-config)))
5268 (home-page "https://dune-project.org/")
5269 (synopsis "Distributed and Unified Numerics Environment")
5270 (description "TypeTree is a template library for constructing and
5271operating on statically typed trees of objects.")
5272 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
5273 (license (list license:lgpl3+ license:gpl2))))
85b9371c
RW
5274
5275(define-public dune-functions
5276 (package
5277 (name "dune-functions")
6ca2d7da 5278 (version "2.7.0")
85b9371c
RW
5279 (source
5280 (origin
5281 (method git-fetch)
5282 (uri (git-reference
5283 (url "https://gitlab.dune-project.org/staging/dune-functions.git")
5284 (commit (string-append "v" version))))
5285 (file-name (git-file-name name version))
5286 (sha256
5287 (base32
6ca2d7da 5288 "1na4gcih0kin37ksj2xj07ds04v7zx53pjdhm1hzy55jjfqdjk8h"))))
85b9371c 5289 (build-system cmake-build-system)
07ebb75d
FG
5290 (arguments
5291 `(#:phases
5292 (modify-phases %standard-phases
5293 (add-after 'unpack 'disable-failing-tests
5294 (lambda _
5295 (setenv "ARGS"
5296 ;; unable to load GMSH file in this test
5297 "--exclude-regex gridviewfunctionspacebasistest")
5298 #t))
5299 (add-after 'build 'build-tests
5300 (lambda* (#:key make-flags #:allow-other-keys)
393dc1cc 5301 (apply invoke "make" "build_tests" make-flags))))))
85b9371c
RW
5302 (inputs
5303 `(("dune-common" ,dune-common)
5304 ("dune-istl" ,dune-istl)
5305 ("dune-localfunctions" ,dune-localfunctions)
5306 ("dune-grid" ,dune-grid)
5307 ("dune-geometry" ,dune-geometry)
5308 ("dune-typetree" ,dune-typetree)
85b9371c
RW
5309 ("openblas" ,openblas)
5310 ("metis" ,metis)
5311 ("python" ,python)
5312 ("superlu" ,superlu)
5313 ("gmp" ,gmp)))
5314 (native-inputs
5315 `(("gfortran" ,gfortran)
5316 ("pkg-config" ,pkg-config)))
5317 (home-page "https://dune-project.org/")
5318 (synopsis "Distributed and Unified Numerics Environment")
5319 (description "The dune-functions module provides an abstraction layer for
5320global finite element functions. Its two main concepts are functions
5321implemented as callable objects, and bases of finite element spaces.")
5322 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
5323 (license (list license:lgpl3+ license:gpl2))))
4714b00e
RW
5324
5325(define-public dune-pdelab
5326 (package
5327 (name "dune-pdelab")
6ca2d7da 5328 (version "2.7.0-git-476fe437")
4714b00e
RW
5329 (source
5330 (origin
5331 (method git-fetch)
5332 (uri (git-reference
5333 (url "https://gitlab.dune-project.org/pdelab/dune-pdelab")
6ca2d7da 5334 (commit "476fe43763fa6f459c5e4658e2a2b4b5582db834")))
4714b00e
RW
5335 (file-name (git-file-name name version))
5336 (sha256
5337 (base32
6ca2d7da 5338 "0cs36piqzn6rq0j2ih3ab3q3q9yg199wk72k5qi86pkzh7i7fdn1"))))
4714b00e
RW
5339 (build-system cmake-build-system)
5340 (arguments '(#:tests? #f)) ; XXX: the tests cannot be compiled
5341 (inputs
5342 `(("dune-common" ,dune-common)
5343 ("dune-istl" ,dune-istl)
5344 ("dune-localfunctions" ,dune-localfunctions)
5345 ("dune-geometry" ,dune-geometry)
5346 ("dune-grid" ,dune-grid)
5347 ("dune-typetree" ,dune-typetree)
5348 ("dune-functions" ,dune-functions)
4714b00e
RW
5349 ;; Optional
5350 ("openblas" ,openblas)
5351 ("eigen" ,eigen)
5352 ("metis" ,metis)
5353 ("python" ,python)
5354 ("superlu" ,superlu)
5355 ("gmp" ,gmp)))
5356 (native-inputs
5357 `(("gfortran" ,gfortran)
5358 ("pkg-config" ,pkg-config)))
5359 (home-page "https://dune-project.org/")
5360 (synopsis "Differential equations solver toolbox")
5361 (description "PDELab is a partial differential equations solver toolbox
5362built on top of DUNE, the Distributed and Unified Numerics Environment.")
5363 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
5364 (license (list license:lgpl3+ license:gpl2))))
413f6126 5365
6ceb7716
FG
5366(define add-openmpi-to-dune-package
5367 (let ((dune-package?
5368 (lambda (p) (string-prefix? "dune-" (package-name p)))))
5369 (package-mapping
5370 (lambda (p)
5371 (if (dune-package? p)
5372 (package (inherit p)
5373 (name (string-append (package-name p) "-openmpi"))
5374 (inputs `(,@(package-inputs p)
5375 ("openmpi" ,openmpi)))
5376 (arguments
5377 (substitute-keyword-arguments (package-arguments p)
5378 ((#:phases phases '%standard-phases)
5379 `(modify-phases ,phases
5380 (add-before 'check 'mpi-setup
5381 ,%openmpi-setup)))))
5382 (synopsis (string-append (package-synopsis p) " (with MPI support)")))
5383 p))
5384 (negate dune-package?))))
5385
5386(define-public dune-common-openmpi
5387 (add-openmpi-to-dune-package dune-common))
5388
5389(define-public dune-geometry-openmpi
5390 (add-openmpi-to-dune-package dune-geometry))
5391
5392(define-public dune-istl-openmpi
5393 (add-openmpi-to-dune-package dune-istl))
5394
5395(define-public dune-typetree-openmpi
5396 (add-openmpi-to-dune-package dune-typetree))
5397
5398(define-public dune-uggrid-openmpi
5399 (add-openmpi-to-dune-package dune-uggrid))
5400
5401(define-public dune-grid-openmpi
5402 (add-openmpi-to-dune-package dune-grid))
5403
5404(define-public dune-alugrid-openmpi
5405 (add-openmpi-to-dune-package dune-alugrid))
5406
5407(define-public dune-subgrid-openmpi
5408 (add-openmpi-to-dune-package dune-subgrid))
5409
5410(define-public dune-localfunctions-openmpi
5411 (add-openmpi-to-dune-package dune-localfunctions))
5412
5413(define-public dune-functions-openmpi
5414 (add-openmpi-to-dune-package dune-functions))
5415
5416(define-public dune-pdelab-openmpi
5417 (add-openmpi-to-dune-package dune-pdelab))
5418
413f6126
AI
5419(define-public mlucas
5420 (package
5421 (name "mlucas")
5422 (version "18")
5423 (source
5424 (origin
5425 (method url-fetch)
5426 (uri (string-append
5427 "https://mersenneforum.org/mayer/src/C/mlucas_v" version ".txz"))
5428 (sha256
a36efdbc 5429 (base32 "0h4xj6pyyac79ka5ibqjilfa3s9j3yxnzgpwc57b54kfh2bj3447"))))
413f6126
AI
5430 (build-system gnu-build-system)
5431 (inputs
5432 `(("python2" ,python-2)))
5433 (arguments
a36efdbc 5434 `(#:tests? #f ; no tests
413f6126
AI
5435 #:phases
5436 (modify-phases %standard-phases
5437 (replace 'configure
5438 (lambda _
5439 (chdir "src")
5440 (call-with-output-file "Makefile"
5441 (lambda (port)
5442 (format port "CC = gcc
5443CFLAGS = -O3 ~a -DUSE_THREADS
5444LDLIBS = -lm -lpthread -lrt
5445Mlucas: $(addsuffix .o,$(basename $(wildcard *.c)))
5446"
5447 ,(let ((system (or (%current-target-system)
5448 (%current-system))))
5449 (cond
5450 ((string-prefix? "x86_64" system) "-DUSE_SSE2")
5451 (else ""))))))
5452 #t))
5453 (replace 'install
5454 (lambda* (#:key outputs #:allow-other-keys)
5455 (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
5456 (install-file "Mlucas" bin)
5457 (install-file "primenet.py" bin))
5458 #t)))))
5459 (home-page "https://www.mersenne.org")
5460 (synopsis "Great Internet Mersenne Prime Search (GIMPS) distributed computing client")
5461 (description "Mlucas performs Lucas-Lehmer primality testing of Mersenne
5462numbers in search of a world-record prime. You may use it to test any
5463suitable number as you wish, but it is preferable that you do so in a
5464coordinated fashion, as part of the Great Internet Mersenne Prime
5465Search (GIMPS). Mlucas also includes a simple Python script for assignment
5466management via the GIMPS project's Primenet server.")
5467 (license license:gpl2+)))
6f8c4195
NG
5468
5469(define-public nauty
5470 (package
5471 (name "nauty")
4b01930f
NG
5472 (version "2.7r1")
5473 (source
5474 (origin
5475 (method url-fetch)
5476 (uri (string-append
5477 "https://pallini.di.uniroma1.it/"
5478 "nauty" (string-join (string-split version #\.) "") ".tar.gz"))
5479 (sha256
5480 (base32 "0xsfqfcknbd6g6wzpa5l7crmmk3bf3zjh37rhylq6b20dqcmvjkn"))))
6f8c4195
NG
5481 (build-system gnu-build-system)
5482 (outputs '("out" "lib"))
5483 (arguments
5484 `(#:test-target "checks"
4b01930f 5485 #:configure-flags '("--enable-generic") ;prevent -march-native
6f8c4195
NG
5486 #:phases
5487 (modify-phases %standard-phases
5488 ;; Default make target does not build all available
5489 ;; executables. Create them now.
5490 (add-after 'build 'build-extra-programs
5491 (lambda _
5492 (for-each (lambda (target) (invoke "make" target))
5493 '("blisstog" "bliss2dre" "checks6" "sumlines"))
5494 #t))
5495 ;; Upstream does not provide any install target.
5496 (replace 'install
5497 (lambda* (#:key outputs #:allow-other-keys)
5498 (let* ((out (assoc-ref outputs "out"))
5499 (lib-output (assoc-ref outputs "lib"))
5500 (bin (string-append out "/bin"))
5501 (doc (string-append out "/share/doc/nauty/"))
5502 (include (string-append lib-output "/include/nauty"))
5503 (lib (string-append lib-output "/lib/nauty")))
5504 (for-each (lambda (f) (install-file f bin))
4b01930f
NG
5505 '("addedgeg" "amtog" "assembleg" "biplabg" "blisstog"
5506 "bliss2dre" "catg" "checks6" "complg" "converseg"
5507 "copyg" "countg" "cubhamg" "deledgeg" "delptg"
5508 "directg" "dreadnaut" "dretodot" "dretog" "genbg"
6f8c4195
NG
5509 "genbgL" "geng" "genquarticg" "genrang" "genspecialg"
5510 "gentourng" "gentreeg" "hamheuristic" "labelg"
5511 "linegraphg" "listg" "multig" "newedgeg" "pickg"
5512 "planarg" "ranlabg" "shortg" "showg" "subdivideg"
4b01930f
NG
5513 "sumlines" "twohamg" "underlyingg" "vcolg"
5514 "watercluster2" "NRswitchg"))
6f8c4195
NG
5515 (for-each (lambda (f) (install-file f include))
5516 (find-files "." "\\.h$"))
5517 (for-each (lambda (f) (install-file f lib))
5518 (find-files "." "\\.a$"))
5519 (for-each (lambda (f) (install-file f doc))
5520 (append '("formats.txt" "README" "schreier.txt")
5521 (find-files "." "\\.pdf$")))))))))
5522 (inputs
5523 `(("gmp" ,gmp))) ;for sumlines
5524 (home-page "https://pallini.di.uniroma1.it/")
5525 (synopsis "Library for graph automorphisms")
5526 (description "@code{nauty} (No AUTomorphisms, Yes?) is a set of
5527procedures for computing automorphism groups of graphs and digraphs.
5528
5529@code{nauty} computes graph information in the form of a set of
5530generators, the size of the group, and the orbits of the group; it can
5531also produce a canonical label. The @code{nauty} suite is written in
5532C and comes with a command-line interface, a collection of
5533command-line tools, and an Application Programming Interface (API).
5534
5535This package provides the static libraries required to run programs
5536compiled against the nauty library.")
5537 (license license:asl2.0)))
26433471
AE
5538
5539(define-public ppl
5540 (package
5541 (name "ppl")
5542 (version "1.2")
5543 (source
5544 (origin
5545 (method url-fetch)
5546 (uri (string-append "https://www.bugseng.com/products/ppl/download/"
5547 "ftp/releases/" version
5548 "/ppl-" version ".tar.gz"))
5549 (sha256
5550 (base32
5551 "1j5aji1g2vmdvc0gqz45n2ll2l2f6czca04wiyfl5g3sm3a6vhvb"))))
5552 (build-system gnu-build-system)
5553 (native-inputs
5554 `(("m4", m4)))
5555 (inputs
5556 `(("glpk" ,glpk)
5557 ("gmp", gmp)))
5558 (home-page "https://www.bugseng.com/parma-polyhedra-library")
5559 (synopsis
5560 "Parma Polyhedra Library for computations with polyhedra")
5561 (description
5562 "The Parma Polyhedra Library (PPL) provides numerical abstractions
5563especially targeted at applications in the field of analysis and
5564verification of complex systems. These abstractions include convex
5565polyhedra, defined as the intersection of a finite number of (open or
5566closed) halfspaces, each described by a linear inequality (strict or
5567non-strict) with rational coefficients; some special classes of polyhedra
5568shapes that offer interesting complexity/precision tradeoffs; and grids
5569which represent regularly spaced points that satisfy a set of linear
5570congruence relations. The library also supports finite powersets and
5571products of (any kind of) polyhedra and grids, a mixed integer linear
5572programming problem solver using an exact-arithmetic version of the simplex
5573algorithm, a parametric integer programming solver, and primitives for
5574termination analysis via the automatic synthesis of linear ranking
5575functions.")
5576 (license license:gpl3+)))
4cb5d251
SS
5577
5578(define-public speedcrunch
5579 (package
5580 (name "speedcrunch")
5581 (version "0.12.0")
5582 (source
5583 (origin
5584 (method git-fetch)
5585 (uri (git-reference
5586 (url "https://bitbucket.org/heldercorreia/speedcrunch.git")
5587 (commit (string-append "release-" version))))
5588 (file-name (git-file-name name version))
5589 (sha256
5590 (base32
5591 "0vh7cd1915bjqzkdp3sk25ngy8cq624mkh8c53c5bnzk357kb0fk"))))
5592 (build-system cmake-build-system)
5593 (inputs `(("qtbase" ,qtbase)))
5594 (native-inputs `(("qttools" ,qttools)))
5595 (arguments
5596 `(#:phases
5597 (modify-phases %standard-phases
5598 (add-after 'unpack 'chdir-to-src
5599 (lambda _ (chdir "src") #t)))))
5600 (synopsis "High-precision scientific calculator")
5601 (description
5602 "SpeedCrunch is a high-precision scientific calculator. It features a
5603syntax-highlighted scrollable display and is designed to be fully used via
5604keyboard. Some distinctive features are auto-completion of functions and
5605variables, a formula book, and quick insertion of constants from various
5606fields of knowledge.")
80fafdba 5607 (home-page "https://speedcrunch.org/")
4cb5d251
SS
5608 (license license:gpl2+)))
5609
3b7828cc
RS
5610(define-public minisat
5611 ;; This is the last commit which is available upstream, no
5612 ;; release happened since 2010.
5613 (let ((commit "37dc6c67e2af26379d88ce349eb9c4c6160e8543")
5614 (revision "1"))
5615 (package
5616 (name "minisat")
5617 (version (string-append "2.2.0-" revision "." (string-take commit 7)))
5618 (source
5619 (origin
5620 (method git-fetch)
5621 (uri (git-reference
b0e7b699 5622 (url "https://github.com/niklasso/minisat")
3b7828cc
RS
5623 (commit commit)))
5624 (file-name (string-append name "-" version "-checkout"))
5625 (sha256
5626 (base32
5627 "091hf3qkm197s5r7xcr3m07xsdwyz2rqk1hc9kj0hn13imz09irq"))
5628 (patches
5629 (search-patches "minisat-friend-declaration.patch"
5630 "minisat-install.patch"))))
5631 (build-system gnu-build-system)
5632 (arguments
5633 '(#:make-flags (list (string-append "prefix=" %output))
5634 #:tests? #f ;no check target
5635 #:phases
5636 (modify-phases %standard-phases
5637 (delete 'configure))))
5638 (inputs
5639 `(("zlib:static" ,zlib "static")
5640 ("zlib" ,zlib)))
5641 (synopsis
5642 "Small, yet efficient, SAT solver")
5643 (description
5644 "MiniSat is a minimalistic, open-source SAT solver, developed to help
5645researchers and developers alike to get started on SAT.")
5646 (home-page
5647 "http://minisat.se/MiniSat.html")
5648 (license license:expat))))
70c98efa
VK
5649
5650(define-public libqalculate
5651 (package
5652 (name "libqalculate")
5653 (version "3.8.0")
5654 (source
5655 (origin
5656 (method git-fetch)
5657 (uri (git-reference
5658 (url "https://github.com/Qalculate/libqalculate/")
5659 (commit (string-append "v" version))))
5660 (file-name (git-file-name name version))
5661 (sha256
9b3c231e
VK
5662 (base32 "1vbaza9c7159xf2ym90l0xkyj2mp6c3hbghhsqn29yvz08fda9df"))
5663 (patches
5664 (search-patches "libqalculate-3.8.0-libcurl-ssl-fix.patch"))))
70c98efa
VK
5665 (build-system gnu-build-system)
5666 (native-inputs
5667 `(("pkg-config" ,pkg-config)
5668 ("gettext" ,gettext-minimal)
5669 ("intltool" ,intltool)
5670 ("automake" ,automake)
5671 ("autoconf" ,autoconf)
5672 ("libtool" ,libtool)
5673 ("doxygen" ,doxygen)
5674 ("file" ,file)))
5675 (inputs
5676 `(("gmp" ,gmp)
5677 ("mpfr" ,mpfr)
5678 ("libxml2" ,libxml2)
5679 ("curl" ,curl)
5680 ("icu4c" ,icu4c)
5681 ("gnuplot" ,gnuplot)
5682 ("readline" ,readline)
5683 ("libiconv" ,libiconv)))
5684 (arguments
5685 `(#:phases
5686 (modify-phases %standard-phases
5687 (add-before 'bootstrap 'setenv
5688 ;; Prevent the autogen.sh script to carry out the configure
5689 ;; script, which has not yet been patched to replace /bin/sh.
5690 (lambda _
5691 (setenv "NOCONFIGURE" "TRUE")
5692 #t)))))
5693 (home-page "https://qalculate.github.io/")
5694 (synopsis "Multi-purpose cli desktop calculator and library")
5695 (description
5696 "Libqalculate is a multi-purpose cli desktop calculator and library.
5697It provides basic and advanced functionality. Features include customizable
5698functions, unit calculations, and conversions, physical constants, symbolic
5699calculations (including integrals and equations), arbitrary precision,
67e2e171 5700uncertainty propagation, interval arithmetic, plotting and a user-friendly
70c98efa
VK
5701cli.")
5702 (license license:gpl2+)))
72c71d24
VK
5703
5704(define-public qalculate-gtk
5705 (package
5706 (name "qalculate-gtk")
5707 (version "3.8.0")
5708 (source
5709 (origin
5710 (method git-fetch)
5711 (uri (git-reference
5712 (url "https://github.com/Qalculate/qalculate-gtk/")
5713 (commit (string-append "v" version))))
5714 (file-name (git-file-name name version))
5715 (sha256
5716 (base32 "0nsg6dzg5r7rzqr671nvrf1c50rjwpz7bxv5f20i4s7agizgv840"))))
5717 (build-system glib-or-gtk-build-system)
5718 (native-inputs
5719 `(("pkg-config" ,pkg-config)
5720 ("intltool" ,intltool)
5721 ("automake" ,automake)
5722 ("autoconf" ,autoconf)
5723 ("libtool" ,libtool)
5724 ("file" ,file)))
5725 (inputs
5726 `(("gmp" ,gmp)
5727 ("mpfr" ,mpfr)
5728 ("libqalculate" ,libqalculate)
5729 ("libxml2" ,libxml2)
5730 ("glib" ,glib)
5731 ("gtk+" ,gtk+)))
5732 (arguments
5733 `(#:phases
5734 (modify-phases %standard-phases
5735 (add-before 'bootstrap 'setenv
5736 ;; Prevent the autogen.sh script to carry out the configure
5737 ;; script, which has not yet been patched to replace /bin/sh.
5738 (lambda _
5739 (setenv "NOCONFIGURE" "TRUE")
5740 #t))
5741 (add-before 'check 'add-pot-file
5742 ;; the file contains translations and are currently not in use
5743 ;; left out on purpose so add it to POTFILES.skip
5744 (lambda _
5745 (with-output-to-file "po/POTFILES.skip"
5746 (lambda _
5747 (format #t "data/shortcuts.ui~%")
5748 #t))
5749 #t)))))
5750 (home-page "https://qalculate.github.io/")
5751 (synopsis "Multi-purpose graphical desktop calculator")
5752 (description
5753 "Qalculate-gtk is the GTK frontend for libqalculate. It is a
5754multi-purpose GUI desktop calculator. It provides basic and advanced
5755functionality. Features include customizable functions, unit calculations,
5756and conversions, physical constants, symbolic calculations (including
1480d212 5757integrals and equations), arbitrary precision, uncertainty propagation,
72c71d24
VK
5758interval arithmetic, plotting.")
5759 (license license:gpl2+)))