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