gnu: rtl-sdr: Use HTTPS URL.
[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
266 (url "https://github.com/cvxopt/cvxopt.git")
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
843 (url "https://github.com/OkoSanto/GCTP.git")
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
1343 (url "https://github.com/Blosc/hdf5-blosc.git")
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
1826 (url "https://github.com/tpaviot/oce.git")
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
2026 (url "https://github.com/gerddie/maxflow.git")
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
2421 (url "https://github.com/metamath/metamath-exe.git")
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")
2619 (version "1.0.4")
2620 (source
2621 (origin
2622 (method url-fetch)
2623 (uri (rubygems-uri "asciimath" version))
2624 (sha256
2625 (base32
2626 "1d80kiph5mc78zps7si1hv48kv4k12mzaq8jk5kb3pqpjdr72qmc"))))
2627 (build-system ruby-build-system)
2628 (arguments
2629 '(#:phases
2630 (modify-phases %standard-phases
2631 ;; Apply this patch
2632 ;; https://github.com/asciidoctor/asciimath/commit/1c06fdc8086077f4785479f78b0823a4a72d7948
2633 (add-after 'unpack 'patch-remove-spurious-backslashes
2634 (lambda _
2635 (substitute* "spec/parser_spec.rb"
2636 (("\\\\\"")
9923d5a4
TGR
2637 "\""))
2638 #t)))))
63e07468
BW
2639 (native-inputs
2640 `(("bundler" ,bundler)
2641 ("ruby-rspec" ,ruby-rspec)))
2642 (synopsis "AsciiMath parsing and conversion library")
2643 (description
2644 "A pure Ruby AsciiMath parsing and conversion library. AsciiMath is an
2645easy-to-write markup language for mathematics.")
2646 (home-page "https://github.com/asciidoctor/asciimath")
2647 (license license:expat)))
2648
183e44ae
EB
2649(define-public superlu
2650 (package
2651 (name "superlu")
995a09e0 2652 (version "5.2.1")
183e44ae
EB
2653 (source
2654 (origin
2655 (method url-fetch)
48fe5c36 2656 (uri (string-append "https://portal.nersc.gov/project/sparse/superlu/"
183e44ae
EB
2657 "superlu_" version ".tar.gz"))
2658 (sha256
995a09e0
EB
2659 (base32 "0qzlb7cd608q62kyppd0a8c65l03vrwqql6gsm465rky23b6dyr8"))
2660 (modules '((guix build utils)))
2661 (snippet
2662 ;; Replace the non-free implementation of MC64 with a stub adapted
2663 ;; from Debian
2664 '(begin
2665 (use-modules (ice-9 regex)
2666 (ice-9 rdelim))
2667 (call-with-output-file "SRC/mc64ad.c"
2668 (lambda (port)
2669 (display "
2670#include <stdio.h>
2671#include <stdlib.h>
2672void mc64id_(int *a) {
2673 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
2674 abort ();
2675}
2676void mc64ad_ (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
2677 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
2678 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
2679 abort ();
2680}\n" port)))
2681 ;; Remove the corresponding license verbiage. MC64 license follows
2682 ;; a "------" line separator.
2683 (with-atomic-file-replacement "License.txt"
2684 (let ((rx (make-regexp "-{8}")))
2685 (lambda (in out)
2686 (let loop ()
2687 (let ((line (read-line in 'concat)))
2688 (unless (regexp-exec rx line)
2689 (display line out)
6cbee49d
MW
2690 (loop))))
2691 #t)))))))
995a09e0 2692 (build-system cmake-build-system)
183e44ae
EB
2693 (native-inputs
2694 `(("tcsh" ,tcsh)))
2695 (inputs
995a09e0 2696 `(("blas" ,openblas)
19afbea1 2697 ("gfortran" ,gfortran)))
183e44ae 2698 (arguments
995a09e0
EB
2699 `(#:configure-flags '("-Denable_blaslib:BOOL=NO" ;do not use internal cblas
2700 "-DTPL_BLAS_LIBRARIES=openblas"
677bc34d 2701 "-DBUILD_SHARED_LIBS:BOOL=YES")))
48fe5c36 2702 (home-page "https://portal.nersc.gov/project/sparse/superlu/")
183e44ae
EB
2703 (synopsis "Supernodal direct solver for sparse linear systems")
2704 (description
2705 "SuperLU is a general purpose library for the direct solution of large,
2706sparse, nonsymmetric systems of linear equations on high performance machines.
2707The library is written in C and is callable from either C or Fortran. The
2708library routines perform an LU decomposition with partial pivoting and
2709triangular system solves through forward and back substitution. The library
2710also provides threshold-based ILU factorization preconditioners.")
995a09e0
EB
2711 (license (list license:bsd-3
2712 license:gpl2+ ;EXAMPLE/*fgmr.c
2713 (license:fsf-free "file://SRC/colamd.h")))))
f8ed036a 2714
a54aefea
EB
2715(define-public superlu-dist
2716 (package
2717 (name "superlu-dist")
aa2e83cc 2718 (version "6.2.0")
a54aefea
EB
2719 (source
2720 (origin
2721 (method url-fetch)
aa2e83cc 2722 (uri (string-append "https://portal.nersc.gov/project/sparse/superlu/"
a54aefea
EB
2723 "superlu_dist_" version ".tar.gz"))
2724 (sha256
aa2e83cc 2725 (base32 "1ynmwqajc9sc3my2hssa5k9s58ggvizqv9rdss0j7w99pbh5mnvw"))
0921eff2 2726 (modules '((guix build utils)))
29080870
EB
2727 (snippet
2728 ;; Replace the non-free implementation of MC64 with a stub
2729 '(begin
0921eff2 2730 (call-with-output-file "SRC/mc64ad_dist.c"
29080870
EB
2731 (lambda (port)
2732 (display "
2733#include <stdio.h>
2734#include <stdlib.h>
0921eff2 2735void mc64id_dist(int *a) {
29080870
EB
2736 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
2737 abort ();
2738}
0921eff2 2739void mc64ad_dist (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
29080870
EB
2740 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
2741 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
2742 abort ();
2743}\n" port)))
29080870 2744 (substitute* "SRC/util.c" ;adjust default algorithm
6161141e
EB
2745 (("RowPerm[[:blank:]]*=[[:blank:]]*LargeDiag_MC64;")
2746 ;; TODO: set to "LargeDiag_AWPM" once combinatorial-blas has
2747 ;; general (i.e. non-square) processor-grid support.
2748 "RowPerm = NOROWPERM;"))
6cbee49d 2749 #t))
6161141e 2750 (patches (search-patches "superlu-dist-scotchmetis.patch"
aa2e83cc 2751 "superlu-dist-awpm-grid.patch"))))
6161141e 2752 (build-system cmake-build-system)
a54aefea
EB
2753 (native-inputs
2754 `(("tcsh" ,tcsh)))
2755 (inputs
6161141e
EB
2756 `(("gfortran" ,gfortran)
2757 ("blas" ,openblas)
2758 ("lapack" ,lapack)
2759 ("combblas" ,combinatorial-blas)))
a54aefea 2760 (propagated-inputs
6161141e
EB
2761 `(("mpi" ,openmpi) ;headers include MPI heades
2762 ("parmetis" ,pt-scotch32 "metis")
2763 ("pt-scotch" ,pt-scotch32)))
a54aefea 2764 (arguments
6161141e
EB
2765 `(#:parallel-tests? #f ;tests use MPI and OpenMP
2766 #:configure-flags (list "-DBUILD_SHARED_LIBS:BOOL=YES"
2767 "-DTPL_ENABLE_COMBBLASLIB=YES"
2768 "-DTPL_BLAS_LIBRARIES=-lopenblas"
2769 "-DTPL_LAPACK_LIBRARIES=-llapack"
2770 (string-append "-DTPL_PARMETIS_LIBRARIES="
2771 (string-join
2772 '("ptscotchparmetis" "ptscotch" "ptscotcherr"
2773 "scotchmetis" "scotch" "scotcherr")
2774 ";"))
2775 (string-append "-DTPL_PARMETIS_INCLUDE_DIRS="
2776 (assoc-ref %build-inputs "parmetis")
2777 "/include")
2778 "-DTPL_ENABLE_COMBBLASLIB=ON"
2779 (string-append "-DTPL_COMBBLAS_INCLUDE_DIRS="
2780 (assoc-ref %build-inputs "combblas")
2781 "/include/CombBLAS;"
2782 (assoc-ref %build-inputs "combblas")
2783 "/include/BipartiteMatchings")
2784 "-DTPL_COMBBLAS_LIBRARIES=CombBLAS")
a54aefea 2785 #:phases
dc1d3cde 2786 (modify-phases %standard-phases
6161141e 2787 (add-before 'configure 'set-c++-standard
dc1d3cde 2788 (lambda _
6161141e
EB
2789 (substitute* "CMakeLists.txt"
2790 ;; AWPM headers require C++14
2791 (("CMAKE_CXX_STANDARD 11") "CMAKE_CXX_STANDARD 14"))))
bbe46a4a
EB
2792 (add-before 'check 'mpi-setup
2793 ,%openmpi-setup)
6161141e
EB
2794 (add-before 'check 'omp-setup
2795 (lambda _ (setenv "OMP_NUM_THREADS" "1") #t)))))
a54aefea
EB
2796 (home-page (package-home-page superlu))
2797 (synopsis "Parallel supernodal direct solver")
2798 (description
2799 "SuperLU_DIST is a parallel extension to the serial SuperLU library.
2800It is targeted for distributed memory parallel machines. SuperLU_DIST is
2801implemented in ANSI C, and MPI for communications.")
2802 (license license:bsd-3)))
2803
f8ed036a
EB
2804(define-public scotch
2805 (package
2806 (name "scotch")
fd373343 2807 (version "6.0.6")
f8ed036a
EB
2808 (source
2809 (origin
2810 (method url-fetch)
1dc31097
TGR
2811 (uri (string-append "https://gforge.inria.fr/frs/download.php/"
2812 "latestfile/298/scotch_" version ".tar.gz"))
f8ed036a 2813 (sha256
fd373343
EB
2814 (base32 "1ky4k9r6jvajhqaqnnx6h8fkmds2yxgp70dpr1qzwcyhi2nhqvv8"))
2815 (patches (search-patches "scotch-build-parallelism.patch"
2816 "scotch-integer-declarations.patch"))))
f8ed036a
EB
2817 (build-system gnu-build-system)
2818 (inputs
525e83ec
VL
2819 `(("zlib" ,zlib)))
2820 (native-inputs
2821 `(("flex" ,flex)
f8ed036a 2822 ("bison" ,bison)))
fd373343 2823 (outputs '("out" "metis"))
f8ed036a 2824 (arguments
fd373343
EB
2825 `(#:make-flags (list (string-append "prefix=" %output))
2826 #:phases
d6602ee9
EB
2827 (modify-phases %standard-phases
2828 (add-after
2829 'unpack 'chdir-to-src
d67a7e9e 2830 (lambda _ (chdir "src") #t))
d6602ee9
EB
2831 (replace
2832 'configure
2833 (lambda _
2834 (call-with-output-file "Makefile.inc"
2835 (lambda (port)
2836 (format port "
f8ed036a
EB
2837EXE =
2838LIB = .a
2839OBJ = .o
2840MAKE = make
2841AR = ar
2842ARFLAGS = -ruv
cf0ec6c4 2843CAT = cat
f8ed036a
EB
2844CCS = gcc
2845CCP = mpicc
2846CCD = gcc
2847CPPFLAGS =~{ -D~a~}
6c798540 2848CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
f8ed036a
EB
2849LDFLAGS = -lz -lm -lrt -lpthread
2850CP = cp
2851LEX = flex -Pscotchyy -olex.yy.c
2852LN = ln
2853MKDIR = mkdir
2854MV = mv
2855RANLIB = ranlib
2856YACC = bison -pscotchyy -y -b y
2857"
d6602ee9
EB
2858 '("COMMON_FILE_COMPRESS_GZ"
2859 "COMMON_PTHREAD"
2860 "COMMON_RANDOM_FIXED_SEED"
fd373343 2861 "INTSIZE64" ;use 'int64_t'
cf0ec6c4
EB
2862 ;; Prevents symbolc clashes with libesmumps
2863 "SCOTCH_RENAME"
d6602ee9
EB
2864 ;; XXX: Causes invalid frees in superlu-dist tests
2865 ;; "SCOTCH_PTHREAD"
2866 ;; "SCOTCH_PTHREAD_NUMBER=2"
d67a7e9e
TGR
2867 "restrict=__restrict"))))
2868 #t))
bbe46a4a 2869 (add-after 'build 'build-esmumps
cf0ec6c4 2870 (lambda _
d67a7e9e
TGR
2871 (invoke "make"
2872 (format #f "-j~a" (parallel-job-count))
2873 "esmumps")))
fd373343
EB
2874 (add-before 'install 'make-install-dirs
2875 (lambda* (#:key outputs #:allow-other-keys)
2876 (mkdir (assoc-ref outputs "out"))))
2877 (add-after 'install 'install-metis
2878 (lambda* (#:key outputs #:allow-other-keys)
2879 (let ((out (assoc-ref outputs "metis")))
2880 (mkdir out)
2881 ;; metis files are not installed with 'make install'
2882 (for-each (lambda (f)
2883 (install-file f (string-append out "/include")))
2884 (find-files "../include/" ".*metis\\.h"))
2885 (for-each (lambda (f)
2886 (install-file f (string-append out "/lib")))
2887 (find-files "../lib/" ".*metis\\..*"))
2888 #t))))))
d5730000 2889 (home-page "https://www.labri.fr/perso/pelegrin/scotch/")
f8ed036a
EB
2890 (synopsis "Programs and libraries for graph algorithms")
2891 (description "SCOTCH is a set of programs and libraries which implement
2892the static mapping and sparse matrix reordering algorithms developed within
2893the SCOTCH project. Its purpose is to apply graph theory, with a divide and
2894conquer approach, to scientific computing problems such as graph and mesh
2895partitioning, static mapping, and sparse matrix ordering, in application
2896domains ranging from structural mechanics to operating systems or
2897bio-chemistry.")
2898 ;; See LICENSE_en.txt
2899 (license license:cecill-c)))
6acb4adb 2900
1c39f3b8
PG
2901(define-public scotch32
2902 ;; This is the 'INTSIZE32' variant, which uses 32-bit integers, as needed by
2903 ;; some applications.
2904 (package (inherit scotch)
2905 (name "scotch32")
2906 (arguments
2907 (substitute-keyword-arguments (package-arguments scotch)
2908 ((#:phases scotch-phases)
2909 `(modify-phases ,scotch-phases
2910 (replace
2911 'configure
2912 (lambda _
2913 (call-with-output-file "Makefile.inc"
2914 (lambda (port)
2915 (format port "
2916EXE =
2917LIB = .a
2918OBJ = .o
2919MAKE = make
2920AR = ar
2921ARFLAGS = -ruv
2922CAT = cat
2923CCS = gcc
2924CCP = mpicc
2925CCD = gcc
2926CPPFLAGS =~{ -D~a~}
2927CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
2928LDFLAGS = -lz -lm -lrt -lpthread
2929CP = cp
2930LEX = flex -Pscotchyy -olex.yy.c
2931LN = ln
2932MKDIR = mkdir
2933MV = mv
2934RANLIB = ranlib
2935YACC = bison -pscotchyy -y -b y
2936"
2937 '("COMMON_FILE_COMPRESS_GZ"
2938 "COMMON_PTHREAD"
2939 "COMMON_RANDOM_FIXED_SEED"
2940 "INTSIZE32" ;use 32-bit integers. See INSTALL.txt
2941 ;; Prevents symbolc clashes with libesmumps
2942 "SCOTCH_RENAME"
2943 ;; XXX: Causes invalid frees in superlu-dist tests
2944 ;; "SCOTCH_PTHREAD"
2945 ;; "SCOTCH_PTHREAD_NUMBER=2"
2946 "restrict=__restrict"))))))))))
2947 (synopsis
2948 "Programs and libraries for graph algorithms (32-bit integers)")))
2949
6acb4adb
EB
2950(define-public pt-scotch
2951 (package (inherit scotch)
2952 (name "pt-scotch")
2953 (propagated-inputs
2954 `(("openmpi" ,openmpi))) ;Headers include MPI headers
2955 (arguments
2956 (substitute-keyword-arguments (package-arguments scotch)
2957 ((#:phases scotch-phases)
d6602ee9
EB
2958 `(modify-phases ,scotch-phases
2959 (replace
2960 'build
d6602ee9 2961 (lambda _
c491f7f8
LC
2962 (invoke "make" (format #f "-j~a" (parallel-job-count))
2963 "ptscotch" "ptesmumps")
2964
2965 ;; Install the serial metis compatibility library
2966 (invoke "make" "-C" "libscotchmetis" "install")))
2967 (add-before 'check 'mpi-setup
2968 ,%openmpi-setup)
2969 (replace 'check
2970 (lambda _
2971 (invoke "make" "ptcheck")))))))
6acb4adb 2972 (synopsis "Programs and libraries for graph algorithms (with MPI)")))
5698b8b8 2973
1c25a52c
PG
2974(define-public pt-scotch32
2975 (package (inherit scotch32)
2976 (name "pt-scotch32")
2977 (propagated-inputs
2978 `(("openmpi" ,openmpi))) ;headers include MPI headers
2979 (arguments
c4d4a779
PG
2980 (substitute-keyword-arguments (package-arguments scotch32)
2981 ((#:phases scotch32-phases)
2982 `(modify-phases ,scotch32-phases
1c25a52c
PG
2983 (replace 'build
2984 (lambda _
c491f7f8
LC
2985 (invoke "make" (format #f "-j~a" (parallel-job-count))
2986 "ptscotch" "ptesmumps")
2987 ;; Install the serial metis compatibility library
2988 (invoke "make" "-C" "libscotchmetis" "install")))
2989 (add-before 'check 'mpi-setup
2990 ,%openmpi-setup)
1c25a52c
PG
2991 (replace 'check
2992 (lambda _
c491f7f8 2993 (invoke "make" "ptcheck")))))))
1c25a52c
PG
2994 (synopsis
2995 "Programs and libraries for graph algorithms (with MPI and 32-bit integers)")))
2996
aa75ad00
EB
2997(define-public metis
2998 (package
2999 (name "metis")
3000 (version "5.1.0")
3001 (source
3002 (origin
3003 (method url-fetch)
3004 (uri (string-append "http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/"
3005 "metis-" version ".tar.gz"))
3006 (sha256
3007 (base32
3008 "1cjxgh41r8k6j029yxs8msp3z6lcnpm16g5pvckk35kc7zhfpykn"))))
3009 (build-system cmake-build-system)
3010 (inputs
3011 `(("blas" ,openblas)))
3012 (arguments
3013 `(#:tests? #f ;no tests
3014 #:configure-flags `("-DSHARED=ON"
3015 ,(string-append "-DGKLIB_PATH=" (getcwd)
3016 "/metis-" ,version "/GKlib"))))
3017 (home-page "http://glaros.dtc.umn.edu/gkhome/metis/metis/overview")
3018 (synopsis "Graph partitioning and fill-reducing matrix ordering library")
3019 (description
3020 "METIS is a set of serial programs for partitioning graphs, partitioning
3021finite element meshes, and producing fill-reducing orderings for sparse
3022matrices. The algorithms implemented in METIS are based on the multilevel
3023recursive-bisection, multilevel k-way, and multi-constraint partitioning
3024schemes.")
3025 (license license:asl2.0))) ;As of version 5.0.3
3026
700ff222
EB
3027(define-public p4est
3028 (package
3029 (name "p4est")
4150da63 3030 (version "2.0")
700ff222
EB
3031 (source
3032 (origin
3033 (method url-fetch)
3034 (uri (string-append "http://p4est.github.io/release/p4est-"
3035 version ".tar.gz"))
3036 (sha256
3037 (base32
4150da63 3038 "16h267z256kxcxfjs390qqzv19hr58vrj4x8lndb7alnk2vca8n5"))))
700ff222
EB
3039 (build-system gnu-build-system)
3040 (inputs
3041 `(("fortran" ,gfortran)
3042 ("blas" ,openblas)
3043 ("lapack" ,lapack)
3044 ("zlib" ,zlib)))
3045 (arguments
3046 `(#:configure-flags `(,(string-append "BLAS_LIBS=-L"
3047 (assoc-ref %build-inputs "blas")
3048 " -lopenblas")
3049 ,(string-append "LAPACK_LIBS=-L"
3050 (assoc-ref %build-inputs "lapack")
6df2a50a
LC
3051 " -llapack"))
3052 #:phases (modify-phases %standard-phases
bbe46a4a
EB
3053 (add-before 'check 'mpi-setup
3054 ,%openmpi-setup))))
700ff222
EB
3055 (home-page "http://www.p4est.org")
3056 (synopsis "Adaptive mesh refinement on forests of octrees")
3057 (description
3058 "The p4est software library enables the dynamic management of a
3059collection of adaptive octrees, conveniently called a forest of octrees.
3060p4est is designed to work in parallel and scales to hundreds of thousands of
3061processor cores.")
3062 (license license:gpl2+)))
3063
3064(define-public p4est-openmpi
3065 (package (inherit p4est)
3066 (name "p4est-openmpi")
3067 (inputs
3068 `(("mpi" ,openmpi)
3069 ,@(package-inputs p4est)))
3070 (arguments
3071 (substitute-keyword-arguments (package-arguments p4est)
3072 ((#:configure-flags cf)
3073 ``("--enable-mpi" ,@,cf))))
3074 (synopsis "Parallel adaptive mesh refinement on forests of octrees")))
3075
5698b8b8
JD
3076(define-public gsegrafix
3077 (package
3078 (name "gsegrafix")
3079 (version "1.0.6")
3080 (source
3081 (origin
3082 (method url-fetch)
3083 (uri (string-append "mirror://gnu/" name "/" name "-"
3084 version ".tar.gz"))
3085 (sha256
3086 (base32
3087 "1b13hvx063zv970y750bx41wpx6hwd5ngjhbdrna8w8yy5kmxcda"))))
3088 (build-system gnu-build-system)
3089 (arguments
3090 `(#:configure-flags '("LDFLAGS=-lm")))
3091 (inputs
3092 `(("libgnomecanvas" ,libgnomecanvas)
3093 ("libbonoboui" ,libbonoboui)
3094 ("libgnomeui" ,libgnomeui)
3095 ("libgnomeprintui" ,libgnomeprintui)
3096 ("popt" ,popt)))
3097 (native-inputs
3098 `(("pkg-config" ,pkg-config)))
6fd52309 3099 (home-page "https://www.gnu.org/software/gsegrafix/")
5698b8b8
JD
3100 (synopsis "GNOME application to create scientific and engineering plots")
3101 (description "GSEGrafix is an application which produces high-quality graphical
3102plots for science and engineering. Plots are specified via simple ASCII
3103parameter files and data files and are presented in an anti-aliased GNOME
3104canvas. The program supports rectangular two-dimensional plots, histograms,
3105polar-axis plots and three-dimensional plots. Plots can be printed or saved
3106to BMP, JPEG or PNG image formats.")
3107 (license license:gpl3+)))
8731e527
JD
3108
3109(define-public maxima
3110 (package
3111 (name "maxima")
21131e9c 3112 (version "5.44.0")
8731e527
JD
3113 (source
3114 (origin
3115 (method url-fetch)
3116 (uri (string-append "mirror://sourceforge/maxima/Maxima-source/"
3117 version "-source/" name "-" version ".tar.gz"))
3118 (sha256
3119 (base32
21131e9c 3120 "1v6jr5s6hhj6r18gfk6hgxk2qd6z1dxkrjq9ss2z1y6sqi45wgyr"))
fc1adab1 3121 (patches (search-patches "maxima-defsystem-mkdir.patch"))))
8731e527 3122 (build-system gnu-build-system)
df354a77 3123 (inputs
6b2eafaa 3124 `(("gcl" ,gcl)
df354a77 3125 ("gnuplot" ,gnuplot) ;for plots
fc9c47bd 3126 ("sed" ,sed)
f36afe4d 3127 ("tk" ,tk))) ;Tcl/Tk is used by 'xmaxima'
df354a77
FB
3128 (native-inputs
3129 `(("texinfo" ,texinfo)
ccbc5758
KK
3130 ("perl" ,perl)
3131 ("python" ,python)))
8731e527 3132 (arguments
df354a77
FB
3133 `(#:configure-flags
3134 (list "--enable-gcl"
3135 (string-append "--with-posix-shell="
3136 (assoc-ref %build-inputs "bash")
3137 "/bin/sh")
3138 (string-append "--with-wish="
3139 (assoc-ref %build-inputs "tk")
3140 "/bin/wish"
3141 (let ((v ,(package-version tk)))
3142 (string-take v (string-index-right v #\.)))))
df354a77 3143 ;; By default Maxima attempts to write temporary files to
77af7b24
MW
3144 ;; '/tmp/nix-build-maxima-*', which won't exist at run time.
3145 ;; Work around that.
df354a77 3146 #:make-flags (list "TMPDIR=/tmp")
0093b126
KK
3147 #:phases
3148 (modify-phases %standard-phases
fc9c47bd
KK
3149 (add-after 'unpack 'patch-paths
3150 (lambda* (#:key inputs #:allow-other-keys)
3151 (let* ((sed (string-append (assoc-ref inputs "sed") "/bin/sed"))
3152 (coreutils (assoc-ref inputs "coreutils"))
3153 (dirname (string-append coreutils "/bin/dirname"))
ccc963d5
KK
3154 (head (string-append coreutils "/bin/head"))
3155 (perl (string-append (assoc-ref inputs "perl") "/bin/perl"))
3156 (python (string-append (assoc-ref inputs "python")
3157 "/bin/python3")))
fc9c47bd
KK
3158 (substitute* "src/maxima.in"
3159 (("sed ") (string-append sed " "))
3160 (("dirname") dirname)
3161 (("head") head))
ccc963d5
KK
3162 (substitute* "doc/info/Makefile.in"
3163 (("/usr/bin/env perl") perl))
3164 (substitute* "doc/info/build_html.sh.in"
3165 (("python") python))
fc9c47bd 3166 #t)))
0093b126
KK
3167 (add-before 'check 'pre-check
3168 (lambda _
3169 (chmod "src/maxima" #o555)
3170 #t))
1472d19a
KK
3171 (replace 'check
3172 (lambda _
3173 ;; This is derived from the testing code in the "debian/rules" file
3174 ;; of Debian's Maxima package.
3175 ;; If Maxima can successfully run this, the binary to be installed
3176 ;; should be fine.
df129041
MW
3177 (invoke "sh" "-c"
3178 (string-append
3179 "./maxima-local "
3180 "--lisp=gcl "
3181 "--batch-string=\"run_testsuite();\" "
3182 "| grep -q \"No unexpected errors found\""))))
0093b126
KK
3183 ;; Make sure the doc and emacs files are found in the
3184 ;; standard location. Also configure maxima to find gnuplot
3185 ;; without having it on the PATH.
3186 (add-after 'install 'post-install
3187 (lambda* (#:key outputs inputs #:allow-other-keys)
3188 (let* ((gnuplot (assoc-ref inputs "gnuplot"))
3189 (out (assoc-ref outputs "out"))
3190 (datadir (string-append out "/share/maxima/" ,version))
3191 (binutils (string-append (assoc-ref inputs "binutils")
3192 "/bin")))
3193 (with-directory-excursion out
3194 (mkdir-p "share/emacs")
3195 (mkdir-p "share/doc")
0093b126
KK
3196 (symlink
3197 (string-append datadir "/doc/")
3198 (string-append out "/share/doc/maxima"))
3199 (with-atomic-file-replacement
3200 (string-append datadir "/share/maxima-init.lisp")
3201 (lambda (in out)
3202 (format out "~a ~s~a~%"
3203 "(setf $gnuplot_command "
3204 (string-append gnuplot "/bin/gnuplot") ")")
3205 (dump-port in out))))
3206 ;; Ensure that Maxima will have access to the GNU binutils
3207 ;; components at runtime.
3208 (wrap-program (string-append out "/bin/maxima")
3209 `("PATH" prefix (,binutils))))
3210 #t)))))
8731e527
JD
3211 (home-page "http://maxima.sourceforge.net")
3212 (synopsis "Numeric and symbolic expression manipulation")
3213 (description "Maxima is a system for the manipulation of symbolic and
3214numerical expressions. It yields high precision numeric results by using
3215exact fractions, arbitrary precision integers, and variable precision floating
e881752c 3216point numbers.")
8731e527
JD
3217 ;; Some files are lgpl2.1+. Some are gpl2+. Some explicitly state gpl1+.
3218 ;; Others simply say "GNU General Public License" without stating a
3219 ;; version (which implicitly means gpl1+).
3220 ;; At least one file (src/maxima.asd) says "version 2."
3221 ;; GPLv2 only is therefore the smallest subset.
f36afe4d 3222 (license license:gpl2)))
ec322be2 3223
9aafbc0c
MW
3224(define-public wxmaxima
3225 (package
3226 (name "wxmaxima")
1bbf7e13 3227 (version "20.04.0")
9aafbc0c
MW
3228 (source
3229 (origin
c93b77ad
KK
3230 (method git-fetch)
3231 (uri (git-reference
3232 (url "https://github.com/wxMaxima-developers/wxmaxima.git")
3233 (commit (string-append "Version-" version))))
3234 (file-name (git-file-name name version))
9aafbc0c 3235 (sha256
1bbf7e13 3236 (base32 "0vrjxzfgmjdzm1rgl0crz4b4badl14jwh032y3xkcdvjl5j67lp3"))))
0181df53 3237 (build-system cmake-build-system)
5143517c 3238 (native-inputs
1d3c6a31
KK
3239 `(("gettext" ,gettext-minimal)
3240 ("xorg-server" ,xorg-server-for-tests)))
3241 ;; TODO: Add libomp for multithreading support.
3242 ;; As of right now, enabling libomp causes the imageCells.wxm test to fail.
9aafbc0c
MW
3243 (inputs
3244 `(("wxwidgets" ,wxwidgets)
de477809
SB
3245 ("maxima" ,maxima)
3246 ;; Runtime support.
3247 ("adwaita-icon-theme" ,adwaita-icon-theme)
3248 ("gtk+" ,gtk+)
3249 ("shared-mime-info" ,shared-mime-info)))
9aafbc0c 3250 (arguments
1d3c6a31 3251 `(#:test-target "test"
0181df53 3252 #:phases
ac2ddcc6 3253 (modify-phases %standard-phases
1d3c6a31
KK
3254 (add-before 'check 'pre-check
3255 (lambda _
3256 ;; Tests require a running X server.
3257 (system "Xvfb :1 &")
3258 (setenv "DISPLAY" ":1")
3259 (setenv "HOME" (getcwd))
3260 #t))
ac2ddcc6
KK
3261 (add-after 'install 'wrap-program
3262 (lambda* (#:key inputs outputs #:allow-other-keys)
3263 (wrap-program (string-append (assoc-ref outputs "out")
3264 "/bin/wxmaxima")
3265 `("PATH" ":" prefix
3266 (,(string-append (assoc-ref inputs "maxima")
3267 "/bin")))
3268 ;; For GtkFileChooserDialog.
3269 `("GSETTINGS_SCHEMA_DIR" =
3270 (,(string-append (assoc-ref inputs "gtk+")
3271 "/share/glib-2.0/schemas")))
3272 `("XDG_DATA_DIRS" ":" prefix
3273 (;; Needed by gdk-pixbuf to know supported icon formats.
3274 ,(string-append
3275 (assoc-ref inputs "shared-mime-info") "/share")
3276 ;; The default icon theme of GTK+.
3277 ,(string-append
3278 (assoc-ref inputs "adwaita-icon-theme") "/share"))))
3279 #t)))))
48446f0f 3280 (home-page "https://wxmaxima-developers.github.io/wxmaxima/")
9aafbc0c
MW
3281 (synopsis "Graphical user interface for the Maxima computer algebra system")
3282 (description
3283 "wxMaxima is a graphical user interface for the Maxima computer algebra
3284system. It eases the use of Maxima by making most of its commands available
3285through a menu system and by providing input dialogs for commands that require
3286more than one argument. It also implements its own display engine that
3287outputs mathematical symbols directly instead of depicting them with ASCII
3288characters.
3289
3290wxMaxima also features 2D and 3D inline plots, simple animations, mixing of
3291text and mathematical calculations to create documents, exporting of input and
3292output to TeX, and a browser for Maxima's manual including command index and
3293full text searching.")
3294 (license license:gpl2+)))
3295
b15e47f9
RW
3296(define-public armadillo
3297 (package
3298 (name "armadillo")
f133e244 3299 (version "9.100.5")
b15e47f9
RW
3300 (source (origin
3301 (method url-fetch)
3302 (uri (string-append "mirror://sourceforge/arma/armadillo-"
7397cd9e 3303 version ".tar.xz"))
b15e47f9
RW
3304 (sha256
3305 (base32
f133e244 3306 "1ka1vd9fcmvp12qkcm4888dkfqwnalvv00x04wy29f3nx3qwczby"))))
b15e47f9 3307 (build-system cmake-build-system)
e405c0bc 3308 (arguments `(#:tests? #f)) ; no test target
b15e47f9
RW
3309 (inputs
3310 `(("openblas" ,openblas)
3311 ("lapack" ,lapack)
3312 ("arpack" ,arpack-ng)))
3313 (home-page "http://arma.sourceforge.net/")
3314 (synopsis "C++ linear algebra library")
3315 (description
3316 "Armadillo is a C++ linear algebra library, aiming towards a good balance
3317between speed and ease of use. It is useful for algorithm development
3318directly in C++, or quick conversion of research code into production
3319environments. It can be used for machine learning, pattern recognition,
3320signal processing, bioinformatics, statistics, econometrics, etc. The library
3321provides efficient classes for vectors, matrices and cubes, as well as 150+
255fb17b 3322associated functions (e.g., contiguous and non-contiguous submatrix views).")
fe418cc5 3323 (license license:asl2.0)))
b15e47f9 3324
279663ef 3325(define-public muparser
d7cff656
LF
3326 ;; When switching download sites, muparser re-issued a 2.2.5 release with a
3327 ;; different hash. In order to make `guix package --upgrade` work correctly,
3328 ;; we set a Guix packaging revision.
3329 ;; When the next version of muparser is released, we can remove
3330 ;; UPSTREAM-VERSION and REVISION and use the plain VERSION.
3331 (let ((upstream-version "2.2.5")
3332 (revision "2"))
3333 (package
3334 (name "muparser")
3335 (version (string-append upstream-version "-" revision))
3336 (source
3337 (origin
67f1db38
TGR
3338 (method git-fetch)
3339 (uri (git-reference
3340 (url "https://github.com/beltoforion/muparser.git")
3341 (commit (string-append "v" upstream-version))))
3342 (file-name (git-file-name name version))
d7cff656 3343 (sha256
67f1db38 3344 (base32 "0f0g4995xngf1pp3zr4p6ai2f8v6f8bxwa0k8ayjjiv1l8h44m24"))))
d7cff656
LF
3345 (build-system gnu-build-system)
3346 (arguments
3347 `(#:configure-flags '("--enable-samples=no")
3348 #:tests? #f)) ;no "check" target
3349 (home-page "http://muparser.beltoforion.de/")
3350 (synopsis "Fast parser library for mathematical expressions")
3351 (description
3352 "muParser is an extensible high performance math parser library. It is
3353based on transforming an expression into a bytecode and precalculating constant
3354parts of it.")
3355 (license license:expat))))
279663ef 3356
e73b49fb
RW
3357(define-public openblas
3358 (package
3359 (name "openblas")
df5a2e4f 3360 (version "0.3.9")
e73b49fb
RW
3361 (source
3362 (origin
3363 (method url-fetch)
a617fd55
MB
3364 (uri (string-append "mirror://sourceforge/openblas/v" version "/OpenBLAS%20"
3365 version "%20version.tar.gz"))
e73b49fb
RW
3366 (file-name (string-append name "-" version ".tar.gz"))
3367 (sha256
3368 (base32
df5a2e4f 3369 "14iz9xnrb9xiwgj84j94mc74gg0zn2vsy9fmsijxxma1n7dck4w3"))))
e73b49fb
RW
3370 (build-system gnu-build-system)
3371 (arguments
5789566a 3372 `(#:test-target "test"
bd0b4379
RW
3373 ;; DYNAMIC_ARCH is only supported on x86. When it is disabled and no
3374 ;; TARGET is specified, OpenBLAS will tune itself to the build host, so
3375 ;; we need to disable substitutions.
71923a91
AE
3376 #:substitutable?
3377 ,(let ((system (or (%current-target-system) (%current-system))))
3378 (or (string-prefix? "x86_64" system)
bd0b4379 3379 (string-prefix? "i686" system)
83a34647
EF
3380 (string-prefix? "mips" system)
3381 (string-prefix? "aarch64" system)))
e73b49fb
RW
3382 #:make-flags
3383 (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
3384 "SHELL=bash"
5855756c 3385 "MAKE_NB_JOBS=0" ;use jobserver for submakes
a4384dc9
MB
3386
3387 ;; This is the maximum number of threads OpenBLAS will ever use (that
3388 ;; is, if $OPENBLAS_NUM_THREADS is greater than that, then NUM_THREADS
3389 ;; is used.) If we don't set it, the makefile sets it to the number
3390 ;; of cores of the build machine, which is obviously wrong.
3391 "NUM_THREADS=128"
3392
af5b817e
RW
3393 ;; Build the library for all supported CPUs. This allows
3394 ;; switching CPU targets at runtime with the environment variable
3395 ;; OPENBLAS_CORETYPE=<type>, where "type" is a supported CPU type.
71923a91
AE
3396 ;; Unfortunately, this is not supported on non-x86 architectures,
3397 ;; where it leads to failed builds.
3398 ,@(let ((system (or (%current-target-system) (%current-system))))
8a637e79
RW
3399 (cond
3400 ((or (string-prefix? "x86_64" system)
71923a91 3401 (string-prefix? "i686" system))
8a637e79
RW
3402 '("DYNAMIC_ARCH=1"))
3403 ;; On MIPS we force the "SICORTEX" TARGET, as for the other
3404 ;; two available MIPS targets special extended instructions
3405 ;; for Loongson cores are used.
3406 ((string-prefix? "mips" system)
3407 '("TARGET=SICORTEX"))
83a34647
EF
3408 ;; On aarch64 force the generic 'armv8-a' target
3409 ((string-prefix? "aarch64" system)
3410 '("TARGET=ARMV8"))
8a637e79 3411 (else '()))))
e73b49fb 3412 ;; no configure script
493937ae
DL
3413 #:phases
3414 (modify-phases %standard-phases
3415 (delete 'configure)
3416 (add-before 'build 'set-extralib
3417 (lambda* (#:key inputs #:allow-other-keys)
3418 ;; Get libgfortran found when building in utest.
3419 (setenv "FEXTRALIB"
3420 (string-append "-L" (assoc-ref inputs "fortran-lib")
3421 "/lib"))
3422 #t)))))
e73b49fb 3423 (inputs
493937ae 3424 `(("fortran-lib" ,gfortran "lib")))
e73b49fb
RW
3425 (native-inputs
3426 `(("cunit" ,cunit)
493937ae 3427 ("fortran" ,gfortran)
e73b49fb 3428 ("perl" ,perl)))
59695981 3429 (home-page "https://www.openblas.net/")
e73b49fb
RW
3430 (synopsis "Optimized BLAS library based on GotoBLAS")
3431 (description
3432 "OpenBLAS is a BLAS library forked from the GotoBLAS2-1.13 BSD version.")
3433 (license license:bsd-3)))
3434
daa6036f 3435(define-public openblas-ilp64
ba05be22 3436 (package/inherit openblas
daa6036f
EB
3437 (name "openblas-ilp64")
3438 (supported-systems '("x86_64-linux" "aarch64-linux" "mips64el-linux"))
3439 (arguments
3440 (substitute-keyword-arguments (package-arguments openblas)
3441 ((#:make-flags flags '())
3442 `(append (list "INTERFACE64=1" "LIBNAMESUFFIX=ilp64")
3443 ,flags))))
3444 (synopsis "Optimized BLAS library based on GotoBLAS (ILP64 version)")
3445 (license license:bsd-3)))
3446
5a7deb11
LC
3447(define* (make-blis implementation #:optional substitutable?)
3448 "Return a BLIS package with the given IMPLEMENTATION (see config/ in the
3449source tree for a list of implementations.)
3450
3451SUBSTITUTABLE? determines whether the package is made available as a
3452substitute.
3453
3454Currently the specialization must be selected at configure-time, but work is
3455underway to allow BLIS to select the right optimized kernels at run time:
3456<https://github.com/flame/blis/issues/129>."
3457 (package
3458 (name (if (string=? implementation "reference")
3459 "blis"
3460 (string-append "blis-" implementation)))
3461 (version "0.2.2")
3462 (home-page "https://github.com/flame/blis")
3463 (source (origin
3464 (method git-fetch)
3465 (uri (git-reference (url home-page) (commit version)))
3466 (sha256
3467 (base32
3468 "1wr79a50nm4abhw8w3sn96nmwp5mrzifcigk7khw9qcgyyyqayfh"))
3469 (file-name (git-file-name "blis" version))))
3470 (build-system gnu-build-system)
3471 (arguments
3472 `(#:test-target "test"
3473
3474 #:substitutable? ,substitutable?
3475
3476 #:phases (modify-phases %standard-phases
3477 (replace 'configure
3478 (lambda* (#:key outputs #:allow-other-keys)
3479 ;; This is a home-made 'configure' script.
3480 (let ((out (assoc-ref outputs "out")))
1ec17821
RW
3481 (invoke "./configure" "-p" out
3482 "-d" "opt"
3483 "--disable-static"
3484 "--enable-shared"
3485 "--enable-threading=openmp"
5a7deb11 3486
1ec17821 3487 ,implementation))))
5a7deb11
LC
3488 (add-before 'check 'show-test-output
3489 (lambda _
3490 ;; By default "make check" is silent. Make it verbose.
3491 (system "tail -F output.testsuite &")
3492 #t)))))
3493 (synopsis "High-performance basic linear algebra (BLAS) routines")
3494 (description
3495 "BLIS is a portable software framework for instantiating high-performance
3496BLAS-like dense linear algebra libraries. The framework was designed to
3497isolate essential kernels of computation that, when optimized, immediately
3498enable optimized implementations of most of its commonly used and
3499computationally intensive operations. While BLIS exports a new BLAS-like API,
3500it also includes a BLAS compatibility layer which gives application developers
3501access to BLIS implementations via traditional BLAS routine calls.")
3502 (license license:bsd-3)))
3503
3504(define-public blis
3505 ;; This is the "reference" implementation, which is the non-optimized but
3506 ;; portable variant (no assembly).
3507 (make-blis "reference" #t))
3508
3509(define ignorance blis)
3510
3511(define-syntax-rule (blis/x86_64 processor)
3512 "Expand to a package specialized for PROCESSOR."
3513 (package
3514 (inherit (make-blis processor))
3515 (supported-systems '("x86_64-linux"))))
3516
3517(define-public blis-sandybridge
3518 ;; BLIS specialized for Sandy Bridge processors (launched 2011):
3519 ;; <http://ark.intel.com/products/codename/29900/Sandy-Bridge>.
3520 (blis/x86_64 "sandybridge"))
3521
3522(define-public blis-haswell
3523 ;; BLIS specialized for Haswell processors (launched 2013):
3524 ;; <http://ark.intel.com/products/codename/42174/Haswell>.
3525 (blis/x86_64 "haswell"))
3526
3527(define-public blis-knl
3528 ;; BLIS specialized for Knights Landing processor (launched 2016):
3529 ;; <http://ark.intel.com/products/series/92650/Intel-Xeon-Phi-x200-Product-Family>.
3530 (blis/x86_64 "knl"))
3531
3532
e1605e36
RW
3533(define-public openlibm
3534 (package
3535 (name "openlibm")
48d7ac17 3536 (version "0.6.0")
e1605e36
RW
3537 (source
3538 (origin
ca72dd2c
TGR
3539 (method git-fetch)
3540 (uri (git-reference
3541 (url "https://github.com/JuliaLang/openlibm.git")
3542 (commit (string-append "v" version))))
3543 (file-name (git-file-name name version))
e1605e36 3544 (sha256
ca72dd2c 3545 (base32 "08wfchmmr5200fvmn1kwq9byc1fhsq46hn0y5k8scdl74771c7gh"))))
e1605e36
RW
3546 (build-system gnu-build-system)
3547 (arguments
3548 `(#:make-flags
3549 (list (string-append "prefix=" (assoc-ref %outputs "out")))
3550 #:phases
3551 ;; no configure script
dc1d3cde 3552 (modify-phases %standard-phases (delete 'configure))
e1605e36 3553 #:tests? #f)) ;the tests are part of the default target
d3be5220 3554 (home-page "https://openlibm.org/")
e1605e36
RW
3555 (synopsis "Portable C mathematical library (libm)")
3556 (description
3557 "OpenLibm is an effort to have a high quality, portable, standalone C
3558mathematical library (libm). It can be used standalone in applications and
3559programming language implementations. The project was born out of a need to
e881752c 3560have a good libm for the Julia programming language that worked consistently
e1605e36
RW
3561across compilers and operating systems, and in 32-bit and 64-bit
3562environments.")
538c0e3b
EF
3563 ;; Each architecture has its own make target, and there is none for mips.
3564 (supported-systems (delete "mips64el-linux" %supported-systems))
e1605e36
RW
3565 ;; See LICENSE.md for details.
3566 (license (list license:expat
3567 license:isc
3568 license:bsd-2
3569 license:public-domain
3570 license:lgpl2.1+))))
3571
e62be58f
RW
3572(define-public openspecfun
3573 (package
3574 (name "openspecfun")
59cd0ba4 3575 (version "0.5.3")
e62be58f
RW
3576 (source
3577 (origin
90cea671
TGR
3578 (method git-fetch)
3579 (uri (git-reference
3580 (url "https://github.com/JuliaLang/openspecfun.git")
3581 (commit (string-append "v" version))))
3582 (file-name (git-file-name name version))
e62be58f 3583 (sha256
90cea671 3584 (base32 "0pfw6l3ch7isz403llx7inxlvavqh01jh1hb9dpidi86sjjx9kfh"))))
e62be58f
RW
3585 (build-system gnu-build-system)
3586 (arguments
59cd0ba4 3587 '(#:tests? #f ; no "check" target
e62be58f
RW
3588 #:make-flags
3589 (list (string-append "prefix=" (assoc-ref %outputs "out")))
59cd0ba4
TGR
3590 #:phases
3591 (modify-phases %standard-phases
3592 (delete 'configure)))) ; no configure script
e62be58f 3593 (inputs
19afbea1 3594 `(("fortran" ,gfortran)))
e62be58f
RW
3595 (home-page "https://github.com/JuliaLang/openspecfun")
3596 (synopsis "Collection of special mathematical functions")
3597 (description
3598 "Openspecfun provides AMOS and Faddeeva. AMOS (from Netlib) is a
3599portable package for Bessel Functions of a Complex Argument and Nonnegative
3600Order; it contains subroutines for computing Bessel functions and Airy
3601functions. Faddeeva allows computing the various error functions of arbitrary
3602complex arguments (Faddeeva function, error function, complementary error
3603function, scaled complementary error function, imaginary error function, and
3604Dawson function); given these, one can also easily compute Voigt functions,
3605Fresnel integrals, and similar related functions as well.")
3606 ;; Faddeeva is released under the Expat license; AMOS is included as
3607 ;; public domain software.
3608 (license (list license:expat license:public-domain))))
3609
2742f87e
RW
3610(define-public suitesparse
3611 (package
3612 (name "suitesparse")
aac148a8 3613 (version "5.7.1")
2742f87e
RW
3614 (source
3615 (origin
aac148a8
FG
3616 (method git-fetch)
3617 (uri (git-reference
3618 (url "https://github.com/DrTimothyAldenDavis/SuiteSparse.git")
3619 (commit (string-append "v" version))))
3620 (file-name (git-file-name name version))
2742f87e
RW
3621 (sha256
3622 (base32
aac148a8
FG
3623 "174p3l78kv9gaa0i5hflyai2ydwnjzh34k9938sl4aa3li0543s8"))
3624 (patches (search-patches "suitesparse-mongoose-cmake.patch"))
bd5b5ac0
EB
3625 (modules '((guix build utils)))
3626 (snippet
3627 ;; Remove bundled metis source
6cbee49d
MW
3628 '(begin
3629 (delete-file-recursively "metis-5.1.0")
3630 #t))))
2742f87e
RW
3631 (build-system gnu-build-system)
3632 (arguments
bd5b5ac0 3633 '(#:tests? #f ;no "check" target
2742f87e
RW
3634 #:make-flags
3635 (list "CC=gcc"
3636 "BLAS=-lblas"
3637 "TBB=-ltbb"
bd5b5ac0 3638 "MY_METIS_LIB=-lmetis"
aac148a8
FG
3639 ;; Flags for cmake (required to build GraphBLAS and Mongoose)
3640 (string-append "CMAKE_OPTIONS=-DCMAKE_INSTALL_PREFIX="
3641 (assoc-ref %outputs "out")
3642 " -DCMAKE_VERBOSE_MAKEFILE=ON"
3643 " -DCMAKE_C_FLAGS_RELEASE=\"$(CFLAGS) $(CPPFLAGS)\""
3644 " -DCMAKE_CXX_FLAGS_RELEASE=\"$(CXXFLAGS) $(CPPFLAGS)\""
3645 " -DCMAKE_SKIP_RPATH=TRUE"
3646 " -DCMAKE_BUILD_TYPE=Release")
2742f87e
RW
3647 (string-append "INSTALL_LIB="
3648 (assoc-ref %outputs "out") "/lib")
3649 (string-append "INSTALL_INCLUDE="
bd5b5ac0
EB
3650 (assoc-ref %outputs "out") "/include")
3651 "library")
2742f87e 3652 #:phases
2509522c 3653 (modify-phases %standard-phases
bd5b5ac0 3654 (delete 'configure)))) ;no configure script
2742f87e
RW
3655 (inputs
3656 `(("tbb" ,tbb)
bd5b5ac0
EB
3657 ("lapack" ,lapack)
3658 ("metis" ,metis)))
aac148a8 3659 (native-inputs
b471337d 3660 `(("cmake" ,cmake-minimal)
aac148a8 3661 ("m4" ,m4)))
2742f87e
RW
3662 (home-page "http://faculty.cse.tamu.edu/davis/suitesparse.html")
3663 (synopsis "Suite of sparse matrix software")
3664 (description
3665 "SuiteSparse is a suite of sparse matrix algorithms, including: UMFPACK,
3666multifrontal LU factorization; CHOLMOD, supernodal Cholesky; SPQR,
3667multifrontal QR; KLU and BTF, sparse LU factorization, well-suited for circuit
3668simulation; ordering methods (AMD, CAMD, COLAMD, and CCOLAMD); CSparse and
3669CXSparse, a concise sparse Cholesky factorization package; and many other
3670packages.")
3671 ;; LGPLv2.1+:
3672 ;; AMD, CAMD, BTF, COLAMD, CCOLAMD, CSparse, CXSparse, KLU, LDL
3673 ;; GPLv2+:
3674 ;; GPUQREngine, RBio, SuiteSparse_GPURuntime, SuiteSparseQR, UMFPACK
3675 (license (list license:gpl2+ license:lgpl2.1+))))
3676
ec322be2
FB
3677(define-public atlas
3678 (package
3679 (name "atlas")
3c98ac02 3680 (version "3.10.3")
ec322be2
FB
3681 (source (origin
3682 (method url-fetch)
de67e922
LF
3683 (uri (string-append "mirror://sourceforge/math-atlas/Stable/"
3684 version "/atlas" version ".tar.bz2"))
ec322be2
FB
3685 (sha256
3686 (base32
3c98ac02 3687 "1dyjlq3fiparvm8ypwk6rsmjzmnwk81l88gkishphpvc79ryp216"))))
ec322be2
FB
3688 (build-system gnu-build-system)
3689 (home-page "http://math-atlas.sourceforge.net/")
19afbea1 3690 (inputs `(("gfortran" ,gfortran)
ec322be2
FB
3691 ("lapack-tar" ,(package-source lapack))))
3692 (outputs '("out" "doc"))
01480b9e
FB
3693 ;; For the moment we drop support for MIPS at it fails to compile. See
3694 ;; https://lists.gnu.org/archive/html/guix-devel/2014-11/msg00516.html
3695 (supported-systems (delete "mips64el-linux" %supported-systems))
ec322be2
FB
3696 (arguments
3697 `(#:parallel-build? #f
3698 #:parallel-tests? #f
f15615b1
LC
3699
3700 ;; ATLAS tunes itself for the machine it is built on, as explained at
3701 ;; <http://lists.gnu.org/archive/html/guix-devel/2014-10/msg00305.html>.
3702 ;; For this reason, we want users to build it locally instead of using
3703 ;; substitutes.
3704 #:substitutable? #f
3705
ec322be2 3706 #:modules ((srfi srfi-26)
ec322be2
FB
3707 (guix build gnu-build-system)
3708 (guix build utils))
40029cbe 3709 #:configure-flags
ec322be2
FB
3710 `(;; Generate position independent code suitable for dynamic libraries
3711 ;; and use WALL timer to get more accurate timing.
3712 "-Fa" "alg" "-fPIC" "-D" "c" "-DWALL"
3713 ;; Set word width.
3714 "-b"
3715 ,,(if (string-match "64" (%current-system))
3716 "64"
3717 "32")
3718 ;; Disable parallel build as it gives errors: atlas_pthread.h is
3719 ;; needed to compile C files before it is generated.
3720 "-Ss" "pmake" "make -j 1"
af89a667
FB
3721 ;; Probe is failing for MIPS. We therefore define the system
3722 ;; architecture explicitly by setting (-A) MACHINETYPE = 49
3723 ;; 'MIPSR1xK' and (-V) ISA = 1 'none'.
3724 ,,@(if (string-prefix? "mips" (%current-system))
3725 (list "-A" "49" "-V" "1")
3726 (list))
ec322be2
FB
3727 ;; Generate shared libraries.
3728 "--shared"
3729 ;; Build a full LAPACK library.
3730 ,(string-append "--with-netlib-lapack-tarfile="
3731 (assoc-ref %build-inputs "lapack-tar")))
3732 #:phases
e5b4b96b
EF
3733 (modify-phases %standard-phases
3734 (add-after 'install 'install-doc
3735 (lambda* (#:key outputs inputs #:allow-other-keys)
3736 (let ((doc (string-append (assoc-ref outputs "doc")
3737 "/share/doc/atlas")))
3738 (mkdir-p doc)
cb6f44d4
RW
3739 (for-each (cut install-file <> doc)
3740 (find-files "../ATLAS/doc" ".*"))
3741 #t)))
e5b4b96b 3742 (add-after 'check 'check-pt
cb6f44d4 3743 (lambda _ (invoke "make" "ptcheck")))
e5b4b96b
EF
3744 ;; Fix files required to run configure.
3745 (add-before 'configure 'fix-/bin/sh
ec322be2
FB
3746 (lambda _
3747 ;; Use `sh', not `/bin/sh'.
3748 (substitute* (find-files "." "Makefile|configure|SpewMakeInc\\.c")
3749 (("/bin/sh")
5b786db8
EF
3750 "sh"))
3751 #t))
e5b4b96b
EF
3752 ;; Fix /bin/sh in generated make files.
3753 (add-after 'configure 'fix-/bin/sh-in-generated-files
3754 (lambda _
3755 (substitute* (find-files "." "^[Mm]ake\\.inc.*")
3756 (("/bin/sh")
5b786db8
EF
3757 "sh"))
3758 #t))
e5b4b96b
EF
3759 ;; ATLAS configure program does not accepts the default flags
3760 ;; passed by the 'gnu-build-system'.
3761 (replace 'configure
3762 (lambda* (#:key native-inputs inputs outputs
3763 (configure-flags '())
3764 #:allow-other-keys #:rest args)
3765 (let* ((prefix (assoc-ref outputs "out"))
3766 (bash (or (and=> (assoc-ref
3767 (or native-inputs inputs) "bash")
3768 (cut string-append <> "/bin/bash"))
3769 "/bin/sh"))
3770 (flags `(,(string-append "--prefix=" prefix)
3771 ,@configure-flags))
3772 (abs-srcdir (getcwd))
3773 (srcdir (string-append "../" (basename abs-srcdir))))
3774 (format #t "source directory: ~s (relative from build: ~s)~%"
3775 abs-srcdir srcdir)
3776 (mkdir "../build")
3777 (chdir "../build")
3778 (format #t "build directory: ~s~%" (getcwd))
3779 (format #t "configure flags: ~s~%" flags)
cb6f44d4
RW
3780 (apply invoke bash
3781 (string-append srcdir "/configure")
3782 flags)))))))
ec322be2
FB
3783 (synopsis "Automatically Tuned Linear Algebra Software")
3784 (description
3785 "ATLAS is an automatically tuned linear algebra software library
3786providing C and Fortran77 interfaces to a portably efficient BLAS
3787implementation, as well as a few routines from LAPACK.
3788
f15615b1
LC
3789Optimization occurs at build time. For this reason, the library is built on
3790the machine where it is installed, without resorting to pre-built substitutes.
ec322be2 3791
f15615b1 3792Before building the library, CPU throttling should be disabled. This can be
d97c429a 3793done in the BIOS, or, on GNU/Linux, with the following command:
ec322be2 3794
8e9ba611 3795@example
d97c429a 3796# cpupower --governor performance
8e9ba611 3797@end example
ec322be2 3798
d97c429a 3799Failure to do so will result in a library with poor performance.")
ec322be2 3800 (license license:bsd-3)))
c12efc72
AE
3801
3802(define-public glm
3803 (package
3804 (name "glm")
1a75fc84 3805 (version "0.9.9.8")
c12efc72
AE
3806 (source
3807 (origin
3808 (method url-fetch)
5ea4b594
MB
3809 (uri (string-append "https://github.com/g-truc/glm/releases/download/"
3810 version "/glm-" version ".zip"))
c12efc72 3811 (sha256
1a75fc84 3812 (base32 "0k6yk9v46h690rshdx49x98y5qspkzibld1wb51jwcm35vba7qip"))))
c12efc72 3813 (build-system cmake-build-system)
1a75fc84
MB
3814 (arguments
3815 `(#:phases (modify-phases %standard-phases
3816 (replace 'install
3817 (lambda* (#:key outputs #:allow-other-keys)
3818 ;; Since version 0.9.9.6, 'make install' is not supported
3819 ;; and we have to do it "manually". Upstream discussion:
3820 ;; <https://github.com/g-truc/glm/pull/968>.
3821 (let* ((source (string-append "../glm"))
3822 (out (assoc-ref outputs "out"))
3823 (inc (string-append out "/include"))
3824 (lib (string-append out "/lib"))
3825 (pkgconfig (string-append lib "/pkgconfig")))
3826 (with-directory-excursion source
3827 (mkdir-p inc)
3828 (mkdir-p pkgconfig)
3829 (copy-recursively "glm" (string-append inc "/glm"))
3830 (copy-recursively "cmake" (string-append lib "/cmake"))
3831 (call-with-output-file (string-append pkgconfig "/glm.pc")
3832 (lambda (port)
3833 (format port
3834 "prefix=~a
3835includedir=${prefix}/include
3836
3837Name: GLM
3838Description: OpenGL Mathematics
3839Version: ~a
3840Cflags: -I${includedir}~%" out ,(version-prefix version 3)))))
3841 #t))))))
c12efc72
AE
3842 (native-inputs
3843 `(("unzip" ,unzip)))
46bda5eb 3844 (home-page "https://glm.g-truc.net/")
c12efc72
AE
3845 (synopsis "OpenGL Mathematics library")
3846 (description "OpenGL Mathematics (GLM) is a header-only C++ mathematics
3847library for graphics software based on the OpenGL Shading Language (GLSL)
3848specifications.")
3849 (license license:expat)))
7f18257b
AE
3850
3851(define-public lpsolve
3852 (package
3853 (name "lpsolve")
a89e0cf5 3854 (version "5.5.2.5")
7f18257b
AE
3855 (source
3856 (origin
3857 (method url-fetch)
3858 (uri (string-append "mirror://sourceforge/lpsolve/lpsolve/" version
3859 "/lp_solve_" version "_source.tar.gz"))
3860 (sha256
3861 (base32
a89e0cf5 3862 "12pj1idjz31r7c2mb5w03vy1cmvycvbkx9z29s40qdmkp1i7q6i0"))
7f18257b
AE
3863 (modules '((guix build utils)))
3864 (snippet
6cbee49d
MW
3865 '(begin
3866 (substitute* (list "lp_solve/ccc" "lpsolve55/ccc")
3867 (("^c=cc") "c=gcc")
3868 ;; Pretend to be on a 64 bit platform to obtain a common directory
3869 ;; name for the build results on all architectures; nothing else
3870 ;; seems to depend on it.
3871 (("^PLATFORM=.*$") "PLATFORM=ux64\n")
3872
3873 ;; The check for 'isnan' as it is written fails with
3874 ;; "non-floating-point argument in call to function
3875 ;; ‘__builtin_isnan’", which leads to the 'NOISNAN' cpp macro
3876 ;; definition, which in turn leads to bad things. Fix the feature
3877 ;; test.
3878 (("isnan\\(0\\)") "isnan(0.)"))
3879 #t))))
7f18257b
AE
3880 (build-system gnu-build-system)
3881 (arguments
6c96b545 3882 `(#:tests? #f ; no check target
7f18257b
AE
3883 #:phases
3884 (modify-phases %standard-phases
6c96b545 3885 (delete 'configure) ; no configure script
7f18257b
AE
3886 (replace 'build
3887 (lambda _
6c96b545
TGR
3888 (with-directory-excursion "lpsolve55"
3889 (invoke "bash" "ccc"))
3890 (with-directory-excursion "lp_solve"
3891 (invoke "bash" "ccc"))
3892 #t))
7f18257b
AE
3893 (replace 'install
3894 (lambda* (#:key outputs #:allow-other-keys)
3895 (let* ((out (assoc-ref outputs "out"))
3896 (bin (string-append out "/bin"))
3897 (lib (string-append out "/lib"))
3898 ;; This is where LibreOffice expects to find the header
3899 ;; files, and where they are installed by Debian.
3900 (include (string-append out "/include/lpsolve")))
6c96b545
TGR
3901 (install-file "lpsolve55/bin/ux64/liblpsolve55.a" lib)
3902 (install-file "lpsolve55/bin/ux64/liblpsolve55.so" lib)
96c46210
LC
3903 (install-file "lp_solve/bin/ux64/lp_solve" bin)
3904
7f18257b
AE
3905 ;; Install a subset of the header files as on Debian
3906 ;; (plus lp_bit.h, which matches the regular expression).
96c46210
LC
3907 (for-each (lambda (name)
3908 (install-file name include))
3909 (find-files "." "lp_[HMSa-z].*\\.h$"))
7f18257b 3910 (with-directory-excursion "shared"
96c46210
LC
3911 (for-each (lambda (name)
3912 (install-file name include))
3913 (find-files "." "\\.h$")))
7f18257b
AE
3914 #t))))))
3915 (home-page "http://lpsolve.sourceforge.net/")
3916 (synopsis "Mixed integer linear programming (MILP) solver")
3917 (description
3918 "lp_solve is a mixed integer linear programming solver based on the
3919revised simplex and the branch-and-bound methods.")
3920 (license license:lgpl2.1+)))
a17d4564
EB
3921
3922(define-public dealii
3923 (package
3924 (name "dealii")
ba567cae 3925 (version "9.1.1")
a17d4564
EB
3926 (source
3927 (origin
3928 (method url-fetch)
3929 (uri (string-append "https://github.com/dealii/dealii/releases/"
3930 "download/v" version "/dealii-" version ".tar.gz"))
3931 (sha256
3932 (base32
ba567cae 3933 "0xhjv0gzswpjbc43xbrpwfc5848g508l01855nszx3g5gwzlhnzw"))
a17d4564
EB
3934 (modules '((guix build utils)))
3935 (snippet
3936 ;; Remove bundled sources: UMFPACK, TBB, muParser, and boost
6cbee49d
MW
3937 '(begin
3938 (delete-file-recursively "bundled")
3939 #t))))
a17d4564
EB
3940 (build-system cmake-build-system)
3941 (inputs
3942 `(("tbb" ,tbb)
3943 ("zlib" ,zlib)
3944 ("boost" ,boost)
3945 ("p4est" ,p4est)
3946 ("blas" ,openblas)
3947 ("lapack" ,lapack)
3948 ("arpack" ,arpack-ng)
3949 ("muparser" ,muparser)
3950 ("gfortran" ,gfortran)
3951 ("suitesparse" ,suitesparse))) ;for UMFPACK
3952 (arguments
3953 `(#:build-type "DebugRelease" ;only supports Release, Debug, or DebugRelease
d84b09e9
EB
3954 #:configure-flags
3955 ;; Work around a bug in libsuitesparseconfig linking
3956 ;; see https://github.com/dealii/dealii/issues/4745
3957 '("-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON")))
a17d4564
EB
3958 (home-page "https://www.dealii.org")
3959 (synopsis "Finite element library")
3960 (description
3961 "Deal.II is a C++ program library targeted at the computational solution
3962of partial differential equations using adaptive finite elements. The main
3963aim of deal.II is to enable rapid development of modern finite element codes,
3964using among other aspects adaptive meshes and a wide array of tools often used
3965in finite element programs.")
3966 (license license:lgpl2.1+)))
3967
3968(define-public dealii-openmpi
3969 (package (inherit dealii)
3970 (name "dealii-openmpi")
3971 (inputs
3972 `(("mpi" ,openmpi)
3973 ;;Supported only with MPI:
4d44bcad 3974 ("hdf5" ,hdf5-parallel-openmpi) ;TODO: have petsc-openmpi propagate?
a17d4564
EB
3975 ("p4est" ,p4est-openmpi)
3976 ("petsc" ,petsc-openmpi)
3977 ("slepc" ,slepc-openmpi)
3978 ("metis" ,metis) ;for MUMPS
3979 ("scalapack" ,scalapack) ;for MUMPS
3980 ("mumps" ,mumps-metis-openmpi) ;configure supports only metis orderings
3981 ("arpack" ,arpack-ng-openmpi)
3982 ,@(fold alist-delete (package-inputs dealii)
3983 '("p4est" "arpack"))))
3984 (arguments
3985 (substitute-keyword-arguments (package-arguments dealii)
3986 ((#:configure-flags cf)
40b114c0
EB
3987 `(cons "-DDEAL_II_WITH_MPI:BOOL=ON"
3988 ,cf))
7e309e8a
EB
3989 ((#:phases phases '%standard-phases)
3990 `(modify-phases ,phases
3991 (add-before 'check 'mpi-setup
3992 ,%openmpi-setup)))))
a17d4564 3993 (synopsis "Finite element library (with MPI support)")))
194c7f95
AE
3994
3995(define-public flann
3996 (package
3997 (name "flann")
ba40ce5b
LC
3998 (version "1.9.1")
3999 (home-page "https://github.com/mariusmuja/flann/")
194c7f95
AE
4000 (source
4001 (origin
ba40ce5b
LC
4002 (method git-fetch)
4003 (uri (git-reference (url home-page) (commit version)))
4004 (file-name (git-file-name name version))
194c7f95
AE
4005 (sha256
4006 (base32
ba40ce5b 4007 "0p56fl2yx1r86ds1mgjq40926jdcgq3hka7p3l1hv2acv9jxp15x"))
b5edc479 4008 (patches (search-patches "flann-cmake-3.11.patch"))))
194c7f95 4009 (build-system cmake-build-system)
f8bb53ca 4010 (outputs '("out"))
194c7f95
AE
4011 (native-inputs
4012 `(("unzip" ,unzip)))
4013 (inputs
4014 `(("hdf5" ,hdf5)
f8bb53ca
LC
4015 ;; FIXME: 'mkoctfile' fails with a linker error:
4016 ;; ld: cannot find -loctinterp
4017 ;; ld: cannot find -loctave
4018 ;; Disable it for now.
4019 ;;("octave" ,octave-cli)
194c7f95
AE
4020 ("python" ,python-2) ; print syntax
4021 ;; ("python2-numpy" ,python2-numpy) ; only required for the tests
4022 ("zlib" ,zlib)))
4023 (arguments
39b30337
LC
4024 `(;; The 'share/flann/octave' contains a .mex file, which is an ELF file
4025 ;; taken 46 MiB unstripped, and 6 MiB stripped.
4026 #:strip-directories '("lib" "lib64" "libexec"
4027 "bin" "sbin" "share/flann/octave")
4028
9684e30b
LC
4029 ;; Save 12 MiB by not installing .a files. Passing
4030 ;; '-DBUILD_STATIC_LIBS=OFF' has no effect.
4031 #:phases (modify-phases %standard-phases
4032 (add-after 'install 'remove-static-libraries
4033 (lambda* (#:key outputs #:allow-other-keys)
4034 (let* ((out (assoc-ref outputs "out"))
4035 (lib (string-append out "/lib")))
4036 (for-each delete-file
4037 (find-files lib "\\.a$"))
4038 #t))))
4039
39b30337 4040 #:tests? #f)) ; The test data are downloaded from the Internet.
194c7f95
AE
4041 (synopsis "Library for approximate nearest neighbors computation")
4042 (description "FLANN is a library for performing fast approximate
4043nearest neighbor searches in high dimensional spaces. It implements a
4044collection of algorithms and a system for automatically choosing the best
4045algorithm and optimum parameters depending on the dataset.
4046
4047FLANN is written in C++ and contains bindings for C, Octave and Python.")
4048 (license (license:non-copyleft "file://COPYING"
4049 "See COPYING in the distribution."))))
d8c97beb
EF
4050
4051(define-public wcalc
4052 (package
4053 (name "wcalc")
4054 (version "2.5")
4055 (source
4056 (origin
4057 (method url-fetch)
de67e922
LF
4058 (uri (string-append "mirror://sourceforge/w-calc/Wcalc/" version "/"
4059 "wcalc-" version ".tar.bz2"))
d8c97beb
EF
4060 (sha256
4061 (base32
4062 "1vi8dl6rccqiq1apmpwawyg2ywx6a1ic1d3cvkf2hlwk1z11fb0f"))))
4063 (build-system gnu-build-system)
4064 (inputs
4065 `(("mpfr" ,mpfr)
4066 ("readline" ,readline)))
4067 (home-page "http://w-calc.sourceforge.net/index.php")
4068 (synopsis "Flexible command-line scientific calculator")
4069 (description "Wcalc is a very capable calculator. It has standard functions
4070(sin, asin, and sinh for example, in either radians or degrees), many
4071pre-defined constants (pi, e, c, etc.), support for using variables, \"active\"
4072variables, a command history, hex/octal/binary input and output, unit
4073conversions, embedded comments, and an expandable expression entry field. It
4074evaluates expressions using the standard order of operations.")
4075 (license license:gpl2+)))
45147b0c
FH
4076
4077(define-public xaos
4078 (package
4079 (name "xaos")
49de3274 4080 (version "4.0")
45147b0c 4081 (source (origin
49de3274
KK
4082 (method git-fetch)
4083 (uri (git-reference
4084 (url "https://github.com/xaos-project/XaoS")
4085 (commit (string-append "release-" version))))
352e09a5 4086 (file-name (git-file-name name version))
45147b0c
FH
4087 (sha256
4088 (base32
49de3274 4089 "00110p5xscjsmn7avfqgydn656zbmdj3l3y2fpv9b4ihzpid8n7a"))))
45147b0c 4090 (build-system gnu-build-system)
49de3274
KK
4091 (native-inputs `(("gettext" ,gettext-minimal)
4092 ("qtbase" ,qtbase)
4093 ("qttools" ,qttools)))
45147b0c
FH
4094 (inputs `(("libx11" ,libx11)
4095 ("zlib" ,zlib)
4096 ("libpng" ,libpng)
4097 ("gsl" ,gsl)))
49de3274
KK
4098 ;; The upstream project file ("XaoS.pro") and the Makefile it generates are
4099 ;; not enough for this package to install properly. These phases fix that.
45147b0c
FH
4100 (arguments
4101 `(#:tests? #f ;no "check" target
49de3274
KK
4102 #:phases
4103 (modify-phases %standard-phases
4104 (add-before 'configure 'make-qt-deterministic
4105 (lambda _
4106 ;; Make Qt deterministic.
4107 (setenv "QT_RCC_SOURCE_DATE_OVERRIDE" "1")
4108 #t))
4109 (replace 'configure
4110 (lambda* (#:key outputs #:allow-other-keys)
4111 (let ((out (assoc-ref outputs "out")))
4112 ;; The DESTDIR is originally set to install the xaos binary to
4113 ;; the "bin" folder inside the build directory. Setting make
4114 ;; flags doesn't seem to change this.
4115 (substitute* "XaoS.pro"
4116 (("DESTDIR.*$")
4117 (string-append "DESTDIR=" out "/bin")))
4118 (substitute* "src/include/config.h"
4119 (("/usr/share/XaoS")
4120 (string-append out "/share/XaoS")))
4121 (invoke "qmake"))))
4122 (add-after 'install 'install-data
4123 (lambda* (#:key outputs #:allow-other-keys)
4124 (let* ((out (assoc-ref outputs "out"))
4125 (share (string-append out "/share")))
4126 (mkdir-p share)
4127 (for-each
4128 (lambda (folder)
4129 (copy-recursively folder
4130 (string-append share "/XaoS/" folder)))
4131 '("catalogs" "examples" "tutorial"))
4132 (install-file "xdg/xaos.png"
4133 (string-append share "/pixmaps"))
4134 (install-file "xdg/xaos.desktop"
4135 (string-append share "/applications")))
4136 #t)))))
45147b0c
FH
4137 (synopsis "Real-time fractal zoomer")
4138 (description "GNU XaoS is a graphical program that generates fractal
4139patterns and allows you to zoom in and out of them infinitely in a fluid,
4140continuous manner. It also includes tutorials that help to explain how fractals
4141are built. It can generate many different fractal types such as the Mandelbrot
4142set.")
49de3274 4143 (home-page "https://xaos-project.github.io/")
45147b0c 4144 (license license:gpl2+)))
528bb464
EB
4145
4146(define-public hypre
4147 (package
4148 (name "hypre")
be099727 4149 (version "2.15.1")
fabcbf32
TGR
4150 (source
4151 (origin
4152 (method git-fetch)
4153 (uri (git-reference
4154 (url "https://github.com/LLNL/hypre.git")
4155 (commit (string-append "v" version))))
4156 (file-name (git-file-name name version))
4157 (sha256
be099727 4158 (base32 "1lvh4ybqkriyqfg2zmic6mrg1981qv1i9vry1fdgsabn81hb71g4"))
fabcbf32
TGR
4159 (modules '((guix build utils)))
4160 (snippet
4161 '(begin
4162 ;; Remove use of __DATE__ and __TIME__ for reproducibility;
be099727 4163 ;; substitute the release date.
fabcbf32
TGR
4164 (substitute* "src/utilities/HYPRE_utilities.h"
4165 (("Date Compiled: .*$")
be099727 4166 "Date Compiled: Oct 19 2018 15:23:00 +0000\"\n"))
fabcbf32 4167 #t))))
528bb464 4168 (build-system gnu-build-system)
be099727
TGR
4169 (outputs '("out" ; 6.1 MiB of headers and libraries
4170 "doc")) ; 4.8 MiB of documentation
528bb464
EB
4171 (native-inputs
4172 `(("doc++" ,doc++)
4173 ("netpbm" ,netpbm)
be099727 4174 ("perl" ,perl) ; needed to run 'ppmquant' during tests
8b35c8cd
RW
4175 ("texlive" ,(texlive-union (list texlive-xypic
4176 texlive-cm
9b405aea 4177 texlive-latex-hyperref
9b405aea 4178 texlive-bibtex)))
528bb464
EB
4179 ("ghostscript" ,ghostscript)))
4180 (inputs
4181 `(("blas" ,openblas)
4182 ("lapack" ,lapack)))
4183 (arguments
4184 `(#:modules ((srfi srfi-1)
4185 ,@%gnu-build-system-modules)
4186 #:configure-flags '("--enable-shared"
4187 "--disable-fortran"
4188 "--without-MPI"
4189 "--with-openmp"
4190 "--with-fei"
4191 "--with-lapack"
4192 "--with-blas")
4193 #:phases
4194 (modify-phases %standard-phases
9b405aea
PN
4195 (add-before 'build 'set-HOME
4196 (lambda _
4197 ;; FIXME: texlive-union does not find the built
4198 ;; metafonts, so it tries to generate them in HOME.
4199 (setenv "HOME" "/tmp")
4200 #t))
528bb464
EB
4201 (add-before 'configure 'chdir-src
4202 (lambda _ (chdir "src")))
4203 (replace 'configure
4204 (lambda* (#:key build target configure-flags
4205 #:allow-other-keys #:rest args)
4206 (let* ((configure (assoc-ref %standard-phases 'configure)))
4207 (apply configure
4208 (append args
4209 (list #:configure-flags
4210 (cons (string-append
4211 "--host=" (or target build))
4212 configure-flags)))))))
4213 (add-after 'build 'build-docs
4214 (lambda _
9b405aea 4215 (invoke "make" "-Cdocs" "pdf" "html")))
528bb464
EB
4216 (replace 'check
4217 (lambda _
4218 (setenv "LD_LIBRARY_PATH" (string-append (getcwd) "/hypre/lib"))
4219 (setenv "PATH" (string-append "." ":" (getenv "PATH")))
6b1c7ac8
RW
4220 (invoke "make" "check" "CHECKRUN=")
4221 (for-each (lambda (filename)
4222 (let ((size (stat:size (stat filename))))
4223 (when (positive? size)
4224 (error (format #f "~a size ~d; error indication~%"
4225 filename size)))))
4226 (find-files "test" ".*\\.err$"))
4227 #t))
528bb464
EB
4228 (add-after 'install 'install-docs
4229 (lambda* (#:key outputs #:allow-other-keys)
4230 ;; Custom install because docs/Makefile doesn't honor ${docdir}.
4231 (let* ((doc (assoc-ref outputs "doc"))
4232 (docdir (string-append doc "/share/doc/hypre-" ,version)))
528bb464
EB
4233 (with-directory-excursion "docs"
4234 (for-each (lambda (base)
4235 (install-file (string-append base ".pdf") docdir)
be099727 4236 (copy-recursively base docdir)) ; html docs
528bb464
EB
4237 '("HYPRE_usr_manual"
4238 "HYPRE_ref_manual")))
4239 #t))))))
4240 (home-page "http://www.llnl.gov/casc/hypre/")
4241 (synopsis "Library of solvers and preconditioners for linear equations")
4242 (description
4243 "HYPRE is a software library of high performance preconditioners and
4244solvers for the solution of large, sparse linear systems of equations. It
4245features multigrid solvers for both structured and unstructured grid
4246problems.")
4247 (license license:lgpl2.1)))
4248
4249(define-public hypre-openmpi
4250 (package (inherit hypre)
4251 (name "hypre-openmpi")
4252 (inputs
4253 `(("mpi" ,openmpi)
4254 ,@(package-inputs hypre)))
4255 (arguments
4256 (substitute-keyword-arguments (package-arguments hypre)
4257 ((#:configure-flags flags)
4258 ``("--with-MPI"
6df2a50a
LC
4259 ,@(delete "--without-MPI" ,flags)))
4260 ((#:phases phases)
4261 `(modify-phases ,phases
bbe46a4a
EB
4262 (add-before 'check 'mpi-setup
4263 ,%openmpi-setup)))))
528bb464
EB
4264 (synopsis "Parallel solvers and preconditioners for linear equations")
4265 (description
4266 "HYPRE is a software library of high performance preconditioners and
4267solvers for the solution of large, sparse linear systems of equations on
4268parallel computers. It features parallel multigrid solvers for both
4269structured and unstructured grid problems.")))
6c90e183
EB
4270
4271(define-public matio
4272 (package
4273 (name "matio")
4274 (version "1.5.6")
4275 (source
4276 (origin
4277 (method url-fetch)
de67e922 4278 (uri (string-append "mirror://sourceforge/matio/matio/" version "/"
6c90e183
EB
4279 "matio-" version ".tar.gz"))
4280 (sha256
4281 (base32
4282 "0y2qymgxank8wdiwc68ap8bxdzrhvyw86i29yh3xgn4z1njfd9ir"))))
4283 (build-system gnu-build-system)
4284 (inputs
4285 `(("zlib" ,zlib)
4286 ("hdf5" ,hdf5)))
4287 (home-page "http://matio.sourceforge.net/")
4288 (synopsis "Library for reading and writing MAT files")
4289 (description "Matio is a library for reading and writing MAT files. It
4290supports compressed MAT files, as well as newer (version 7.3) MAT files.")
4291 (license license:bsd-2)))
d721c83a 4292
517318ad
LF
4293(define-public vc
4294 (package
4295 (name "vc")
9d731fb6 4296 (version "1.4.1")
517318ad
LF
4297 (source
4298 (origin (method url-fetch)
4299 (uri (string-append "https://github.com/VcDevel/Vc/releases/"
4300 "download/" version "/Vc-" version ".tar.gz"))
4301 (sha256
4302 (base32
9d731fb6 4303 "17qili8bf8r78cng65yf4qmgna8kiqjqbgcqbric6v9j6nkhkrk8"))))
517318ad
LF
4304 (build-system cmake-build-system)
4305 (arguments
4306 '(#:configure-flags
33d82486
MB
4307 '("-DBUILD_TESTING=ON"
4308 ;; By default, Vc will optimize for the CPU of the build machine.
4309 ;; Setting this to "none" makes it create portable binaries. See
4310 ;; "cmake/OptimizeForArchitecture.cmake".
9d731fb6
MB
4311 "-DTARGET_ARCHITECTURE=none")
4312 #:phases (modify-phases %standard-phases
4313 (add-after 'unpack 'copy-testdata
4314 (lambda* (#:key inputs native-inputs #:allow-other-keys)
4315 (let ((testdata (assoc-ref (or native-inputs inputs)
4316 "testdata")))
4317 (copy-recursively testdata "tests/testdata")
4318 #t))))))
4319 (native-inputs
4320 `(("virtest" ,virtest)
4321
4322 ;; This is a submodule in the git project, but not part of the
4323 ;; released sources. See the git branch for the commit to take.
4324 ("testdata" ,(let ((commit "9ada1f34d6a41f1b5553d6223f277eae72c039d3"))
4325 (origin
4326 (method git-fetch)
4327 (uri (git-reference
4328 (url "https://github.com/VcDevel/vc-testdata")
4329 (commit "9ada1f34d6a41f1b5553d6223f277eae72c039d3")))
4330 (file-name (git-file-name "vc-testdata"
4331 (string-take commit 7)))
4332 (sha256
4333 (base32
4334 "1hkhqib03qlcq412ym2dciynfxcdr2ygqhnplz4l1vissr1wnqn2")))))))
517318ad
LF
4335 (synopsis "SIMD vector classes for C++")
4336 (description "Vc provides portable, zero-overhead C++ types for explicitly
4337data-parallel programming. It is a library designed to ease explicit
4338vectorization of C++ code. Its types enable explicitly stating data-parallel
4339operations on multiple values. The parallelism is therefore added via the type
4340system. Vc has an intuitive API and provides portability between different
4341compilers and compiler versions as well as portability between different vector
4342instruction sets. Thus, an application written with Vc can be compiled for:
4343@enumerate
4344@item AVX and AVX2
d1e4ad1b 4345@item SSE2 up to SSE4.2 or SSE4a
517318ad
LF
4346@item Scalar
4347@item MIC
4348@item NEON (in development)
4349@item NVIDIA GPUs / CUDA (in development)
4350@end enumerate\n")
4351 (home-page "https://github.com/VcDevel/Vc")
a8ead6f9
EF
4352 ;; "No support_???.cpp file exists for this architecture."
4353 (supported-systems '("x86_64-linux" "i686-linux"))
517318ad 4354 (license license:bsd-3)))
54052a54 4355
4356(define-public reducelcs
4357 ;; This is the last commit which is available upstream, no
4358 ;; release happened since 2010.
4359 (let ((commit "474f88deb968061abe8cf11c959e02319b8ae5c0")
4360 (revision "1"))
4361 (package
4362 (name "reducelcs")
4363 (version (string-append "1.0-" revision "." (string-take commit 7)))
4364 (source
4365 (origin
4366 (method git-fetch)
4367 (uri (git-reference
4368 (url "https://github.com/gdv/Reduce-Expand-for-LCS")
4369 (commit commit)))
4370 (file-name (string-append name "-" version "-checkout"))
4371 (sha256
4372 (base32
4373 "1rllzcfwc042c336mhq262a8ha90x6afq30kvk60r7i4761j4yjm"))))
4374 (build-system gnu-build-system)
4375 (inputs
4376 `(("openlibm" ,openlibm)))
4377 (arguments
4378 `(#:tests? #f ; no tests
4379 #:phases
4380 (modify-phases %standard-phases
4381 (delete 'configure) ; No configure script exists.
4382 (replace 'install ; No install phase exists.
4383 (lambda* (#:key outputs #:allow-other-keys)
4384 (let* ((out (assoc-ref outputs "out"))
4385 (bin (string-append out "/bin")))
4386 (install-file "Approximation" bin)
4387 (install-file "CollectResults" bin)
4388 (install-file "GenerateInstances" bin)
4389 #t))))))
4390 (synopsis "Approximate Longest Commons Subsequence computation tool")
4391 (description
4392 "@code{reduceLCS} is an implementation of the Reduce-Expand
4393algorithm for LCS. It is a fast program to compute the approximate
4394Longest Commons Subsequence of a set of strings.")
4395 (home-page "https://github.com/gdv/Reduce-Expand-for-LCS")
c000b6b1 4396 (license license:gpl3+))))
479c4273
JD
4397
4398(define-public jacal
4399 (package
4400 (name "jacal")
4401 (version "1c4")
4402 (source (origin
4403 (method url-fetch)
4404 (uri (string-append
4405 "http://groups.csail.mit.edu/mac/ftpdir/scm/jacal-"
4406 version ".zip"))
4407 (sha256 (base32
4408 "055zrn12a1dmy0dqkwrkq3fklbhg3yir6vn0lacp4mvbg8573a3q"))
4409 (patches (search-patches "jacal-fix-texinfo.patch"))))
4410 (build-system gnu-build-system)
4411 (arguments
4412 `(#:phases
4413 (modify-phases %standard-phases
4414 (add-before 'build 'pre-build
4415 ;; Don't use upstream's script - it really doesn't fit into
4416 ;; Guix's functional paradigm.
4417 (lambda* (#:key inputs outputs #:allow-other-keys)
4418 (substitute* "Makefile"
4419 (("^install: install-script") "install: "))))
4420 (add-after 'install 'post-install
4421 ;; Instead, we provide our own simplified script.
4422 (lambda* (#:key inputs outputs #:allow-other-keys)
4423 (let ((wrapper (string-append (assoc-ref outputs "out")
4424 "/bin/jacal")))
4425 (format (open wrapper (logior O_WRONLY O_CREAT))
4426 (string-append "#!~a\nexec ~a/bin/scm -ip1 "
4427 "-e '(slib:load \"~a/lib/jacal/math\") "
4428 "(math)' \"$@\"\n")
4429 (which "bash")
4430 (assoc-ref inputs "scm")
4431 (assoc-ref outputs "out"))
4432 (chmod wrapper #o555))))
4433 (replace 'configure
9cd82b1c
RW
4434 (lambda* (#:key outputs #:allow-other-keys)
4435 (invoke "./configure"
4436 (string-append "--prefix="
4437 (assoc-ref outputs "out"))))))))
479c4273
JD
4438 (inputs `(("scm" ,scm)))
4439 (native-inputs `(("unzip" ,unzip)
4440 ("texinfo" ,texinfo)))
4441 (synopsis "Symbolic mathematics system")
4442 (description "GNU JACAL is an interactive symbolic mathematics program based on
4443Scheme. It manipulate and simplify a range of mathematical expressions such
4444as equations, scalars, vectors, and matrices.")
6fd52309 4445 (home-page "https://www.gnu.org/software/jacal/")
479c4273
JD
4446 (license license:gpl3+)))
4447
313844d9
TF
4448(define-public z3
4449 (package
4450 (name "z3")
0fe654eb 4451 (version "4.8.8")
fb525bfd 4452 (home-page "https://github.com/Z3Prover/z3")
313844d9 4453 (source (origin
fb525bfd
MB
4454 (method git-fetch)
4455 (uri (git-reference (url home-page)
4456 (commit (string-append "z3-" version))))
2d7b99b3 4457 (file-name (git-file-name name version))
313844d9
TF
4458 (sha256
4459 (base32
0fe654eb 4460 "1rn538ghqwxq0v8i6578j8mflk6fyv0cp4hjfqynzvinjbps56da"))))
fa574a6d 4461 (build-system gnu-build-system)
313844d9 4462 (arguments
f6b4d395
JK
4463 `(#:imported-modules ((guix build python-build-system)
4464 ,@%gnu-build-system-modules)
4465 #:modules (((guix build python-build-system) #:select (site-packages))
4466 (guix build gnu-build-system)
4467 (guix build utils))
4468 #:phases
313844d9 4469 (modify-phases %standard-phases
8b87d095
JK
4470 (add-after 'unpack 'enable-bytecode-determinism
4471 (lambda _
4472 (setenv "PYTHONHASHSEED" "0")
4473 #t))
ad6c6a5b
EF
4474 (add-after 'unpack 'fix-compatability
4475 ;; Versions after 4.8.3 have immintrin.h IFDEFed for Windows only.
4476 (lambda _
4477 (substitute* "src/util/mpz.cpp"
4478 (("#include <immintrin.h>") ""))
4479 #t))
cf684d87
TF
4480 (add-before 'configure 'bootstrap
4481 (lambda _
32d5360f 4482 (invoke "python" "scripts/mk_make.py")))
fa574a6d
AB
4483 ;; work around gnu-build-system's setting --enable-fast-install
4484 ;; (z3's `configure' is a wrapper around the above python file,
4485 ;; which fails when passed --enable-fast-install)
4486 (replace 'configure
4487 (lambda* (#:key inputs outputs #:allow-other-keys)
4488 (invoke "./configure"
f6b4d395
JK
4489 "--python"
4490 (string-append "--prefix=" (assoc-ref outputs "out"))
4491 (string-append "--pypkgdir=" (site-packages inputs outputs)))))
fa574a6d
AB
4492 (add-after 'configure 'change-directory
4493 (lambda _
4494 (chdir "build")
4495 #t))
cf684d87 4496 (add-before 'check 'make-test-z3
313844d9 4497 (lambda _
cf684d87 4498 ;; Build the test suite executable.
32d5360f
RW
4499 (invoke "make" "test-z3" "-j"
4500 (number->string (parallel-job-count)))))
cf684d87
TF
4501 (replace 'check
4502 (lambda _
4503 ;; Run all the tests that don't require arguments.
32d5360f 4504 (invoke "./test-z3" "/a"))))))
313844d9 4505 (native-inputs
fa574a6d
AB
4506 `(("which" ,which)
4507 ("python" ,python-wrapper)))
313844d9
TF
4508 (synopsis "Theorem prover")
4509 (description "Z3 is a theorem prover and @dfn{satisfiability modulo
cf684d87 4510theories} (SMT) solver. It provides a C/C++ API, as well as Python bindings.")
313844d9 4511 (license license:expat)))
3d5d87a3 4512
6d433d6e
EB
4513(define-public elpa
4514 (package
4515 (name "elpa")
4516 (version "2018.11.001")
4517 (source (origin
4518 (method url-fetch)
4519 (uri (string-append "http://elpa.mpcdf.mpg.de/html/Releases/"
4520 version "/elpa-" version ".tar.gz"))
4521 (sha256
4522 (base32
4523 "05hv3v5i6xmziaizw350ff72y1c3k662r85fm3xfdrkclj5zw9yc"))))
4524 (build-system gnu-build-system)
4525 (native-inputs
4526 `(("fortran" ,gfortran)
4527 ("perl" ,perl))) ;for configure and deps
4528 (inputs
4529 `(("blas" ,openblas)))
4530 (arguments
4531 `(#:configure-flags
4532 `("--enable-openmp"
4533 "--with-mpi=no"
4534 ;; ELPA unfortunately does not support runtime dispatch, so we can
4535 ;; only enable the "generic" kernels. See the "Cross compilation"
4536 ;; section of INSTALL.md.
4537 "--enable-generic"
4538 "--disable-sse" "--disable-sse-assembly" ;Require SSE3
4539 "--disable-avx" "--disable-avx2" "--disable-avx512"
4540 ,(string-append "CFLAGS=-O3 "
4541 "-funsafe-loop-optimizations -funsafe-math-optimizations "
4542 "-ftree-vect-loop-version -ftree-vectorize "
4543 ,(let ((system (or (%current-target-system)
4544 (%current-system))))
4545 (cond
4546 ((or (string-prefix? "x86_64" system)
4547 (string-prefix? "i686" system))
4548 "-msse2")
4549 (else "")))))
4550 #:parallel-tests? #f ;tests are multi-threaded, via BLAS
4551 #:phases
4552 (modify-phases %standard-phases
4553 (add-before 'configure 'patch-header-generation
4554 (lambda _
4555 (substitute* "configure"
4556 (("^ *make.*top_srcdir=\"\\$srcdir\"" &)
4557 (string-append & " CPP=\"$CPP\"")))
4558 #t))
4559 (add-before 'check 'setup-tests
4560 (lambda _
4561 ;; Decrease test time and RAM use by computing fewer eigenvalues.
4562 ;; The flags are (MATRIX-SIZE, EIGENVALUES, BLOCK-SIZE), where
4563 ;; the default is (500, 250, 16) for C tests and (5000, 150, 16)
4564 ;; for Fortran. This also causes several tests to pass that
4565 ;; otherwise would otherwise fail with matrix size 5000; possibly
4566 ;; due to floating point tolerances that are too tight.
4567 (setenv "TEST_FLAGS" "1500 50 16") ;from elpa.spec
4568 (setenv "OMP_NUM_THREADS" (number->string (parallel-job-count)))
4569 (substitute* "Makefile"
4570 ;; Test scripts are generated, patch the shebang
4571 (("#!/bin/bash") (string-append "#!" (which "sh"))))
4572 #t)))))
4573 (home-page "http://elpa.mpcdf.mpg.de")
4574 (synopsis "Eigenvalue solvers for symmetric matrices")
4575 (description
4576 "The ELPA library provides efficient and scalable direct eigensolvers for
4577symmetric matrices.")
4578 (license license:lgpl3)))
4579
4580(define-public elpa-openmpi
4581 (package (inherit elpa)
4582 (name "elpa-openmpi")
4583 (inputs
4584 `(("mpi" ,openmpi)
4585 ("scalapack" ,scalapack)
4586 ,@(package-inputs elpa)))
4587 (arguments
4588 (substitute-keyword-arguments (package-arguments elpa)
4589 ((#:configure-flags cf '())
4590 `(cons "--with-mpi=yes" (delete "--with-mpi=no" ,cf)))
4591 ((#:phases phases '%standard-phases)
4592 `(modify-phases ,phases
4593 (add-before 'check 'mpi-setup
4594 (lambda _
4595 ;; Tests use 2 mpi tasks by default, use our remaining build
4596 ;; cores as OpenMP threads.
4597 (setenv "OMP_NUM_THREADS" (number->string
4598 (max (quotient (parallel-job-count) 2)
4599 1)))
4600 (,%openmpi-setup)))))))
4601 (synopsis "Eigenvalue solvers for symmetric matrices (with MPI support)")))
4602
e01397b4
EB
4603(define-public elemental
4604 (package
4605 (name "elemental")
4606 (version "0.87.7")
4607 (source (origin
5c0b6d1b
EF
4608 (method git-fetch)
4609 (uri (git-reference
4610 (url "https://github.com/elemental/Elemental.git")
4611 (commit (string-append "v" version))))
4612 (file-name (git-file-name name version))
e01397b4
EB
4613 (sha256
4614 (base32
5c0b6d1b 4615 "1687xpjjzig27y2pnqv7hv09smpijyfdpz7qjgmcxf4shfajlfkc"))))
e01397b4 4616 (build-system cmake-build-system)
1e05e837 4617 (home-page "https://github.com/elemental/Elemental")
e01397b4
EB
4618 (native-inputs
4619 `(("gfortran" ,gfortran)))
4620 (inputs
4621 `(("blas" ,openblas)
4622 ("gfortran:lib" ,gfortran "lib")
4623 ("gmp" ,gmp)
4624 ("lapack" ,lapack)
4625 ("metis" ,metis)
4626 ("mpc" ,mpc)
4627 ("mpfr" ,mpfr)
4628 ("mpi" ,openmpi)
4629 ("qd" ,qd)))
4630 (arguments
4631 `(#:build-type "Release" ;default RelWithDebInfo not supported
4632 #:configure-flags `("-DEL_DISABLE_PARMETIS:BOOL=YES"
4633 "-DEL_AVOID_COMPLEX_MPI:BOOL=NO"
4634 "-DEL_CACHE_WARNINGS:BOOL=YES"
4635 "-DEL_TESTS:BOOL=YES"
4636 "-DCMAKE_INSTALL_LIBDIR=lib"
4637 "-DGFORTRAN_LIB=gfortran")
4638 #:phases (modify-phases %standard-phases
3b42e2be
EF
4639 (add-before 'check 'mpi-setup
4640 ,%openmpi-setup)
e01397b4
EB
4641 (add-before 'check 'setup-tests
4642 (lambda _
4643 ;; Parallelism is done at the MPI layer.
4644 (setenv "OMP_NUM_THREADS" "1")
4645 #t))
4646 (add-after 'install 'remove-tests
4647 (lambda* (#:key outputs #:allow-other-keys)
4648 ;; Tests are installed, with no easy configuration
4649 ;; switch to prevent this, so delete them.
4650 (delete-file-recursively
3b42e2be 4651 (string-append (assoc-ref outputs "out") "/bin"))
e01397b4
EB
4652 #t)))))
4653 (synopsis "Dense and sparse-direct linear algebra and optimization")
4654 (description "Elemental is a modern C++ library for distributed-memory
4655dense and sparse-direct linear algebra, conic optimization, and lattice
4656reduction.")
4657 (license license:bsd-2)))
5b05dce7
JN
4658
4659(define-public mcrl2
4660 (package
4661 (name "mcrl2")
3bc74090 4662 (version "201908.0")
5b05dce7
JN
4663 (source (origin
4664 (method url-fetch)
185152e3
JN
4665 (uri (string-append
4666 "https://www.mcrl2.org/download/release/mcrl2-"
4667 version ".tar.gz"))
5b05dce7
JN
4668 (sha256
4669 (base32
3bc74090 4670 "1i4xgl2d5fgiz1mwi50cyfkrrcpm8nxfayfjgmhq7chs58wlhfsz"))))
5b05dce7
JN
4671 (inputs
4672 `(("boost" ,boost)
4673 ("glu" ,glu)
4674 ("mesa" ,mesa)
077d66ed 4675 ("qtbase" ,qtbase)))
5b05dce7 4676 (build-system cmake-build-system)
ed0c5d3c 4677 (synopsis "Toolset for the mCRL2 formal specification language")
5b05dce7 4678 (description
ed0c5d3c
TGR
4679 "@dfn{mCRL2} (micro Common Representation Language 2) is a formal
4680specification language for describing concurrent discrete event systems. Its
4681toolset supports analysis and automatic verification, linearisation, simulation,
4682state-space exploration and generation, and tools to optimise and analyse
5b05dce7
JN
4683specifications. Also, state spaces can be manipulated, visualised and
4684analysed.")
b3882709 4685 (home-page "https://mcrl2.org")
5b05dce7 4686 (license license:boost1.0)))
41835f94 4687
e03b9126
JN
4688(define-public mcrl2-minimal
4689 (package
4690 (inherit mcrl2)
4691 (name "mcrl2-minimal")
4692 (inputs
4693 `(("boost" ,boost)))
4694 (arguments
4695 '(#:configure-flags '("-DMCRL2_ENABLE_GUI_TOOLS=OFF")))))
4696
910deec6
NV
4697(define-public tcalc
4698 (package
4699 (name "tcalc")
4700 (version "2.0")
4701 (source
4702 (origin
4703 (method url-fetch)
4704 (uri (string-append "https://sites.google.com/site/mohammedisam2000/tcalc/tcalc-"
4705 version ".tar.gz"))
4706 (sha256
4707 (base32
4708 "0jq806m4dqfia85nppfm75mml9w57g0cgv4cdw9bp3zymda83s0m"))))
4709 (build-system gnu-build-system)
4710 (synopsis "The terminal calculator")
4711 (description
4712 "The terminal calculator is a small program to help users of the GNU/Linux
4713terminal do calculations simply and quickly. The formula to be calculated can
4714be fed to @command{tcalc} through the command line.")
4715 (home-page "https://sites.google.com/site/mohammedisam2000/tcalc")
4716 (license license:gpl3+)))
b26e4f26
EB
4717
4718(define-public sundials
4719 (package
4720 (name "sundials")
4721 (version "3.1.1")
4722 (source
4723 (origin
4724 (method url-fetch)
4725 (uri (string-append "https://computation.llnl.gov/projects/sundials/download/"
4726 "sundials-" version ".tar.gz"))
4727 (sha256
4728 (base32
4729 "090s8ymhd0g1s1d44fa73r5yi32hb4biwahhbfi327zd64yn8kd2"))))
4730 (build-system cmake-build-system)
4731 (native-inputs
4732 `(("python" ,python-2))) ;for tests; syntax incompatible with python 3
4733 (inputs
4734 `(("fortran" ,gfortran) ;for fcmix
4735 ("blas" ,openblas)
4736 ("suitesparse" ,suitesparse))) ;TODO: Add hypre
4737 (arguments
4738 `(#:configure-flags `("-DEXAMPLES_ENABLE_C:BOOL=ON"
4739 "-DEXAMPLES_ENABLE_CXX:BOOL=ON"
4740 "-DEXAMPLES_ENABLE_F77:BOOL=ON"
4741 "-DEXAMPLES_ENABLE_F90:BOOL=ON"
4742 "-DEXAMPLES_INSTALL:BOOL=OFF"
4743
4744 "-DFCMIX_ENABLE:BOOL=ON"
4745
4746 "-DKLU_ENABLE:BOOL=ON"
4747 ,(string-append "-DKLU_INCLUDE_DIR="
4748 (assoc-ref %build-inputs "suitesparse")
4749 "/include")
4750 ,(string-append "-DKLU_LIBRARY_DIR="
4751 (assoc-ref %build-inputs "suitesparse")
4752 "/lib"))))
4753 (home-page "https://computation.llnl.gov/projects/sundials")
4754 (synopsis "Suite of nonlinear and differential/algebraic equation solvers")
4755 (description "SUNDIALS is a family of software packages implemented with
4756the goal of providing robust time integrators and nonlinear solvers that can
4757easily be incorporated into existing simulation codes.")
4758 (license license:bsd-3)))
4759
4760(define-public sundials-openmpi
4761 (package (inherit sundials)
4762 (name "sundials-openmpi")
4763 (inputs
4764 `(("mpi" ,openmpi)
4765 ("petsc" ,petsc-openmpi) ;support in SUNDIALS requires MPI
4766 ,@(package-inputs sundials)))
4767 (arguments
4768 (substitute-keyword-arguments (package-arguments sundials)
4769 ((#:configure-flags flags '())
4770 `(cons* "-DMPI_ENABLE:BOOL=ON"
4771 "-DPETSC_ENABLE:BOOL=ON"
4772 (string-append "-DPETSC_INCLUDE_DIR="
4773 (assoc-ref %build-inputs "petsc")
4774 "/include")
4775 (string-append "-DPETSC_LIBRARY_DIR="
4776 (assoc-ref %build-inputs "petsc")
4777 "/lib")
4778 ,flags))
4779 ((#:phases phases '%standard-phases)
4780 `(modify-phases ,phases
bbe46a4a
EB
4781 (add-before 'check 'mpi-setup
4782 ,%openmpi-setup)))))
b26e4f26 4783 (synopsis "SUNDIALS with OpenMPI support")))
a6b9ebc2
EB
4784
4785(define-public combinatorial-blas
4786 (package
4787 (name "combinatorial-blas")
4788 (version "1.6.2")
4789 (source
4790 (origin
4791 (method url-fetch)
4792 (uri (string-append "http://eecs.berkeley.edu/~aydin/CombBLAS_FILES/"
4793 "CombBLAS_beta_"
4794 (match (string-split version #\.)
4795 ((major minor patch)
4796 (string-append major minor "_" patch))) ;e.g. "16_2"
4797 ".tgz"))
4798 (sha256
4799 (base32
4800 "1a9wbgdqyy1whhfc0yl0yqkax3amnqa6iihhq48d063gc0jwfd9a"))
4801 (patches (search-patches "combinatorial-blas-awpm.patch"
4802 "combinatorial-blas-io-fix.patch"))))
4803 (build-system cmake-build-system)
4804 (inputs
4805 `(("mpi" ,openmpi)
4806 ("test-data" ,(origin
4807 (method url-fetch)
4808 (uri (string-append "https://people.eecs.berkeley.edu/~aydin/"
4809 "CombBLAS_FILES/testdata_combblas1.6.1.tgz"))
4810 (sha256
4811 (base32
4812 "01y2781cy3fww7znmidrp85mf8zx0c905w5vzvk1mgrmhhynim87"))))))
4813 (arguments
4814 `(#:configure-flags '("-DBUILD_SHARED_LIBS:BOOL=YES"
4815 "-DCMAKE_CXX_FLAGS=-DUSE_FUNNEL")
4816 #:parallel-tests? #f ;tests use 'mpiexec -n4'
4817 #:phases
4818 (modify-phases %standard-phases
4819 (add-before 'check 'mpi-setup
4820 ,%openmpi-setup)
4821 (add-before 'check 'test-setup
4822 (lambda* (#:key inputs #:allow-other-keys)
4823 (setenv "OMP_NUM_THREADS" "2")
4824 (invoke "tar" "xf" (assoc-ref inputs "test-data")))))))
4825 (home-page "https://people.eecs.berkeley.edu/~aydin/CombBLAS/html/")
4826 (synopsis "Linear algebra primitives for graph analytics")
4827 (description "The Combinatorial BLAS (CombBLAS) is an extensible
4828distributed-memory parallel graph library offering a small but powerful set of
4829linear algebra primitives specifically targeting graph analytics.")
4830 (license (list
4831 license:gpl2+ ;include/psort/(funnel|sort)*.h
4832 license:x11 ;usort and psort
4833 license:bsd-3)))) ;CombBLAS and MersenneTwister.h
3847d1f2
RW
4834
4835(define-public dune-common
4836 (package
4837 (name "dune-common")
6ca2d7da 4838 (version "2.7.0")
3847d1f2
RW
4839 (source
4840 (origin
4841 (method url-fetch)
4842 (uri (string-append "https://dune-project.org/download/"
4843 version "/dune-common-" version ".tar.gz"))
4844 (sha256
4845 (base32
6ca2d7da 4846 "140q1zh44cr5yrjwg4b5ga803rkqv55vk30l2cqm29aklj1wb0rw"))))
3847d1f2
RW
4847 (build-system cmake-build-system)
4848 (arguments
4849 `(#:phases
4850 (modify-phases %standard-phases
4851 (add-after 'build 'build-tests
4852 (lambda* (#:key make-flags #:allow-other-keys)
393dc1cc 4853 (apply invoke "make" "build_tests" make-flags))))))
3847d1f2
RW
4854 (inputs
4855 `(("gmp" ,gmp)
4856 ("metis" ,metis)
3847d1f2
RW
4857 ("openblas" ,openblas)
4858 ("python" ,python)
4859 ("superlu" ,superlu)))
4860 (native-inputs
4861 `(("gfortran" ,gfortran)
4862 ("pkg-config" ,pkg-config)))
4863 (home-page "https://dune-project.org/")
4864 (synopsis "Distributed and Unified Numerics Environment")
4865 (description "DUNE, the Distributed and Unified Numerics Environment is a
4866modular toolbox for solving @dfn{partial differential equations} (PDEs) with
4867grid-based methods. It supports the easy implementation of methods like
4868@dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
4869Differences} (FD).")
4870 ;; GPL version 2 with "runtime exception" to make it behave like LGPLv2.
4871 (license license:gpl2)))
242dbd8e
RW
4872
4873(define-public dune-geometry
4874 (package
4875 (name "dune-geometry")
6ca2d7da 4876 (version "2.7.0")
242dbd8e
RW
4877 (source
4878 (origin
4879 (method url-fetch)
4880 (uri (string-append "https://dune-project.org/download/"
4881 version "/dune-geometry-" version ".tar.gz"))
4882 (sha256
4883 (base32
6ca2d7da 4884 "1cicvlwbyyw76npicnblxckyvhbfn3ip8isydiv3hlrlz8zcg5nr"))))
242dbd8e
RW
4885 (build-system cmake-build-system)
4886 (arguments
4887 `(#:phases
4888 (modify-phases %standard-phases
4889 (add-after 'build 'build-tests
4890 (lambda* (#:key make-flags #:allow-other-keys)
4891 (apply invoke "make" "build_tests" make-flags))))))
4892 (inputs
4893 `(("dune-common" ,dune-common)
242dbd8e
RW
4894 ;; Optional
4895 ("openblas" ,openblas)
4896 ("gmp" ,gmp)
4897 ("python" ,python)))
4898 (native-inputs
4899 `(("gfortran" ,gfortran)
4900 ("pkg-config" ,pkg-config)))
4901 (home-page "https://dune-project.org/")
4902 (synopsis "Distributed and Unified Numerics Environment")
4903 (description "DUNE, the Distributed and Unified Numerics Environment is a
4904modular toolbox for solving @dfn{partial differential equations} (PDEs) with
4905grid-based methods. It supports the easy implementation of methods like
4906@dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
4907Differences} (FD).
4908
4909This package contains the basic DUNE geometry classes.")
4910 ;; GPL version 2 with "runtime exception"
4911 (license license:gpl2)))
ef6e69fd 4912
07ebb75d
FG
4913(define-public dune-uggrid
4914 (package
4915 (name "dune-uggrid")
6ca2d7da 4916 (version "2.7.0")
07ebb75d
FG
4917 (source
4918 (origin
6ca2d7da
FG
4919 (method git-fetch)
4920 (uri (git-reference
4921 (url "https://gitlab.dune-project.org/staging/dune-uggrid.git")
4922 (commit (string-append "v" version))))
4923 (file-name (git-file-name name version))
07ebb75d
FG
4924 (sha256
4925 (base32
6ca2d7da 4926 "192miqgmfj6jwk969gydzpbv9ki7jg5nky3ydnrwa2nq29b5xkh0"))))
07ebb75d
FG
4927 (build-system cmake-build-system)
4928 (arguments
4929 `(#:phases
4930 (modify-phases %standard-phases
4931 (add-after 'build 'build-tests
4932 (lambda* (#:key make-flags #:allow-other-keys)
4933 (apply invoke "make" "build_tests" make-flags))))))
4934 (inputs
393dc1cc 4935 `(("dune-common" ,dune-common)))
07ebb75d
FG
4936 (native-inputs
4937 `(("gfortran" ,gfortran)
4938 ("pkg-config" ,pkg-config)))
4939 (home-page "https://dune-project.org/")
4940 (synopsis "Distributed and Unified Numerics Environment")
4941 (description "DUNE, the Distributed and Unified Numerics Environment is a
4942modular toolbox for solving @dfn{partial differential equations} (PDEs) with
4943grid-based methods. It supports the easy implementation of methods like
4944@dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
4945Differences} (FD).
4946
4947This package contains the DUNE UG grid classes.")
4948 (license license:lgpl2.1)))
4949
ef6e69fd
RW
4950(define-public dune-grid
4951 (package
4952 (name "dune-grid")
6ca2d7da 4953 (version "2.7.0")
ef6e69fd
RW
4954 (source
4955 (origin
4956 (method url-fetch)
4957 (uri (string-append "https://dune-project.org/download/"
4958 version "/dune-grid-" version ".tar.gz"))
4959 (sha256
4960 (base32
6ca2d7da 4961 "17fjz30qazjgl11sryyxnw9klai4yz1ji4bs68013xcxc5hdv27s"))))
ef6e69fd
RW
4962 (build-system cmake-build-system)
4963 (arguments
4964 `(#:phases
4965 (modify-phases %standard-phases
4966 (add-after 'build 'build-tests
4967 (lambda* (#:key make-flags #:allow-other-keys)
393dc1cc 4968 (apply invoke "make" "build_tests" make-flags))))))
ef6e69fd
RW
4969 (inputs
4970 `(("dune-common" ,dune-common)
4971 ("dune-geometry" ,dune-geometry)
4972 ("gmp" ,gmp)
4973 ("metis" ,metis)
4974 ("openblas" ,openblas)
ef6e69fd 4975 ("python" ,python)))
07ebb75d
FG
4976 (propagated-inputs
4977 `(("dune-uggrid" ,dune-uggrid)))
ef6e69fd
RW
4978 (native-inputs
4979 `(("gfortran" ,gfortran)
4980 ("pkg-config" ,pkg-config)))
4981 (home-page "https://dune-project.org/")
4982 (synopsis "Distributed and Unified Numerics Environment")
4983 (description "DUNE, the Distributed and Unified Numerics Environment is a
4984modular toolbox for solving @dfn{partial differential equations} (PDEs) with
4985grid-based methods. It supports the easy implementation of methods like
4986@dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
4987Differences} (FD).
4988
4989This package contains the basic DUNE grid classes.")
4990 ;; GPL version 2 with "runtime exception"
4991 (license license:gpl2)))
ea51d357
RW
4992
4993(define-public dune-istl
4994 (package
4995 (name "dune-istl")
6ca2d7da 4996 (version "2.7.0")
ea51d357
RW
4997 (source
4998 (origin
4999 (method url-fetch)
5000 (uri (string-append "https://dune-project.org/download/"
5001 version "/dune-istl-" version ".tar.gz"))
5002 (sha256
5003 (base32
6ca2d7da
FG
5004 "0gl3wgz5rs6sb4m83440ny45sbx7z7lnbi3gx6r9nm3rvy5j33f9"))
5005 (patches (search-patches "dune-istl-2.7-fix-non-mpi-tests.patch"))))
ea51d357
RW
5006 (build-system cmake-build-system)
5007 (arguments
5008 `(#:phases
5009 (modify-phases %standard-phases
f7cbf403
MB
5010 ;; XXX: istl/test/matrixtest.cc includes <fenv.h> and fails to find
5011 ;; the stdlib types when the gfortran header is used. Remove gfortran
5012 ;; from CPLUS_INCLUDE_PATH as a workaround.
5013 (add-after 'set-paths 'hide-gfortran
5014 (lambda* (#:key inputs #:allow-other-keys)
5015 (let ((gfortran (assoc-ref inputs "gfortran")))
5016 (setenv "CPLUS_INCLUDE_PATH"
5017 (string-join
5018 (delete (string-append gfortran "/include/c++")
5019 (string-split (getenv "CPLUS_INCLUDE_PATH") #\:))
5020 ":"))
5021 #t)))
ea51d357
RW
5022 (add-after 'build 'build-tests
5023 (lambda* (#:key make-flags #:allow-other-keys)
393dc1cc 5024 (apply invoke "make" "build_tests" make-flags))))))
ea51d357
RW
5025 (inputs
5026 `(("dune-common" ,dune-common)
ea51d357
RW
5027 ;; Optional
5028 ("metis" ,metis)
0a703c04 5029 ("suitesparse" ,suitesparse)
ea51d357
RW
5030 ("superlu" ,superlu)
5031 ("openblas" ,openblas)
5032 ("gmp" ,gmp)
5033 ("python" ,python)))
5034 (native-inputs
5035 `(("gfortran" ,gfortran)
5036 ("pkg-config" ,pkg-config)))
5037 (home-page "https://dune-project.org/")
5038 (synopsis "Distributed and Unified Numerics Environment")
5039 (description "DUNE, the Distributed and Unified Numerics Environment is a
5040modular toolbox for solving @dfn{partial differential equations} (PDEs) with
5041grid-based methods.
5042
5043This is the iterative solver template library which provides generic sparse
5044matrix/vector classes and a variety of solvers based on these classes. A
5045special feature is the use of templates to exploit the recursive block
5046structure of finite element matrices at compile time. Available solvers
5047include Krylov methods, (block-) incomplete decompositions and
5048aggregation-based algebraic multigrid.")
5049 ;; GPL version 2 with "runtime exception"
5050 (license license:gpl2)))
5a70aa7d
RW
5051
5052(define-public dune-localfunctions
5053 (package
5054 (name "dune-localfunctions")
6ca2d7da 5055 (version "2.7.0")
5a70aa7d
RW
5056 (source
5057 (origin
5058 (method url-fetch)
5059 (uri (string-append "https://dune-project.org/download/"
5060 version "/dune-localfunctions-" version ".tar.gz"))
5061 (sha256
5062 (base32
6ca2d7da 5063 "1yih59h6vngii696bx1c2vil02lriij4kz0nc583mjn9kiaqxfqd"))))
5a70aa7d
RW
5064 (build-system cmake-build-system)
5065 (arguments
5066 `(#:phases
5067 (modify-phases %standard-phases
109bf6a0
MB
5068 ;; XXX: localfunctions/test/lagrangeshapefunctiontest.cc includes <fenv.h>
5069 ;; and fails to find the stdlib types when the gfortran header is used.
5070 ;; Hide gfortran from CPLUS_INCLUDE_PATH to ensure we get the GCC header.
5071 (add-after 'set-paths 'hide-gfortran
5072 (lambda* (#:key inputs #:allow-other-keys)
5073 (let ((gfortran (assoc-ref inputs "gfortran")))
5074 (setenv "CPLUS_INCLUDE_PATH"
5075 (string-join
5076 (delete (string-append gfortran "/include/c++")
5077 (string-split (getenv "CPLUS_INCLUDE_PATH") #\:))
5078 ":"))
5079 #t)))
5a70aa7d
RW
5080 (add-after 'build 'build-tests
5081 (lambda* (#:key make-flags #:allow-other-keys)
5082 (apply invoke "make" "build_tests" make-flags))))))
5083 (inputs
5084 `(("dune-common" ,dune-common)
5085 ("dune-geometry" ,dune-geometry)
5a70aa7d
RW
5086 ;; Optional
5087 ("metis" ,metis)
5088 ("superlu" ,superlu)
5089 ("gmp" ,gmp)))
5090 (native-inputs
5091 `(("gfortran" ,gfortran)
5092 ("pkg-config" ,pkg-config)))
5093 (home-page "https://dune-project.org/")
5094 (synopsis "Distributed and Unified Numerics Environment") ; TODO
5095 (description "This DUNE module provides interface and implementation for
5096shape functions defined on the DUNE reference elements. In addition to the
5097shape function, interpolation operators and special keys are provided which
5098can be used to assemble global function spaces on finite-element grids.
5099
5100This package provides an interface and implementation for shape functions
5101defined on the DUNE reference elements. In addition to the shape function,
5102interpolation operators and special keys are provided which can be used to
5103assemble global function spaces on finite-element grids.")
5104 ;; GPL version 2 with "runtime exception"
5105 (license license:gpl2)))
ab03d899
RW
5106
5107(define-public dune-alugrid
5108 (package
5109 (name "dune-alugrid")
6ca2d7da 5110 (version "2.7.0-git-81d35682")
ab03d899
RW
5111 (source
5112 (origin
6ca2d7da
FG
5113 (method git-fetch)
5114 (uri (git-reference
5115 (url "https://gitlab.dune-project.org/extensions/dune-alugrid.git")
5116 (commit "81d356827c84454b971937db02c02b90bbcd7fe5")))
5117 (file-name (git-file-name name version))
ab03d899
RW
5118 (sha256
5119 (base32
6ca2d7da 5120 "0z54lwfp53prcrs94k8gwh047l9z642jll3l56xlyfr69z0b2zz1"))))
ab03d899
RW
5121 (build-system cmake-build-system)
5122 (arguments
a669f6e2 5123 `(#:phases
ab03d899
RW
5124 (modify-phases %standard-phases
5125 (add-after 'unpack 'patch-include
5126 (lambda _
5127 (substitute* "dune/alugrid/test/test-alugrid.cc"
5128 (("doc/grids/gridfactory/testgrids")
5129 "doc/dune-grid/grids/gridfactory/testgrids"))
5130 #t))
5131 (add-after 'build 'build-tests
5132 (lambda* (#:key inputs make-flags #:allow-other-keys)
5133 (setenv "CPLUS_INCLUDE_PATH"
97149c57 5134 (string-append (assoc-ref inputs "dune-grid") "/share"))
393dc1cc 5135 (apply invoke "make" "build_tests" make-flags))))))
ab03d899
RW
5136 (inputs
5137 `(("dune-common" ,dune-common)
5138 ("dune-geometry" ,dune-geometry)
5139 ("dune-grid" ,dune-grid)
ab03d899
RW
5140 ;; Optional
5141 ("metis" ,metis)
5142 ("openblas" ,openblas)
5143 ("python" ,python)
5144 ("superlu" ,superlu)
5145 ("gmp" ,gmp)
5146 ("zlib" ,zlib)))
5147 (native-inputs
5148 `(("gfortran" ,gfortran)
5149 ("pkg-config" ,pkg-config)))
5150 (home-page "https://dune-project.org/")
5151 (synopsis "Distributed and Unified Numerics Environment")
5152 (description "ALUGrid is an adaptive, loadbalancing, unstructured
5153implementation of the DUNE grid interface supporting either simplices or
5154cubes.")
5155 (license license:gpl2+)))
0e50630f 5156
f1f9466e
FG
5157(define-public dune-subgrid
5158 (package
5159 (name "dune-subgrid")
6ca2d7da 5160 (version "2.7.0-git-2103a363")
f1f9466e
FG
5161 (source
5162 (origin
5163 (method git-fetch)
5164 (uri (git-reference
5165 (url "https://git.imp.fu-berlin.de/agnumpde/dune-subgrid")
6ca2d7da 5166 (commit "2103a363f32e8d7b60e66eee7ddecf969f6cf762")))
f1f9466e
FG
5167 (file-name (git-file-name name version))
5168 (sha256
5169 (base32
6ca2d7da 5170 "1wsjlypd3835c3arqjkw836cxx5q67zy447wa65q634lf6f6v9ia"))))
f1f9466e
FG
5171 (build-system cmake-build-system)
5172 (arguments
5173 `(#:phases
5174 (modify-phases %standard-phases
5175 (add-after 'build 'build-tests
5176 (lambda* (#:key make-flags #:allow-other-keys)
393dc1cc 5177 (apply invoke "make" "build_tests" make-flags))))))
f1f9466e
FG
5178 (inputs
5179 `(("dune-common" ,dune-common)
5180 ("dune-geometry" ,dune-geometry)
5181 ("dune-grid" ,dune-grid)
f1f9466e
FG
5182 ;; Optional
5183 ("metis" ,metis)
5184 ("openblas" ,openblas)
5185 ("gmp" ,gmp)))
5186 (native-inputs
5187 `(("gfortran" ,gfortran)
5188 ("pkg-config" ,pkg-config)))
5189 (home-page "http://numerik.mi.fu-berlin.de/dune-subgrid/index.php")
5190 (synopsis "Distributed and Unified Numerics Environment")
48b0d9c0 5191 (description "The dune-subgrid module marks elements of
f1f9466e
FG
5192another hierarchical dune grid. The set of marked elements can then be
5193accessed as a hierarchical dune grid in its own right. Dune-Subgrid
5194provides the full grid interface including adaptive mesh refinement.")
5195 (license license:gpl2+)))
5196
0e50630f
RW
5197(define-public dune-typetree
5198 (package
5199 (name "dune-typetree")
6ca2d7da 5200 (version "2.7.0")
0e50630f
RW
5201 (source
5202 (origin
5203 (method git-fetch)
5204 (uri (git-reference
5205 (url "https://gitlab.dune-project.org/staging/dune-typetree.git")
5206 (commit (string-append "v" version))))
5207 (file-name (git-file-name name version))
5208 (sha256
5209 (base32
6ca2d7da 5210 "1rhv25yg0q1hw50c8wlfqhgwrjl4mh62zq9v14ilwgzbfgxmpiy7"))))
0e50630f
RW
5211 (build-system cmake-build-system)
5212 (arguments
5213 `(#:phases
5214 (modify-phases %standard-phases
5215 (add-after 'build 'build-tests
5216 (lambda* (#:key make-flags #:allow-other-keys)
5217 (apply invoke "make" "build_tests" make-flags))))))
5218 (inputs
5219 `(("dune-common" ,dune-common)
0e50630f
RW
5220 ;; Optional
5221 ("openblas" ,openblas)
5222 ("python" ,python)
5223 ("metis" ,metis)
5224 ("superlu" ,superlu)
5225 ("gmp" ,gmp)))
5226 (native-inputs
5227 `(("gfortran" ,gfortran)
5228 ("pkg-config" ,pkg-config)))
5229 (home-page "https://dune-project.org/")
5230 (synopsis "Distributed and Unified Numerics Environment")
5231 (description "TypeTree is a template library for constructing and
5232operating on statically typed trees of objects.")
5233 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
5234 (license (list license:lgpl3+ license:gpl2))))
85b9371c
RW
5235
5236(define-public dune-functions
5237 (package
5238 (name "dune-functions")
6ca2d7da 5239 (version "2.7.0")
85b9371c
RW
5240 (source
5241 (origin
5242 (method git-fetch)
5243 (uri (git-reference
5244 (url "https://gitlab.dune-project.org/staging/dune-functions.git")
5245 (commit (string-append "v" version))))
5246 (file-name (git-file-name name version))
5247 (sha256
5248 (base32
6ca2d7da 5249 "1na4gcih0kin37ksj2xj07ds04v7zx53pjdhm1hzy55jjfqdjk8h"))))
85b9371c 5250 (build-system cmake-build-system)
07ebb75d
FG
5251 (arguments
5252 `(#:phases
5253 (modify-phases %standard-phases
5254 (add-after 'unpack 'disable-failing-tests
5255 (lambda _
5256 (setenv "ARGS"
5257 ;; unable to load GMSH file in this test
5258 "--exclude-regex gridviewfunctionspacebasistest")
5259 #t))
5260 (add-after 'build 'build-tests
5261 (lambda* (#:key make-flags #:allow-other-keys)
393dc1cc 5262 (apply invoke "make" "build_tests" make-flags))))))
85b9371c
RW
5263 (inputs
5264 `(("dune-common" ,dune-common)
5265 ("dune-istl" ,dune-istl)
5266 ("dune-localfunctions" ,dune-localfunctions)
5267 ("dune-grid" ,dune-grid)
5268 ("dune-geometry" ,dune-geometry)
5269 ("dune-typetree" ,dune-typetree)
85b9371c
RW
5270 ("openblas" ,openblas)
5271 ("metis" ,metis)
5272 ("python" ,python)
5273 ("superlu" ,superlu)
5274 ("gmp" ,gmp)))
5275 (native-inputs
5276 `(("gfortran" ,gfortran)
5277 ("pkg-config" ,pkg-config)))
5278 (home-page "https://dune-project.org/")
5279 (synopsis "Distributed and Unified Numerics Environment")
5280 (description "The dune-functions module provides an abstraction layer for
5281global finite element functions. Its two main concepts are functions
5282implemented as callable objects, and bases of finite element spaces.")
5283 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
5284 (license (list license:lgpl3+ license:gpl2))))
4714b00e
RW
5285
5286(define-public dune-pdelab
5287 (package
5288 (name "dune-pdelab")
6ca2d7da 5289 (version "2.7.0-git-476fe437")
4714b00e
RW
5290 (source
5291 (origin
5292 (method git-fetch)
5293 (uri (git-reference
5294 (url "https://gitlab.dune-project.org/pdelab/dune-pdelab")
6ca2d7da 5295 (commit "476fe43763fa6f459c5e4658e2a2b4b5582db834")))
4714b00e
RW
5296 (file-name (git-file-name name version))
5297 (sha256
5298 (base32
6ca2d7da 5299 "0cs36piqzn6rq0j2ih3ab3q3q9yg199wk72k5qi86pkzh7i7fdn1"))))
4714b00e
RW
5300 (build-system cmake-build-system)
5301 (arguments '(#:tests? #f)) ; XXX: the tests cannot be compiled
5302 (inputs
5303 `(("dune-common" ,dune-common)
5304 ("dune-istl" ,dune-istl)
5305 ("dune-localfunctions" ,dune-localfunctions)
5306 ("dune-geometry" ,dune-geometry)
5307 ("dune-grid" ,dune-grid)
5308 ("dune-typetree" ,dune-typetree)
5309 ("dune-functions" ,dune-functions)
4714b00e
RW
5310 ;; Optional
5311 ("openblas" ,openblas)
5312 ("eigen" ,eigen)
5313 ("metis" ,metis)
5314 ("python" ,python)
5315 ("superlu" ,superlu)
5316 ("gmp" ,gmp)))
5317 (native-inputs
5318 `(("gfortran" ,gfortran)
5319 ("pkg-config" ,pkg-config)))
5320 (home-page "https://dune-project.org/")
5321 (synopsis "Differential equations solver toolbox")
5322 (description "PDELab is a partial differential equations solver toolbox
5323built on top of DUNE, the Distributed and Unified Numerics Environment.")
5324 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
5325 (license (list license:lgpl3+ license:gpl2))))
413f6126 5326
6ceb7716
FG
5327(define add-openmpi-to-dune-package
5328 (let ((dune-package?
5329 (lambda (p) (string-prefix? "dune-" (package-name p)))))
5330 (package-mapping
5331 (lambda (p)
5332 (if (dune-package? p)
5333 (package (inherit p)
5334 (name (string-append (package-name p) "-openmpi"))
5335 (inputs `(,@(package-inputs p)
5336 ("openmpi" ,openmpi)))
5337 (arguments
5338 (substitute-keyword-arguments (package-arguments p)
5339 ((#:phases phases '%standard-phases)
5340 `(modify-phases ,phases
5341 (add-before 'check 'mpi-setup
5342 ,%openmpi-setup)))))
5343 (synopsis (string-append (package-synopsis p) " (with MPI support)")))
5344 p))
5345 (negate dune-package?))))
5346
5347(define-public dune-common-openmpi
5348 (add-openmpi-to-dune-package dune-common))
5349
5350(define-public dune-geometry-openmpi
5351 (add-openmpi-to-dune-package dune-geometry))
5352
5353(define-public dune-istl-openmpi
5354 (add-openmpi-to-dune-package dune-istl))
5355
5356(define-public dune-typetree-openmpi
5357 (add-openmpi-to-dune-package dune-typetree))
5358
5359(define-public dune-uggrid-openmpi
5360 (add-openmpi-to-dune-package dune-uggrid))
5361
5362(define-public dune-grid-openmpi
5363 (add-openmpi-to-dune-package dune-grid))
5364
5365(define-public dune-alugrid-openmpi
5366 (add-openmpi-to-dune-package dune-alugrid))
5367
5368(define-public dune-subgrid-openmpi
5369 (add-openmpi-to-dune-package dune-subgrid))
5370
5371(define-public dune-localfunctions-openmpi
5372 (add-openmpi-to-dune-package dune-localfunctions))
5373
5374(define-public dune-functions-openmpi
5375 (add-openmpi-to-dune-package dune-functions))
5376
5377(define-public dune-pdelab-openmpi
5378 (add-openmpi-to-dune-package dune-pdelab))
5379
413f6126
AI
5380(define-public mlucas
5381 (package
5382 (name "mlucas")
5383 (version "18")
5384 (source
5385 (origin
5386 (method url-fetch)
5387 (uri (string-append
5388 "https://mersenneforum.org/mayer/src/C/mlucas_v" version ".txz"))
5389 (sha256
a36efdbc 5390 (base32 "0h4xj6pyyac79ka5ibqjilfa3s9j3yxnzgpwc57b54kfh2bj3447"))))
413f6126
AI
5391 (build-system gnu-build-system)
5392 (inputs
5393 `(("python2" ,python-2)))
5394 (arguments
a36efdbc 5395 `(#:tests? #f ; no tests
413f6126
AI
5396 #:phases
5397 (modify-phases %standard-phases
5398 (replace 'configure
5399 (lambda _
5400 (chdir "src")
5401 (call-with-output-file "Makefile"
5402 (lambda (port)
5403 (format port "CC = gcc
5404CFLAGS = -O3 ~a -DUSE_THREADS
5405LDLIBS = -lm -lpthread -lrt
5406Mlucas: $(addsuffix .o,$(basename $(wildcard *.c)))
5407"
5408 ,(let ((system (or (%current-target-system)
5409 (%current-system))))
5410 (cond
5411 ((string-prefix? "x86_64" system) "-DUSE_SSE2")
5412 (else ""))))))
5413 #t))
5414 (replace 'install
5415 (lambda* (#:key outputs #:allow-other-keys)
5416 (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
5417 (install-file "Mlucas" bin)
5418 (install-file "primenet.py" bin))
5419 #t)))))
5420 (home-page "https://www.mersenne.org")
5421 (synopsis "Great Internet Mersenne Prime Search (GIMPS) distributed computing client")
5422 (description "Mlucas performs Lucas-Lehmer primality testing of Mersenne
5423numbers in search of a world-record prime. You may use it to test any
5424suitable number as you wish, but it is preferable that you do so in a
5425coordinated fashion, as part of the Great Internet Mersenne Prime
5426Search (GIMPS). Mlucas also includes a simple Python script for assignment
5427management via the GIMPS project's Primenet server.")
5428 (license license:gpl2+)))
6f8c4195
NG
5429
5430(define-public nauty
5431 (package
5432 (name "nauty")
4b01930f
NG
5433 (version "2.7r1")
5434 (source
5435 (origin
5436 (method url-fetch)
5437 (uri (string-append
5438 "https://pallini.di.uniroma1.it/"
5439 "nauty" (string-join (string-split version #\.) "") ".tar.gz"))
5440 (sha256
5441 (base32 "0xsfqfcknbd6g6wzpa5l7crmmk3bf3zjh37rhylq6b20dqcmvjkn"))))
6f8c4195
NG
5442 (build-system gnu-build-system)
5443 (outputs '("out" "lib"))
5444 (arguments
5445 `(#:test-target "checks"
4b01930f 5446 #:configure-flags '("--enable-generic") ;prevent -march-native
6f8c4195
NG
5447 #:phases
5448 (modify-phases %standard-phases
5449 ;; Default make target does not build all available
5450 ;; executables. Create them now.
5451 (add-after 'build 'build-extra-programs
5452 (lambda _
5453 (for-each (lambda (target) (invoke "make" target))
5454 '("blisstog" "bliss2dre" "checks6" "sumlines"))
5455 #t))
5456 ;; Upstream does not provide any install target.
5457 (replace 'install
5458 (lambda* (#:key outputs #:allow-other-keys)
5459 (let* ((out (assoc-ref outputs "out"))
5460 (lib-output (assoc-ref outputs "lib"))
5461 (bin (string-append out "/bin"))
5462 (doc (string-append out "/share/doc/nauty/"))
5463 (include (string-append lib-output "/include/nauty"))
5464 (lib (string-append lib-output "/lib/nauty")))
5465 (for-each (lambda (f) (install-file f bin))
4b01930f
NG
5466 '("addedgeg" "amtog" "assembleg" "biplabg" "blisstog"
5467 "bliss2dre" "catg" "checks6" "complg" "converseg"
5468 "copyg" "countg" "cubhamg" "deledgeg" "delptg"
5469 "directg" "dreadnaut" "dretodot" "dretog" "genbg"
6f8c4195
NG
5470 "genbgL" "geng" "genquarticg" "genrang" "genspecialg"
5471 "gentourng" "gentreeg" "hamheuristic" "labelg"
5472 "linegraphg" "listg" "multig" "newedgeg" "pickg"
5473 "planarg" "ranlabg" "shortg" "showg" "subdivideg"
4b01930f
NG
5474 "sumlines" "twohamg" "underlyingg" "vcolg"
5475 "watercluster2" "NRswitchg"))
6f8c4195
NG
5476 (for-each (lambda (f) (install-file f include))
5477 (find-files "." "\\.h$"))
5478 (for-each (lambda (f) (install-file f lib))
5479 (find-files "." "\\.a$"))
5480 (for-each (lambda (f) (install-file f doc))
5481 (append '("formats.txt" "README" "schreier.txt")
5482 (find-files "." "\\.pdf$")))))))))
5483 (inputs
5484 `(("gmp" ,gmp))) ;for sumlines
5485 (home-page "https://pallini.di.uniroma1.it/")
5486 (synopsis "Library for graph automorphisms")
5487 (description "@code{nauty} (No AUTomorphisms, Yes?) is a set of
5488procedures for computing automorphism groups of graphs and digraphs.
5489
5490@code{nauty} computes graph information in the form of a set of
5491generators, the size of the group, and the orbits of the group; it can
5492also produce a canonical label. The @code{nauty} suite is written in
5493C and comes with a command-line interface, a collection of
5494command-line tools, and an Application Programming Interface (API).
5495
5496This package provides the static libraries required to run programs
5497compiled against the nauty library.")
5498 (license license:asl2.0)))
26433471
AE
5499
5500(define-public ppl
5501 (package
5502 (name "ppl")
5503 (version "1.2")
5504 (source
5505 (origin
5506 (method url-fetch)
5507 (uri (string-append "https://www.bugseng.com/products/ppl/download/"
5508 "ftp/releases/" version
5509 "/ppl-" version ".tar.gz"))
5510 (sha256
5511 (base32
5512 "1j5aji1g2vmdvc0gqz45n2ll2l2f6czca04wiyfl5g3sm3a6vhvb"))))
5513 (build-system gnu-build-system)
5514 (native-inputs
5515 `(("m4", m4)))
5516 (inputs
5517 `(("glpk" ,glpk)
5518 ("gmp", gmp)))
5519 (home-page "https://www.bugseng.com/parma-polyhedra-library")
5520 (synopsis
5521 "Parma Polyhedra Library for computations with polyhedra")
5522 (description
5523 "The Parma Polyhedra Library (PPL) provides numerical abstractions
5524especially targeted at applications in the field of analysis and
5525verification of complex systems. These abstractions include convex
5526polyhedra, defined as the intersection of a finite number of (open or
5527closed) halfspaces, each described by a linear inequality (strict or
5528non-strict) with rational coefficients; some special classes of polyhedra
5529shapes that offer interesting complexity/precision tradeoffs; and grids
5530which represent regularly spaced points that satisfy a set of linear
5531congruence relations. The library also supports finite powersets and
5532products of (any kind of) polyhedra and grids, a mixed integer linear
5533programming problem solver using an exact-arithmetic version of the simplex
5534algorithm, a parametric integer programming solver, and primitives for
5535termination analysis via the automatic synthesis of linear ranking
5536functions.")
5537 (license license:gpl3+)))
4cb5d251
SS
5538
5539(define-public speedcrunch
5540 (package
5541 (name "speedcrunch")
5542 (version "0.12.0")
5543 (source
5544 (origin
5545 (method git-fetch)
5546 (uri (git-reference
5547 (url "https://bitbucket.org/heldercorreia/speedcrunch.git")
5548 (commit (string-append "release-" version))))
5549 (file-name (git-file-name name version))
5550 (sha256
5551 (base32
5552 "0vh7cd1915bjqzkdp3sk25ngy8cq624mkh8c53c5bnzk357kb0fk"))))
5553 (build-system cmake-build-system)
5554 (inputs `(("qtbase" ,qtbase)))
5555 (native-inputs `(("qttools" ,qttools)))
5556 (arguments
5557 `(#:phases
5558 (modify-phases %standard-phases
5559 (add-after 'unpack 'chdir-to-src
5560 (lambda _ (chdir "src") #t)))))
5561 (synopsis "High-precision scientific calculator")
5562 (description
5563 "SpeedCrunch is a high-precision scientific calculator. It features a
5564syntax-highlighted scrollable display and is designed to be fully used via
5565keyboard. Some distinctive features are auto-completion of functions and
5566variables, a formula book, and quick insertion of constants from various
5567fields of knowledge.")
80fafdba 5568 (home-page "https://speedcrunch.org/")
4cb5d251
SS
5569 (license license:gpl2+)))
5570
3b7828cc
RS
5571(define-public minisat
5572 ;; This is the last commit which is available upstream, no
5573 ;; release happened since 2010.
5574 (let ((commit "37dc6c67e2af26379d88ce349eb9c4c6160e8543")
5575 (revision "1"))
5576 (package
5577 (name "minisat")
5578 (version (string-append "2.2.0-" revision "." (string-take commit 7)))
5579 (source
5580 (origin
5581 (method git-fetch)
5582 (uri (git-reference
5583 (url "https://github.com/niklasso/minisat.git")
5584 (commit commit)))
5585 (file-name (string-append name "-" version "-checkout"))
5586 (sha256
5587 (base32
5588 "091hf3qkm197s5r7xcr3m07xsdwyz2rqk1hc9kj0hn13imz09irq"))
5589 (patches
5590 (search-patches "minisat-friend-declaration.patch"
5591 "minisat-install.patch"))))
5592 (build-system gnu-build-system)
5593 (arguments
5594 '(#:make-flags (list (string-append "prefix=" %output))
5595 #:tests? #f ;no check target
5596 #:phases
5597 (modify-phases %standard-phases
5598 (delete 'configure))))
5599 (inputs
5600 `(("zlib:static" ,zlib "static")
5601 ("zlib" ,zlib)))
5602 (synopsis
5603 "Small, yet efficient, SAT solver")
5604 (description
5605 "MiniSat is a minimalistic, open-source SAT solver, developed to help
5606researchers and developers alike to get started on SAT.")
5607 (home-page
5608 "http://minisat.se/MiniSat.html")
5609 (license license:expat))))
70c98efa
VK
5610
5611(define-public libqalculate
5612 (package
5613 (name "libqalculate")
5614 (version "3.8.0")
5615 (source
5616 (origin
5617 (method git-fetch)
5618 (uri (git-reference
5619 (url "https://github.com/Qalculate/libqalculate/")
5620 (commit (string-append "v" version))))
5621 (file-name (git-file-name name version))
5622 (sha256
9b3c231e
VK
5623 (base32 "1vbaza9c7159xf2ym90l0xkyj2mp6c3hbghhsqn29yvz08fda9df"))
5624 (patches
5625 (search-patches "libqalculate-3.8.0-libcurl-ssl-fix.patch"))))
70c98efa
VK
5626 (build-system gnu-build-system)
5627 (native-inputs
5628 `(("pkg-config" ,pkg-config)
5629 ("gettext" ,gettext-minimal)
5630 ("intltool" ,intltool)
5631 ("automake" ,automake)
5632 ("autoconf" ,autoconf)
5633 ("libtool" ,libtool)
5634 ("doxygen" ,doxygen)
5635 ("file" ,file)))
5636 (inputs
5637 `(("gmp" ,gmp)
5638 ("mpfr" ,mpfr)
5639 ("libxml2" ,libxml2)
5640 ("curl" ,curl)
5641 ("icu4c" ,icu4c)
5642 ("gnuplot" ,gnuplot)
5643 ("readline" ,readline)
5644 ("libiconv" ,libiconv)))
5645 (arguments
5646 `(#:phases
5647 (modify-phases %standard-phases
5648 (add-before 'bootstrap 'setenv
5649 ;; Prevent the autogen.sh script to carry out the configure
5650 ;; script, which has not yet been patched to replace /bin/sh.
5651 (lambda _
5652 (setenv "NOCONFIGURE" "TRUE")
5653 #t)))))
5654 (home-page "https://qalculate.github.io/")
5655 (synopsis "Multi-purpose cli desktop calculator and library")
5656 (description
5657 "Libqalculate is a multi-purpose cli desktop calculator and library.
5658It provides basic and advanced functionality. Features include customizable
5659functions, unit calculations, and conversions, physical constants, symbolic
5660calculations (including integrals and equations), arbitrary precision,
67e2e171 5661uncertainty propagation, interval arithmetic, plotting and a user-friendly
70c98efa
VK
5662cli.")
5663 (license license:gpl2+)))
72c71d24
VK
5664
5665(define-public qalculate-gtk
5666 (package
5667 (name "qalculate-gtk")
5668 (version "3.8.0")
5669 (source
5670 (origin
5671 (method git-fetch)
5672 (uri (git-reference
5673 (url "https://github.com/Qalculate/qalculate-gtk/")
5674 (commit (string-append "v" version))))
5675 (file-name (git-file-name name version))
5676 (sha256
5677 (base32 "0nsg6dzg5r7rzqr671nvrf1c50rjwpz7bxv5f20i4s7agizgv840"))))
5678 (build-system glib-or-gtk-build-system)
5679 (native-inputs
5680 `(("pkg-config" ,pkg-config)
5681 ("intltool" ,intltool)
5682 ("automake" ,automake)
5683 ("autoconf" ,autoconf)
5684 ("libtool" ,libtool)
5685 ("file" ,file)))
5686 (inputs
5687 `(("gmp" ,gmp)
5688 ("mpfr" ,mpfr)
5689 ("libqalculate" ,libqalculate)
5690 ("libxml2" ,libxml2)
5691 ("glib" ,glib)
5692 ("gtk+" ,gtk+)))
5693 (arguments
5694 `(#:phases
5695 (modify-phases %standard-phases
5696 (add-before 'bootstrap 'setenv
5697 ;; Prevent the autogen.sh script to carry out the configure
5698 ;; script, which has not yet been patched to replace /bin/sh.
5699 (lambda _
5700 (setenv "NOCONFIGURE" "TRUE")
5701 #t))
5702 (add-before 'check 'add-pot-file
5703 ;; the file contains translations and are currently not in use
5704 ;; left out on purpose so add it to POTFILES.skip
5705 (lambda _
5706 (with-output-to-file "po/POTFILES.skip"
5707 (lambda _
5708 (format #t "data/shortcuts.ui~%")
5709 #t))
5710 #t)))))
5711 (home-page "https://qalculate.github.io/")
5712 (synopsis "Multi-purpose graphical desktop calculator")
5713 (description
5714 "Qalculate-gtk is the GTK frontend for libqalculate. It is a
5715multi-purpose GUI desktop calculator. It provides basic and advanced
5716functionality. Features include customizable functions, unit calculations,
5717and conversions, physical constants, symbolic calculations (including
1480d212 5718integrals and equations), arbitrary precision, uncertainty propagation,
72c71d24
VK
5719interval arithmetic, plotting.")
5720 (license license:gpl2+)))