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