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