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