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