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