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