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