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