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