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