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