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