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