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