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