Merge branch 'staging' into core-updates
[jackhill/guix/guix.git] / gnu / packages / maths.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2014, 2015, 2016 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 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 Ricardo Wurmus <rekado@elephly.net>
9 ;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com>
10 ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
11 ;;; Copyright © 2015, 2016, 2017, 2018 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 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 Paul Garlick <pgarlick@tourbillion-technology.com>
19 ;;; Copyright © 2017 Nils Gillmann <ng0@n0.is>
20 ;;; Copyright © 2017 Ben Woodcroft <donttrustben@gmail.com>
21 ;;; Copyright © 2017 Theodoros Foradis <theodoros@foradis.org>
22 ;;; Copyright © 2017 Arun Isaac <arunisaac@systemreboot.net>
23 ;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
24 ;;; Copyright © 2017 Dave Love <me@fx@gnu.org>
25 ;;; Copyright © 2018 Jan Nieuwenhuizen <janneke@gnu.org>
26 ;;; Copyright © 2018 Joshua Sierles, Nextjournal <joshua@nextjournal.com>
27 ;;; Copyright © 2018 Nadya Voronova <voronovank@gmail.com>
28 ;;; Copyright © 2018 Adam Massmann <massmannak@gmail.com>
29 ;;; Copyright © 2018 Marius Bakke <mbakke@fastmail.com>
30 ;;;
31 ;;; This file is part of GNU Guix.
32 ;;;
33 ;;; GNU Guix is free software; you can redistribute it and/or modify it
34 ;;; under the terms of the GNU General Public License as published by
35 ;;; the Free Software Foundation; either version 3 of the License, or (at
36 ;;; your option) any later version.
37 ;;;
38 ;;; GNU Guix is distributed in the hope that it will be useful, but
39 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
40 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
41 ;;; GNU General Public License for more details.
42 ;;;
43 ;;; You should have received a copy of the GNU General Public License
44 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
45
46 (define-module (gnu packages maths)
47 #:use-module (ice-9 regex)
48 #:use-module (gnu packages)
49 #:use-module ((guix licenses) #:prefix license:)
50 #:use-module (guix packages)
51 #:use-module (guix download)
52 #:use-module (guix git-download)
53 #:use-module (guix utils)
54 #:use-module (guix build utils)
55 #:use-module (guix build-system cmake)
56 #:use-module (guix build-system gnu)
57 #:use-module (guix build-system ocaml)
58 #:use-module (guix build-system python)
59 #:use-module (guix build-system r)
60 #:use-module (guix build-system ruby)
61 #:use-module (gnu packages algebra)
62 #:use-module (gnu packages audio)
63 #:use-module (gnu packages autotools)
64 #:use-module (gnu packages bison)
65 #:use-module (gnu packages boost)
66 #:use-module (gnu packages check)
67 #:use-module (gnu packages cmake)
68 #:use-module (gnu packages compression)
69 #:use-module (gnu packages curl)
70 #:use-module (gnu packages cyrus-sasl)
71 #:use-module (gnu packages documentation)
72 #:use-module (gnu packages elf)
73 #:use-module (gnu packages flex)
74 #:use-module (gnu packages fltk)
75 #:use-module (gnu packages fontutils)
76 #:use-module (gnu packages gettext)
77 #:use-module (gnu packages gcc)
78 #:use-module (gnu packages gd)
79 #:use-module (gnu packages ghostscript)
80 #:use-module (gnu packages graphviz)
81 #:use-module (gnu packages gtk)
82 #:use-module (gnu packages image)
83 #:use-module (gnu packages java)
84 #:use-module (gnu packages less)
85 #:use-module (gnu packages lisp)
86 #:use-module (gnu packages linux)
87 #:use-module (gnu packages logging)
88 #:use-module (gnu packages lua)
89 #:use-module (gnu packages gnome)
90 #:use-module (gnu packages guile)
91 #:use-module (gnu packages xorg)
92 #:use-module (gnu packages gl)
93 #:use-module (gnu packages imagemagick)
94 #:use-module (gnu packages m4)
95 #:use-module (gnu packages mpi)
96 #:use-module (gnu packages multiprecision)
97 #:use-module (gnu packages netpbm)
98 #:use-module (gnu packages ocaml)
99 #:use-module (gnu packages pcre)
100 #:use-module (gnu packages popt)
101 #:use-module (gnu packages perl)
102 #:use-module (gnu packages pkg-config)
103 #:use-module (gnu packages pulseaudio)
104 #:use-module (gnu packages python)
105 #:use-module (gnu packages python-web)
106 #:use-module (gnu packages qt)
107 #:use-module (gnu packages readline)
108 #:use-module (gnu packages ruby)
109 #:use-module (gnu packages tbb)
110 #:use-module (gnu packages scheme)
111 #:use-module (gnu packages shells)
112 #:use-module (gnu packages tcl)
113 #:use-module (gnu packages texinfo)
114 #:use-module (gnu packages tex)
115 #:use-module (gnu packages tls)
116 #:use-module (gnu packages version-control)
117 #:use-module (gnu packages wxwidgets)
118 #:use-module (gnu packages xml)
119 #:use-module (srfi srfi-1))
120
121 (define-public aris
122 (package
123 (name "aris")
124 (version "2.2")
125 (source (origin
126 (method url-fetch)
127 (uri (string-append "mirror://gnu/" name "/" name "-" version ".tar.gz"))
128 (sha256 (base32
129 "1q1887ryqdr9sn0522hc7p16kqwlxxyz5dkmma8ar2nxplhgll7q"))))
130 (build-system gnu-build-system)
131 (inputs `(("gtk+" ,gtk+)
132 ("libxml2" ,libxml2)))
133 (native-inputs `(("pkg-config" ,pkg-config)))
134 (synopsis "Natural deduction first-order logic interface")
135 (description "Aris is a program for performing logical proofs. It supports
136 propositional and predicate logic, as well as Boolean algebra and
137 arithmetical logic. In addition to its predefined inference and equivalence
138 rules, Aris also supports references to older proofs. Its use of standard
139 logical symbols and its natural deduction interface make it easy to use for
140 beginners.")
141 (license license:gpl3+)
142 (home-page "https://www.gnu.org/software/aris/")))
143
144 (define-public c-graph
145 (package
146 (name "c-graph")
147 (version "2.0")
148 (source (origin
149 (method url-fetch)
150 (uri (string-append "mirror://gnu/c-graph/c-graph-" version
151 ".tar.gz"))
152 (sha256 (base32
153 "1hlvpzrh7hzzf533diyfiabzskddi8zx92av9hwkjw3l46z7qv01"))))
154 (build-system gnu-build-system)
155 (inputs
156 `(("fortran" ,gfortran)))
157 (synopsis "Visualizing and demonstrating convolution")
158 (description
159 "GNU C-Graph is a tool for demonstrating the theory of convolution.
160 Thus, it can serve as an excellent aid to students of signal and systems
161 theory in visualizing the convolution process. Rather than forcing the
162 student to write code, the program offers an intuitive interface with
163 interactive dialogs to guide them.")
164 (license license:gpl3+)
165 (home-page "https://www.gnu.org/software/c-graph/")))
166
167 (define-public coda
168 (package
169 (name "coda")
170 (version "2.19")
171 (source
172 (origin
173 (method url-fetch)
174 (uri (string-append "https://github.com/stcorp/coda/releases/download/"
175 version "/coda-" version ".tar.gz"))
176 (sha256
177 (base32 "1fbxd2afm7dshd92p10yy8dwbr9gc1h1fmnnnmr7d0c5lnw80245"))
178 (patches (search-patches "coda-use-system-libs.patch"))
179 (modules '((guix build utils)))
180 (snippet
181 ;; Make sure we don't use the bundled software.
182 '(begin
183 (for-each (lambda (d)
184 (delete-file-recursively (string-append "libcoda/" d)))
185 '("zlib" "pcre" "expat"))
186 #t))))
187 (native-inputs
188 `(("fortran" ,gfortran)
189 ("python" ,python)
190 ("python-numpy" ,python-numpy)))
191 (inputs
192 `(("zlib" ,zlib)
193 ("pcre" ,pcre)
194 ("expat" ,expat)
195 ("hdf4" ,hdf4-alt)
196 ("hdf5" ,hdf5)))
197 (build-system gnu-build-system)
198 (arguments
199 '(#:configure-flags '("--with-hdf4" "--with-hdf5" "--enable-python"
200 "LIBS= -lz -lpcre -lexpat")))
201 (synopsis "A common interface to various earth observation data formats")
202 (description
203 "The Common Data Access toolbox (CODA) provides a set of interfaces for
204 reading remote sensing data from earth observation data files. It consists of
205 command line applications and interfaces to the C, Fortran, Python, and Java
206 programming languages.")
207 (home-page "https://stcorp.nl/coda")
208 (license license:gpl2+)))
209
210 (define-public qhull
211 (package
212 (name "qhull")
213 (version "2015.2")
214 (source (origin
215 (method url-fetch)
216 (uri (string-append "http://www.qhull.org/download/qhull-"
217 (car (string-split version #\.))
218 "-src-7.2.0.tgz"))
219 (sha256
220 (base32
221 "0dm4b2xr3asy6w74khq2zg4gf26zsy3qf9sq7pf7lmrvbj911c3q"))))
222 (build-system cmake-build-system)
223 (synopsis "Calculate convex hulls and related structures")
224 (description
225 "@code{Qhull} computes the convex hull, Delaunay triangulation, Voronoi
226 diagram, halfspace intersection about a point, furthest-site Delaunay
227 triangulation, and furthest-site Voronoi diagram. The source code runs in 2-d,
228 3-d, 4-d, and higher dimensions. @code{Qhull} implements the Quickhull
229 algorithm for computing the convex hull. It handles roundoff errors from
230 floating point arithmetic. It computes volumes, surface areas, and
231 approximations to the convex hull.
232
233 @code{Qhull} does not support triangulation of non-convex surfaces, mesh
234 generation of non-convex objects, medium-sized inputs in 9-D and higher, alpha
235 shapes, weighted Voronoi diagrams, Voronoi volumes, or constrained Delaunay
236 triangulations.")
237 (home-page "http://qhull.org")
238 (license (license:non-copyleft "file://COPYING.txt"
239 "See COPYING in the distribution."))))
240
241 (define-public units
242 (package
243 (name "units")
244 (version "2.17")
245 (source (origin
246 (method url-fetch)
247 (uri (string-append "mirror://gnu/units/units-" version
248 ".tar.gz"))
249 (sha256 (base32
250 "1n2xzpnxfn475zkd8rzs5gg58xszjbr4bdbgvk6hryzimvwwj0qz"))))
251 (build-system gnu-build-system)
252 (inputs
253 `(("readline" ,readline)
254 ("python" ,python-wrapper) ;for 'units_cur' script
255 ("python-requests" ,python-requests)))
256 (arguments
257 `(#:phases (modify-phases %standard-phases
258 (add-after 'install 'wrap-units_cur
259 (lambda* (#:key outputs #:allow-other-keys)
260 (let* ((out (assoc-ref outputs "out"))
261 (bin (string-append out "/bin")))
262 (wrap-program (string-append bin "/units_cur")
263 `("PYTHONPATH" ":" prefix
264 ,(search-path-as-string->list (getenv "PYTHONPATH"))))
265 #t))))))
266 (synopsis "Conversion between thousands of scales")
267 (description
268 "GNU Units converts numeric quantities between units of measure. It
269 can handle scale changes through adaptive usage of standard scale
270 prefixes (micro-, kilo-, etc.). It can also handle nonlinear
271 conversions such as Fahrenheit to Celsius. Its interpreter is powerful
272 enough to be used effectively as a scientific calculator.")
273 (license license:gpl3+)
274 (home-page "https://www.gnu.org/software/units/")))
275
276 (define-public double-conversion
277 (package
278 (name "double-conversion")
279 (version "3.0.0")
280 (home-page "https://github.com/google/double-conversion")
281 (source (origin
282 (method url-fetch)
283 (uri (string-append home-page "/archive/v" version ".tar.gz"))
284 (file-name (string-append name "-" version ".tar.gz"))
285 (sha256
286 (base32
287 "059r1czs28ljjd388pn6l3njg1ghbf1cv3q9nkxv3dj2a8siabqm"))))
288 (build-system cmake-build-system)
289 (arguments
290 '(#:test-target "test"
291 #:configure-flags '("-DBUILD_SHARED_LIBS=ON"
292 "-DBUILD_TESTING=ON")))
293 (synopsis "Conversion routines for IEEE doubles")
294 (description
295 "The double-conversion library provides binary-decimal and decimal-binary
296 routines for IEEE doubles. The library consists of efficient conversion
297 routines that have been extracted from the V8 JavaScript engine.")
298 (license license:bsd-3)))
299
300 (define-public dionysus
301 (package
302 (name "dionysus")
303 (version "1.4.0")
304 (source (origin
305 (method url-fetch)
306 (uri (string-append "mirror://gnu/dionysus/dionysus-" version
307 ".tar.xz"))
308 (sha256
309 (base32
310 "194pzs1mlsj4ww6v37qq3961h5hckm5h805cv0r14xj3g9wfx2sk"))))
311 (build-system gnu-build-system)
312 (inputs `(("tcl" ,tcl))) ;for 'tclsh'
313 (synopsis "Local search for universal constants and scientific values")
314 (description
315 "GNU Dionysus is a convenient system for quickly retrieving the values of
316 mathematical constants used in science and engineering. Values can be
317 searched using a simple command-line tool, choosing from three databases:
318 universal constants, atomic numbers, and constants related to
319 semiconductors.")
320 (license license:gpl3+)
321 (home-page "https://www.gnu.org/software/dionysus/")))
322
323 (define-public gsl
324 (package
325 (name "gsl")
326 (version "2.5")
327 (source (origin
328 (method url-fetch)
329 (uri (string-append "mirror://gnu/gsl/gsl-"
330 version ".tar.gz"))
331 (sha256
332 (base32
333 "1395y9hlhqadn5g9j8q22224fds5sd92jxi9czfavjj24myasq04"))
334 (patches (search-patches "gsl-test-i686.patch"))))
335 (build-system gnu-build-system)
336 (arguments
337 `(;; Currently there are numerous tests that fail on "exotic"
338 ;; architectures such as aarch64 and ppc64le.
339 ,@(if (string-prefix? "aarch64-linux"
340 (or (%current-target-system) (%current-system)))
341 '(#:tests? #f)
342 '())))
343 (home-page "https://www.gnu.org/software/gsl/")
344 (synopsis "Numerical library for C and C++")
345 (description
346 "The GNU Scientific Library is a library for numerical analysis in C
347 and C++. It includes a wide range of mathematical routines, with over 1000
348 functions in total. Subject areas covered by the library include:
349 differential equations, linear algebra, Fast Fourier Transforms and random
350 numbers.")
351 (license license:gpl3+)))
352
353 (define-public ocaml-gsl
354 (package
355 (name "ocaml-gsl")
356 (version "1.22.0")
357 (source
358 (origin
359 (method url-fetch)
360 (uri
361 (string-append
362 "https://github.com/mmottl/gsl-ocaml/releases/download/"
363 version "/gsl-" version ".tbz"))
364 (sha256
365 (base32
366 "17vcswipliq1b2idbzx1z95kskn1a4q4s5v04igilg0f7lnkaarb"))))
367 (build-system ocaml-build-system)
368 (inputs
369 `(("gsl" ,gsl)))
370 (home-page "https://mmottl.github.io/gsl-ocaml")
371 (synopsis "Bindings to the GNU Scientific Library")
372 (description
373 "GSL-OCaml is an interface to the @dfn{GNU scientific library} (GSL) for
374 the OCaml language.")
375 (license license:gpl3+)))
376
377 (define-public ocaml4.01-gsl
378 (package-with-ocaml4.01 ocaml-gsl))
379
380 (define-public glpk
381 (package
382 (name "glpk")
383 (version "4.65")
384 (source
385 (origin
386 (method url-fetch)
387 (uri (string-append "mirror://gnu/glpk/glpk-"
388 version ".tar.gz"))
389 (sha256
390 (base32
391 "040sfaa9jclg2nqdh83w71sv9rc1sznpnfiripjdyr48cady50a2"))))
392 (build-system gnu-build-system)
393 (inputs
394 `(("gmp" ,gmp)))
395 (arguments
396 `(#:configure-flags '("--with-gmp")))
397 (home-page "https://www.gnu.org/software/glpk/")
398 (synopsis "GNU Linear Programming Kit, supporting the MathProg language")
399 (description
400 "GLPK is a C library for solving large-scale linear programming (LP),
401 mixed integer programming (MIP), and other related problems. It supports the
402 GNU MathProg modeling language, a subset of the AMPL language, and features a
403 translator for the language. In addition to the C library, a stand-alone
404 LP/MIP solver is included in the package.")
405 (license license:gpl3+)))
406
407 (define-public 4ti2
408 (package
409 (name "4ti2")
410 (version "1.6.7")
411 (source
412 (origin
413 (method url-fetch)
414 (uri (string-append "http://www.4ti2.de/version_" version
415 "/4ti2-" version ".tar.gz"))
416 (sha256
417 (base32
418 "1frix3rnm9ffr93alqzw4cavxbfpf524l8rfbmcpyhwd3n1km0yl"))))
419 (build-system gnu-build-system)
420 (native-inputs
421 `(("which" ,(@ (gnu packages base) which)))) ; for the tests
422 (inputs
423 `(("glpk" ,glpk)
424 ("gmp" ,gmp)))
425 (home-page "http://www.4ti2.de/")
426 (synopsis "Mathematical tool suite for problems on linear spaces")
427 (description
428 "4ti2 implements algorithms for solving algebraic, geometric and
429 combinatorial problems on linear spaces. Among others, it solves systems
430 of linear equations, computes extreme rays of polyhedral cones, solves
431 integer programming problems and computes Markov bases for statistics.")
432 (license license:gpl2+)))
433
434 (define-public cddlib
435 (package
436 (name "cddlib")
437 (version "0.94i")
438 (source
439 (origin
440 (method url-fetch)
441 (uri (string-append "ftp://ftp.math.ethz.ch/users/fukudak/cdd/cddlib-"
442 (string-delete #\. version) ".tar.gz"))
443 (sha256
444 (base32
445 "00zdgiqb91vx6gd2103h3ijij0llspsxc6zz3iw2bll39fvkl4xq"))))
446 (build-system gnu-build-system)
447 (inputs
448 `(("gmp" ,gmp)))
449 (home-page "https://www.inf.ethz.ch/personal/fukudak/cdd_home/index.html")
450 (synopsis "Library for convex hulls and extreme rays of polyhedra")
451 (description
452 "The C-library cddlib implements the Double Description Method of
453 Motzkin et al. for generating all vertices (i.e. extreme points) and extreme
454 rays of a general convex polyhedron given by a system of linear inequalities
455 in arbitrary dimension. It can also be used for the converse operation of
456 computing convex hulls.")
457 (license license:gpl2+)))
458
459 (define-public arpack-ng
460 (package
461 (name "arpack-ng")
462 (version "3.5.0")
463 (home-page "https://github.com/opencollab/arpack-ng")
464 (source
465 (origin
466 (method url-fetch)
467 (uri (string-append home-page "/archive/" version ".tar.gz"))
468 (file-name (string-append name "-" version ".tar.gz"))
469 (sha256
470 (base32
471 "0f8jx3fifmj9qdp289zr7r651y1q48k1jya859rqxq62mvis7xsh"))))
472 (build-system gnu-build-system)
473 (arguments
474 '(#:phases (modify-phases %standard-phases
475 (add-after 'unpack 'autoreconf
476 (lambda _
477 (invoke "autoreconf" "-vfi"))))))
478 (native-inputs
479 `(("autoconf" ,autoconf)
480 ("automake" ,automake)
481 ("libtool" ,libtool)))
482 (inputs
483 `(("lapack" ,lapack)
484 ("fortran" ,gfortran)))
485 (synopsis "Fortran subroutines for solving eigenvalue problems")
486 (description
487 "ARPACK-NG is a collection of Fortran77 subroutines designed to solve
488 large scale eigenvalue problems.")
489 (license (license:non-copyleft "file://COPYING"
490 "See COPYING in the distribution."))))
491
492 (define-public arpack-ng-3.3.0
493 (package
494 (inherit arpack-ng)
495 (version "3.3.0")
496 (name (package-name arpack-ng))
497 (home-page (package-home-page arpack-ng))
498 (source
499 (origin
500 (method url-fetch)
501 (uri (string-append home-page "/archive/" version ".tar.gz"))
502 (file-name (string-append name "-" version ".tar.gz"))
503 (sha256
504 (base32
505 "1cz53wqzcf6czmcpfb3vb61xi0rn5bwhinczl65hpmbrglg82ndd"))))))
506
507 (define-public arpack-ng-openmpi
508 (package (inherit arpack-ng)
509 (name "arpack-ng-openmpi")
510 (inputs
511 `(("mpi" ,openmpi)
512 ,@(package-inputs arpack-ng)))
513 (arguments
514 (substitute-keyword-arguments (package-arguments arpack-ng)
515 ((#:configure-flags _ '())
516 ''("--enable-mpi"))))
517 (synopsis "Fortran subroutines for solving eigenvalue problems with MPI")))
518
519 (define-public lapack
520 (package
521 (name "lapack")
522 (version "3.7.1")
523 (source
524 (origin
525 (method url-fetch)
526 (uri (string-append "http://www.netlib.org/lapack/lapack-"
527 version ".tgz"))
528 (sha256
529 (base32
530 "1j51r7n5w4k7r3lrvy7710xrpkg40wf4rqnmngfz6ck9ypckzign"))))
531 (build-system cmake-build-system)
532 (home-page "http://www.netlib.org/lapack/")
533 (inputs `(("fortran" ,gfortran)
534 ("python" ,python-2)))
535 (arguments
536 `(#:configure-flags (list
537 "-DBUILD_SHARED_LIBS:BOOL=YES"
538 "-DLAPACKE=ON"
539
540 ;; Build the 'LAPACKE_clatms' functions.
541 "-DLAPACKE_WITH_TMG=ON")
542 #:phases
543 (modify-phases %standard-phases
544 (add-before 'check 'patch-python
545 (lambda* (#:key inputs #:allow-other-keys)
546 (let ((python (assoc-ref inputs "python")))
547 (substitute* "lapack_testing.py"
548 (("/usr/bin/env python") python)))
549 #t)))))
550 (synopsis "Library for numerical linear algebra")
551 (description
552 "LAPACK is a Fortran 90 library for solving the most commonly occurring
553 problems in numerical linear algebra.")
554 (license (license:non-copyleft "file://LICENSE"
555 "See LICENSE in the distribution."))))
556
557 (define-public scalapack
558 (package
559 (name "scalapack")
560 (version "2.0.2")
561 (source
562 (origin
563 (method url-fetch)
564 (uri (string-append "http://www.netlib.org/scalapack/scalapack-"
565 version ".tgz"))
566 (sha256
567 (base32
568 "0p1r61ss1fq0bs8ynnx7xq4wwsdvs32ljvwjnx6yxr8gd6pawx0c"))))
569 (build-system cmake-build-system)
570 (inputs
571 `(("mpi" ,openmpi)
572 ("fortran" ,gfortran)
573 ("lapack" ,lapack))) ;for testing only
574 (arguments
575 `(#:configure-flags `("-DBUILD_SHARED_LIBS:BOOL=YES")
576 #:phases (modify-phases %standard-phases
577 (add-before 'check 'set-test-environment
578 (lambda _
579 ;; By default, running the test suite would fail because
580 ;; 'ssh' could not be found in $PATH. Define this
581 ;; variable to placate Open MPI without adding a
582 ;; dependency on OpenSSH (the agent isn't used anyway.)
583 (setenv "OMPI_MCA_plm_rsh_agent" (which "cat"))
584 #t)))))
585 (home-page "http://www.netlib.org/scalapack/")
586 (synopsis "Library for scalable numerical linear algebra")
587 (description
588 "ScaLAPACK is a Fortran 90 library of high-performance linear algebra
589 routines on parallel distributed memory machines. ScaLAPACK solves dense and
590 banded linear systems, least squares problems, eigenvalue problems, and
591 singular value problems.")
592 (license (license:bsd-style "file://LICENSE"
593 "See LICENSE in the distribution."))))
594
595 (define-public gnuplot
596 (package
597 (name "gnuplot")
598 (version "5.2.4")
599 (source (origin
600 (method url-fetch)
601 (uri (string-append "mirror://sourceforge/gnuplot/gnuplot/"
602 version "/gnuplot-"
603 version ".tar.gz"))
604 (sha256
605 (base32
606 "1jvh8xmd2cvrhlsg88kxwh55wkwx31sg50v1n59slfippl0g058m"))))
607 (build-system gnu-build-system)
608 (inputs `(("readline" ,readline)
609 ("cairo" ,cairo)
610 ("pango" ,pango)
611 ("gd" ,gd)
612 ("lua" ,lua)))
613 (native-inputs
614 `(("pkg-config" ,pkg-config)
615 ("texlive" ,texlive-tiny)))
616 (arguments `(#:configure-flags (list (string-append
617 "--with-texdir=" %output
618 "/texmf-local/tex/latex/gnuplot"))))
619 (home-page "http://www.gnuplot.info")
620 (synopsis "Command-line driven graphing utility")
621 (description "Gnuplot is a portable command-line driven graphing
622 utility. It was originally created to allow scientists and students to
623 visualize mathematical functions and data interactively, but has grown to
624 support many non-interactive uses such as web scripting. It is also used as a
625 plotting engine by third-party applications like Octave.")
626 ;; X11 Style with the additional restriction that derived works may only be
627 ;; distributed as patches to the original.
628 (license (license:fsf-free
629 "http://gnuplot.cvs.sourceforge.net/gnuplot/gnuplot/Copyright"))))
630
631 (define-public gctp
632 (package
633 (name "gctp")
634 (version "2.0.0")
635 (source
636 (origin
637 (method url-fetch)
638 (uri (string-append "https://github.com/OkoSanto/GCTP/archive/v"
639 version ".tar.gz"))
640 (file-name (string-append name "-" version ".tar.gz"))
641 (sha256
642 (base32
643 "0l9aqnqynh9laicn5dxf3rsb1n14xiks79wbyqccirzmjqd1c1x4"))))
644 (native-inputs
645 `(("fortran" ,gfortran)))
646 (build-system gnu-build-system)
647 (synopsis "General Cartographic Transformation Package (GCTP)")
648 (description
649 "The General Cartographic Transformation Package (GCTP) is a system of
650 software routines designed to permit the transformation of coordinate pairs
651 from one map projection to another. The GCTP is the standard computer
652 software used by the National Mapping Division for map projection
653 computations.")
654 (home-page "https://github.com/OkoSanto/GCTP")
655 (license license:public-domain))) ;https://www2.usgs.gov/laws/info_policies.html
656
657 (define-public hdf4
658 (package
659 (name "hdf4")
660 (version "4.2.13")
661 (source
662 (origin
663 (method url-fetch)
664 (uri (string-append "https://support.hdfgroup.org/ftp/HDF/releases/HDF"
665 version "/src/hdf-" version ".tar.bz2"))
666 (sha256
667 (base32 "1wz0586zh91pqb95wvr0pbh71a8rz358fdj6n2ksp85x2cis9lsm"))
668 (patches (search-patches "hdf4-architectures.patch"
669 "hdf4-reproducibility.patch"
670 "hdf4-shared-fortran.patch"))))
671 (build-system gnu-build-system)
672 (native-inputs
673 `(("gfortran" ,gfortran)
674 ("bison" ,bison)
675 ("flex" ,flex)))
676 (inputs
677 `(("zlib" ,zlib)
678 ("libjpeg" ,libjpeg)))
679 (arguments
680 `(#:parallel-tests? #f
681 #:configure-flags '("--enable-shared")
682 #:phases
683 (modify-phases %standard-phases
684 ;; This is inspired by two of Debian's patches.
685 (add-before 'configure 'add-more-aarch64-support
686 (lambda _
687 (substitute* '("mfhdf/ncgen/ncgen.l"
688 "mfhdf/ncgen/ncgenyy.c"
689 "mfhdf/libsrc/netcdf.h.in")
690 (("AIX5L64") "__aarch64__"))
691 #t))
692 (add-before 'configure 'patchbuild
693 (lambda _
694 (substitute*
695 '("mfhdf/hdfimport/testutil.sh.in" "hdf/util/testutil.sh.in")
696 (("/bin/rm") "rm")
697 (("/bin/mkdir") "mkdir"))
698 (substitute* (find-files "." "^Makefile\\.in$")
699 (("@HDF_BUILD_XDR_TRUE@XDR_ADD = \
700 -R\\$\\(abs_top_builddir\\)/mfhdf/xdr/\\.libs") "")
701 (("@HDF_BUILD_SHARED_TRUE@AM_LDFLAGS = \
702 -R\\$\\(abs_top_builddir\\)/mfhdf/libsrc/\\.libs \
703 -R\\$\\(abs_top_builddir\\)/hdf/src/\\.libs \\$\\(XDR_ADD\\)") ""))
704 #t))
705 (add-after 'configure 'patch-settings
706 (lambda _
707 ;; libhdf4.settings contains the full path of the
708 ;; compilers used, and its contents are included in
709 ;; .so-files. We truncate the hashes to avoid
710 ;; unnecessary store references to those compilers:
711 (substitute* "libhdf4.settings"
712 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
713 (string-append prefix (string-take hash 10) "...")))
714 #t))
715 )))
716 (home-page "https://www.hdfgroup.org/products/hdf4/")
717 (synopsis
718 "Library and multi-object file format for storing and managing data")
719 (description "HDF4 is a library and multi-object file format for storing
720 and managing data between machines. HDF4 is an older hierarchical data format,
721 incompatible with HDF5.")
722 (license
723 (license:non-copyleft
724 "https://www.hdfgroup.org/ftp/HDF/HDF_Current/src/unpacked/COPYING"))))
725
726 (define-public hdf4-alt
727 (package
728 (inherit hdf4)
729 (name "hdf4-alt")
730 (arguments
731 (substitute-keyword-arguments (package-arguments hdf4)
732 ((#:configure-flags flags) `(cons* "--disable-netcdf" ,flags))))
733 (synopsis
734 "HDF4 without netCDF API, can be combined with the regular netCDF library")))
735
736 (define-public hdf5
737 (package
738 (name "hdf5")
739 (version "1.8.19")
740 (source
741 (origin
742 (method url-fetch)
743 (uri (list (string-append "https://support.hdfgroup.org/ftp/HDF5/releases/"
744 "hdf5-" (version-major+minor version)
745 "/hdf5-" version "/src/hdf5-"
746 version ".tar.bz2")
747 (string-append "https://support.hdfgroup.org/ftp/HDF5/"
748 "current"
749 (apply string-append
750 (take (string-split version #\.) 2))
751 "/src/hdf5-" version ".tar.bz2")))
752 (sha256
753 (base32 "0f3jfbqpaaq21ighi40qzs52nb52kc2d2yjk541rjmsx20b3ih2r"))
754 (patches (list (search-patch "hdf5-config-date.patch")))))
755 (build-system gnu-build-system)
756 (inputs
757 `(("zlib" ,zlib)))
758 (native-inputs
759 `(("gfortran" ,gfortran)))
760 (outputs '("out" ; core library
761 "fortran")) ; fortran interface
762 (arguments
763 `(;; Some of the users, notably Flann, need the C++ interface.
764 #:configure-flags '("--enable-cxx"
765 "--enable-fortran"
766 "--enable-fortran2003")
767 ;; Use -fPIC to allow the R bindings to link with the static libraries
768 #:make-flags (list "CFLAGS=-fPIC"
769 "CXXFLAGS=-fPIC")
770 #:phases
771 (modify-phases %standard-phases
772 (add-before 'configure 'patch-configure
773 (lambda* (#:key outputs #:allow-other-keys)
774 (substitute* "configure"
775 (("/bin/mv") "mv"))
776 (substitute* "fortran/src/Makefile.in"
777 (("libhdf5_fortran_la_LDFLAGS =")
778 (string-append "libhdf5_fortran_la_LDFLAGS = -Wl-rpath="
779 (assoc-ref outputs "fortran") "/lib")))
780 (substitute* "hl/fortran/src/Makefile.in"
781 (("libhdf5hl_fortran_la_LDFLAGS =")
782 (string-append "libhdf5hl_fortran_la_LDFLAGS = -Wl,-rpath="
783 (assoc-ref outputs "fortran") "/lib")))
784 #t))
785 (add-after 'configure 'patch-settings
786 (lambda _
787 ;; libhdf5.settings contains the full path of the
788 ;; compilers used, and its contents are included in
789 ;; libhdf5.so. We truncate the hashes to avoid
790 ;; unnecessary store references to those compilers:
791 (substitute* "src/libhdf5.settings"
792 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
793 (string-append prefix (string-take hash 10) "..."))
794 ;; Don't record the build-time kernel version to make the
795 ;; settings file reproducible.
796 (("Uname information:.*")
797 "Uname information: Linux\n"))
798 #t))
799 (add-after 'install 'patch-references
800 (lambda* (#:key inputs outputs #:allow-other-keys)
801 (let ((bin (string-append (assoc-ref outputs "out") "/bin"))
802 (zlib (assoc-ref inputs "zlib")))
803 (substitute* (find-files bin "h5p?cc")
804 (("-lz" lib)
805 (string-append "-L" zlib "/lib " lib)))
806 #t)))
807 (add-after 'install 'split
808 (lambda* (#:key inputs outputs #:allow-other-keys)
809 ;; Move all fortran-related files
810 (let* ((out (assoc-ref outputs "out"))
811 (bin (string-append out "/bin"))
812 (lib (string-append out "/lib"))
813 (inc (string-append out "/include"))
814 (ex (string-append out "/share/hdf5_examples/fortran"))
815 (fort (assoc-ref outputs "fortran"))
816 (fbin (string-append fort "/bin"))
817 (flib (string-append fort "/lib"))
818 (finc (string-append fort "/include"))
819 (fex (string-append fort "/share/hdf5_examples/fortran")))
820 (mkdir-p fbin)
821 (mkdir-p flib)
822 (mkdir-p finc)
823 (mkdir-p fex)
824 (rename-file (string-append bin "/h5fc")
825 (string-append fbin "/h5fc"))
826 (for-each (lambda (file)
827 (rename-file file
828 (string-append flib "/" (basename file))))
829 (find-files lib ".*fortran.*"))
830 (for-each (lambda (file)
831 (rename-file file
832 (string-append finc "/" (basename file))))
833 (find-files inc ".*mod"))
834 (for-each (lambda (file)
835 (rename-file file
836 (string-append fex "/" (basename file))))
837 (find-files ex ".*"))
838 (delete-file-recursively ex))
839 #t)))))
840 (home-page "http://www.hdfgroup.org")
841 (synopsis "Management suite for extremely large and complex data")
842 (description "HDF5 is a suite that makes possible the management of
843 extremely large and complex data collections.")
844 (license (license:x11-style
845 "http://www.hdfgroup.org/ftp/HDF5/current/src/unpacked/COPYING"))))
846
847 (define-public hdf-java
848 (package
849 (name "hdf-java")
850 (version "3.3.2")
851 (source
852 (origin
853 (method url-fetch)
854 (uri (string-append
855 "http://www.hdfgroup.org/ftp/HDF5/releases/HDF-JAVA/hdfjni-"
856 version "/src/CMake-hdfjava-" version ".tar.gz"))
857 (sha256
858 (base32 "0m1gp2aspcblqzmpqbdpfp6giskws85ds6p5gz8sx7asyp7wznpr"))
859 (modules '((guix build utils)))
860 (snippet ; Make sure we don't use the bundled sources and binaries.
861 `(begin
862 (for-each delete-file
863 (list "SZip.tar.gz" "ZLib.tar.gz" "JPEG8d.tar.gz"
864 "HDF4.tar.gz" "HDF5.tar.gz"))
865 (delete-file-recursively ,(string-append "hdfjava-" version "/lib"))
866 #t))))
867 (build-system gnu-build-system)
868 (native-inputs
869 `(("jdk" ,icedtea "jdk")
870 ("automake" ,automake) ; For up to date 'config.guess' and 'config.sub'.
871 ;; For tests:
872 ("hamcrest-core" ,java-hamcrest-core)
873 ("junit" ,java-junit)
874 ("slf4j-simple" ,java-slf4j-simple)))
875 (inputs
876 `(("hdf4" ,hdf4)
877 ("hdf5" ,hdf5)
878 ("zlib" ,zlib)
879 ("libjpeg" ,libjpeg)
880 ("slf4j-api" ,java-slf4j-api)))
881 (arguments
882 `(#:configure-flags
883 (list (string-append "--target=" ,(or (%current-target-system) (%current-system)))
884 (string-append "--with-jdk=" (assoc-ref %build-inputs "jdk") "/include,"
885 (assoc-ref %build-inputs "jdk") "/lib" )
886 (string-append "--with-hdf4=" (assoc-ref %build-inputs "hdf4") "/lib")
887 (string-append "--with-hdf5=" (assoc-ref %build-inputs "hdf5") "/lib"))
888
889 #:make-flags
890 (list (string-append "HDFLIB=" (assoc-ref %build-inputs "hdf4") "/lib")
891 (string-append "HDF5LIB=" (assoc-ref %build-inputs "hdf5") "/lib")
892 (string-append "ZLIB=" (assoc-ref %build-inputs "zlib") "/lib/libz.so")
893 (string-append "JPEGLIB="
894 (assoc-ref %build-inputs "libjpeg") "/lib/libjpeg.so")
895 "LLEXT=so")
896
897 #:phases
898 (modify-phases %standard-phases
899 (add-before 'configure 'chdir-to-source
900 (lambda _ (chdir ,(string-append "hdfjava-" version))))
901 (add-before 'configure 'patch-build
902 (lambda* (#:key inputs outputs #:allow-other-keys)
903 (substitute* "configure"
904 (("COPT=\"") "COPT=\"-O2 ") ; CFLAGS is ignored in Makefiles
905 (("/bin/cat") (which "cat")))
906 ;; Set classpath for compilation
907 (substitute* '("hdf/hdf5lib/Makefile.in"
908 "hdf/hdf5lib/exceptions/Makefile.in"
909 "hdf/hdflib/Makefile.in")
910 (("\\$\\(TOP\\)/lib/slf4j-api-1\\.7\\.5\\.jar")
911 (string-append (assoc-ref inputs "slf4j-api")
912 "/share/java/slf4j-api.jar")))
913 ;; Replace outdated config.sub and config.guess:
914 (with-directory-excursion "config"
915 (for-each (lambda (file)
916 (copy-file
917 (string-append (assoc-ref inputs "automake")
918 "/share/automake-1.15/" file) file))
919 '("config.sub" "config.guess")))
920 (mkdir-p (string-append (assoc-ref outputs "out")))
921 ;; Set classpath for tests
922 (let* ((build-dir (getcwd))
923 (lib (string-append build-dir "/lib"))
924 (jhdf (string-append lib "/jhdf.jar"))
925 (jhdf5 (string-append lib "/jhdf5.jar"))
926 (testjars
927 (map (lambda (i)
928 (string-append (assoc-ref inputs i)
929 "/share/java/" i ".jar"))
930 '("junit" "hamcrest-core" "slf4j-api" "slf4j-simple")))
931 (class-path
932 (string-join `("." ,build-dir ,jhdf ,jhdf5 ,@testjars) ":")))
933
934 (substitute* '("test/hdf5lib/Makefile.in"
935 "test/hdf5lib/junit.sh.in"
936 "examples/runExample.sh.in")
937 (("/usr/bin/test")
938 (string-append (assoc-ref inputs "coreutils")
939 "/bin/test"))
940 (("/usr/bin/uname")
941 (string-append (assoc-ref inputs "coreutils")
942 "/bin/uname"))
943 (("CLASSPATH=[^\n]*")
944 (string-append "CLASSPATH=" class-path)))
945 (setenv "CLASSPATH" class-path))
946 #t))
947 (add-before 'check 'build-examples
948 (lambda _
949 (zero? (apply system* `("javac"
950 ,@(find-files "examples" ".*\\.java")))))))
951
952 #:parallel-build? #f
953
954 #:parallel-tests? #f ))
955 (home-page "https://support.hdfgroup.org/products/java")
956 (synopsis "Java interface for the HDF4 and HDF5 libraries")
957 (description "Java HDF Interface (JHI) and Java HDF5 Interface (JHI5) use
958 the Java Native Interface to wrap the HDF4 and HDF5 libraries, which are
959 implemented in C.")
960
961 ;; BSD-style license:
962 (license (license:x11-style
963 "https://support.hdfgroup.org/ftp/HDF5/hdf-java\
964 /current/src/unpacked/COPYING"))))
965
966 (define-public hdf-eos2
967 (package
968 (name "hdf-eos2")
969 (version "19.1.0")
970 (source
971 (origin
972 (method url-fetch)
973 (uri "ftp://edhs1.gsfc.nasa.gov\
974 /edhs/hdfeos/latest_release/HDF-EOS2.19v1.00.tar.Z")
975 (sha256
976 (base32 "0c9fcz25s292ldap12wxmlrvnyz99z24p63d8fwx51bf8s0s1zrz"))
977 (patches (search-patches "hdf-eos2-remove-gctp.patch"
978 "hdf-eos2-build-shared.patch"
979 "hdf-eos2-fortrantests.patch"))))
980 (build-system gnu-build-system)
981 (native-inputs
982 `(("gfortran" ,gfortran)))
983 (inputs
984 `(("hdf4" ,hdf4-alt) ; assume most HDF-EOS2 users won't use the HDF4 netCDF API
985 ("zlib" ,zlib)
986 ("libjpeg" ,libjpeg)
987 ("gctp" ,gctp)))
988 (arguments
989 `( #:configure-flags '("--enable-install-include" "--enable-shared"
990 "CC=h4cc -Df2cFortran" "LIBS=-lgctp")
991 #:parallel-tests? #f))
992 (home-page "http://hdfeos.org/software/library.php#HDF-EOS2")
993 (synopsis "HDF4-based data format for NASA's Earth Observing System")
994 (description "HDF-EOS2 is a software library built on HDF4 which supports
995 the construction of data structures used in NASA's Earth Observing
996 System (Grid, Point and Swath).")
997
998 ;; Source files carry a permissive license header.
999 (license (license:non-copyleft home-page))))
1000
1001 (define-public hdf-eos5
1002 (package
1003 (name "hdf-eos5")
1004 (version "1.15")
1005 (source (origin
1006 (method url-fetch)
1007 (uri (string-append "ftp://edhs1.gsfc.nasa.gov\
1008 /edhs/hdfeos5/latest_release/HDF-EOS5." version ".tar.Z"))
1009 (sha256
1010 (base32
1011 "1p83333nzzy8rn5chxlm0hrkjjnhh2w1ji8ac0f9q4xzg838i58i"))
1012 (patches (search-patches "hdf-eos5-build-shared.patch"
1013 "hdf-eos5-remove-gctp.patch"
1014 "hdf-eos5-fix-szip.patch"
1015 "hdf-eos5-fortrantests.patch"))))
1016 (native-inputs
1017 `(("gfortran" ,gfortran)))
1018 (build-system gnu-build-system)
1019 (inputs
1020 `(("hdf5" ,hdf5)
1021 ("zlib" ,zlib)
1022 ("gctp" ,gctp)))
1023 (arguments
1024 `(#:configure-flags '("--enable-install-include" "--enable-shared"
1025 "CC=h5cc -Df2cFortran" "LIBS=-lgctp")
1026 #:parallel-tests? #f))
1027 (synopsis "HDF5-based data format for NASA's Earth Observing System")
1028 (description
1029 "HDF-EOS5 is a software library built on HDF5 to support the construction
1030 of data structures used in NASA's Earth Observing System (Grid, Point and
1031 Swath).")
1032 (home-page "http://www.hdfeos.org/software/library.php#HDF-EOS5")
1033
1034 ;; Source files carry a permissive license header.
1035 (license (license:non-copyleft home-page))))
1036
1037 (define-public hdf5-parallel-openmpi
1038 (package (inherit hdf5)
1039 (name "hdf5-parallel-openmpi")
1040 (inputs
1041 `(("mpi" ,openmpi)
1042 ,@(package-inputs hdf5)))
1043 (arguments
1044 (substitute-keyword-arguments `(#:configure-flags '("--enable-parallel")
1045 ,@(package-arguments hdf5))
1046 ((#:phases phases)
1047 `(modify-phases ,phases
1048 (add-before 'check 'patch-tests
1049 (lambda _
1050 ;; OpenMPI's mpirun will exit with non-zero status if it
1051 ;; detects an "abnormal termination", i.e. any process not
1052 ;; calling MPI_Finalize(). Since the test is explicitely
1053 ;; avoiding MPI_Finalize so as not to have at_exit and thus
1054 ;; H5C_flush_cache from being called, mpirun will always
1055 ;; complain, so turn this test off.
1056 (substitute* "testpar/Makefile"
1057 (("(^TEST_PROG_PARA.*)t_pflush1(.*)" front back)
1058 (string-append front back "\n")))
1059 (substitute* "tools/h5diff/testph5diff.sh"
1060 (("/bin/sh") (which "sh")))
1061 #t))))))
1062 (synopsis "Management suite for data with parallel IO support")))
1063
1064 (define-public h5check
1065 (package
1066 (name "h5check")
1067 (version "2.0.1")
1068 (source
1069 (origin
1070 (method url-fetch)
1071 (uri (string-append "http://www.hdfgroup.org/ftp/HDF5/tools/"
1072 "h5check/src/h5check-" version ".tar.gz"))
1073 (sha256
1074 (base32
1075 "1gm76jbwhz9adbxgn14zx8cj33dmjdr2g5xcy0m9c2gakp8w59kj"))))
1076 (build-system gnu-build-system)
1077 (inputs `(("hdf5" ,hdf5))) ;h5cc for tests
1078 (home-page "https://www.hdfgroup.org/products/hdf5_tools/h5check.html")
1079 (synopsis "HDF5 format checker")
1080 (description "@code{h5check} is a validation tool for verifying that an
1081 HDF5 file is encoded according to the HDF File Format Specification.")
1082 (license (license:x11-style "file://COPYING"))))
1083
1084 (define-public itpp
1085 (package
1086 (name "itpp")
1087 (version "4.3.1")
1088 (source (origin
1089 (method url-fetch)
1090 (uri (string-append "mirror://sourceforge/itpp/itpp/"
1091 version "/itpp-"
1092 version ".tar.gz"))
1093 (sha256
1094 (base32
1095 "14ddy2xnb6sgp4hiax9v5sv4pr4l4dd4ps76nfha3nrpr1ikhcqm"))))
1096 (build-system cmake-build-system)
1097 (arguments `(#:tests? #f)) ; Tests require googletest *sources*
1098 (inputs `(("lapack" ,lapack)
1099 ("fftw" ,fftw)))
1100 ;; FIXME: Even though the fonts are available dvips complains:
1101 ;; "Font cmmi10 not found; characters will be left blank."
1102 (native-inputs
1103 `(("texlive" ,texlive-tiny)
1104 ("ghostscript" ,ghostscript)
1105 ("doxygen" ,doxygen)))
1106 (home-page "http://itpp.sourceforge.net")
1107 (synopsis "C++ library of maths, signal processing and communication classes")
1108 (description "IT++ is a C++ library of mathematical, signal processing and
1109 communication classes and functions. Its main use is in simulation of
1110 communication systems and for performing research in the area of
1111 communications. The kernel of the library consists of generic vector and
1112 matrix classes, and a set of accompanying routines. Such a kernel makes IT++
1113 similar to MATLAB, GNU Octave or SciPy.")
1114 (license license:gpl3+)))
1115
1116 (define-public netcdf
1117 (package
1118 (name "netcdf")
1119 (version "4.4.1.1")
1120 (source
1121 (origin
1122 (method url-fetch)
1123 (uri (string-append "ftp://ftp.unidata.ucar.edu/pub/netcdf/"
1124 "netcdf-" version ".tar.gz"))
1125 (sha256
1126 (base32
1127 "1blc7ik5yin7i0ls2kag0a9xjk12m0dzx6v1x88az3ras3scci2d"))
1128 (patches (search-patches "netcdf-date-time.patch"
1129 "netcdf-tst_h_par.patch"))))
1130 (build-system gnu-build-system)
1131 (native-inputs
1132 `(("m4" ,m4)
1133 ("doxygen" ,doxygen)
1134 ("graphviz" ,graphviz)))
1135 (inputs
1136 `(("hdf4" ,hdf4-alt)
1137 ("hdf5" ,hdf5)
1138 ("zlib" ,zlib)
1139 ("libjpeg" ,libjpeg)))
1140 (arguments
1141 `(#:configure-flags '("--enable-doxygen" "--enable-dot" "--enable-hdf4")
1142
1143 #:phases (modify-phases %standard-phases
1144 (add-before 'configure 'fix-source-date
1145 (lambda _
1146 ;; As we ${SOURCE_DATE_EPOCH} evaluates to "1" in the build
1147 ;; environment, `date -u -d ${SOURCE_DATE_EPOCH}` will evaluate
1148 ;; to '1st hour of the current day', and therefore makes the
1149 ;; package not reproducible.
1150 (substitute* "./configure"
1151 (("date -u -d \"\\$\\{SOURCE_DATE_EPOCH\\}\"")
1152 "date --date='@0'"))
1153 #t))
1154 (add-after 'configure 'patch-settings
1155 (lambda _
1156 ;; libnetcdf.settings contains the full filename of the compilers
1157 ;; used to build the library. We truncate the hashes of those
1158 ;; filenames to avoid unnecessary references to the corresponding
1159 ;; store items.
1160 (substitute* "libnetcdf.settings"
1161 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
1162 (string-append prefix (string-take hash 10) "...")))
1163 #t)))
1164
1165 #:parallel-tests? #f)) ;various race conditions
1166 (home-page "http://www.unidata.ucar.edu/software/netcdf/")
1167 (synopsis "Library for scientific data")
1168 (description "NetCDF is an interface for scientific data access and a
1169 software library that provides an implementation of the interface. The netCDF
1170 library defines a machine-independent format for representing scientific data.
1171 Together, the interface, library, and format support the creation, access, and
1172 sharing of scientific data.")
1173 (license (license:x11-style "file://COPYRIGHT"))))
1174
1175 (define-public netcdf-parallel-openmpi
1176 (package (inherit netcdf)
1177 (name "netcdf-parallel-openmpi")
1178 (inputs
1179 `(("mpi" ,openmpi)
1180 ,@(alist-replace "hdf5" (list hdf5-parallel-openmpi)
1181 (package-inputs netcdf))))
1182 ;; TODO: Replace pkg-config references in nc-config with absolute references
1183 (arguments
1184 (substitute-keyword-arguments (package-arguments netcdf)
1185 ((#:configure-flags flags)
1186 `(cons* "CC=mpicc" "CXX=mpicxx"
1187 "--enable-parallel-tests"
1188 ;; Shared libraries not supported with parallel IO.
1189 "--disable-shared" "--with-pic"
1190 ,flags))))))
1191
1192 (define-public netcdf-fortran
1193 (package
1194 (name "netcdf-fortran")
1195 (version "4.4.4")
1196 (source (origin
1197 (method url-fetch)
1198 (uri (string-append
1199 "ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-fortran-"
1200 version ".tar.gz"))
1201 (sha256
1202 (base32
1203 "0xaxdcg1p83zmypwml3swsnr3ccn38inwldyr1l3wa4dbwbrblxj"))))
1204 (build-system gnu-build-system)
1205 (arguments
1206 `(#:parallel-tests? #f))
1207 (inputs
1208 `(("netcdf" ,netcdf)))
1209 (native-inputs
1210 `(("gfortran" ,gfortran)))
1211 (synopsis "Fortran interface for the netCDF library")
1212 (description (package-description netcdf))
1213 (home-page (package-home-page netcdf))
1214 (license (package-license netcdf))))
1215
1216 (define-public nlopt
1217 (package
1218 (name "nlopt")
1219 (version "2.4.2")
1220 (source (origin
1221 (method url-fetch)
1222 (uri (string-append "http://ab-initio.mit.edu/nlopt/nlopt-"
1223 version ".tar.gz"))
1224 (sha256
1225 (base32 "12cfkkhcdf4zmb6h7y6qvvdvqjs2xf9sjpa3rl3bq76px4yn76c0"))))
1226 (build-system gnu-build-system)
1227 (arguments
1228 `(;; Shared libraries are not built by default. They are required to
1229 ;; build the Guile, Octave, and Python bindings.
1230 #:configure-flags '("--enable-shared")
1231
1232 #:phases
1233 (modify-phases %standard-phases
1234 (add-before 'configure 'set-libnlopt-file-name
1235 (lambda* (#:key outputs #:allow-other-keys)
1236 ;; Make sure the Scheme module refers to the library by its
1237 ;; absolute file name (we cannot do that from a snippet
1238 ;; because the expansion of @libdir@ contains
1239 ;; ${exec_prefix}.)
1240 (let ((out (assoc-ref outputs "out")))
1241 (substitute* "swig/nlopt.scm.in"
1242 (("libnlopt")
1243 (string-append out "/lib/libnlopt")))
1244 #t))))))
1245 (inputs `(("guile" ,guile-2.0)))
1246 (native-inputs `(("pkg-config" ,pkg-config)))
1247 (home-page "http://ab-initio.mit.edu/wiki/")
1248 (synopsis "Library for nonlinear optimization")
1249 (description "NLopt is a library for nonlinear optimization, providing a
1250 common interface for a number of different free optimization routines available
1251 online as well as original implementations of various other algorithms.")
1252 (license license:lgpl2.1+)))
1253
1254 (define-public ipopt
1255 (package
1256 (name "ipopt")
1257 (version "3.12.5")
1258 (source (origin
1259 (method url-fetch)
1260 (uri (string-append
1261 "http://www.coin-or.org/download/source/Ipopt/Ipopt-"
1262 version".tgz"))
1263 (sha256
1264 (base32
1265 "09bk2hqy2vgi4yi76xng9zxakddwqy3wij9nx7wf2vfbxxpazrsk"))
1266 (modules '((guix build utils)))
1267 (snippet
1268 ;; Make sure we don't use the bundled software.
1269 '(begin
1270 (delete-file-recursively "ThirdParty")
1271 #t))))
1272 (build-system gnu-build-system)
1273 (arguments
1274 '(#:phases (modify-phases %standard-phases
1275 (add-after 'install 'add--L-flags-in-ipopt.pc
1276 (lambda* (#:key inputs outputs #:allow-other-keys)
1277 ;; The '.pc' file lists '-llapack -lblas' in "Libs";
1278 ;; move it to "Libs.private" where it belongs, and add a
1279 ;; '-L' flag for LAPACK.
1280 (let ((out (assoc-ref outputs "out"))
1281 (lapack (assoc-ref inputs "lapack")))
1282 (substitute* (string-append out "/lib/pkgconfig/"
1283 "ipopt.pc")
1284 (("Libs: (.*)-llapack -lblas(.*)$" _ before after)
1285 (string-append "Libs: " before " " after "\n"
1286 "Libs.private: " before
1287 "-L" lapack "/lib -llapack -lblas "
1288 after "\n")))
1289 #t))))))
1290 (native-inputs
1291 `(("gfortran" ,gfortran)))
1292 (inputs
1293 ;; TODO: Maybe add dependency on COIN-MUMPS, ASL, and HSL.
1294 `(("lapack" ,lapack))) ;for both libblas and liblapack
1295 (home-page "http://www.coin-or.org")
1296 (synopsis "Large-scale nonlinear optimizer")
1297 (description
1298 "The Interior Point Optimizer (IPOPT) is a software package for
1299 large-scale nonlinear optimization. It provides C++, C, and Fortran
1300 interfaces.")
1301 (license license:epl1.0)))
1302
1303 (define-public ceres
1304 (package
1305 (name "ceres-solver")
1306 (version "1.14.0")
1307 (home-page "http://ceres-solver.org/")
1308 (source (origin
1309 (method url-fetch)
1310 (uri (string-append home-page "ceres-solver-"
1311 version ".tar.gz"))
1312 (sha256
1313 (base32
1314 "13lfxy8x58w8vprr0nkbzziaijlh0vvqshgahvcgw0mrqdgh0i27"))))
1315 (build-system cmake-build-system)
1316 (arguments
1317 ;; TODO: Build HTML user documentation and install separately.
1318 '(#:configure-flags '("-DBUILD_EXAMPLES=OFF"
1319 "-DBUILD_SHARED_LIBS=ON")
1320
1321 #:phases (modify-phases %standard-phases
1322 (add-before 'configure 'set-library-directory
1323 (lambda _
1324 ;; Install libraries to lib/, not lib64/.
1325 (substitute* "internal/ceres/CMakeLists.txt"
1326 (("set\\(LIB_SUFFIX \"64\"\\)")
1327 "set(LIB_SUFFIX \"\")"))
1328 #t)))))
1329 (native-inputs
1330 `(("pkg-config" ,pkg-config)))
1331 (propagated-inputs
1332 `(("glog" ,glog))) ;for #include <glog/glog.h>
1333 (inputs
1334 `(("eigen" ,eigen)
1335 ("blas" ,openblas)
1336 ("lapack" ,lapack)
1337 ("suitesparse" ,suitesparse)
1338 ("gflags" ,gflags)))
1339 (synopsis "C++ library for solving large optimization problems")
1340 (description
1341 "Ceres Solver is a C++ library for modeling and solving large,
1342 complicated optimization problems. It is a feature rich, mature and
1343 performant library which has been used in production since 2010. Ceres Solver
1344 can solve two kinds of problems:
1345 @enumerate
1346 @item non-linear least squares problems with bounds constraints;
1347 @item general unconstrained optimization problems.
1348 @end enumerate\n")
1349 (license license:bsd-3)))
1350
1351 ;; For a fully featured Octave, users are strongly recommended also to install
1352 ;; the following packages: less, ghostscript, gnuplot.
1353 (define-public octave
1354 (package
1355 (name "octave")
1356 (version "4.4.1")
1357 (source
1358 (origin
1359 (method url-fetch)
1360 (uri (string-append "mirror://gnu/octave/octave-"
1361 version ".tar.lz"))
1362 (sha256
1363 (base32
1364 "0jsdgizlv02an2ppfjwk5qf209zpwi3317yb7jvlsjzxnir3lvhy"))))
1365 (build-system gnu-build-system)
1366 (inputs
1367 `(("lapack" ,lapack)
1368 ("qhull" ,qhull)
1369 ("readline" ,readline)
1370 ("gl2ps" ,gl2ps)
1371 ("glpk" ,glpk)
1372 ("fftw" ,fftw)
1373 ("fftwf" ,fftwf)
1374 ("arpack" ,arpack-ng)
1375 ("pcre" ,pcre)
1376 ("fltk" ,fltk)
1377 ("fontconfig" ,fontconfig)
1378 ("freetype" ,freetype)
1379 ("hdf5" ,hdf5)
1380 ("libxft" ,libxft)
1381 ("mesa" ,mesa)
1382 ("glu" ,glu)
1383 ("zlib" ,zlib)
1384 ("curl" ,curl)
1385 ("texinfo" ,texinfo)
1386 ("graphicsmagick" ,graphicsmagick)
1387 ("suitesparse" ,suitesparse)
1388 ("libsndfile" ,libsndfile)
1389 ("portaudio" ,portaudio)
1390 ("alsa-lib" ,alsa-lib)))
1391 (native-inputs
1392 `(("lzip" ,lzip)
1393 ("gfortran" ,gfortran)
1394 ("pkg-config" ,pkg-config)
1395 ("perl" ,perl)
1396 ;; The following inputs are not actually used in the build process.
1397 ;; However, the ./configure gratuitously tests for their existence and
1398 ;; assumes that programs not present at build time are also not, and
1399 ;; can never be, available at run time! If these inputs are therefore
1400 ;; not present, support for them will be built out. However, Octave
1401 ;; will still run without them, albeit without the features they
1402 ;; provide.
1403 ("less" ,less)
1404 ("ghostscript" ,ghostscript)
1405 ("gnuplot" ,gnuplot)))
1406 (arguments
1407 `(#:configure-flags
1408 (list (string-append "--with-shell="
1409 (assoc-ref %build-inputs "bash")
1410 "/bin/sh"))
1411 #:phases
1412 (modify-phases %standard-phases
1413 (add-after 'configure 'configure-makeinfo
1414 (lambda* (#:key inputs #:allow-other-keys)
1415 (substitute* "libinterp/corefcn/help.cc"
1416 (("Vmakeinfo_program = \"makeinfo\"")
1417 (string-append "Vmakeinfo_program = \""
1418 (assoc-ref inputs "texinfo")
1419 "/bin/makeinfo\"")))
1420 #t)))))
1421 (home-page "https://www.gnu.org/software/octave/")
1422 (synopsis "High-level language for numerical computation")
1423 (description "GNU Octave is a high-level interpreted language that is
1424 specialized for numerical computations. It can be used for both linear and
1425 non-linear applications and it provides great support for visualizing results.
1426 Work may be performed both at the interactive command-line as well as via
1427 script files.")
1428 (license license:gpl3+)))
1429
1430 (define-public qtoctave
1431 (package (inherit octave)
1432 (name "qtoctave")
1433 (source (origin
1434 (inherit (package-source octave))))
1435 (inputs
1436 `(("qscintilla" ,qscintilla)
1437 ("qt" ,qtbase)
1438 ,@(package-inputs octave)))
1439 (native-inputs
1440 `(("qttools" , qttools) ;for lrelease
1441 ("texlive" ,texlive) ;for texi2dvi
1442 ,@(package-native-inputs octave)))
1443 (arguments
1444 (substitute-keyword-arguments (package-arguments octave)
1445 ((#:phases phases)
1446 `(modify-phases ,phases
1447 (add-before 'configure 'patch-qscintilla-library-name
1448 (lambda* (#:key inputs #:allow-other-keys)
1449 ;; The QScintilla library that the Octave configure script tries
1450 ;; to link with should be named libqscintilla-qt5.so, but the
1451 ;; QScintilla input provides the shared library as
1452 ;; libqscintilla2_qt5.so.
1453 (substitute* "configure"
1454 (("qscintilla2-qt5")
1455 "qscintilla2_qt5"))
1456 #t))))))))
1457
1458 (define-public opencascade-oce
1459 (package
1460 (name "opencascade-oce")
1461 (version "0.17.2")
1462 (source
1463 (origin
1464 (method url-fetch)
1465 (uri (string-append
1466 "https://github.com/tpaviot/oce/archive/OCE-"
1467 version
1468 ".tar.gz"))
1469 (patches (search-patches "opencascade-oce-glibc-2.26.patch"))
1470 (sha256
1471 (base32
1472 "0vpmnb0k5y2f7lpmwx9pg9yfq24zjvnsak5alzacncfm1hv9b6cd"))))
1473 (build-system cmake-build-system)
1474 (arguments
1475 '(#:configure-flags
1476 (list "-DOCE_TESTING:BOOL=ON"
1477 "-DOCE_USE_TCL_TEST_FRAMEWORK:BOOL=ON"
1478 "-DOCE_DRAW:BOOL=ON"
1479 (string-append "-DOCE_INSTALL_PREFIX:PATH="
1480 (assoc-ref %outputs "out"))
1481 "-UCMAKE_INSTALL_RPATH")))
1482 (inputs
1483 `(("freetype" ,freetype)
1484 ("glu" ,glu)
1485 ("libxmu" ,libxmu)
1486 ("mesa" ,mesa)
1487 ("tcl" ,tcl)
1488 ("tk" ,tk)))
1489 (native-inputs
1490 `(("python" ,python-wrapper)))
1491 (home-page "https://github.com/tpaviot/oce")
1492 (synopsis "Libraries for 3D modeling and numerical simulation")
1493 (description
1494 "Open CASCADE is a set of libraries for the development of applications
1495 dealing with 3D CAD data or requiring industrial 3D capabilities. It includes
1496 C++ class libraries providing services for 3D surface and solid modeling, CAD
1497 data exchange, and visualization. It is used for development of specialized
1498 software dealing with 3D models in design (CAD), manufacturing (CAM),
1499 numerical simulation (CAE), measurement equipment (CMM), and quality
1500 control (CAQ) domains.
1501
1502 This is the ``Community Edition'' (OCE) of Open CASCADE, which gathers
1503 patches, improvements, and experiments contributed by users over the official
1504 Open CASCADE library.")
1505 (license (list license:lgpl2.1; OCE libraries, with an exception for the
1506 ; use of header files; see
1507 ; OCCT_LGPL_EXCEPTION.txt
1508 license:public-domain; files
1509 ; src/Standard/Standard_StdAllocator.hxx and
1510 ; src/NCollection/NCollection_StdAllocator.hxx
1511 license:expat; file src/OpenGl/OpenGl_glext.h
1512 license:bsd-3)))); test framework gtest
1513
1514 (define-public gmsh
1515 (package
1516 (name "gmsh")
1517 (version "2.16.0")
1518 (source
1519 (origin
1520 (method url-fetch)
1521 (uri (string-append "http://gmsh.info/src/gmsh-"
1522 version "-source.tgz"))
1523 (sha256
1524 (base32 "1slf0bfkwrcgn6296wb4qhbk4ahz6i4wfb10hnim08x05vrylag8"))
1525 (modules '((guix build utils)))
1526 (snippet
1527 ;; Remove non-free METIS code
1528 '(begin
1529 (delete-file-recursively "contrib/Metis")
1530 #t))))
1531 (build-system cmake-build-system)
1532 (propagated-inputs
1533 `(("fltk" ,fltk)
1534 ("gfortran" ,gfortran)
1535 ("gmp" ,gmp)
1536 ("hdf5" ,hdf5)
1537 ("lapack" ,lapack)
1538 ("mesa" ,mesa)
1539 ("glu" ,glu)
1540 ("opencascade-oce" ,opencascade-oce)
1541 ("libx11" ,libx11)
1542 ("libxext" ,libxext)))
1543 (inputs
1544 `(("fontconfig" ,fontconfig)
1545 ("libxft" ,libxft)))
1546 (arguments
1547 `(#:configure-flags `("-DENABLE_METIS:BOOL=OFF"
1548 "-DENABLE_BUILD_SHARED:BOOL=ON"
1549 "-DENABLE_BUILD_DYNAMIC:BOOL=ON")))
1550 (home-page "http://www.geuz.org/gmsh/")
1551 (synopsis "3D finite element grid generator")
1552 (description "Gmsh is a 3D finite element grid generator with a built-in
1553 CAD engine and post-processor. Its design goal is to provide a fast, light
1554 and user-friendly meshing tool with parametric input and advanced
1555 visualization capabilities. Gmsh is built around four modules: geometry,
1556 mesh, solver and post-processing. The specification of any input to these
1557 modules is done either interactively using the graphical user interface or in
1558 ASCII text files using Gmsh's own scripting language.")
1559 (license license:gpl2+)))
1560
1561 (define-public maxflow
1562 (package
1563 (name "maxflow")
1564 (version "3.04")
1565 (source (origin
1566 (method git-fetch)
1567 (uri (git-reference
1568 (url "https://github.com/gerddie/maxflow.git")
1569 (commit "42401fa54823d16b9da47716f04e5d9ef1605875")))
1570 (file-name (string-append name "-" version "-checkout"))
1571 (sha256
1572 (base32
1573 "0rll38whw55h0vcjrrwdnh9ascvxby0ph7n1l0d12z17cg215kkb"))))
1574 (build-system cmake-build-system)
1575 (home-page "http://pub.ist.ac.at/~vnk/software.html")
1576 (synopsis "Library implementing Maxflow algorithm")
1577 (description "An implementation of the maxflow algorithm described in
1578 @cite{An Experimental Comparison of Min-Cut/Max-Flow Algorithms for
1579 Energy Minimization in Computer Vision.\n
1580 Yuri Boykov and Vladimir Kolmogorov.\n
1581 In IEEE Transactions on Pattern Analysis and Machine Intelligence,\n
1582 September 2004}")
1583 (license license:gpl3+)))
1584
1585 (define-public petsc
1586 (package
1587 (name "petsc")
1588 (version "3.8.0")
1589 (source
1590 (origin
1591 (method url-fetch)
1592 ;; The *-lite-* tarball does not contain the *large* documentation
1593 (uri (string-append "http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/"
1594 "petsc-lite-" version ".tar.gz"))
1595 (sha256
1596 (base32 "1lajbk3c29hnh83v6cbmm3a8wv6bdykh0p70kwrr4vrnizalk88s"))))
1597 (build-system gnu-build-system)
1598 (native-inputs
1599 `(("python" ,python-2)))
1600 (inputs
1601 `(("gfortran" ,gfortran)
1602 ("lapack" ,lapack)
1603 ("superlu" ,superlu)
1604 ;; leaving out hdf5 and fftw, as petsc expects them to be built with mpi
1605 ;; leaving out opengl, as configuration seems to only be for mac
1606 ))
1607 (arguments
1608 `(#:test-target "test"
1609 #:parallel-build? #f ;build is parallel by default
1610 #:configure-flags
1611 `("--with-mpi=0"
1612 "--with-openmp=1"
1613 "--with-superlu=1"
1614 ,(string-append "--with-superlu-include="
1615 (assoc-ref %build-inputs "superlu") "/include")
1616 ,(string-append "--with-superlu-lib="
1617 (assoc-ref %build-inputs "superlu") "/lib/libsuperlu.a"))
1618 #:make-flags
1619 ;; Honor (parallel-job-count) for build. Do not use --with-make-np,
1620 ;; whose value is dumped to $out/lib/petsc/conf/petscvariables.
1621 (list (format #f "MAKE_NP=~a" (parallel-job-count)))
1622 #:phases
1623 (modify-phases %standard-phases
1624 (replace 'configure
1625 ;; PETSc's configure script is actually a python script, so we can't
1626 ;; run it with bash.
1627 (lambda* (#:key outputs (configure-flags '())
1628 #:allow-other-keys)
1629 (let* ((prefix (assoc-ref outputs "out"))
1630 (flags `(,(string-append "--prefix=" prefix)
1631 ,@configure-flags)))
1632 (format #t "build directory: ~s~%" (getcwd))
1633 (format #t "configure flags: ~s~%" flags)
1634 (apply invoke "./configure" flags))))
1635 (add-after 'configure 'clean-local-references
1636 (lambda* (#:key outputs #:allow-other-keys)
1637 (let ((out (assoc-ref outputs "out")))
1638 (substitute* (find-files "." "^petsc(conf|machineinfo).h$")
1639 ;; Prevent build directory from leaking into compiled code
1640 (((getcwd)) out)
1641 ;; Scrub timestamp for reproducibility
1642 ((".*Libraries compiled on.*") ""))
1643 (substitute* (find-files "." "petscvariables")
1644 ;; Do not expose build machine characteristics, set to defaults.
1645 (("MAKE_NP = [:digit:]+") "MAKE_NP = 2")
1646 (("NPMAX = [:digit:]+") "NPMAX = 2"))
1647 #t)))
1648 (add-after 'install 'clean-install
1649 ;; Try to keep installed files from leaking build directory names.
1650 (lambda* (#:key inputs outputs #:allow-other-keys)
1651 (let ((out (assoc-ref outputs "out")))
1652 (substitute* (map (lambda (file)
1653 (string-append out "/lib/petsc/conf/" file))
1654 '("petscvariables"))
1655 (((getcwd)) out))
1656 ;; Make compiler references point to the store
1657 (substitute* (string-append out "/lib/petsc/conf/petscvariables")
1658 (("= (gcc|g\\+\\+|gfortran)" _ compiler)
1659 (string-append "= " (which compiler))))
1660 ;; PETSc installs some build logs, which aren't necessary.
1661 (for-each (lambda (file)
1662 (let ((f (string-append out "/lib/petsc/conf/" file)))
1663 (when (file-exists? f)
1664 (delete-file f))))
1665 '("configure.log" "make.log" "gmake.log"
1666 "test.log" "error.log" "RDict.db"
1667 "PETScBuildInternal.cmake"
1668 ;; Once installed, should uninstall with Guix
1669 "uninstall.py"))
1670 #t))))))
1671 (home-page "http://www.mcs.anl.gov/petsc")
1672 (synopsis "Library to solve PDEs")
1673 (description "PETSc, pronounced PET-see (the S is silent), is a suite of
1674 data structures and routines for the scalable (parallel) solution of
1675 scientific applications modeled by partial differential equations.")
1676 (license (license:non-copyleft
1677 "http://www.mcs.anl.gov/petsc/documentation/copyright.html"))))
1678
1679 (define-public petsc-complex
1680 (package (inherit petsc)
1681 (name "petsc-complex")
1682 (arguments
1683 (substitute-keyword-arguments (package-arguments petsc)
1684 ((#:configure-flags cf)
1685 `(cons "--with-scalar-type=complex" ,cf))))
1686 (synopsis "Library to solve PDEs (with complex scalars)")))
1687
1688 (define-public petsc-openmpi
1689 (package (inherit petsc)
1690 (name "petsc-openmpi")
1691 (inputs
1692 `(("openmpi" ,openmpi)
1693 ,@(package-inputs petsc)))
1694 (arguments
1695 (substitute-keyword-arguments (package-arguments petsc)
1696 ((#:configure-flags cf)
1697 ``("--with-mpiexec=mpirun"
1698 ,(string-append "--with-mpi-dir="
1699 (assoc-ref %build-inputs "openmpi"))
1700 ,@(delete "--with-mpi=0" ,cf)))))
1701 (synopsis "Library to solve PDEs (with MPI support)")))
1702
1703 (define-public petsc-complex-openmpi
1704 (package (inherit petsc-complex)
1705 (name "petsc-complex-openmpi")
1706 (inputs
1707 `(("openmpi" ,openmpi)
1708 ,@(package-inputs petsc-complex)))
1709 (arguments
1710 (substitute-keyword-arguments (package-arguments petsc-complex)
1711 ((#:configure-flags cf)
1712 ``("--with-mpiexec=mpirun"
1713 ,(string-append "--with-mpi-dir="
1714 (assoc-ref %build-inputs "openmpi"))
1715 ,@(delete "--with-mpi=0" ,cf)))))
1716 (synopsis "Library to solve PDEs (with complex scalars and MPI support)")))
1717
1718
1719 (define-public python-kiwisolver
1720 (package
1721 (name "python-kiwisolver")
1722 (version "1.0.1")
1723 (source (origin
1724 (method url-fetch)
1725 (uri (pypi-uri "kiwisolver" version))
1726 (sha256
1727 (base32
1728 "0y22ci86znwwwfhbmvbgdfnbi6lv5gv2xkdlxvjw7lml43ayafyf"))))
1729 (build-system python-build-system)
1730 (home-page "https://github.com/nucleic/kiwi")
1731 (synopsis "Fast implementation of the Cassowary constraint solver")
1732 (description
1733 "Kiwi is an efficient C++ implementation of the Cassowary constraint
1734 solving algorithm. Kiwi has been designed from the ground up to be
1735 lightweight and fast. Kiwi ranges from 10x to 500x faster than the original
1736 Cassowary solver with typical use cases gaining a 40x improvement. Memory
1737 savings are consistently > 5x.")
1738 (license license:bsd-3)))
1739
1740 (define-public python2-kiwisolver
1741 (package-with-python2 python-kiwisolver))
1742
1743 (define-public slepc
1744 (package
1745 (name "slepc")
1746 (version "3.8.2")
1747 (source
1748 (origin
1749 (method url-fetch)
1750 (uri (string-append "http://slepc.upv.es/download/distrib/slepc-"
1751 version ".tar.gz"))
1752 (sha256
1753 (base32
1754 "04zd48p43rnvg68p6cp28zll0px5whglc5v0sc3s6vdj1v920z8y"))))
1755 (build-system gnu-build-system)
1756 (native-inputs
1757 `(("python" ,python-2)))
1758 (inputs
1759 `(("arpack" ,arpack-ng)
1760 ("gfortran" ,gfortran)))
1761 (propagated-inputs
1762 `(("petsc" ,petsc)))
1763 (arguments
1764 `(#:parallel-build? #f ;build is parallel by default
1765 #:configure-flags
1766 `(,(string-append "--with-arpack-dir="
1767 (assoc-ref %build-inputs "arpack") "/lib"))
1768 #:make-flags ;honor (parallel-job-count)
1769 `(,(format #f "MAKE_NP=~a" (parallel-job-count)))
1770 #:phases
1771 (modify-phases %standard-phases
1772 (replace 'configure
1773 ;; configure is a python script, so we can't run it with bash.
1774 (lambda* (#:key inputs outputs (configure-flags '())
1775 #:allow-other-keys)
1776 (let* ((prefix (assoc-ref outputs "out"))
1777 (flags `(,(string-append "--prefix=" prefix)
1778 ,@configure-flags)))
1779 (format #t "build directory: ~s~%" (getcwd))
1780 (format #t "configure flags: ~s~%" flags)
1781 (setenv "SLEPC_DIR" (getcwd))
1782 (setenv "PETSC_DIR" (assoc-ref inputs "petsc"))
1783 (apply invoke "./configure" flags))))
1784 (add-after 'install 'delete-doc
1785 ;; TODO: SLEPc installs HTML documentation alongside headers in
1786 ;; $out/include. We'd like to move them to share/doc, but delete
1787 ;; them for now, as they are incomplete and installing the complete
1788 ;; documentation is difficult.
1789 (lambda* (#:key outputs #:allow-other-keys)
1790 (let* ((out (assoc-ref outputs "out")))
1791 (for-each delete-file (find-files out "\\.html$"))
1792 #t)))
1793 (add-after 'install 'clean-install
1794 ;; Clean up unnecessary build logs from installation.
1795 (lambda* (#:key outputs #:allow-other-keys)
1796 (let ((out (assoc-ref outputs "out")))
1797 (for-each (lambda (file)
1798 (let ((f (string-append out "/lib/slepc/conf/" file)))
1799 (when (file-exists? f)
1800 (delete-file f))))
1801 '("configure.log" "make.log" "gmake.log"
1802 "test.log" "error.log" "RDict.db"
1803 "uninstall.py"))
1804 #t))))))
1805 (home-page "http://slepc.upv.es")
1806 (synopsis "Scalable library for eigenproblems")
1807 (description "SLEPc is a software library for the solution of large sparse
1808 eigenproblems on parallel computers. It can be used for the solution of
1809 linear eigenvalue problems formulated in either standard or generalized form,
1810 as well as other related problems such as the singular value decomposition.
1811 The emphasis of the software is on methods and techniques appropriate for
1812 problems in which the associated matrices are sparse, for example, those
1813 arising after the discretization of partial differential equations.")
1814 (license license:bsd-2)))
1815
1816 (define-public slepc-complex
1817 (package (inherit slepc)
1818 (name "slepc-complex")
1819 (propagated-inputs
1820 `(("petsc" ,petsc-complex)
1821 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
1822 (synopsis "Scalable library for eigenproblems (with complex scalars)")))
1823
1824 (define-public slepc-openmpi
1825 (package (inherit slepc)
1826 (name "slepc-openmpi")
1827 (arguments
1828 (substitute-keyword-arguments (package-arguments slepc)
1829 ((#:phases phases '%standard-phases)
1830 `(modify-phases ,phases
1831 (add-before 'check 'set-test-environment
1832 (lambda _
1833 ;; By default, running the test suite would fail because 'ssh'
1834 ;; could not be found in $PATH. Define this variable to
1835 ;; placate Open MPI without adding a dependency on OpenSSH (the
1836 ;; agent isn't used anyway.)
1837 (setenv "OMPI_MCA_plm_rsh_agent" (which "cat"))
1838 #t))))))
1839 (inputs
1840 `(("mpi" ,openmpi)
1841 ("arpack" ,arpack-ng-openmpi)
1842 ,@(alist-delete "arpack" (package-inputs slepc))))
1843 (propagated-inputs
1844 `(("petsc" ,petsc-openmpi)
1845 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
1846 (synopsis "Scalable library for eigenproblems (with MPI support)")))
1847
1848 (define-public slepc-complex-openmpi
1849 (package (inherit slepc-openmpi)
1850 (name "slepc-complex-openmpi")
1851 (propagated-inputs
1852 `(("petsc" ,petsc-complex-openmpi)
1853 ,@(alist-delete "petsc" (package-propagated-inputs slepc-openmpi))))
1854 (synopsis "Scalable library for eigenproblems (with complex scalars and MPI support)")))
1855
1856 (define-public mumps
1857 (package
1858 (name "mumps")
1859 (version "5.1.2")
1860 (source
1861 (origin
1862 (method url-fetch)
1863 (uri (string-append "http://mumps.enseeiht.fr/MUMPS_"
1864 version ".tar.gz"))
1865 (sha256
1866 (base32
1867 "1s9asin08zqzmh08257sdghhivvy9vjif7c53fhaxaax2kd5qd7b"))
1868 (patches (search-patches "mumps-build-parallelism.patch"))))
1869 (build-system gnu-build-system)
1870 (inputs
1871 `(("fortran" ,gfortran)
1872 ;; These are required for linking against mumps, but we let the user
1873 ;; declare the dependency.
1874 ("blas" ,openblas)
1875 ("metis" ,metis)
1876 ("scotch" ,scotch)))
1877 (arguments
1878 `(#:modules ((ice-9 match)
1879 (ice-9 popen)
1880 (srfi srfi-1)
1881 ,@%gnu-build-system-modules)
1882 #:phases
1883 (modify-phases %standard-phases
1884 (replace 'configure
1885 (lambda* (#:key inputs #:allow-other-keys)
1886 (call-with-output-file "Makefile.inc"
1887 (lambda (port)
1888 (format port "
1889 PLAT =
1890 LIBEXT = .a
1891 OUTC = -o
1892 OUTF = -o
1893 RM = rm -f~:[
1894 CC = gcc
1895 FC = gfortran
1896 FL = gfortran
1897 INCSEQ = -I$(topdir)/libseq
1898 LIBSEQ = -L$(topdir)/libseq -lmpiseq
1899 LIBSEQNEEDED = libseqneeded~;
1900 CC = mpicc
1901 FC = mpifort
1902 FL = mpifort~]
1903 AR = ar vr # rules require trailing space, ugh...
1904 RANLIB = ranlib
1905 LIBBLAS = -L~a -lopenblas~@[
1906 SCALAP = -L~a -lscalapack~]
1907 LIBOTHERS = -pthread
1908 CDEFS = -DAdd_
1909 PIC = -fPIC
1910 OPTF = -O2 -DALLOW_NON_INIT $(PIC)
1911 OPTL = -O2 $(PIC)
1912 OPTC = -O2 $(PIC)
1913 INCS = $(INCSEQ)
1914 LIBS = $(SCALAP) $(LIBSEQ)
1915 LPORDDIR = $(topdir)/PORD/lib
1916 IPORD = -I$(topdir)/PORD/include
1917 LPORD = -L$(LPORDDIR) -lpord
1918 ORDERINGSF = -Dpord~@[
1919 METISDIR = ~a
1920 IMETIS = -I$(METISDIR)/include
1921 LMETIS = -L$(METISDIR)/lib -lmetis
1922 ORDERINGSF += -Dmetis~]~@[~:{
1923 SCOTCHDIR = ~a
1924 ISCOTCH = -I$(SCOTCHDIR)/include
1925 LSCOTCH = -L$(SCOTCHDIR)/lib ~a-lesmumps -lscotch -lscotcherr
1926 ORDERINGSF += ~a~}~]
1927 ORDERINGSC = $(ORDERINGSF)
1928 LORDERINGS = $(LPORD) $(LMETIS) $(LSCOTCH)
1929 IORDERINGSF = $(ISCOTCH)
1930 IORDERINGSC = $(IPORD) $(IMETIS) $(ISCOTCH)"
1931 (assoc-ref inputs "mpi")
1932 (assoc-ref inputs "blas")
1933 (assoc-ref inputs "scalapack")
1934 (assoc-ref inputs "metis")
1935 (match (list (assoc-ref inputs "pt-scotch")
1936 (assoc-ref inputs "scotch"))
1937 ((#f #f)
1938 #f)
1939 ((#f scotch)
1940 `((,scotch "" "-Dscotch")))
1941 ((ptscotch _)
1942 `((,ptscotch
1943 "-lptesmumps -lptscotch -lptscotcherr "
1944 "-Dptscotch")))))))))
1945 (replace 'build
1946 ;; By default only the d-precision library is built. Make with "all"
1947 ;; target so that all precision libraries and examples are built.
1948 (lambda _
1949 (invoke "make" "all"
1950 (format #f "-j~a" (parallel-job-count)))))
1951 (replace 'check
1952 ;; Run the simple test drivers, which read test input from stdin:
1953 ;; from the "real" input for the single- and double-precision
1954 ;; testers, and from the "cmplx" input for complex-precision
1955 ;; testers. The EXEC-PREFIX key is used by the mumps-openmpi
1956 ;; package to prefix execution with "mpirun".
1957 (lambda* (#:key (exec-prefix '()) #:allow-other-keys)
1958 (with-directory-excursion "examples"
1959 (every
1960 (lambda (prec type)
1961 (let ((tester (apply open-pipe*
1962 `(,OPEN_WRITE
1963 ,@exec-prefix
1964 ,(string-append "./" prec
1965 "simpletest"))))
1966 (input (open-input-file
1967 (string-append "input_simpletest_" type))))
1968 (begin
1969 (dump-port input tester)
1970 (close-port input)
1971 (zero? (close-pipe tester)))))
1972 '("s" "d" "c" "z")
1973 '("real" "real" "cmplx" "cmplx")))))
1974 (replace 'install
1975 (lambda* (#:key outputs #:allow-other-keys)
1976 (let* ((out (assoc-ref outputs "out"))
1977 (libdir (string-append out "/lib")))
1978 (copy-recursively "lib" libdir)
1979 (copy-recursively "include" (string-append out "/include"))
1980 (when (file-exists? "libseq/libmpiseq.a")
1981 (install-file "libseq/libmpiseq.a" libdir))
1982 #t))))))
1983 (home-page "http://mumps.enseeiht.fr")
1984 (synopsis "Multifrontal sparse direct solver")
1985 (description
1986 "MUMPS (MUltifrontal Massively Parallel sparse direct Solver) solves a
1987 sparse system of linear equations A x = b using Guassian elimination.")
1988 (license license:cecill-c)))
1989
1990 (define-public mumps-metis
1991 (package (inherit mumps)
1992 (name "mumps-metis")
1993 (inputs
1994 (alist-delete "scotch" (package-inputs mumps)))))
1995
1996 (define-public mumps-openmpi
1997 (package (inherit mumps)
1998 (name "mumps-openmpi")
1999 (inputs
2000 `(("mpi" ,openmpi)
2001 ("scalapack" ,scalapack)
2002 ("pt-scotch" ,pt-scotch)
2003 ,@(alist-delete "scotch" (package-inputs mumps))))
2004 (arguments
2005 (substitute-keyword-arguments (package-arguments mumps)
2006 ((#:phases phases)
2007 `(modify-phases ,phases
2008 (add-before 'check 'set-test-environment
2009 (lambda _
2010 ;; By default, running the test suite would fail because 'ssh'
2011 ;; could not be found in $PATH. Define this variable to
2012 ;; placate Open MPI without adding a dependency on OpenSSH (the
2013 ;; agent isn't used anyway.)
2014 (setenv "OMPI_MCA_plm_rsh_agent" (which "cat"))
2015 #t))
2016 (replace 'check
2017 (lambda _
2018 ((assoc-ref ,phases 'check)
2019 #:exec-prefix '("mpirun" "-n" "2"))))))))
2020 (synopsis "Multifrontal sparse direct solver (with MPI)")))
2021
2022 (define-public mumps-metis-openmpi
2023 (package (inherit mumps-openmpi)
2024 (name "mumps-metis-openmpi")
2025 (inputs
2026 (alist-delete "pt-scotch" (package-inputs mumps-openmpi)))))
2027
2028 (define-public r-quadprog
2029 (package
2030 (name "r-quadprog")
2031 (version "1.5-5")
2032 (source
2033 (origin
2034 (method url-fetch)
2035 (uri (cran-uri "quadprog" version))
2036 (sha256
2037 (base32
2038 "0jg3r6abmhp8r9vkbhpx9ldjfw6vyl1m4c5vwlyjhk1mi03656fr"))))
2039 (build-system r-build-system)
2040 (native-inputs
2041 `(("gfortran" ,gfortran)))
2042 (home-page "https://cran.r-project.org/web/packages/quadprog")
2043 (synopsis "Functions to solve quadratic programming problems")
2044 (description
2045 "This package contains routines and documentation for solving quadratic
2046 programming problems.")
2047 (license license:gpl3+)))
2048
2049 (define-public r-pracma
2050 (package
2051 (name "r-pracma")
2052 (version "2.1.4")
2053 (source (origin
2054 (method url-fetch)
2055 (uri (cran-uri "pracma" version))
2056 (sha256
2057 (base32 "1ygm81i7mqvh229dp9935djjyb120p3bqvaf4k572sa4q63fzjhc"))))
2058 (build-system r-build-system)
2059 (propagated-inputs
2060 `(("r-quadprog" ,r-quadprog)))
2061 (home-page "https://cran.r-project.org/web/packages/pracma")
2062 (synopsis "Practical numerical math functions")
2063 (description "This package provides functions for numerical analysis and
2064 linear algebra, numerical optimization, differential equations, plus some
2065 special functions. It uses Matlab function names where appropriate to simplify
2066 porting.")
2067 (license license:gpl3+)))
2068
2069 (define-public ruby-asciimath
2070 (package
2071 (name "ruby-asciimath")
2072 (version "1.0.4")
2073 (source
2074 (origin
2075 (method url-fetch)
2076 (uri (rubygems-uri "asciimath" version))
2077 (sha256
2078 (base32
2079 "1d80kiph5mc78zps7si1hv48kv4k12mzaq8jk5kb3pqpjdr72qmc"))))
2080 (build-system ruby-build-system)
2081 (arguments
2082 '(#:phases
2083 (modify-phases %standard-phases
2084 ;; Apply this patch
2085 ;; https://github.com/asciidoctor/asciimath/commit/1c06fdc8086077f4785479f78b0823a4a72d7948
2086 (add-after 'unpack 'patch-remove-spurious-backslashes
2087 (lambda _
2088 (substitute* "spec/parser_spec.rb"
2089 (("\\\\\"")
2090 "\"")))))))
2091 (native-inputs
2092 `(("bundler" ,bundler)
2093 ("ruby-rspec" ,ruby-rspec)))
2094 (synopsis "AsciiMath parsing and conversion library")
2095 (description
2096 "A pure Ruby AsciiMath parsing and conversion library. AsciiMath is an
2097 easy-to-write markup language for mathematics.")
2098 (home-page "https://github.com/asciidoctor/asciimath")
2099 (license license:expat)))
2100
2101 (define-public superlu
2102 (package
2103 (name "superlu")
2104 (version "5.2.1")
2105 (source
2106 (origin
2107 (method url-fetch)
2108 (uri (string-append "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/"
2109 "superlu_" version ".tar.gz"))
2110 (sha256
2111 (base32 "0qzlb7cd608q62kyppd0a8c65l03vrwqql6gsm465rky23b6dyr8"))
2112 (modules '((guix build utils)))
2113 (snippet
2114 ;; Replace the non-free implementation of MC64 with a stub adapted
2115 ;; from Debian
2116 '(begin
2117 (use-modules (ice-9 regex)
2118 (ice-9 rdelim))
2119 (call-with-output-file "SRC/mc64ad.c"
2120 (lambda (port)
2121 (display "
2122 #include <stdio.h>
2123 #include <stdlib.h>
2124 void mc64id_(int *a) {
2125 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
2126 abort ();
2127 }
2128 void mc64ad_ (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
2129 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
2130 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
2131 abort ();
2132 }\n" port)))
2133 ;; Remove the corresponding license verbiage. MC64 license follows
2134 ;; a "------" line separator.
2135 (with-atomic-file-replacement "License.txt"
2136 (let ((rx (make-regexp "-{8}")))
2137 (lambda (in out)
2138 (let loop ()
2139 (let ((line (read-line in 'concat)))
2140 (unless (regexp-exec rx line)
2141 (display line out)
2142 (loop))))
2143 #t)))))))
2144 (build-system cmake-build-system)
2145 (native-inputs
2146 `(("tcsh" ,tcsh)))
2147 (inputs
2148 `(("blas" ,openblas)
2149 ("gfortran" ,gfortran)))
2150 (arguments
2151 `(#:configure-flags '("-Denable_blaslib:BOOL=NO" ;do not use internal cblas
2152 "-DTPL_BLAS_LIBRARIES=openblas"
2153 "-DBUILD_SHARED_LIBS:BOOL=YES")))
2154 (home-page "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/")
2155 (synopsis "Supernodal direct solver for sparse linear systems")
2156 (description
2157 "SuperLU is a general purpose library for the direct solution of large,
2158 sparse, nonsymmetric systems of linear equations on high performance machines.
2159 The library is written in C and is callable from either C or Fortran. The
2160 library routines perform an LU decomposition with partial pivoting and
2161 triangular system solves through forward and back substitution. The library
2162 also provides threshold-based ILU factorization preconditioners.")
2163 (license (list license:bsd-3
2164 license:gpl2+ ;EXAMPLE/*fgmr.c
2165 (license:fsf-free "file://SRC/colamd.h")))))
2166
2167 (define-public superlu-dist
2168 (package
2169 (name "superlu-dist")
2170 (version "5.3.0")
2171 (source
2172 (origin
2173 (method url-fetch)
2174 (uri (string-append "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/"
2175 "superlu_dist_" version ".tar.gz"))
2176 (sha256
2177 (base32 "0ja5ihqivkda1wd58y4lmzvmwssm9g91f70c5q0fzwhng6580h6y"))
2178 (modules '((guix build utils)))
2179 (snippet
2180 ;; Replace the non-free implementation of MC64 with a stub
2181 '(begin
2182 (use-modules (ice-9 regex)
2183 (ice-9 rdelim))
2184 (call-with-output-file "SRC/mc64ad_dist.c"
2185 (lambda (port)
2186 (display "
2187 #include <stdio.h>
2188 #include <stdlib.h>
2189 void mc64id_dist(int *a) {
2190 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
2191 abort ();
2192 }
2193 void mc64ad_dist (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
2194 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
2195 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
2196 abort ();
2197 }\n" port)))
2198 (substitute* "SRC/util.c" ;adjust default algorithm
2199 (("RowPerm[[:blank:]]*=[[:blank:]]*LargeDiag")
2200 "RowPerm = NOROWPERM"))
2201 #t))
2202 (patches (search-patches "superlu-dist-scotchmetis.patch"))))
2203 (build-system gnu-build-system)
2204 (native-inputs
2205 `(("tcsh" ,tcsh)))
2206 (inputs
2207 `(("gfortran" ,gfortran)))
2208 (propagated-inputs
2209 `(("openmpi" ,openmpi) ;headers include MPI heades
2210 ("lapack" ,lapack) ;required to link with output library
2211 ("pt-scotch" ,pt-scotch))) ;same
2212 (arguments
2213 `(#:parallel-build? #f ;race conditions using ar
2214 #:phases
2215 (modify-phases %standard-phases
2216 (replace 'configure
2217 (lambda* (#:key inputs outputs #:allow-other-keys)
2218 (call-with-output-file "make.inc"
2219 (lambda (port)
2220 (format port "
2221 PLAT =
2222 DSuperLUroot = ~a
2223 DSUPERLULIB = ~a/lib/libsuperlu_dist.a
2224 BLASDEF = -DUSE_VENDOR_BLAS
2225 BLASLIB = -L~a/lib -lblas
2226 PARMETISLIB = -L~a/lib \
2227 -lptscotchparmetis -lptscotch -lptscotcherr -lptscotcherrexit \
2228 -lscotch -lscotcherr -lscotcherrexit
2229 METISLIB = -L~:*~a/lib \
2230 -lscotchmetis -lscotch -lscotcherr -lscotcherrexit
2231 LIBS = $(DSUPERLULIB) $(PARMETISLIB) $(METISLIB) $(BLASLIB)
2232 ARCH = ar
2233 ARCHFLAGS = cr
2234 RANLIB = ranlib
2235 CC = mpicc
2236 PIC = -fPIC
2237 CFLAGS = -O3 -g -DPRNTlevel=0 $(PIC)
2238 NOOPTS = -O0 -g $(PIC)
2239 FORTRAN = mpifort
2240 FFLAGS = -O2 -g $(PIC)
2241 LOADER = $(CC)
2242 CDEFS = -DAdd_"
2243 (getcwd)
2244 (assoc-ref outputs "out")
2245 (assoc-ref inputs "lapack")
2246 (assoc-ref inputs "pt-scotch"))))
2247 #t))
2248 (add-after 'unpack 'remove-broken-symlinks
2249 (lambda _
2250 (for-each delete-file
2251 (find-files "MAKE_INC" "\\.#make\\..*"))
2252 #t))
2253 (add-before 'build 'create-install-directories
2254 (lambda* (#:key outputs #:allow-other-keys)
2255 (for-each
2256 (lambda (dir)
2257 (mkdir-p (string-append (assoc-ref outputs "out")
2258 "/" dir)))
2259 '("lib" "include"))
2260 #t))
2261 (replace 'check
2262 (lambda _
2263 ;; By default, running the test suite would fail because 'ssh'
2264 ;; could not be found in $PATH. Define this variable to placate
2265 ;; Open MPI without adding a dependency on OpenSSH (the agent
2266 ;; isn't used anyway.)
2267 (setenv "OMPI_MCA_plm_rsh_agent" (which "cat"))
2268 (with-directory-excursion "EXAMPLE"
2269 (invoke "mpirun" "-n" "2"
2270 "./pddrive" "-r" "1" "-c" "2" "g20.rua")
2271 (invoke "mpirun" "-n" "2"
2272 "./pzdrive" "-r" "1" "-c" "2" "cg20.cua"))
2273 #t))
2274 (replace 'install
2275 (lambda* (#:key outputs #:allow-other-keys)
2276 ;; Library is placed in lib during the build phase. Copy over
2277 ;; headers to include.
2278 (let* ((out (assoc-ref outputs "out"))
2279 (incdir (string-append out "/include")))
2280 (for-each (lambda (file)
2281 (let ((base (basename file)))
2282 (format #t "installing `~a' to `~a'~%"
2283 base incdir)
2284 (copy-file file
2285 (string-append incdir "/" base))))
2286 (find-files "SRC" ".*\\.h$")))
2287 #t)))))
2288 (home-page (package-home-page superlu))
2289 (synopsis "Parallel supernodal direct solver")
2290 (description
2291 "SuperLU_DIST is a parallel extension to the serial SuperLU library.
2292 It is targeted for distributed memory parallel machines. SuperLU_DIST is
2293 implemented in ANSI C, and MPI for communications.")
2294 (license license:bsd-3)))
2295
2296 (define-public scotch
2297 (package
2298 (name "scotch")
2299 (version "6.0.5a")
2300 (source
2301 (origin
2302 (method url-fetch)
2303 (uri (string-append "https://gforge.inria.fr/frs/download.php/"
2304 "latestfile/298/scotch_" version ".tar.gz"))
2305 (sha256
2306 (base32 "0vsmgjz8qv80di3ljmc7hbdsizxxxwy2b9rgd2fl1mdc6dgbj8av"))
2307 (patches (search-patches "scotch-test-threading.patch"
2308 "scotch-build-parallelism.patch"
2309 "scotch-graph-induce-type-64.patch"
2310 "scotch-graph-diam-64.patch"))))
2311 (build-system gnu-build-system)
2312 (inputs
2313 `(("zlib" ,zlib)
2314 ("flex" ,flex)
2315 ("bison" ,bison)))
2316 (arguments
2317 `(#:phases
2318 (modify-phases %standard-phases
2319 (add-after
2320 'unpack 'chdir-to-src
2321 (lambda _ (chdir "src") #t))
2322 (replace
2323 'configure
2324 (lambda _
2325 (call-with-output-file "Makefile.inc"
2326 (lambda (port)
2327 (format port "
2328 EXE =
2329 LIB = .a
2330 OBJ = .o
2331 MAKE = make
2332 AR = ar
2333 ARFLAGS = -ruv
2334 CAT = cat
2335 CCS = gcc
2336 CCP = mpicc
2337 CCD = gcc
2338 CPPFLAGS =~{ -D~a~}
2339 CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
2340 LDFLAGS = -lz -lm -lrt -lpthread
2341 CP = cp
2342 LEX = flex -Pscotchyy -olex.yy.c
2343 LN = ln
2344 MKDIR = mkdir
2345 MV = mv
2346 RANLIB = ranlib
2347 YACC = bison -pscotchyy -y -b y
2348 "
2349 '("COMMON_FILE_COMPRESS_GZ"
2350 "COMMON_PTHREAD"
2351 "COMMON_RANDOM_FIXED_SEED"
2352 "INTSIZE64" ;use 'long' instead of 'int'
2353 ;; Prevents symbolc clashes with libesmumps
2354 "SCOTCH_RENAME"
2355 ;; XXX: Causes invalid frees in superlu-dist tests
2356 ;; "SCOTCH_PTHREAD"
2357 ;; "SCOTCH_PTHREAD_NUMBER=2"
2358 "restrict=__restrict"))))
2359 #t))
2360 (add-after
2361 'build 'build-esmumps
2362 (lambda _
2363 ;; By default, running the test suite would fail because 'ssh'
2364 ;; could not be found in $PATH. Define this variable to placate
2365 ;; Open MPI without adding a dependency on OpenSSH (the agent
2366 ;; isn't used anyway.)
2367 (setenv "OMPI_MCA_plm_rsh_agent" (which "cat"))
2368
2369 (invoke "make"
2370 (format #f "-j~a" (parallel-job-count))
2371 "esmumps")))
2372 (replace
2373 'install
2374 (lambda* (#:key outputs #:allow-other-keys)
2375 (let ((out (assoc-ref outputs "out")))
2376 (mkdir out)
2377 (invoke "make"
2378 (string-append "prefix=" out)
2379 "install")
2380 ;; esmumps files are not installed with the above
2381 (for-each (lambda (f)
2382 (copy-file f (string-append out "/include/" f)))
2383 (find-files "../include" ".*esmumps.h$"))
2384 (for-each (lambda (f)
2385 (copy-file f (string-append out "/lib/" f)))
2386 (find-files "../lib" "^lib.*esmumps.*"))
2387 #t))))))
2388 (home-page "http://www.labri.fr/perso/pelegrin/scotch/")
2389 (synopsis "Programs and libraries for graph algorithms")
2390 (description "SCOTCH is a set of programs and libraries which implement
2391 the static mapping and sparse matrix reordering algorithms developed within
2392 the SCOTCH project. Its purpose is to apply graph theory, with a divide and
2393 conquer approach, to scientific computing problems such as graph and mesh
2394 partitioning, static mapping, and sparse matrix ordering, in application
2395 domains ranging from structural mechanics to operating systems or
2396 bio-chemistry.")
2397 ;; See LICENSE_en.txt
2398 (license license:cecill-c)))
2399
2400 (define-public scotch32
2401 ;; This is the 'INTSIZE32' variant, which uses 32-bit integers, as needed by
2402 ;; some applications.
2403 (package (inherit scotch)
2404 (name "scotch32")
2405 (arguments
2406 (substitute-keyword-arguments (package-arguments scotch)
2407 ((#:phases scotch-phases)
2408 `(modify-phases ,scotch-phases
2409 (replace
2410 'configure
2411 (lambda _
2412 (call-with-output-file "Makefile.inc"
2413 (lambda (port)
2414 (format port "
2415 EXE =
2416 LIB = .a
2417 OBJ = .o
2418 MAKE = make
2419 AR = ar
2420 ARFLAGS = -ruv
2421 CAT = cat
2422 CCS = gcc
2423 CCP = mpicc
2424 CCD = gcc
2425 CPPFLAGS =~{ -D~a~}
2426 CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
2427 LDFLAGS = -lz -lm -lrt -lpthread
2428 CP = cp
2429 LEX = flex -Pscotchyy -olex.yy.c
2430 LN = ln
2431 MKDIR = mkdir
2432 MV = mv
2433 RANLIB = ranlib
2434 YACC = bison -pscotchyy -y -b y
2435 "
2436 '("COMMON_FILE_COMPRESS_GZ"
2437 "COMMON_PTHREAD"
2438 "COMMON_RANDOM_FIXED_SEED"
2439 "INTSIZE32" ;use 32-bit integers. See INSTALL.txt
2440 ;; Prevents symbolc clashes with libesmumps
2441 "SCOTCH_RENAME"
2442 ;; XXX: Causes invalid frees in superlu-dist tests
2443 ;; "SCOTCH_PTHREAD"
2444 ;; "SCOTCH_PTHREAD_NUMBER=2"
2445 "restrict=__restrict"))))))))))
2446 (synopsis
2447 "Programs and libraries for graph algorithms (32-bit integers)")))
2448
2449 (define-public pt-scotch
2450 (package (inherit scotch)
2451 (name "pt-scotch")
2452 (propagated-inputs
2453 `(("openmpi" ,openmpi))) ;Headers include MPI headers
2454 (arguments
2455 (substitute-keyword-arguments (package-arguments scotch)
2456 ((#:phases scotch-phases)
2457 `(modify-phases ,scotch-phases
2458 (replace
2459 'build
2460 (lambda _
2461 (and
2462 (zero? (system* "make"
2463 (format #f "-j~a" (parallel-job-count))
2464 "ptscotch" "ptesmumps"))
2465 ;; Install the serial metis compatibility library
2466 (zero? (system* "make" "-C" "libscotchmetis" "install")))))
2467 (replace
2468 'check
2469 (lambda _ (zero? (system* "make" "ptcheck"))))))))
2470 (synopsis "Programs and libraries for graph algorithms (with MPI)")))
2471
2472 (define-public pt-scotch32
2473 (package (inherit scotch32)
2474 (name "pt-scotch32")
2475 (propagated-inputs
2476 `(("openmpi" ,openmpi))) ;headers include MPI headers
2477 (arguments
2478 (substitute-keyword-arguments (package-arguments scotch32)
2479 ((#:phases scotch32-phases)
2480 `(modify-phases ,scotch32-phases
2481 (replace 'build
2482 (lambda _
2483 (and
2484 (zero? (system* "make"
2485 (format #f "-j~a" (parallel-job-count))
2486 "ptscotch" "ptesmumps"))
2487 ;; Install the serial metis compatibility library
2488 (zero? (system* "make" "-C" "libscotchmetis" "install")))))
2489 (replace 'check
2490 (lambda _
2491 (zero? (system* "make" "ptcheck"))))))))
2492 (synopsis
2493 "Programs and libraries for graph algorithms (with MPI and 32-bit integers)")))
2494
2495 (define-public metis
2496 (package
2497 (name "metis")
2498 (version "5.1.0")
2499 (source
2500 (origin
2501 (method url-fetch)
2502 (uri (string-append "http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/"
2503 "metis-" version ".tar.gz"))
2504 (sha256
2505 (base32
2506 "1cjxgh41r8k6j029yxs8msp3z6lcnpm16g5pvckk35kc7zhfpykn"))))
2507 (build-system cmake-build-system)
2508 (inputs
2509 `(("blas" ,openblas)))
2510 (arguments
2511 `(#:tests? #f ;no tests
2512 #:configure-flags `("-DSHARED=ON"
2513 ,(string-append "-DGKLIB_PATH=" (getcwd)
2514 "/metis-" ,version "/GKlib"))))
2515 (home-page "http://glaros.dtc.umn.edu/gkhome/metis/metis/overview")
2516 (synopsis "Graph partitioning and fill-reducing matrix ordering library")
2517 (description
2518 "METIS is a set of serial programs for partitioning graphs, partitioning
2519 finite element meshes, and producing fill-reducing orderings for sparse
2520 matrices. The algorithms implemented in METIS are based on the multilevel
2521 recursive-bisection, multilevel k-way, and multi-constraint partitioning
2522 schemes.")
2523 (license license:asl2.0))) ;As of version 5.0.3
2524
2525 (define-public p4est
2526 (package
2527 (name "p4est")
2528 (version "2.0")
2529 (source
2530 (origin
2531 (method url-fetch)
2532 (uri (string-append "http://p4est.github.io/release/p4est-"
2533 version ".tar.gz"))
2534 (sha256
2535 (base32
2536 "16h267z256kxcxfjs390qqzv19hr58vrj4x8lndb7alnk2vca8n5"))))
2537 (build-system gnu-build-system)
2538 (inputs
2539 `(("fortran" ,gfortran)
2540 ("blas" ,openblas)
2541 ("lapack" ,lapack)
2542 ("zlib" ,zlib)))
2543 (arguments
2544 `(#:configure-flags `(,(string-append "BLAS_LIBS=-L"
2545 (assoc-ref %build-inputs "blas")
2546 " -lopenblas")
2547 ,(string-append "LAPACK_LIBS=-L"
2548 (assoc-ref %build-inputs "lapack")
2549 " -llapack"))
2550 #:phases (modify-phases %standard-phases
2551 (add-before 'check 'set-test-environment
2552 (lambda _
2553 ;; By default, running the test suite would fail because
2554 ;; 'ssh' could not be found in $PATH. Define this
2555 ;; variable to placate Open MPI without adding a
2556 ;; dependency on OpenSSH (the agent isn't used anyway.)
2557 (setenv "OMPI_MCA_plm_rsh_agent" (which "cat"))
2558 #t)))))
2559 (home-page "http://www.p4est.org")
2560 (synopsis "Adaptive mesh refinement on forests of octrees")
2561 (description
2562 "The p4est software library enables the dynamic management of a
2563 collection of adaptive octrees, conveniently called a forest of octrees.
2564 p4est is designed to work in parallel and scales to hundreds of thousands of
2565 processor cores.")
2566 (license license:gpl2+)))
2567
2568 (define-public p4est-openmpi
2569 (package (inherit p4est)
2570 (name "p4est-openmpi")
2571 (inputs
2572 `(("mpi" ,openmpi)
2573 ,@(package-inputs p4est)))
2574 (arguments
2575 (substitute-keyword-arguments (package-arguments p4est)
2576 ((#:configure-flags cf)
2577 ``("--enable-mpi" ,@,cf))))
2578 (synopsis "Parallel adaptive mesh refinement on forests of octrees")))
2579
2580 (define-public gsegrafix
2581 (package
2582 (name "gsegrafix")
2583 (version "1.0.6")
2584 (source
2585 (origin
2586 (method url-fetch)
2587 (uri (string-append "mirror://gnu/" name "/" name "-"
2588 version ".tar.gz"))
2589 (sha256
2590 (base32
2591 "1b13hvx063zv970y750bx41wpx6hwd5ngjhbdrna8w8yy5kmxcda"))))
2592 (build-system gnu-build-system)
2593 (arguments
2594 `(#:configure-flags '("LDFLAGS=-lm")))
2595 (inputs
2596 `(("libgnomecanvas" ,libgnomecanvas)
2597 ("libbonoboui" ,libbonoboui)
2598 ("libgnomeui" ,libgnomeui)
2599 ("libgnomeprintui" ,libgnomeprintui)
2600 ("popt" ,popt)))
2601 (native-inputs
2602 `(("pkg-config" ,pkg-config)))
2603 (home-page "https://www.gnu.org/software/gsegrafix/")
2604 (synopsis "GNOME application to create scientific and engineering plots")
2605 (description "GSEGrafix is an application which produces high-quality graphical
2606 plots for science and engineering. Plots are specified via simple ASCII
2607 parameter files and data files and are presented in an anti-aliased GNOME
2608 canvas. The program supports rectangular two-dimensional plots, histograms,
2609 polar-axis plots and three-dimensional plots. Plots can be printed or saved
2610 to BMP, JPEG or PNG image formats.")
2611 (license license:gpl3+)))
2612
2613 (define-public maxima
2614 (package
2615 (name "maxima")
2616 (version "5.41.0")
2617 (source
2618 (origin
2619 (method url-fetch)
2620 (uri (string-append "mirror://sourceforge/maxima/Maxima-source/"
2621 version "-source/" name "-" version ".tar.gz"))
2622 (sha256
2623 (base32
2624 "0x0n81z0s4pl8nwpf7ivlsbvsdphm9w42250g7qdkizl0132by6s"))
2625 (patches (search-patches "maxima-defsystem-mkdir.patch"))))
2626 (build-system gnu-build-system)
2627 (inputs
2628 `(("gcl" ,gcl)
2629 ("gnuplot" ,gnuplot) ;for plots
2630 ("tk" ,tk))) ;Tcl/Tk is used by 'xmaxima'
2631 (native-inputs
2632 `(("texinfo" ,texinfo)
2633 ("perl" ,perl)
2634 ("python" ,python)))
2635 (arguments
2636 `(#:configure-flags
2637 (list "--enable-gcl"
2638 (string-append "--with-posix-shell="
2639 (assoc-ref %build-inputs "bash")
2640 "/bin/sh")
2641 (string-append "--with-wish="
2642 (assoc-ref %build-inputs "tk")
2643 "/bin/wish"
2644 (let ((v ,(package-version tk)))
2645 (string-take v (string-index-right v #\.)))))
2646 ;; By default Maxima attempts to write temporary files to
2647 ;; '/tmp/nix-build-maxima-*', which won't exist at run time.
2648 ;; Work around that.
2649 #:make-flags (list "TMPDIR=/tmp")
2650 #:phases
2651 (modify-phases %standard-phases
2652 (add-before 'check 'pre-check
2653 (lambda _
2654 (chmod "src/maxima" #o555)
2655 #t))
2656 ;; Make sure the doc and emacs files are found in the
2657 ;; standard location. Also configure maxima to find gnuplot
2658 ;; without having it on the PATH.
2659 (add-after 'install 'post-install
2660 (lambda* (#:key outputs inputs #:allow-other-keys)
2661 (let* ((gnuplot (assoc-ref inputs "gnuplot"))
2662 (out (assoc-ref outputs "out"))
2663 (datadir (string-append out "/share/maxima/" ,version))
2664 (binutils (string-append (assoc-ref inputs "binutils")
2665 "/bin")))
2666 (with-directory-excursion out
2667 (mkdir-p "share/emacs")
2668 (mkdir-p "share/doc")
2669 (symlink
2670 (string-append datadir "/emacs/")
2671 (string-append out "/share/emacs/site-lisp"))
2672 (symlink
2673 (string-append datadir "/doc/")
2674 (string-append out "/share/doc/maxima"))
2675 (with-atomic-file-replacement
2676 (string-append datadir "/share/maxima-init.lisp")
2677 (lambda (in out)
2678 (format out "~a ~s~a~%"
2679 "(setf $gnuplot_command "
2680 (string-append gnuplot "/bin/gnuplot") ")")
2681 (dump-port in out))))
2682 ;; Ensure that Maxima will have access to the GNU binutils
2683 ;; components at runtime.
2684 (wrap-program (string-append out "/bin/maxima")
2685 `("PATH" prefix (,binutils))))
2686 #t)))))
2687 (home-page "http://maxima.sourceforge.net")
2688 (synopsis "Numeric and symbolic expression manipulation")
2689 (description "Maxima is a system for the manipulation of symbolic and
2690 numerical expressions. It yields high precision numeric results by using
2691 exact fractions, arbitrary precision integers, and variable precision floating
2692 point numbers.")
2693 ;; Some files are lgpl2.1+. Some are gpl2+. Some explicitly state gpl1+.
2694 ;; Others simply say "GNU General Public License" without stating a
2695 ;; version (which implicitly means gpl1+).
2696 ;; At least one file (src/maxima.asd) says "version 2."
2697 ;; GPLv2 only is therefore the smallest subset.
2698 (license license:gpl2)))
2699
2700 (define-public wxmaxima
2701 (package
2702 (name "wxmaxima")
2703 (version "18.02.0")
2704 (source
2705 (origin
2706 (method url-fetch)
2707 (uri (string-append "https://github.com/andrejv/" name "/archive"
2708 "/Version-" version ".tar.gz"))
2709 (file-name (string-append name "-" version ".tar.gz"))
2710 (sha256
2711 (base32
2712 "03kr2rgfp4hcf3is8m8d8f9hj660c3xgrc50vrrfpixx4syh6wvj"))
2713 (patches
2714 (search-patches "wxmaxima-do-not-use-old-gnuplot-parameters.patch"))))
2715 (build-system cmake-build-system)
2716 (native-inputs
2717 `(("gettext" ,gettext-minimal)))
2718 (inputs
2719 `(("wxwidgets" ,wxwidgets)
2720 ("maxima" ,maxima)
2721 ;; Runtime support.
2722 ("adwaita-icon-theme" ,adwaita-icon-theme)
2723 ("gtk+" ,gtk+)
2724 ("shared-mime-info" ,shared-mime-info)))
2725 (arguments
2726 `(#:tests? #f ; no check target
2727 #:phases
2728 (modify-phases %standard-phases
2729 (add-after 'install 'wrap-program
2730 (lambda* (#:key inputs outputs #:allow-other-keys)
2731 (wrap-program (string-append (assoc-ref outputs "out")
2732 "/bin/wxmaxima")
2733 `("PATH" ":" prefix
2734 (,(string-append (assoc-ref inputs "maxima")
2735 "/bin")))
2736 ;; For GtkFileChooserDialog.
2737 `("GSETTINGS_SCHEMA_DIR" =
2738 (,(string-append (assoc-ref inputs "gtk+")
2739 "/share/glib-2.0/schemas")))
2740 `("XDG_DATA_DIRS" ":" prefix
2741 (;; Needed by gdk-pixbuf to know supported icon formats.
2742 ,(string-append
2743 (assoc-ref inputs "shared-mime-info") "/share")
2744 ;; The default icon theme of GTK+.
2745 ,(string-append
2746 (assoc-ref inputs "adwaita-icon-theme") "/share"))))
2747 #t)))))
2748 (home-page "https://andrejv.github.io/wxmaxima/")
2749 (synopsis "Graphical user interface for the Maxima computer algebra system")
2750 (description
2751 "wxMaxima is a graphical user interface for the Maxima computer algebra
2752 system. It eases the use of Maxima by making most of its commands available
2753 through a menu system and by providing input dialogs for commands that require
2754 more than one argument. It also implements its own display engine that
2755 outputs mathematical symbols directly instead of depicting them with ASCII
2756 characters.
2757
2758 wxMaxima also features 2D and 3D inline plots, simple animations, mixing of
2759 text and mathematical calculations to create documents, exporting of input and
2760 output to TeX, and a browser for Maxima's manual including command index and
2761 full text searching.")
2762 (license license:gpl2+)))
2763
2764 (define-public armadillo
2765 (package
2766 (name "armadillo")
2767 (version "9.100.5")
2768 (source (origin
2769 (method url-fetch)
2770 (uri (string-append "mirror://sourceforge/arma/armadillo-"
2771 version ".tar.xz"))
2772 (sha256
2773 (base32
2774 "1ka1vd9fcmvp12qkcm4888dkfqwnalvv00x04wy29f3nx3qwczby"))))
2775 (build-system cmake-build-system)
2776 (arguments `(#:tests? #f)) ; no test target
2777 (inputs
2778 `(("openblas" ,openblas)
2779 ("lapack" ,lapack)
2780 ("arpack" ,arpack-ng)))
2781 (home-page "http://arma.sourceforge.net/")
2782 (synopsis "C++ linear algebra library")
2783 (description
2784 "Armadillo is a C++ linear algebra library, aiming towards a good balance
2785 between speed and ease of use. It is useful for algorithm development
2786 directly in C++, or quick conversion of research code into production
2787 environments. It can be used for machine learning, pattern recognition,
2788 signal processing, bioinformatics, statistics, econometrics, etc. The library
2789 provides efficient classes for vectors, matrices and cubes, as well as 150+
2790 associated functions (eg. contiguous and non-contiguous submatrix views).")
2791 (license license:asl2.0)))
2792
2793 (define-public muparser
2794 ;; When switching download sites, muparser re-issued a 2.2.5 release with a
2795 ;; different hash. In order to make `guix package --upgrade` work correctly,
2796 ;; we set a Guix packaging revision.
2797 ;; When the next version of muparser is released, we can remove
2798 ;; UPSTREAM-VERSION and REVISION and use the plain VERSION.
2799 (let ((upstream-version "2.2.5")
2800 (revision "2"))
2801 (package
2802 (name "muparser")
2803 (version (string-append upstream-version "-" revision))
2804 (source
2805 (origin
2806 (method url-fetch)
2807 (uri (string-append "https://github.com/beltoforion/muparser/archive/v"
2808 upstream-version ".tar.gz"))
2809 (file-name (string-append name "-" version ".tar.gz"))
2810 (sha256
2811 (base32
2812 "0277qsi5l23jsck1vhn383bmvc2n9l4a1dl5r9bf7hvjv9ayyrh6"))))
2813 (build-system gnu-build-system)
2814 (arguments
2815 `(#:configure-flags '("--enable-samples=no")
2816 #:tests? #f)) ;no "check" target
2817 (home-page "http://muparser.beltoforion.de/")
2818 (synopsis "Fast parser library for mathematical expressions")
2819 (description
2820 "muParser is an extensible high performance math parser library. It is
2821 based on transforming an expression into a bytecode and precalculating constant
2822 parts of it.")
2823 (license license:expat))))
2824
2825 (define-public openblas
2826 (package
2827 (name "openblas")
2828 (version "0.3.2")
2829 (source
2830 (origin
2831 (method url-fetch)
2832 (uri (string-append "https://github.com/xianyi/OpenBLAS/tarball/v"
2833 version))
2834 (file-name (string-append name "-" version ".tar.gz"))
2835 (sha256
2836 (base32
2837 "0b20km2jv7m6qiylrlvhq2vnmkmilb633mr8rhqmgbn1wqrp58jq"))))
2838 (build-system gnu-build-system)
2839 (arguments
2840 `(#:test-target "test"
2841 ;; DYNAMIC_ARCH is only supported on x86. When it is disabled and no
2842 ;; TARGET is specified, OpenBLAS will tune itself to the build host, so
2843 ;; we need to disable substitutions.
2844 #:substitutable?
2845 ,(let ((system (or (%current-target-system) (%current-system))))
2846 (or (string-prefix? "x86_64" system)
2847 (string-prefix? "i686" system)
2848 (string-prefix? "mips" system)
2849 (string-prefix? "aarch64" system)))
2850 #:make-flags
2851 (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
2852 "SHELL=bash"
2853 ;; Build the library for all supported CPUs. This allows
2854 ;; switching CPU targets at runtime with the environment variable
2855 ;; OPENBLAS_CORETYPE=<type>, where "type" is a supported CPU type.
2856 ;; Unfortunately, this is not supported on non-x86 architectures,
2857 ;; where it leads to failed builds.
2858 ,@(let ((system (or (%current-target-system) (%current-system))))
2859 (cond
2860 ((or (string-prefix? "x86_64" system)
2861 (string-prefix? "i686" system))
2862 '("DYNAMIC_ARCH=1"))
2863 ;; On MIPS we force the "SICORTEX" TARGET, as for the other
2864 ;; two available MIPS targets special extended instructions
2865 ;; for Loongson cores are used.
2866 ((string-prefix? "mips" system)
2867 '("TARGET=SICORTEX"))
2868 ;; On aarch64 force the generic 'armv8-a' target
2869 ((string-prefix? "aarch64" system)
2870 '("TARGET=ARMV8"))
2871 (else '()))))
2872 ;; no configure script
2873 #:phases
2874 (modify-phases %standard-phases
2875 (delete 'configure)
2876 (add-before 'build 'set-extralib
2877 (lambda* (#:key inputs #:allow-other-keys)
2878 ;; Get libgfortran found when building in utest.
2879 (setenv "FEXTRALIB"
2880 (string-append "-L" (assoc-ref inputs "fortran-lib")
2881 "/lib"))
2882 #t)))))
2883 (inputs
2884 `(("fortran-lib" ,gfortran "lib")))
2885 (native-inputs
2886 `(("cunit" ,cunit)
2887 ("fortran" ,gfortran)
2888 ("perl" ,perl)))
2889 (home-page "http://www.openblas.net/")
2890 (synopsis "Optimized BLAS library based on GotoBLAS")
2891 (description
2892 "OpenBLAS is a BLAS library forked from the GotoBLAS2-1.13 BSD version.")
2893 (license license:bsd-3)))
2894
2895 (define* (make-blis implementation #:optional substitutable?)
2896 "Return a BLIS package with the given IMPLEMENTATION (see config/ in the
2897 source tree for a list of implementations.)
2898
2899 SUBSTITUTABLE? determines whether the package is made available as a
2900 substitute.
2901
2902 Currently the specialization must be selected at configure-time, but work is
2903 underway to allow BLIS to select the right optimized kernels at run time:
2904 <https://github.com/flame/blis/issues/129>."
2905 (package
2906 (name (if (string=? implementation "reference")
2907 "blis"
2908 (string-append "blis-" implementation)))
2909 (version "0.2.2")
2910 (home-page "https://github.com/flame/blis")
2911 (source (origin
2912 (method git-fetch)
2913 (uri (git-reference (url home-page) (commit version)))
2914 (sha256
2915 (base32
2916 "1wr79a50nm4abhw8w3sn96nmwp5mrzifcigk7khw9qcgyyyqayfh"))
2917 (file-name (git-file-name "blis" version))))
2918 (build-system gnu-build-system)
2919 (arguments
2920 `(#:test-target "test"
2921
2922 #:substitutable? ,substitutable?
2923
2924 #:phases (modify-phases %standard-phases
2925 (replace 'configure
2926 (lambda* (#:key outputs #:allow-other-keys)
2927 ;; This is a home-made 'configure' script.
2928 (let ((out (assoc-ref outputs "out")))
2929 (zero? (system* "./configure" "-p" out
2930 "-d" "opt"
2931 "--disable-static"
2932 "--enable-shared"
2933 "--enable-threading=openmp"
2934
2935 ,implementation)))))
2936 (add-before 'check 'show-test-output
2937 (lambda _
2938 ;; By default "make check" is silent. Make it verbose.
2939 (system "tail -F output.testsuite &")
2940 #t)))))
2941 (synopsis "High-performance basic linear algebra (BLAS) routines")
2942 (description
2943 "BLIS is a portable software framework for instantiating high-performance
2944 BLAS-like dense linear algebra libraries. The framework was designed to
2945 isolate essential kernels of computation that, when optimized, immediately
2946 enable optimized implementations of most of its commonly used and
2947 computationally intensive operations. While BLIS exports a new BLAS-like API,
2948 it also includes a BLAS compatibility layer which gives application developers
2949 access to BLIS implementations via traditional BLAS routine calls.")
2950 (license license:bsd-3)))
2951
2952 (define-public blis
2953 ;; This is the "reference" implementation, which is the non-optimized but
2954 ;; portable variant (no assembly).
2955 (make-blis "reference" #t))
2956
2957 (define ignorance blis)
2958
2959 (define-syntax-rule (blis/x86_64 processor)
2960 "Expand to a package specialized for PROCESSOR."
2961 (package
2962 (inherit (make-blis processor))
2963 (supported-systems '("x86_64-linux"))))
2964
2965 (define-public blis-sandybridge
2966 ;; BLIS specialized for Sandy Bridge processors (launched 2011):
2967 ;; <http://ark.intel.com/products/codename/29900/Sandy-Bridge>.
2968 (blis/x86_64 "sandybridge"))
2969
2970 (define-public blis-haswell
2971 ;; BLIS specialized for Haswell processors (launched 2013):
2972 ;; <http://ark.intel.com/products/codename/42174/Haswell>.
2973 (blis/x86_64 "haswell"))
2974
2975 (define-public blis-knl
2976 ;; BLIS specialized for Knights Landing processor (launched 2016):
2977 ;; <http://ark.intel.com/products/series/92650/Intel-Xeon-Phi-x200-Product-Family>.
2978 (blis/x86_64 "knl"))
2979
2980
2981 (define-public openlibm
2982 (package
2983 (name "openlibm")
2984 (version "0.6.0")
2985 (source
2986 (origin
2987 (method url-fetch)
2988 (uri (string-append "https://github.com/JuliaLang/openlibm/archive/v"
2989 version ".tar.gz"))
2990 (file-name (string-append name "-" version ".tar.gz"))
2991 (sha256
2992 (base32
2993 "0a5fpm8nra5ldhjk0cqd2rx1qh32wiarkxmcqcm5xl8z7l4kjm6l"))))
2994 (build-system gnu-build-system)
2995 (arguments
2996 `(#:make-flags
2997 (list (string-append "prefix=" (assoc-ref %outputs "out")))
2998 #:phases
2999 ;; no configure script
3000 (modify-phases %standard-phases (delete 'configure))
3001 #:tests? #f)) ;the tests are part of the default target
3002 (home-page "http://openlibm.org/")
3003 (synopsis "Portable C mathematical library (libm)")
3004 (description
3005 "OpenLibm is an effort to have a high quality, portable, standalone C
3006 mathematical library (libm). It can be used standalone in applications and
3007 programming language implementations. The project was born out of a need to
3008 have a good libm for the Julia programming language that worked consistently
3009 across compilers and operating systems, and in 32-bit and 64-bit
3010 environments.")
3011 ;; Each architecture has its own make target, and there is none for mips.
3012 (supported-systems (delete "mips64el-linux" %supported-systems))
3013 ;; See LICENSE.md for details.
3014 (license (list license:expat
3015 license:isc
3016 license:bsd-2
3017 license:public-domain
3018 license:lgpl2.1+))))
3019
3020 (define-public openspecfun
3021 (package
3022 (name "openspecfun")
3023 (version "0.5.3")
3024 (source
3025 (origin
3026 (method url-fetch)
3027 (uri (string-append "https://github.com/JuliaLang/openspecfun/archive/v"
3028 version ".tar.gz"))
3029 (file-name (string-append name "-" version ".tar.gz"))
3030 (sha256
3031 (base32
3032 "1rs1bv8jq751fv9vq79890wqf9xlbjc7lvz3ighzyfczbyjcf18m"))))
3033 (build-system gnu-build-system)
3034 (arguments
3035 '(#:tests? #f ; no "check" target
3036 #:make-flags
3037 (list (string-append "prefix=" (assoc-ref %outputs "out")))
3038 #:phases
3039 (modify-phases %standard-phases
3040 (delete 'configure)))) ; no configure script
3041 (inputs
3042 `(("fortran" ,gfortran)))
3043 (home-page "https://github.com/JuliaLang/openspecfun")
3044 (synopsis "Collection of special mathematical functions")
3045 (description
3046 "Openspecfun provides AMOS and Faddeeva. AMOS (from Netlib) is a
3047 portable package for Bessel Functions of a Complex Argument and Nonnegative
3048 Order; it contains subroutines for computing Bessel functions and Airy
3049 functions. Faddeeva allows computing the various error functions of arbitrary
3050 complex arguments (Faddeeva function, error function, complementary error
3051 function, scaled complementary error function, imaginary error function, and
3052 Dawson function); given these, one can also easily compute Voigt functions,
3053 Fresnel integrals, and similar related functions as well.")
3054 ;; Faddeeva is released under the Expat license; AMOS is included as
3055 ;; public domain software.
3056 (license (list license:expat license:public-domain))))
3057
3058 (define-public suitesparse
3059 (package
3060 (name "suitesparse")
3061 (version "4.5.5")
3062 (source
3063 (origin
3064 (method url-fetch)
3065 (uri (string-append
3066 "http://faculty.cse.tamu.edu/davis/SuiteSparse/SuiteSparse-"
3067 version ".tar.gz"))
3068 (sha256
3069 (base32
3070 "1dnr6pmjzc2qmbkmb4shigx1l74ilf6abn7svyd6brxgvph8vadr"))
3071 (modules '((guix build utils)))
3072 (snippet
3073 ;; Remove bundled metis source
3074 '(begin
3075 (delete-file-recursively "metis-5.1.0")
3076 #t))))
3077 (build-system gnu-build-system)
3078 (arguments
3079 '(#:tests? #f ;no "check" target
3080 #:make-flags
3081 (list "CC=gcc"
3082 "BLAS=-lblas"
3083 "TBB=-ltbb"
3084 "MY_METIS_LIB=-lmetis"
3085 (string-append "INSTALL_LIB="
3086 (assoc-ref %outputs "out") "/lib")
3087 (string-append "INSTALL_INCLUDE="
3088 (assoc-ref %outputs "out") "/include")
3089 "library")
3090 #:phases
3091 (modify-phases %standard-phases
3092 (delete 'configure)))) ;no configure script
3093 (inputs
3094 `(("tbb" ,tbb)
3095 ("lapack" ,lapack)
3096 ("metis" ,metis)))
3097 (home-page "http://faculty.cse.tamu.edu/davis/suitesparse.html")
3098 (synopsis "Suite of sparse matrix software")
3099 (description
3100 "SuiteSparse is a suite of sparse matrix algorithms, including: UMFPACK,
3101 multifrontal LU factorization; CHOLMOD, supernodal Cholesky; SPQR,
3102 multifrontal QR; KLU and BTF, sparse LU factorization, well-suited for circuit
3103 simulation; ordering methods (AMD, CAMD, COLAMD, and CCOLAMD); CSparse and
3104 CXSparse, a concise sparse Cholesky factorization package; and many other
3105 packages.")
3106 ;; LGPLv2.1+:
3107 ;; AMD, CAMD, BTF, COLAMD, CCOLAMD, CSparse, CXSparse, KLU, LDL
3108 ;; GPLv2+:
3109 ;; GPUQREngine, RBio, SuiteSparse_GPURuntime, SuiteSparseQR, UMFPACK
3110 (license (list license:gpl2+ license:lgpl2.1+))))
3111
3112 (define-public atlas
3113 (package
3114 (name "atlas")
3115 (version "3.10.3")
3116 (source (origin
3117 (method url-fetch)
3118 (uri (string-append "mirror://sourceforge/math-atlas/Stable/"
3119 version "/atlas" version ".tar.bz2"))
3120 (sha256
3121 (base32
3122 "1dyjlq3fiparvm8ypwk6rsmjzmnwk81l88gkishphpvc79ryp216"))))
3123 (build-system gnu-build-system)
3124 (home-page "http://math-atlas.sourceforge.net/")
3125 (inputs `(("gfortran" ,gfortran)
3126 ("lapack-tar" ,(package-source lapack))))
3127 (outputs '("out" "doc"))
3128 ;; For the moment we drop support for MIPS at it fails to compile. See
3129 ;; https://lists.gnu.org/archive/html/guix-devel/2014-11/msg00516.html
3130 (supported-systems (delete "mips64el-linux" %supported-systems))
3131 (arguments
3132 `(#:parallel-build? #f
3133 #:parallel-tests? #f
3134
3135 ;; ATLAS tunes itself for the machine it is built on, as explained at
3136 ;; <http://lists.gnu.org/archive/html/guix-devel/2014-10/msg00305.html>.
3137 ;; For this reason, we want users to build it locally instead of using
3138 ;; substitutes.
3139 #:substitutable? #f
3140
3141 #:modules ((srfi srfi-26)
3142 (srfi srfi-1)
3143 (guix build gnu-build-system)
3144 (guix build utils))
3145 #:configure-flags
3146 `(;; Generate position independent code suitable for dynamic libraries
3147 ;; and use WALL timer to get more accurate timing.
3148 "-Fa" "alg" "-fPIC" "-D" "c" "-DWALL"
3149 ;; Set word width.
3150 "-b"
3151 ,,(if (string-match "64" (%current-system))
3152 "64"
3153 "32")
3154 ;; Disable parallel build as it gives errors: atlas_pthread.h is
3155 ;; needed to compile C files before it is generated.
3156 "-Ss" "pmake" "make -j 1"
3157 ;; Probe is failing for MIPS. We therefore define the system
3158 ;; architecture explicitly by setting (-A) MACHINETYPE = 49
3159 ;; 'MIPSR1xK' and (-V) ISA = 1 'none'.
3160 ,,@(if (string-prefix? "mips" (%current-system))
3161 (list "-A" "49" "-V" "1")
3162 (list))
3163 ;; Generate shared libraries.
3164 "--shared"
3165 ;; Build a full LAPACK library.
3166 ,(string-append "--with-netlib-lapack-tarfile="
3167 (assoc-ref %build-inputs "lapack-tar")))
3168 #:phases
3169 (modify-phases %standard-phases
3170 (add-after 'install 'install-doc
3171 (lambda* (#:key outputs inputs #:allow-other-keys)
3172 (let ((doc (string-append (assoc-ref outputs "doc")
3173 "/share/doc/atlas")))
3174 (mkdir-p doc)
3175 (fold (lambda (file previous)
3176 (and previous (zero? (system* "cp" file doc))))
3177 #t (find-files "../ATLAS/doc" ".*")))))
3178 (add-after 'check 'check-pt
3179 (lambda _ (zero? (system* "make" "ptcheck"))))
3180 ;; Fix files required to run configure.
3181 (add-before 'configure 'fix-/bin/sh
3182 (lambda _
3183 ;; Use `sh', not `/bin/sh'.
3184 (substitute* (find-files "." "Makefile|configure|SpewMakeInc\\.c")
3185 (("/bin/sh")
3186 "sh"))))
3187 ;; Fix /bin/sh in generated make files.
3188 (add-after 'configure 'fix-/bin/sh-in-generated-files
3189 (lambda _
3190 (substitute* (find-files "." "^[Mm]ake\\.inc.*")
3191 (("/bin/sh")
3192 "sh"))))
3193 ;; ATLAS configure program does not accepts the default flags
3194 ;; passed by the 'gnu-build-system'.
3195 (replace 'configure
3196 (lambda* (#:key native-inputs inputs outputs
3197 (configure-flags '())
3198 #:allow-other-keys #:rest args)
3199 (let* ((prefix (assoc-ref outputs "out"))
3200 (bash (or (and=> (assoc-ref
3201 (or native-inputs inputs) "bash")
3202 (cut string-append <> "/bin/bash"))
3203 "/bin/sh"))
3204 (flags `(,(string-append "--prefix=" prefix)
3205 ,@configure-flags))
3206 (abs-srcdir (getcwd))
3207 (srcdir (string-append "../" (basename abs-srcdir))))
3208 (format #t "source directory: ~s (relative from build: ~s)~%"
3209 abs-srcdir srcdir)
3210 (mkdir "../build")
3211 (chdir "../build")
3212 (format #t "build directory: ~s~%" (getcwd))
3213 (format #t "configure flags: ~s~%" flags)
3214 (zero? (apply system* bash
3215 (string-append srcdir "/configure")
3216 flags))))))))
3217 (synopsis "Automatically Tuned Linear Algebra Software")
3218 (description
3219 "ATLAS is an automatically tuned linear algebra software library
3220 providing C and Fortran77 interfaces to a portably efficient BLAS
3221 implementation, as well as a few routines from LAPACK.
3222
3223 Optimization occurs at build time. For this reason, the library is built on
3224 the machine where it is installed, without resorting to pre-built substitutes.
3225
3226 Before building the library, CPU throttling should be disabled. This can be
3227 done in the BIOS, or, on GNU/Linux, with the following command:
3228
3229 @example
3230 # cpupower --governor performance
3231 @end example
3232
3233 Failure to do so will result in a library with poor performance.")
3234 (license license:bsd-3)))
3235
3236 (define-public glm
3237 (package
3238 (name "glm")
3239 (version "0.9.9.0")
3240 (source
3241 (origin
3242 (method url-fetch)
3243 (uri (string-append "https://github.com/g-truc/glm/releases/download/"
3244 version "/glm-" version ".zip"))
3245 (sha256
3246 (base32
3247 "0ihjadp2sb8w312a276skfjsljm3y41bjscbxf79wn23gi00giz1"))))
3248 (build-system cmake-build-system)
3249 (native-inputs
3250 `(("unzip" ,unzip)))
3251 (home-page "https://glm.g-truc.net/")
3252 (synopsis "OpenGL Mathematics library")
3253 (description "OpenGL Mathematics (GLM) is a header-only C++ mathematics
3254 library for graphics software based on the OpenGL Shading Language (GLSL)
3255 specifications.")
3256 (license license:expat)))
3257
3258 (define-public lpsolve
3259 (package
3260 (name "lpsolve")
3261 (version "5.5.2.5")
3262 (source
3263 (origin
3264 (method url-fetch)
3265 (uri (string-append "mirror://sourceforge/lpsolve/lpsolve/" version
3266 "/lp_solve_" version "_source.tar.gz"))
3267 (sha256
3268 (base32
3269 "12pj1idjz31r7c2mb5w03vy1cmvycvbkx9z29s40qdmkp1i7q6i0"))
3270 (modules '((guix build utils)))
3271 (snippet
3272 '(begin
3273 (substitute* (list "lp_solve/ccc" "lpsolve55/ccc")
3274 (("^c=cc") "c=gcc")
3275 ;; Pretend to be on a 64 bit platform to obtain a common directory
3276 ;; name for the build results on all architectures; nothing else
3277 ;; seems to depend on it.
3278 (("^PLATFORM=.*$") "PLATFORM=ux64\n")
3279
3280 ;; The check for 'isnan' as it is written fails with
3281 ;; "non-floating-point argument in call to function
3282 ;; ‘__builtin_isnan’", which leads to the 'NOISNAN' cpp macro
3283 ;; definition, which in turn leads to bad things. Fix the feature
3284 ;; test.
3285 (("isnan\\(0\\)") "isnan(0.)"))
3286 #t))))
3287 (build-system gnu-build-system)
3288 (arguments
3289 `(#:tests? #f ; no check target
3290 #:phases
3291 (modify-phases %standard-phases
3292 (delete 'configure) ; no configure script
3293 (replace 'build
3294 (lambda _
3295 (with-directory-excursion "lpsolve55"
3296 (invoke "bash" "ccc"))
3297 (with-directory-excursion "lp_solve"
3298 (invoke "bash" "ccc"))
3299 #t))
3300 (replace 'install
3301 (lambda* (#:key outputs #:allow-other-keys)
3302 (let* ((out (assoc-ref outputs "out"))
3303 (bin (string-append out "/bin"))
3304 (lib (string-append out "/lib"))
3305 ;; This is where LibreOffice expects to find the header
3306 ;; files, and where they are installed by Debian.
3307 (include (string-append out "/include/lpsolve")))
3308 (install-file "lpsolve55/bin/ux64/liblpsolve55.a" lib)
3309 (install-file "lpsolve55/bin/ux64/liblpsolve55.so" lib)
3310 (install-file "lp_solve/bin/ux64/lp_solve" bin)
3311
3312 ;; Install a subset of the header files as on Debian
3313 ;; (plus lp_bit.h, which matches the regular expression).
3314 (for-each (lambda (name)
3315 (install-file name include))
3316 (find-files "." "lp_[HMSa-z].*\\.h$"))
3317 (with-directory-excursion "shared"
3318 (for-each (lambda (name)
3319 (install-file name include))
3320 (find-files "." "\\.h$")))
3321 #t))))))
3322 (home-page "http://lpsolve.sourceforge.net/")
3323 (synopsis "Mixed integer linear programming (MILP) solver")
3324 (description
3325 "lp_solve is a mixed integer linear programming solver based on the
3326 revised simplex and the branch-and-bound methods.")
3327 (license license:lgpl2.1+)))
3328
3329 (define-public dealii
3330 (package
3331 (name "dealii")
3332 (version "8.5.1")
3333 (source
3334 (origin
3335 (method url-fetch)
3336 (uri (string-append "https://github.com/dealii/dealii/releases/"
3337 "download/v" version "/dealii-" version ".tar.gz"))
3338 (sha256
3339 (base32
3340 "1bh9rsmkrg0zi70n27b11djmac9lximghsiy7mg7w7x544n82gnk"))
3341 (modules '((guix build utils)))
3342 (snippet
3343 ;; Remove bundled sources: UMFPACK, TBB, muParser, and boost
3344 '(begin
3345 (delete-file-recursively "bundled")
3346 #t))))
3347 (build-system cmake-build-system)
3348 (inputs
3349 `(("tbb" ,tbb)
3350 ("zlib" ,zlib)
3351 ("boost" ,boost)
3352 ("p4est" ,p4est)
3353 ("blas" ,openblas)
3354 ("lapack" ,lapack)
3355 ("arpack" ,arpack-ng)
3356 ("muparser" ,muparser)
3357 ("gfortran" ,gfortran)
3358 ("suitesparse" ,suitesparse))) ;for UMFPACK
3359 (arguments
3360 `(#:build-type "DebugRelease" ;only supports Release, Debug, or DebugRelease
3361 #:configure-flags
3362 ;; Work around a bug in libsuitesparseconfig linking
3363 ;; see https://github.com/dealii/dealii/issues/4745
3364 '("-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON")))
3365 (home-page "https://www.dealii.org")
3366 (synopsis "Finite element library")
3367 (description
3368 "Deal.II is a C++ program library targeted at the computational solution
3369 of partial differential equations using adaptive finite elements. The main
3370 aim of deal.II is to enable rapid development of modern finite element codes,
3371 using among other aspects adaptive meshes and a wide array of tools often used
3372 in finite element programs.")
3373 (license license:lgpl2.1+)))
3374
3375 (define-public dealii-openmpi
3376 (package (inherit dealii)
3377 (name "dealii-openmpi")
3378 (inputs
3379 `(("mpi" ,openmpi)
3380 ;;Supported only with MPI:
3381 ("p4est" ,p4est-openmpi)
3382 ("petsc" ,petsc-openmpi)
3383 ("slepc" ,slepc-openmpi)
3384 ("metis" ,metis) ;for MUMPS
3385 ("scalapack" ,scalapack) ;for MUMPS
3386 ("mumps" ,mumps-metis-openmpi) ;configure supports only metis orderings
3387 ("arpack" ,arpack-ng-openmpi)
3388 ,@(fold alist-delete (package-inputs dealii)
3389 '("p4est" "arpack"))))
3390 (arguments
3391 (substitute-keyword-arguments (package-arguments dealii)
3392 ((#:configure-flags cf)
3393 ``("-DMPI_C_COMPILER=mpicc"
3394 "-DMPI_CXX_COMPILER=mpicxx"
3395 "-DMPI_Fortran_COMPILER=mpifort"
3396 ,@,cf))))
3397 (synopsis "Finite element library (with MPI support)")))
3398
3399 (define-public flann
3400 (package
3401 (name "flann")
3402 (version "1.8.4")
3403 (source
3404 (origin
3405 (method url-fetch)
3406 (uri
3407 (string-append
3408 "http://www.cs.ubc.ca/research/flann/uploads/FLANN/flann-"
3409 version "-src.zip"))
3410 (sha256
3411 (base32
3412 "022w8hph7bli5zbpnk3z1qh1c2sl5hm8fw2ccim651ynn0hr7fyz"))
3413 (patches (search-patches "flann-cmake-3.11.patch"))))
3414 (build-system cmake-build-system)
3415 (outputs '("out"
3416 "octave")) ;46 MiB .mex file that pulls Octave
3417 (native-inputs
3418 `(("unzip" ,unzip)))
3419 (inputs
3420 `(("hdf5" ,hdf5)
3421 ("octave" ,octave)
3422 ("python" ,python-2) ; print syntax
3423 ;; ("python2-numpy" ,python2-numpy) ; only required for the tests
3424 ("zlib" ,zlib)))
3425 (arguments
3426 `(;; The 'share/flann/octave' contains a .mex file, which is an ELF file
3427 ;; taken 46 MiB unstripped, and 6 MiB stripped.
3428 #:strip-directories '("lib" "lib64" "libexec"
3429 "bin" "sbin" "share/flann/octave")
3430
3431 ;; Save 12 MiB by not installing .a files. Passing
3432 ;; '-DBUILD_STATIC_LIBS=OFF' has no effect.
3433 #:phases (modify-phases %standard-phases
3434 (add-before 'configure 'set-octave-directory
3435 (lambda* (#:key outputs #:allow-other-keys)
3436 ;; Install the .mex file in the "octave" output.
3437 (let ((out (assoc-ref outputs "octave")))
3438 (substitute* "src/matlab/CMakeLists.txt"
3439 (("share/flann/octave")
3440 (string-append out "/share/flann/octave")))
3441 #t)))
3442 (add-after 'install 'remove-static-libraries
3443 (lambda* (#:key outputs #:allow-other-keys)
3444 (let* ((out (assoc-ref outputs "out"))
3445 (lib (string-append out "/lib")))
3446 (for-each delete-file
3447 (find-files lib "\\.a$"))
3448 #t))))
3449
3450 #:tests? #f)) ; The test data are downloaded from the Internet.
3451 (home-page "http://www.cs.ubc.ca/research/flann/")
3452 (synopsis "Library for approximate nearest neighbors computation")
3453 (description "FLANN is a library for performing fast approximate
3454 nearest neighbor searches in high dimensional spaces. It implements a
3455 collection of algorithms and a system for automatically choosing the best
3456 algorithm and optimum parameters depending on the dataset.
3457
3458 FLANN is written in C++ and contains bindings for C, Octave and Python.")
3459 (license (license:non-copyleft "file://COPYING"
3460 "See COPYING in the distribution."))))
3461
3462 (define-public wcalc
3463 (package
3464 (name "wcalc")
3465 (version "2.5")
3466 (source
3467 (origin
3468 (method url-fetch)
3469 (uri (string-append "mirror://sourceforge/w-calc/Wcalc/" version "/"
3470 "wcalc-" version ".tar.bz2"))
3471 (sha256
3472 (base32
3473 "1vi8dl6rccqiq1apmpwawyg2ywx6a1ic1d3cvkf2hlwk1z11fb0f"))))
3474 (build-system gnu-build-system)
3475 (inputs
3476 `(("mpfr" ,mpfr)
3477 ("readline" ,readline)))
3478 (home-page "http://w-calc.sourceforge.net/index.php")
3479 (synopsis "Flexible command-line scientific calculator")
3480 (description "Wcalc is a very capable calculator. It has standard functions
3481 (sin, asin, and sinh for example, in either radians or degrees), many
3482 pre-defined constants (pi, e, c, etc.), support for using variables, \"active\"
3483 variables, a command history, hex/octal/binary input and output, unit
3484 conversions, embedded comments, and an expandable expression entry field. It
3485 evaluates expressions using the standard order of operations.")
3486 (license license:gpl2+)))
3487
3488 (define-public xaos
3489 (package
3490 (name "xaos")
3491 (version "3.6")
3492 (source (origin
3493 (method url-fetch)
3494 (uri (string-append "mirror://sourceforge/xaos/XaoS/" version
3495 "/xaos-" version ".tar.gz"))
3496 (sha256
3497 (base32
3498 "15cd1cx1dyygw6g2nhjqq3bsfdj8sj8m4va9n75i0f3ryww3x7wq"))))
3499 (build-system gnu-build-system)
3500 (native-inputs `(("gettext" ,gettext-minimal)))
3501 (inputs `(("libx11" ,libx11)
3502 ("zlib" ,zlib)
3503 ("libpng" ,libpng)
3504 ("gsl" ,gsl)))
3505 (arguments
3506 `(#:tests? #f ;no "check" target
3507 #:make-flags '("LOCALEDIR=$DATAROOTDIR/locale")))
3508 (synopsis "Real-time fractal zoomer")
3509 (description "GNU XaoS is a graphical program that generates fractal
3510 patterns and allows you to zoom in and out of them infinitely in a fluid,
3511 continuous manner. It also includes tutorials that help to explain how fractals
3512 are built. It can generate many different fractal types such as the Mandelbrot
3513 set.")
3514 (home-page "https://www.gnu.org/software/xaos/")
3515 (license license:gpl2+)))
3516
3517 (define-public hypre
3518 (package
3519 (name "hypre")
3520 (version "2.11.0")
3521 (source (origin
3522 (method url-fetch)
3523 (uri (string-append "https://github.com/LLNL/hypre/archive/"
3524 "v" version ".tar.gz"))
3525 (file-name (string-append name "-" version ".tar.gz"))
3526 (sha256
3527 (base32
3528 "0q69ia0jivzcr8p049dn3mg8yjpn6nwq4sw9iqac8vr63vi54l6m"))
3529 (modules '((guix build utils)))
3530 (snippet
3531 '(begin
3532 ;; Remove use of __DATE__ and __TIME__ for reproducibility;
3533 ;; substitute the tarball creation time.
3534 (substitute* "src/utilities/HYPRE_utilities.h"
3535 (("Date Compiled: .*$")
3536 "Date Compiled: Mar 28 2016 20:19:59 +0000\"\n"))
3537 #t))))
3538 (build-system gnu-build-system)
3539 (outputs '("out" ;6.1 MiB of headers and libraries
3540 "doc")) ;4.8 MiB of documentation
3541 (native-inputs
3542 `(("doc++" ,doc++)
3543 ("netpbm" ,netpbm)
3544 ("perl" ,perl) ;needed to run 'ppmquant' during tests
3545 ("texlive" ,texlive) ;full package required for fonts
3546 ("ghostscript" ,ghostscript)))
3547 (inputs
3548 `(("blas" ,openblas)
3549 ("lapack" ,lapack)))
3550 (arguments
3551 `(#:modules ((srfi srfi-1)
3552 ,@%gnu-build-system-modules)
3553 #:configure-flags '("--enable-shared"
3554 "--disable-fortran"
3555 "--without-MPI"
3556 "--with-openmp"
3557 "--with-fei"
3558 "--with-lapack"
3559 "--with-blas")
3560 #:phases
3561 (modify-phases %standard-phases
3562 (add-before 'configure 'chdir-src
3563 (lambda _ (chdir "src")))
3564 (replace 'configure
3565 (lambda* (#:key build target configure-flags
3566 #:allow-other-keys #:rest args)
3567 (let* ((configure (assoc-ref %standard-phases 'configure)))
3568 (apply configure
3569 (append args
3570 (list #:configure-flags
3571 (cons (string-append
3572 "--host=" (or target build))
3573 configure-flags)))))))
3574 (add-after 'build 'build-docs
3575 (lambda _
3576 (zero? (system* "make" "-Cdocs" "pdf" "html"))))
3577 (replace 'check
3578 (lambda _
3579 (setenv "LD_LIBRARY_PATH" (string-append (getcwd) "/hypre/lib"))
3580 (setenv "PATH" (string-append "." ":" (getenv "PATH")))
3581 (and (system* "make" "check" "CHECKRUN=")
3582 (fold (lambda (filename result)
3583 (and result
3584 (let ((size (stat:size (stat filename))))
3585 (when (not (zero? size))
3586 (format #t "~a size ~d; error indication~%"
3587 filename size))
3588 (zero? size))))
3589 #t
3590 (find-files "test" ".*\\.err$")))))
3591 (add-after 'install 'install-docs
3592 (lambda* (#:key outputs #:allow-other-keys)
3593 ;; Custom install because docs/Makefile doesn't honor ${docdir}.
3594 (let* ((doc (assoc-ref outputs "doc"))
3595 (docdir (string-append doc "/share/doc/hypre-" ,version)))
3596 (with-directory-excursion "docs"
3597 (for-each (lambda (base)
3598 (install-file (string-append base ".pdf") docdir)
3599 (copy-recursively base docdir)) ;html docs
3600 '("HYPRE_usr_manual"
3601 "HYPRE_ref_manual")))
3602 #t))))))
3603 (home-page "http://www.llnl.gov/casc/hypre/")
3604 (synopsis "Library of solvers and preconditioners for linear equations")
3605 (description
3606 "HYPRE is a software library of high performance preconditioners and
3607 solvers for the solution of large, sparse linear systems of equations. It
3608 features multigrid solvers for both structured and unstructured grid
3609 problems.")
3610 (license license:lgpl2.1)))
3611
3612 (define-public hypre-openmpi
3613 (package (inherit hypre)
3614 (name "hypre-openmpi")
3615 (inputs
3616 `(("mpi" ,openmpi)
3617 ,@(package-inputs hypre)))
3618 (arguments
3619 (substitute-keyword-arguments (package-arguments hypre)
3620 ((#:configure-flags flags)
3621 ``("--with-MPI"
3622 ,@(delete "--without-MPI" ,flags)))
3623 ((#:phases phases)
3624 `(modify-phases ,phases
3625 (add-before 'check 'set-test-environment
3626 (lambda _
3627 ;; By default, running the test suite would fail because 'ssh'
3628 ;; could not be found in $PATH. Define this variable to
3629 ;; placate Open MPI without adding a dependency on OpenSSH (the
3630 ;; agent isn't used anyway.)
3631 (setenv "OMPI_MCA_plm_rsh_agent" (which "cat"))
3632 #t))))))
3633 (synopsis "Parallel solvers and preconditioners for linear equations")
3634 (description
3635 "HYPRE is a software library of high performance preconditioners and
3636 solvers for the solution of large, sparse linear systems of equations on
3637 parallel computers. It features parallel multigrid solvers for both
3638 structured and unstructured grid problems.")))
3639
3640 (define-public matio
3641 (package
3642 (name "matio")
3643 (version "1.5.6")
3644 (source
3645 (origin
3646 (method url-fetch)
3647 (uri (string-append "mirror://sourceforge/matio/matio/" version "/"
3648 "matio-" version ".tar.gz"))
3649 (sha256
3650 (base32
3651 "0y2qymgxank8wdiwc68ap8bxdzrhvyw86i29yh3xgn4z1njfd9ir"))))
3652 (build-system gnu-build-system)
3653 (inputs
3654 `(("zlib" ,zlib)
3655 ("hdf5" ,hdf5)))
3656 (home-page "http://matio.sourceforge.net/")
3657 (synopsis "Library for reading and writing MAT files")
3658 (description "Matio is a library for reading and writing MAT files. It
3659 supports compressed MAT files, as well as newer (version 7.3) MAT files.")
3660 (license license:bsd-2)))
3661
3662 (define-public vc
3663 (package
3664 (name "vc")
3665 (version "1.3.3")
3666 (source
3667 (origin (method url-fetch)
3668 (uri (string-append "https://github.com/VcDevel/Vc/releases/"
3669 "download/" version "/Vc-" version ".tar.gz"))
3670 (sha256
3671 (base32
3672 "1zmlpn32jzb38smp3j834llmbix3whsrbw0h397qxysbw792kih8"))))
3673 (build-system cmake-build-system)
3674 (arguments
3675 '(#:configure-flags
3676 '("-DBUILD_TESTING=ON"
3677 ;; By default, Vc will optimize for the CPU of the build machine.
3678 ;; Setting this to "none" makes it create portable binaries. See
3679 ;; "cmake/OptimizeForArchitecture.cmake".
3680 "-DTARGET_ARCHITECTURE=none")))
3681 (synopsis "SIMD vector classes for C++")
3682 (description "Vc provides portable, zero-overhead C++ types for explicitly
3683 data-parallel programming. It is a library designed to ease explicit
3684 vectorization of C++ code. Its types enable explicitly stating data-parallel
3685 operations on multiple values. The parallelism is therefore added via the type
3686 system. Vc has an intuitive API and provides portability between different
3687 compilers and compiler versions as well as portability between different vector
3688 instruction sets. Thus, an application written with Vc can be compiled for:
3689 @enumerate
3690 @item AVX and AVX2
3691 @item SSE2 up to SSE4.2 or SSE4a
3692 @item Scalar
3693 @item MIC
3694 @item NEON (in development)
3695 @item NVIDIA GPUs / CUDA (in development)
3696 @end enumerate\n")
3697 (home-page "https://github.com/VcDevel/Vc")
3698 ;; "No support_???.cpp file exists for this architecture."
3699 (supported-systems '("x86_64-linux" "i686-linux"))
3700 (license license:bsd-3)))
3701
3702 (define-public reducelcs
3703 ;; This is the last commit which is available upstream, no
3704 ;; release happened since 2010.
3705 (let ((commit "474f88deb968061abe8cf11c959e02319b8ae5c0")
3706 (revision "1"))
3707 (package
3708 (name "reducelcs")
3709 (version (string-append "1.0-" revision "." (string-take commit 7)))
3710 (source
3711 (origin
3712 (method git-fetch)
3713 (uri (git-reference
3714 (url "https://github.com/gdv/Reduce-Expand-for-LCS")
3715 (commit commit)))
3716 (file-name (string-append name "-" version "-checkout"))
3717 (sha256
3718 (base32
3719 "1rllzcfwc042c336mhq262a8ha90x6afq30kvk60r7i4761j4yjm"))))
3720 (build-system gnu-build-system)
3721 (inputs
3722 `(("openlibm" ,openlibm)))
3723 (arguments
3724 `(#:tests? #f ; no tests
3725 #:phases
3726 (modify-phases %standard-phases
3727 (delete 'configure) ; No configure script exists.
3728 (replace 'install ; No install phase exists.
3729 (lambda* (#:key outputs #:allow-other-keys)
3730 (let* ((out (assoc-ref outputs "out"))
3731 (bin (string-append out "/bin")))
3732 (install-file "Approximation" bin)
3733 (install-file "CollectResults" bin)
3734 (install-file "GenerateInstances" bin)
3735 #t))))))
3736 (synopsis "Approximate Longest Commons Subsequence computation tool")
3737 (description
3738 "@code{reduceLCS} is an implementation of the Reduce-Expand
3739 algorithm for LCS. It is a fast program to compute the approximate
3740 Longest Commons Subsequence of a set of strings.")
3741 (home-page "https://github.com/gdv/Reduce-Expand-for-LCS")
3742 (license license:gpl3+))))
3743
3744 (define-public jacal
3745 (package
3746 (name "jacal")
3747 (version "1c4")
3748 (source (origin
3749 (method url-fetch)
3750 (uri (string-append
3751 "http://groups.csail.mit.edu/mac/ftpdir/scm/jacal-"
3752 version ".zip"))
3753 (sha256 (base32
3754 "055zrn12a1dmy0dqkwrkq3fklbhg3yir6vn0lacp4mvbg8573a3q"))
3755 (patches (search-patches "jacal-fix-texinfo.patch"))))
3756 (build-system gnu-build-system)
3757 (arguments
3758 `(#:phases
3759 (modify-phases %standard-phases
3760 (add-before 'build 'pre-build
3761 ;; Don't use upstream's script - it really doesn't fit into
3762 ;; Guix's functional paradigm.
3763 (lambda* (#:key inputs outputs #:allow-other-keys)
3764 (substitute* "Makefile"
3765 (("^install: install-script") "install: "))))
3766 (add-after 'install 'post-install
3767 ;; Instead, we provide our own simplified script.
3768 (lambda* (#:key inputs outputs #:allow-other-keys)
3769 (let ((wrapper (string-append (assoc-ref outputs "out")
3770 "/bin/jacal")))
3771 (format (open wrapper (logior O_WRONLY O_CREAT))
3772 (string-append "#!~a\nexec ~a/bin/scm -ip1 "
3773 "-e '(slib:load \"~a/lib/jacal/math\") "
3774 "(math)' \"$@\"\n")
3775 (which "bash")
3776 (assoc-ref inputs "scm")
3777 (assoc-ref outputs "out"))
3778 (chmod wrapper #o555))))
3779 (replace 'configure
3780 (lambda* (#:key inputs outputs #:allow-other-keys)
3781 (zero? (system* "./configure"
3782 (string-append "--prefix="
3783 (assoc-ref outputs "out")))))))))
3784 (inputs `(("scm" ,scm)))
3785 (native-inputs `(("unzip" ,unzip)
3786 ("texinfo" ,texinfo)))
3787 (synopsis "Symbolic mathematics system")
3788 (description "GNU JACAL is an interactive symbolic mathematics program based on
3789 Scheme. It manipulate and simplify a range of mathematical expressions such
3790 as equations, scalars, vectors, and matrices.")
3791 (home-page "https://www.gnu.org/software/jacal/")
3792 (license license:gpl3+)))
3793
3794 (define-public z3
3795 (package
3796 (name "z3")
3797 (version "4.5.0")
3798 (source (origin
3799 (method url-fetch)
3800 (uri (string-append
3801 "https://github.com/Z3Prover/z3/archive/z3-"
3802 version ".tar.gz"))
3803 (sha256
3804 (base32
3805 "032a5lvji2liwmc25jv52bdrhimqflvqbpg77ccaq1jykhiivbmf"))))
3806 (build-system cmake-build-system)
3807 (arguments
3808 `(#:configure-flags
3809 (list "-DBUILD_PYTHON_BINDINGS=true"
3810 "-DINSTALL_PYTHON_BINDINGS=true"
3811 (string-append "-DCMAKE_INSTALL_PYTHON_PKG_DIR="
3812 %output
3813 "/lib/python2.7/site-packages"))
3814 #:phases
3815 (modify-phases %standard-phases
3816 (add-before 'configure 'bootstrap
3817 (lambda _
3818 (zero?
3819 (system* "python" "contrib/cmake/bootstrap.py" "create"))))
3820 (add-before 'check 'make-test-z3
3821 (lambda _
3822 ;; Build the test suite executable.
3823 (zero? (system* "make" "test-z3" "-j"
3824 (number->string (parallel-job-count))))))
3825 (replace 'check
3826 (lambda _
3827 ;; Run all the tests that don't require arguments.
3828 (zero? (system* "./test-z3" "/a")))))))
3829 (native-inputs
3830 `(("python" ,python-2)))
3831 (synopsis "Theorem prover")
3832 (description "Z3 is a theorem prover and @dfn{satisfiability modulo
3833 theories} (SMT) solver. It provides a C/C++ API, as well as Python bindings.")
3834 (home-page "https://github.com/Z3Prover/z3")
3835 (license license:expat)))
3836
3837 (define-public cubicle
3838 (package
3839 (name "cubicle")
3840 (version "1.1.1")
3841 (source (origin
3842 (method url-fetch)
3843 (uri (string-append "http://cubicle.lri.fr/cubicle-"
3844 version ".tar.gz"))
3845 (sha256
3846 (base32
3847 "1sny9c4fm14k014pk62ibpwbrjjirkx8xmhs9jg7q1hk7y7x3q2h"))))
3848 (build-system gnu-build-system)
3849 (native-inputs
3850 `(("ocaml" ,ocaml)
3851 ("which" ,(@@ (gnu packages base) which))))
3852 (propagated-inputs
3853 `(("z3" ,z3)))
3854 (arguments
3855 `(#:configure-flags (list "--with-z3")
3856 #:tests? #f
3857 #:phases
3858 (modify-phases %standard-phases
3859 (add-before 'configure 'configure-for-release
3860 (lambda _
3861 (substitute* "Makefile.in"
3862 (("SVNREV=") "#SVNREV="))))
3863 (add-before 'configure 'fix-/bin/sh
3864 (lambda _
3865 (substitute* "configure"
3866 (("/bin/sh") (which "sh")))))
3867 (add-before 'configure 'fix-smt-z3wrapper.ml
3868 (lambda _
3869 (substitute* "Makefile.in"
3870 (("\\\\n") "")))))))
3871 (home-page "http://cubicle.lri.fr/")
3872 (synopsis "Model checker for array-based systems")
3873 (description "Cubicle is a model checker for verifying safety properties
3874 of array-based systems. This is a syntactically restricted class of
3875 parametrized transition systems with states represented as arrays indexed by
3876 an arbitrary number of processes. Cache coherence protocols and mutual
3877 exclusion algorithms are typical examples of such systems.")
3878 (license license:asl2.0)))
3879
3880 (define-public elemental
3881 (package
3882 (name "elemental")
3883 (version "0.87.7")
3884 (source (origin
3885 (method url-fetch)
3886 (uri (string-append "https://github.com/elemental/Elemental/"
3887 "archive/v" version ".tar.gz"))
3888 (file-name (string-append name "-" version ".tar.gz"))
3889 (sha256
3890 (base32
3891 "1nfp82w22pi8x8fg9sc37z8kf84dqi1dhxp8bbk7571y4aygvv3v"))))
3892 (build-system cmake-build-system)
3893 (home-page "http://libelemental.org")
3894 (native-inputs
3895 `(("gfortran" ,gfortran)))
3896 (inputs
3897 `(("blas" ,openblas)
3898 ("gfortran:lib" ,gfortran "lib")
3899 ("gmp" ,gmp)
3900 ("lapack" ,lapack)
3901 ("metis" ,metis)
3902 ("mpc" ,mpc)
3903 ("mpfr" ,mpfr)
3904 ("mpi" ,openmpi)
3905 ("qd" ,qd)))
3906 (arguments
3907 `(#:build-type "Release" ;default RelWithDebInfo not supported
3908 #:configure-flags `("-DEL_DISABLE_PARMETIS:BOOL=YES"
3909 "-DEL_AVOID_COMPLEX_MPI:BOOL=NO"
3910 "-DEL_CACHE_WARNINGS:BOOL=YES"
3911 "-DEL_TESTS:BOOL=YES"
3912 "-DCMAKE_INSTALL_LIBDIR=lib"
3913 "-DGFORTRAN_LIB=gfortran")
3914 #:phases (modify-phases %standard-phases
3915 (add-before 'check 'setup-tests
3916 (lambda _
3917 ;; Parallelism is done at the MPI layer.
3918 (setenv "OMP_NUM_THREADS" "1")
3919 #t))
3920 (add-after 'install 'remove-tests
3921 (lambda* (#:key outputs #:allow-other-keys)
3922 ;; Tests are installed, with no easy configuration
3923 ;; switch to prevent this, so delete them.
3924 (delete-file-recursively
3925 (string-append (assoc-ref outputs "out") "/bin"))
3926 #t)))))
3927 (synopsis "Dense and sparse-direct linear algebra and optimization")
3928 (description "Elemental is a modern C++ library for distributed-memory
3929 dense and sparse-direct linear algebra, conic optimization, and lattice
3930 reduction.")
3931 (license license:bsd-2)))
3932
3933 (define-public mcrl2
3934 (package
3935 (name "mcrl2")
3936 (version "201707.1.15162")
3937 (source (origin
3938 (method url-fetch)
3939 (uri (string-append "http://www.mcrl2.org/download/devel/mcrl2-"
3940 version
3941 ".tar.gz"))
3942 (sha256
3943 (base32
3944 "1ziww2fchsklm25hl9p2mngssxfh9w07nc114cncqaxfibqp2p8f"))))
3945 (native-inputs
3946 `(("subversion" ,subversion)))
3947 (inputs
3948 `(("boost" ,boost)
3949 ("glu" ,glu)
3950 ("mesa" ,mesa)
3951 ("qtbase" ,qtbase)))
3952 (build-system cmake-build-system)
3953 (synopsis "Toolset for the mCRL2 formal specification language")
3954 (description
3955 "@dfn{mCRL2} (micro Common Representation Language 2) is a formal
3956 specification language for describing concurrent discrete event systems. Its
3957 toolset supports analysis and automatic verification, linearisation, simulation,
3958 state-space exploration and generation, and tools to optimise and analyse
3959 specifications. Also, state spaces can be manipulated, visualised and
3960 analysed.")
3961 (home-page "http://mcrl2.org")
3962 (license license:boost1.0)))
3963
3964 (define-public r-subplex
3965 (package
3966 (name "r-subplex")
3967 (version "1.5-4")
3968 (source
3969 (origin
3970 (method url-fetch)
3971 (uri (cran-uri "subplex" version))
3972 (sha256
3973 (base32
3974 "10cbgbx1bgsax5z7gz6716g360xpq4mvq19cf4qqrxv02mmwz57z"))))
3975 (build-system r-build-system)
3976 (native-inputs
3977 `(("gfortran" ,gfortran)))
3978 (home-page "https://cran.r-project.org/web/packages/subplex")
3979 (synopsis "Unconstrained optimization using the subplex algorithm")
3980 (description "This package implements the Subplex optimization algorithm.
3981 It solves unconstrained optimization problems using a simplex method on
3982 subspaces. The method is well suited for optimizing objective functions that
3983 are noisy or are discontinuous at the solution.")
3984 (license license:gpl3+)))
3985
3986 (define-public r-desolve
3987 (package
3988 (name "r-desolve")
3989 (version "1.21")
3990 (source
3991 (origin
3992 (method url-fetch)
3993 (uri (cran-uri "deSolve" version))
3994 (sha256
3995 (base32
3996 "0qqc4mknw1jblzcmph1dg3k1p6w42yal0k1xjh8pqk7yb3a75hs5"))))
3997 (properties `((upstream-name . "deSolve")))
3998 (build-system r-build-system)
3999 (native-inputs
4000 `(("gfortran" ,gfortran)))
4001 (home-page "https://desolve.r-forge.r-project.org/")
4002 (synopsis "Solvers for initial value problems of differential equations")
4003 (description "This package provides functions that solve initial
4004 value problems of a system of first-order ordinary differential equations (ODE),
4005 of partial differential equations (PDE), of differential algebraic equations
4006 (DAE), and of delay differential equations. The functions provide an interface
4007 to the FORTRAN functions lsoda, lsodar, lsode, lsodes of the ODEPACK collection,
4008 to the FORTRAN functions dvode and daspk and a C-implementation of solvers of
4009 the Runge-Kutta family with fixed or variable time steps. The package contains
4010 routines designed for solving ODEs resulting from 1-D, 2-D and 3-D partial
4011 differential equations (PDE) that have been converted to ODEs by numerical
4012 differencing.")
4013 (license license:gpl2+)))
4014
4015 (define-public tcalc
4016 (package
4017 (name "tcalc")
4018 (version "2.0")
4019 (source
4020 (origin
4021 (method url-fetch)
4022 (uri (string-append "https://sites.google.com/site/mohammedisam2000/tcalc/tcalc-"
4023 version ".tar.gz"))
4024 (sha256
4025 (base32
4026 "0jq806m4dqfia85nppfm75mml9w57g0cgv4cdw9bp3zymda83s0m"))))
4027 (build-system gnu-build-system)
4028 (synopsis "The terminal calculator")
4029 (description
4030 "The terminal calculator is a small program to help users of the GNU/Linux
4031 terminal do calculations simply and quickly. The formula to be calculated can
4032 be fed to @command{tcalc} through the command line.")
4033 (home-page "https://sites.google.com/site/mohammedisam2000/tcalc")
4034 (license license:gpl3+)))