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