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