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