gnu: rust: Remove unused "localstatedir" setting.
[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 (("\\\\\"")
9923d5a4
TGR
2087 "\""))
2088 #t)))))
63e07468
BW
2089 (native-inputs
2090 `(("bundler" ,bundler)
2091 ("ruby-rspec" ,ruby-rspec)))
2092 (synopsis "AsciiMath parsing and conversion library")
2093 (description
2094 "A pure Ruby AsciiMath parsing and conversion library. AsciiMath is an
2095easy-to-write markup language for mathematics.")
2096 (home-page "https://github.com/asciidoctor/asciimath")
2097 (license license:expat)))
2098
183e44ae
EB
2099(define-public superlu
2100 (package
2101 (name "superlu")
995a09e0 2102 (version "5.2.1")
183e44ae
EB
2103 (source
2104 (origin
2105 (method url-fetch)
2106 (uri (string-append "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/"
2107 "superlu_" version ".tar.gz"))
2108 (sha256
995a09e0
EB
2109 (base32 "0qzlb7cd608q62kyppd0a8c65l03vrwqql6gsm465rky23b6dyr8"))
2110 (modules '((guix build utils)))
2111 (snippet
2112 ;; Replace the non-free implementation of MC64 with a stub adapted
2113 ;; from Debian
2114 '(begin
2115 (use-modules (ice-9 regex)
2116 (ice-9 rdelim))
2117 (call-with-output-file "SRC/mc64ad.c"
2118 (lambda (port)
2119 (display "
2120#include <stdio.h>
2121#include <stdlib.h>
2122void mc64id_(int *a) {
2123 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
2124 abort ();
2125}
2126void mc64ad_ (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
2127 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
2128 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
2129 abort ();
2130}\n" port)))
2131 ;; Remove the corresponding license verbiage. MC64 license follows
2132 ;; a "------" line separator.
2133 (with-atomic-file-replacement "License.txt"
2134 (let ((rx (make-regexp "-{8}")))
2135 (lambda (in out)
2136 (let loop ()
2137 (let ((line (read-line in 'concat)))
2138 (unless (regexp-exec rx line)
2139 (display line out)
6cbee49d
MW
2140 (loop))))
2141 #t)))))))
995a09e0 2142 (build-system cmake-build-system)
183e44ae
EB
2143 (native-inputs
2144 `(("tcsh" ,tcsh)))
2145 (inputs
995a09e0 2146 `(("blas" ,openblas)
19afbea1 2147 ("gfortran" ,gfortran)))
183e44ae 2148 (arguments
995a09e0
EB
2149 `(#:configure-flags '("-Denable_blaslib:BOOL=NO" ;do not use internal cblas
2150 "-DTPL_BLAS_LIBRARIES=openblas"
677bc34d 2151 "-DBUILD_SHARED_LIBS:BOOL=YES")))
183e44ae
EB
2152 (home-page "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/")
2153 (synopsis "Supernodal direct solver for sparse linear systems")
2154 (description
2155 "SuperLU is a general purpose library for the direct solution of large,
2156sparse, nonsymmetric systems of linear equations on high performance machines.
2157The library is written in C and is callable from either C or Fortran. The
2158library routines perform an LU decomposition with partial pivoting and
2159triangular system solves through forward and back substitution. The library
2160also provides threshold-based ILU factorization preconditioners.")
995a09e0
EB
2161 (license (list license:bsd-3
2162 license:gpl2+ ;EXAMPLE/*fgmr.c
2163 (license:fsf-free "file://SRC/colamd.h")))))
f8ed036a 2164
a54aefea
EB
2165(define-public superlu-dist
2166 (package
2167 (name "superlu-dist")
0921eff2 2168 (version "5.3.0")
a54aefea
EB
2169 (source
2170 (origin
2171 (method url-fetch)
2172 (uri (string-append "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/"
2173 "superlu_dist_" version ".tar.gz"))
2174 (sha256
0921eff2
LC
2175 (base32 "0ja5ihqivkda1wd58y4lmzvmwssm9g91f70c5q0fzwhng6580h6y"))
2176 (modules '((guix build utils)))
29080870
EB
2177 (snippet
2178 ;; Replace the non-free implementation of MC64 with a stub
2179 '(begin
2180 (use-modules (ice-9 regex)
2181 (ice-9 rdelim))
0921eff2 2182 (call-with-output-file "SRC/mc64ad_dist.c"
29080870
EB
2183 (lambda (port)
2184 (display "
2185#include <stdio.h>
2186#include <stdlib.h>
0921eff2 2187void mc64id_dist(int *a) {
29080870
EB
2188 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
2189 abort ();
2190}
0921eff2 2191void mc64ad_dist (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
29080870
EB
2192 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
2193 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
2194 abort ();
2195}\n" port)))
29080870
EB
2196 (substitute* "SRC/util.c" ;adjust default algorithm
2197 (("RowPerm[[:blank:]]*=[[:blank:]]*LargeDiag")
6cbee49d
MW
2198 "RowPerm = NOROWPERM"))
2199 #t))
fc1adab1 2200 (patches (search-patches "superlu-dist-scotchmetis.patch"))))
a54aefea
EB
2201 (build-system gnu-build-system)
2202 (native-inputs
2203 `(("tcsh" ,tcsh)))
2204 (inputs
19afbea1 2205 `(("gfortran" ,gfortran)))
a54aefea
EB
2206 (propagated-inputs
2207 `(("openmpi" ,openmpi) ;headers include MPI heades
2208 ("lapack" ,lapack) ;required to link with output library
2209 ("pt-scotch" ,pt-scotch))) ;same
2210 (arguments
2211 `(#:parallel-build? #f ;race conditions using ar
2212 #:phases
dc1d3cde
KK
2213 (modify-phases %standard-phases
2214 (replace 'configure
2215 (lambda* (#:key inputs outputs #:allow-other-keys)
2216 (call-with-output-file "make.inc"
2217 (lambda (port)
2218 (format port "
a54aefea
EB
2219PLAT =
2220DSuperLUroot = ~a
2221DSUPERLULIB = ~a/lib/libsuperlu_dist.a
2222BLASDEF = -DUSE_VENDOR_BLAS
2223BLASLIB = -L~a/lib -lblas
2224PARMETISLIB = -L~a/lib \
2225 -lptscotchparmetis -lptscotch -lptscotcherr -lptscotcherrexit \
2226 -lscotch -lscotcherr -lscotcherrexit
2227METISLIB = -L~:*~a/lib \
2228 -lscotchmetis -lscotch -lscotcherr -lscotcherrexit
2229LIBS = $(DSUPERLULIB) $(PARMETISLIB) $(METISLIB) $(BLASLIB)
2230ARCH = ar
2231ARCHFLAGS = cr
2232RANLIB = ranlib
2233CC = mpicc
2234PIC = -fPIC
2235CFLAGS = -O3 -g -DPRNTlevel=0 $(PIC)
2236NOOPTS = -O0 -g $(PIC)
2237FORTRAN = mpifort
2238FFLAGS = -O2 -g $(PIC)
2239LOADER = $(CC)
2240CDEFS = -DAdd_"
dc1d3cde
KK
2241 (getcwd)
2242 (assoc-ref outputs "out")
2243 (assoc-ref inputs "lapack")
2244 (assoc-ref inputs "pt-scotch"))))
2245 #t))
2246 (add-after 'unpack 'remove-broken-symlinks
2247 (lambda _
2248 (for-each delete-file
2249 (find-files "MAKE_INC" "\\.#make\\..*"))
2250 #t))
2251 (add-before 'build 'create-install-directories
2252 (lambda* (#:key outputs #:allow-other-keys)
2253 (for-each
2254 (lambda (dir)
2255 (mkdir-p (string-append (assoc-ref outputs "out")
2256 "/" dir)))
2257 '("lib" "include"))
2258 #t))
bbe46a4a
EB
2259 (add-before 'check 'mpi-setup
2260 ,%openmpi-setup)
dc1d3cde 2261 (replace 'check
a54aefea
EB
2262 (lambda _
2263 (with-directory-excursion "EXAMPLE"
e02a9975
TGR
2264 (invoke "mpirun" "-n" "2"
2265 "./pddrive" "-r" "1" "-c" "2" "g20.rua")
2266 (invoke "mpirun" "-n" "2"
2267 "./pzdrive" "-r" "1" "-c" "2" "cg20.cua"))
2268 #t))
dc1d3cde
KK
2269 (replace 'install
2270 (lambda* (#:key outputs #:allow-other-keys)
2271 ;; Library is placed in lib during the build phase. Copy over
2272 ;; headers to include.
2273 (let* ((out (assoc-ref outputs "out"))
2274 (incdir (string-append out "/include")))
2275 (for-each (lambda (file)
2276 (let ((base (basename file)))
2277 (format #t "installing `~a' to `~a'~%"
2278 base incdir)
2279 (copy-file file
2280 (string-append incdir "/" base))))
2281 (find-files "SRC" ".*\\.h$")))
2282 #t)))))
a54aefea
EB
2283 (home-page (package-home-page superlu))
2284 (synopsis "Parallel supernodal direct solver")
2285 (description
2286 "SuperLU_DIST is a parallel extension to the serial SuperLU library.
2287It is targeted for distributed memory parallel machines. SuperLU_DIST is
2288implemented in ANSI C, and MPI for communications.")
2289 (license license:bsd-3)))
2290
f8ed036a
EB
2291(define-public scotch
2292 (package
2293 (name "scotch")
d98e9009 2294 (version "6.0.5a")
f8ed036a
EB
2295 (source
2296 (origin
2297 (method url-fetch)
1dc31097
TGR
2298 (uri (string-append "https://gforge.inria.fr/frs/download.php/"
2299 "latestfile/298/scotch_" version ".tar.gz"))
f8ed036a 2300 (sha256
d98e9009 2301 (base32 "0vsmgjz8qv80di3ljmc7hbdsizxxxwy2b9rgd2fl1mdc6dgbj8av"))
fc1adab1 2302 (patches (search-patches "scotch-test-threading.patch"
d98e9009
EB
2303 "scotch-build-parallelism.patch"
2304 "scotch-graph-induce-type-64.patch"
2305 "scotch-graph-diam-64.patch"))))
f8ed036a
EB
2306 (build-system gnu-build-system)
2307 (inputs
2308 `(("zlib" ,zlib)
5e54f4ad 2309 ("flex" ,flex)
f8ed036a
EB
2310 ("bison" ,bison)))
2311 (arguments
2312 `(#:phases
d6602ee9
EB
2313 (modify-phases %standard-phases
2314 (add-after
2315 'unpack 'chdir-to-src
d67a7e9e 2316 (lambda _ (chdir "src") #t))
d6602ee9
EB
2317 (replace
2318 'configure
2319 (lambda _
2320 (call-with-output-file "Makefile.inc"
2321 (lambda (port)
2322 (format port "
f8ed036a
EB
2323EXE =
2324LIB = .a
2325OBJ = .o
2326MAKE = make
2327AR = ar
2328ARFLAGS = -ruv
cf0ec6c4 2329CAT = cat
f8ed036a
EB
2330CCS = gcc
2331CCP = mpicc
2332CCD = gcc
2333CPPFLAGS =~{ -D~a~}
6c798540 2334CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
f8ed036a
EB
2335LDFLAGS = -lz -lm -lrt -lpthread
2336CP = cp
2337LEX = flex -Pscotchyy -olex.yy.c
2338LN = ln
2339MKDIR = mkdir
2340MV = mv
2341RANLIB = ranlib
2342YACC = bison -pscotchyy -y -b y
2343"
d6602ee9
EB
2344 '("COMMON_FILE_COMPRESS_GZ"
2345 "COMMON_PTHREAD"
2346 "COMMON_RANDOM_FIXED_SEED"
26599d69 2347 "INTSIZE64" ;use 'long' instead of 'int'
cf0ec6c4
EB
2348 ;; Prevents symbolc clashes with libesmumps
2349 "SCOTCH_RENAME"
d6602ee9
EB
2350 ;; XXX: Causes invalid frees in superlu-dist tests
2351 ;; "SCOTCH_PTHREAD"
2352 ;; "SCOTCH_PTHREAD_NUMBER=2"
d67a7e9e
TGR
2353 "restrict=__restrict"))))
2354 #t))
bbe46a4a 2355 (add-after 'build 'build-esmumps
cf0ec6c4 2356 (lambda _
d67a7e9e
TGR
2357 (invoke "make"
2358 (format #f "-j~a" (parallel-job-count))
2359 "esmumps")))
d6602ee9 2360 (replace
f8ed036a
EB
2361 'install
2362 (lambda* (#:key outputs #:allow-other-keys)
2363 (let ((out (assoc-ref outputs "out")))
2364 (mkdir out)
d67a7e9e
TGR
2365 (invoke "make"
2366 (string-append "prefix=" out)
2367 "install")
cf0ec6c4
EB
2368 ;; esmumps files are not installed with the above
2369 (for-each (lambda (f)
2370 (copy-file f (string-append out "/include/" f)))
2371 (find-files "../include" ".*esmumps.h$"))
2372 (for-each (lambda (f)
2373 (copy-file f (string-append out "/lib/" f)))
d67a7e9e
TGR
2374 (find-files "../lib" "^lib.*esmumps.*"))
2375 #t))))))
f8ed036a
EB
2376 (home-page "http://www.labri.fr/perso/pelegrin/scotch/")
2377 (synopsis "Programs and libraries for graph algorithms")
2378 (description "SCOTCH is a set of programs and libraries which implement
2379the static mapping and sparse matrix reordering algorithms developed within
2380the SCOTCH project. Its purpose is to apply graph theory, with a divide and
2381conquer approach, to scientific computing problems such as graph and mesh
2382partitioning, static mapping, and sparse matrix ordering, in application
2383domains ranging from structural mechanics to operating systems or
2384bio-chemistry.")
2385 ;; See LICENSE_en.txt
2386 (license license:cecill-c)))
6acb4adb 2387
1c39f3b8
PG
2388(define-public scotch32
2389 ;; This is the 'INTSIZE32' variant, which uses 32-bit integers, as needed by
2390 ;; some applications.
2391 (package (inherit scotch)
2392 (name "scotch32")
2393 (arguments
2394 (substitute-keyword-arguments (package-arguments scotch)
2395 ((#:phases scotch-phases)
2396 `(modify-phases ,scotch-phases
2397 (replace
2398 'configure
2399 (lambda _
2400 (call-with-output-file "Makefile.inc"
2401 (lambda (port)
2402 (format port "
2403EXE =
2404LIB = .a
2405OBJ = .o
2406MAKE = make
2407AR = ar
2408ARFLAGS = -ruv
2409CAT = cat
2410CCS = gcc
2411CCP = mpicc
2412CCD = gcc
2413CPPFLAGS =~{ -D~a~}
2414CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
2415LDFLAGS = -lz -lm -lrt -lpthread
2416CP = cp
2417LEX = flex -Pscotchyy -olex.yy.c
2418LN = ln
2419MKDIR = mkdir
2420MV = mv
2421RANLIB = ranlib
2422YACC = bison -pscotchyy -y -b y
2423"
2424 '("COMMON_FILE_COMPRESS_GZ"
2425 "COMMON_PTHREAD"
2426 "COMMON_RANDOM_FIXED_SEED"
2427 "INTSIZE32" ;use 32-bit integers. See INSTALL.txt
2428 ;; Prevents symbolc clashes with libesmumps
2429 "SCOTCH_RENAME"
2430 ;; XXX: Causes invalid frees in superlu-dist tests
2431 ;; "SCOTCH_PTHREAD"
2432 ;; "SCOTCH_PTHREAD_NUMBER=2"
2433 "restrict=__restrict"))))))))))
2434 (synopsis
2435 "Programs and libraries for graph algorithms (32-bit integers)")))
2436
6acb4adb
EB
2437(define-public pt-scotch
2438 (package (inherit scotch)
2439 (name "pt-scotch")
2440 (propagated-inputs
2441 `(("openmpi" ,openmpi))) ;Headers include MPI headers
2442 (arguments
2443 (substitute-keyword-arguments (package-arguments scotch)
2444 ((#:phases scotch-phases)
d6602ee9
EB
2445 `(modify-phases ,scotch-phases
2446 (replace
2447 'build
d6602ee9
EB
2448 (lambda _
2449 (and
cf0ec6c4
EB
2450 (zero? (system* "make"
2451 (format #f "-j~a" (parallel-job-count))
2452 "ptscotch" "ptesmumps"))
d6602ee9
EB
2453 ;; Install the serial metis compatibility library
2454 (zero? (system* "make" "-C" "libscotchmetis" "install")))))
2455 (replace
2456 'check
2457 (lambda _ (zero? (system* "make" "ptcheck"))))))))
6acb4adb 2458 (synopsis "Programs and libraries for graph algorithms (with MPI)")))
5698b8b8 2459
1c25a52c
PG
2460(define-public pt-scotch32
2461 (package (inherit scotch32)
2462 (name "pt-scotch32")
2463 (propagated-inputs
2464 `(("openmpi" ,openmpi))) ;headers include MPI headers
2465 (arguments
c4d4a779
PG
2466 (substitute-keyword-arguments (package-arguments scotch32)
2467 ((#:phases scotch32-phases)
2468 `(modify-phases ,scotch32-phases
1c25a52c
PG
2469 (replace 'build
2470 (lambda _
2471 (and
2472 (zero? (system* "make"
2473 (format #f "-j~a" (parallel-job-count))
2474 "ptscotch" "ptesmumps"))
2475 ;; Install the serial metis compatibility library
2476 (zero? (system* "make" "-C" "libscotchmetis" "install")))))
2477 (replace 'check
2478 (lambda _
2479 (zero? (system* "make" "ptcheck"))))))))
2480 (synopsis
2481 "Programs and libraries for graph algorithms (with MPI and 32-bit integers)")))
2482
aa75ad00
EB
2483(define-public metis
2484 (package
2485 (name "metis")
2486 (version "5.1.0")
2487 (source
2488 (origin
2489 (method url-fetch)
2490 (uri (string-append "http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/"
2491 "metis-" version ".tar.gz"))
2492 (sha256
2493 (base32
2494 "1cjxgh41r8k6j029yxs8msp3z6lcnpm16g5pvckk35kc7zhfpykn"))))
2495 (build-system cmake-build-system)
2496 (inputs
2497 `(("blas" ,openblas)))
2498 (arguments
2499 `(#:tests? #f ;no tests
2500 #:configure-flags `("-DSHARED=ON"
2501 ,(string-append "-DGKLIB_PATH=" (getcwd)
2502 "/metis-" ,version "/GKlib"))))
2503 (home-page "http://glaros.dtc.umn.edu/gkhome/metis/metis/overview")
2504 (synopsis "Graph partitioning and fill-reducing matrix ordering library")
2505 (description
2506 "METIS is a set of serial programs for partitioning graphs, partitioning
2507finite element meshes, and producing fill-reducing orderings for sparse
2508matrices. The algorithms implemented in METIS are based on the multilevel
2509recursive-bisection, multilevel k-way, and multi-constraint partitioning
2510schemes.")
2511 (license license:asl2.0))) ;As of version 5.0.3
2512
700ff222
EB
2513(define-public p4est
2514 (package
2515 (name "p4est")
4150da63 2516 (version "2.0")
700ff222
EB
2517 (source
2518 (origin
2519 (method url-fetch)
2520 (uri (string-append "http://p4est.github.io/release/p4est-"
2521 version ".tar.gz"))
2522 (sha256
2523 (base32
4150da63 2524 "16h267z256kxcxfjs390qqzv19hr58vrj4x8lndb7alnk2vca8n5"))))
700ff222
EB
2525 (build-system gnu-build-system)
2526 (inputs
2527 `(("fortran" ,gfortran)
2528 ("blas" ,openblas)
2529 ("lapack" ,lapack)
2530 ("zlib" ,zlib)))
2531 (arguments
2532 `(#:configure-flags `(,(string-append "BLAS_LIBS=-L"
2533 (assoc-ref %build-inputs "blas")
2534 " -lopenblas")
2535 ,(string-append "LAPACK_LIBS=-L"
2536 (assoc-ref %build-inputs "lapack")
6df2a50a
LC
2537 " -llapack"))
2538 #:phases (modify-phases %standard-phases
bbe46a4a
EB
2539 (add-before 'check 'mpi-setup
2540 ,%openmpi-setup))))
700ff222
EB
2541 (home-page "http://www.p4est.org")
2542 (synopsis "Adaptive mesh refinement on forests of octrees")
2543 (description
2544 "The p4est software library enables the dynamic management of a
2545collection of adaptive octrees, conveniently called a forest of octrees.
2546p4est is designed to work in parallel and scales to hundreds of thousands of
2547processor cores.")
2548 (license license:gpl2+)))
2549
2550(define-public p4est-openmpi
2551 (package (inherit p4est)
2552 (name "p4est-openmpi")
2553 (inputs
2554 `(("mpi" ,openmpi)
2555 ,@(package-inputs p4est)))
2556 (arguments
2557 (substitute-keyword-arguments (package-arguments p4est)
2558 ((#:configure-flags cf)
2559 ``("--enable-mpi" ,@,cf))))
2560 (synopsis "Parallel adaptive mesh refinement on forests of octrees")))
2561
5698b8b8
JD
2562(define-public gsegrafix
2563 (package
2564 (name "gsegrafix")
2565 (version "1.0.6")
2566 (source
2567 (origin
2568 (method url-fetch)
2569 (uri (string-append "mirror://gnu/" name "/" name "-"
2570 version ".tar.gz"))
2571 (sha256
2572 (base32
2573 "1b13hvx063zv970y750bx41wpx6hwd5ngjhbdrna8w8yy5kmxcda"))))
2574 (build-system gnu-build-system)
2575 (arguments
2576 `(#:configure-flags '("LDFLAGS=-lm")))
2577 (inputs
2578 `(("libgnomecanvas" ,libgnomecanvas)
2579 ("libbonoboui" ,libbonoboui)
2580 ("libgnomeui" ,libgnomeui)
2581 ("libgnomeprintui" ,libgnomeprintui)
2582 ("popt" ,popt)))
2583 (native-inputs
2584 `(("pkg-config" ,pkg-config)))
6fd52309 2585 (home-page "https://www.gnu.org/software/gsegrafix/")
5698b8b8
JD
2586 (synopsis "GNOME application to create scientific and engineering plots")
2587 (description "GSEGrafix is an application which produces high-quality graphical
2588plots for science and engineering. Plots are specified via simple ASCII
2589parameter files and data files and are presented in an anti-aliased GNOME
2590canvas. The program supports rectangular two-dimensional plots, histograms,
2591polar-axis plots and three-dimensional plots. Plots can be printed or saved
2592to BMP, JPEG or PNG image formats.")
2593 (license license:gpl3+)))
8731e527
JD
2594
2595(define-public maxima
2596 (package
2597 (name "maxima")
b3b2efc8 2598 (version "5.41.0")
8731e527
JD
2599 (source
2600 (origin
2601 (method url-fetch)
2602 (uri (string-append "mirror://sourceforge/maxima/Maxima-source/"
2603 version "-source/" name "-" version ".tar.gz"))
2604 (sha256
2605 (base32
b3b2efc8 2606 "0x0n81z0s4pl8nwpf7ivlsbvsdphm9w42250g7qdkizl0132by6s"))
fc1adab1 2607 (patches (search-patches "maxima-defsystem-mkdir.patch"))))
8731e527 2608 (build-system gnu-build-system)
df354a77 2609 (inputs
6b2eafaa 2610 `(("gcl" ,gcl)
df354a77 2611 ("gnuplot" ,gnuplot) ;for plots
f36afe4d 2612 ("tk" ,tk))) ;Tcl/Tk is used by 'xmaxima'
df354a77
FB
2613 (native-inputs
2614 `(("texinfo" ,texinfo)
ccbc5758
KK
2615 ("perl" ,perl)
2616 ("python" ,python)))
8731e527 2617 (arguments
df354a77
FB
2618 `(#:configure-flags
2619 (list "--enable-gcl"
2620 (string-append "--with-posix-shell="
2621 (assoc-ref %build-inputs "bash")
2622 "/bin/sh")
2623 (string-append "--with-wish="
2624 (assoc-ref %build-inputs "tk")
2625 "/bin/wish"
2626 (let ((v ,(package-version tk)))
2627 (string-take v (string-index-right v #\.)))))
df354a77 2628 ;; By default Maxima attempts to write temporary files to
77af7b24
MW
2629 ;; '/tmp/nix-build-maxima-*', which won't exist at run time.
2630 ;; Work around that.
df354a77 2631 #:make-flags (list "TMPDIR=/tmp")
0093b126
KK
2632 #:phases
2633 (modify-phases %standard-phases
2634 (add-before 'check 'pre-check
2635 (lambda _
2636 (chmod "src/maxima" #o555)
2637 #t))
2638 ;; Make sure the doc and emacs files are found in the
2639 ;; standard location. Also configure maxima to find gnuplot
2640 ;; without having it on the PATH.
2641 (add-after 'install 'post-install
2642 (lambda* (#:key outputs inputs #:allow-other-keys)
2643 (let* ((gnuplot (assoc-ref inputs "gnuplot"))
2644 (out (assoc-ref outputs "out"))
2645 (datadir (string-append out "/share/maxima/" ,version))
2646 (binutils (string-append (assoc-ref inputs "binutils")
2647 "/bin")))
2648 (with-directory-excursion out
2649 (mkdir-p "share/emacs")
2650 (mkdir-p "share/doc")
2651 (symlink
2652 (string-append datadir "/emacs/")
2653 (string-append out "/share/emacs/site-lisp"))
2654 (symlink
2655 (string-append datadir "/doc/")
2656 (string-append out "/share/doc/maxima"))
2657 (with-atomic-file-replacement
2658 (string-append datadir "/share/maxima-init.lisp")
2659 (lambda (in out)
2660 (format out "~a ~s~a~%"
2661 "(setf $gnuplot_command "
2662 (string-append gnuplot "/bin/gnuplot") ")")
2663 (dump-port in out))))
2664 ;; Ensure that Maxima will have access to the GNU binutils
2665 ;; components at runtime.
2666 (wrap-program (string-append out "/bin/maxima")
2667 `("PATH" prefix (,binutils))))
2668 #t)))))
8731e527
JD
2669 (home-page "http://maxima.sourceforge.net")
2670 (synopsis "Numeric and symbolic expression manipulation")
2671 (description "Maxima is a system for the manipulation of symbolic and
2672numerical expressions. It yields high precision numeric results by using
2673exact fractions, arbitrary precision integers, and variable precision floating
e881752c 2674point numbers.")
8731e527
JD
2675 ;; Some files are lgpl2.1+. Some are gpl2+. Some explicitly state gpl1+.
2676 ;; Others simply say "GNU General Public License" without stating a
2677 ;; version (which implicitly means gpl1+).
2678 ;; At least one file (src/maxima.asd) says "version 2."
2679 ;; GPLv2 only is therefore the smallest subset.
f36afe4d 2680 (license license:gpl2)))
ec322be2 2681
9aafbc0c
MW
2682(define-public wxmaxima
2683 (package
2684 (name "wxmaxima")
0181df53 2685 (version "18.02.0")
9aafbc0c
MW
2686 (source
2687 (origin
2688 (method url-fetch)
5143517c
KK
2689 (uri (string-append "https://github.com/andrejv/" name "/archive"
2690 "/Version-" version ".tar.gz"))
2691 (file-name (string-append name "-" version ".tar.gz"))
9aafbc0c
MW
2692 (sha256
2693 (base32
0181df53
KK
2694 "03kr2rgfp4hcf3is8m8d8f9hj660c3xgrc50vrrfpixx4syh6wvj"))
2695 (patches
2696 (search-patches "wxmaxima-do-not-use-old-gnuplot-parameters.patch"))))
2697 (build-system cmake-build-system)
5143517c 2698 (native-inputs
0181df53 2699 `(("gettext" ,gettext-minimal)))
9aafbc0c
MW
2700 (inputs
2701 `(("wxwidgets" ,wxwidgets)
de477809
SB
2702 ("maxima" ,maxima)
2703 ;; Runtime support.
2704 ("adwaita-icon-theme" ,adwaita-icon-theme)
2705 ("gtk+" ,gtk+)
2706 ("shared-mime-info" ,shared-mime-info)))
9aafbc0c 2707 (arguments
0181df53
KK
2708 `(#:tests? #f ; no check target
2709 #:phases
ac2ddcc6 2710 (modify-phases %standard-phases
ac2ddcc6
KK
2711 (add-after 'install 'wrap-program
2712 (lambda* (#:key inputs outputs #:allow-other-keys)
2713 (wrap-program (string-append (assoc-ref outputs "out")
2714 "/bin/wxmaxima")
2715 `("PATH" ":" prefix
2716 (,(string-append (assoc-ref inputs "maxima")
2717 "/bin")))
2718 ;; For GtkFileChooserDialog.
2719 `("GSETTINGS_SCHEMA_DIR" =
2720 (,(string-append (assoc-ref inputs "gtk+")
2721 "/share/glib-2.0/schemas")))
2722 `("XDG_DATA_DIRS" ":" prefix
2723 (;; Needed by gdk-pixbuf to know supported icon formats.
2724 ,(string-append
2725 (assoc-ref inputs "shared-mime-info") "/share")
2726 ;; The default icon theme of GTK+.
2727 ,(string-append
2728 (assoc-ref inputs "adwaita-icon-theme") "/share"))))
2729 #t)))))
9aafbc0c
MW
2730 (home-page "https://andrejv.github.io/wxmaxima/")
2731 (synopsis "Graphical user interface for the Maxima computer algebra system")
2732 (description
2733 "wxMaxima is a graphical user interface for the Maxima computer algebra
2734system. It eases the use of Maxima by making most of its commands available
2735through a menu system and by providing input dialogs for commands that require
2736more than one argument. It also implements its own display engine that
2737outputs mathematical symbols directly instead of depicting them with ASCII
2738characters.
2739
2740wxMaxima also features 2D and 3D inline plots, simple animations, mixing of
2741text and mathematical calculations to create documents, exporting of input and
2742output to TeX, and a browser for Maxima's manual including command index and
2743full text searching.")
2744 (license license:gpl2+)))
2745
b15e47f9
RW
2746(define-public armadillo
2747 (package
2748 (name "armadillo")
f133e244 2749 (version "9.100.5")
b15e47f9
RW
2750 (source (origin
2751 (method url-fetch)
2752 (uri (string-append "mirror://sourceforge/arma/armadillo-"
7397cd9e 2753 version ".tar.xz"))
b15e47f9
RW
2754 (sha256
2755 (base32
f133e244 2756 "1ka1vd9fcmvp12qkcm4888dkfqwnalvv00x04wy29f3nx3qwczby"))))
b15e47f9 2757 (build-system cmake-build-system)
e405c0bc 2758 (arguments `(#:tests? #f)) ; no test target
b15e47f9
RW
2759 (inputs
2760 `(("openblas" ,openblas)
2761 ("lapack" ,lapack)
2762 ("arpack" ,arpack-ng)))
2763 (home-page "http://arma.sourceforge.net/")
2764 (synopsis "C++ linear algebra library")
2765 (description
2766 "Armadillo is a C++ linear algebra library, aiming towards a good balance
2767between speed and ease of use. It is useful for algorithm development
2768directly in C++, or quick conversion of research code into production
2769environments. It can be used for machine learning, pattern recognition,
2770signal processing, bioinformatics, statistics, econometrics, etc. The library
2771provides efficient classes for vectors, matrices and cubes, as well as 150+
2772associated functions (eg. contiguous and non-contiguous submatrix views).")
fe418cc5 2773 (license license:asl2.0)))
b15e47f9 2774
279663ef 2775(define-public muparser
d7cff656
LF
2776 ;; When switching download sites, muparser re-issued a 2.2.5 release with a
2777 ;; different hash. In order to make `guix package --upgrade` work correctly,
2778 ;; we set a Guix packaging revision.
2779 ;; When the next version of muparser is released, we can remove
2780 ;; UPSTREAM-VERSION and REVISION and use the plain VERSION.
2781 (let ((upstream-version "2.2.5")
2782 (revision "2"))
2783 (package
2784 (name "muparser")
2785 (version (string-append upstream-version "-" revision))
2786 (source
2787 (origin
2788 (method url-fetch)
2789 (uri (string-append "https://github.com/beltoforion/muparser/archive/v"
2790 upstream-version ".tar.gz"))
2791 (file-name (string-append name "-" version ".tar.gz"))
2792 (sha256
2793 (base32
2794 "0277qsi5l23jsck1vhn383bmvc2n9l4a1dl5r9bf7hvjv9ayyrh6"))))
2795 (build-system gnu-build-system)
2796 (arguments
2797 `(#:configure-flags '("--enable-samples=no")
2798 #:tests? #f)) ;no "check" target
2799 (home-page "http://muparser.beltoforion.de/")
2800 (synopsis "Fast parser library for mathematical expressions")
2801 (description
2802 "muParser is an extensible high performance math parser library. It is
2803based on transforming an expression into a bytecode and precalculating constant
2804parts of it.")
2805 (license license:expat))))
279663ef 2806
e73b49fb
RW
2807(define-public openblas
2808 (package
2809 (name "openblas")
f419abea 2810 (version "0.3.2")
e73b49fb
RW
2811 (source
2812 (origin
2813 (method url-fetch)
a617fd55
MB
2814 (uri (string-append "mirror://sourceforge/openblas/v" version "/OpenBLAS%20"
2815 version "%20version.tar.gz"))
e73b49fb
RW
2816 (file-name (string-append name "-" version ".tar.gz"))
2817 (sha256
2818 (base32
f419abea 2819 "0b20km2jv7m6qiylrlvhq2vnmkmilb633mr8rhqmgbn1wqrp58jq"))))
e73b49fb
RW
2820 (build-system gnu-build-system)
2821 (arguments
5789566a 2822 `(#:test-target "test"
bd0b4379
RW
2823 ;; DYNAMIC_ARCH is only supported on x86. When it is disabled and no
2824 ;; TARGET is specified, OpenBLAS will tune itself to the build host, so
2825 ;; we need to disable substitutions.
71923a91
AE
2826 #:substitutable?
2827 ,(let ((system (or (%current-target-system) (%current-system))))
2828 (or (string-prefix? "x86_64" system)
bd0b4379 2829 (string-prefix? "i686" system)
83a34647
EF
2830 (string-prefix? "mips" system)
2831 (string-prefix? "aarch64" system)))
e73b49fb
RW
2832 #:make-flags
2833 (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
2834 "SHELL=bash"
af5b817e
RW
2835 ;; Build the library for all supported CPUs. This allows
2836 ;; switching CPU targets at runtime with the environment variable
2837 ;; OPENBLAS_CORETYPE=<type>, where "type" is a supported CPU type.
71923a91
AE
2838 ;; Unfortunately, this is not supported on non-x86 architectures,
2839 ;; where it leads to failed builds.
2840 ,@(let ((system (or (%current-target-system) (%current-system))))
8a637e79
RW
2841 (cond
2842 ((or (string-prefix? "x86_64" system)
71923a91 2843 (string-prefix? "i686" system))
8a637e79
RW
2844 '("DYNAMIC_ARCH=1"))
2845 ;; On MIPS we force the "SICORTEX" TARGET, as for the other
2846 ;; two available MIPS targets special extended instructions
2847 ;; for Loongson cores are used.
2848 ((string-prefix? "mips" system)
2849 '("TARGET=SICORTEX"))
83a34647
EF
2850 ;; On aarch64 force the generic 'armv8-a' target
2851 ((string-prefix? "aarch64" system)
2852 '("TARGET=ARMV8"))
8a637e79 2853 (else '()))))
e73b49fb 2854 ;; no configure script
493937ae
DL
2855 #:phases
2856 (modify-phases %standard-phases
2857 (delete 'configure)
2858 (add-before 'build 'set-extralib
2859 (lambda* (#:key inputs #:allow-other-keys)
2860 ;; Get libgfortran found when building in utest.
2861 (setenv "FEXTRALIB"
2862 (string-append "-L" (assoc-ref inputs "fortran-lib")
2863 "/lib"))
2864 #t)))))
e73b49fb 2865 (inputs
493937ae 2866 `(("fortran-lib" ,gfortran "lib")))
e73b49fb
RW
2867 (native-inputs
2868 `(("cunit" ,cunit)
493937ae 2869 ("fortran" ,gfortran)
e73b49fb
RW
2870 ("perl" ,perl)))
2871 (home-page "http://www.openblas.net/")
2872 (synopsis "Optimized BLAS library based on GotoBLAS")
2873 (description
2874 "OpenBLAS is a BLAS library forked from the GotoBLAS2-1.13 BSD version.")
2875 (license license:bsd-3)))
2876
daa6036f
EB
2877(define-public openblas-ilp64
2878 (package (inherit openblas)
2879 (name "openblas-ilp64")
2880 (supported-systems '("x86_64-linux" "aarch64-linux" "mips64el-linux"))
2881 (arguments
2882 (substitute-keyword-arguments (package-arguments openblas)
2883 ((#:make-flags flags '())
2884 `(append (list "INTERFACE64=1" "LIBNAMESUFFIX=ilp64")
2885 ,flags))))
2886 (synopsis "Optimized BLAS library based on GotoBLAS (ILP64 version)")
2887 (license license:bsd-3)))
2888
5a7deb11
LC
2889(define* (make-blis implementation #:optional substitutable?)
2890 "Return a BLIS package with the given IMPLEMENTATION (see config/ in the
2891source tree for a list of implementations.)
2892
2893SUBSTITUTABLE? determines whether the package is made available as a
2894substitute.
2895
2896Currently the specialization must be selected at configure-time, but work is
2897underway to allow BLIS to select the right optimized kernels at run time:
2898<https://github.com/flame/blis/issues/129>."
2899 (package
2900 (name (if (string=? implementation "reference")
2901 "blis"
2902 (string-append "blis-" implementation)))
2903 (version "0.2.2")
2904 (home-page "https://github.com/flame/blis")
2905 (source (origin
2906 (method git-fetch)
2907 (uri (git-reference (url home-page) (commit version)))
2908 (sha256
2909 (base32
2910 "1wr79a50nm4abhw8w3sn96nmwp5mrzifcigk7khw9qcgyyyqayfh"))
2911 (file-name (git-file-name "blis" version))))
2912 (build-system gnu-build-system)
2913 (arguments
2914 `(#:test-target "test"
2915
2916 #:substitutable? ,substitutable?
2917
2918 #:phases (modify-phases %standard-phases
2919 (replace 'configure
2920 (lambda* (#:key outputs #:allow-other-keys)
2921 ;; This is a home-made 'configure' script.
2922 (let ((out (assoc-ref outputs "out")))
2923 (zero? (system* "./configure" "-p" out
2924 "-d" "opt"
2925 "--disable-static"
2926 "--enable-shared"
2927 "--enable-threading=openmp"
2928
2929 ,implementation)))))
2930 (add-before 'check 'show-test-output
2931 (lambda _
2932 ;; By default "make check" is silent. Make it verbose.
2933 (system "tail -F output.testsuite &")
2934 #t)))))
2935 (synopsis "High-performance basic linear algebra (BLAS) routines")
2936 (description
2937 "BLIS is a portable software framework for instantiating high-performance
2938BLAS-like dense linear algebra libraries. The framework was designed to
2939isolate essential kernels of computation that, when optimized, immediately
2940enable optimized implementations of most of its commonly used and
2941computationally intensive operations. While BLIS exports a new BLAS-like API,
2942it also includes a BLAS compatibility layer which gives application developers
2943access to BLIS implementations via traditional BLAS routine calls.")
2944 (license license:bsd-3)))
2945
2946(define-public blis
2947 ;; This is the "reference" implementation, which is the non-optimized but
2948 ;; portable variant (no assembly).
2949 (make-blis "reference" #t))
2950
2951(define ignorance blis)
2952
2953(define-syntax-rule (blis/x86_64 processor)
2954 "Expand to a package specialized for PROCESSOR."
2955 (package
2956 (inherit (make-blis processor))
2957 (supported-systems '("x86_64-linux"))))
2958
2959(define-public blis-sandybridge
2960 ;; BLIS specialized for Sandy Bridge processors (launched 2011):
2961 ;; <http://ark.intel.com/products/codename/29900/Sandy-Bridge>.
2962 (blis/x86_64 "sandybridge"))
2963
2964(define-public blis-haswell
2965 ;; BLIS specialized for Haswell processors (launched 2013):
2966 ;; <http://ark.intel.com/products/codename/42174/Haswell>.
2967 (blis/x86_64 "haswell"))
2968
2969(define-public blis-knl
2970 ;; BLIS specialized for Knights Landing processor (launched 2016):
2971 ;; <http://ark.intel.com/products/series/92650/Intel-Xeon-Phi-x200-Product-Family>.
2972 (blis/x86_64 "knl"))
2973
2974
e1605e36
RW
2975(define-public openlibm
2976 (package
2977 (name "openlibm")
48d7ac17 2978 (version "0.6.0")
e1605e36
RW
2979 (source
2980 (origin
2981 (method url-fetch)
2982 (uri (string-append "https://github.com/JuliaLang/openlibm/archive/v"
2983 version ".tar.gz"))
2984 (file-name (string-append name "-" version ".tar.gz"))
2985 (sha256
2986 (base32
48d7ac17 2987 "0a5fpm8nra5ldhjk0cqd2rx1qh32wiarkxmcqcm5xl8z7l4kjm6l"))))
e1605e36
RW
2988 (build-system gnu-build-system)
2989 (arguments
2990 `(#:make-flags
2991 (list (string-append "prefix=" (assoc-ref %outputs "out")))
2992 #:phases
2993 ;; no configure script
dc1d3cde 2994 (modify-phases %standard-phases (delete 'configure))
e1605e36
RW
2995 #:tests? #f)) ;the tests are part of the default target
2996 (home-page "http://openlibm.org/")
2997 (synopsis "Portable C mathematical library (libm)")
2998 (description
2999 "OpenLibm is an effort to have a high quality, portable, standalone C
3000mathematical library (libm). It can be used standalone in applications and
3001programming language implementations. The project was born out of a need to
e881752c 3002have a good libm for the Julia programming language that worked consistently
e1605e36
RW
3003across compilers and operating systems, and in 32-bit and 64-bit
3004environments.")
538c0e3b
EF
3005 ;; Each architecture has its own make target, and there is none for mips.
3006 (supported-systems (delete "mips64el-linux" %supported-systems))
e1605e36
RW
3007 ;; See LICENSE.md for details.
3008 (license (list license:expat
3009 license:isc
3010 license:bsd-2
3011 license:public-domain
3012 license:lgpl2.1+))))
3013
e62be58f
RW
3014(define-public openspecfun
3015 (package
3016 (name "openspecfun")
59cd0ba4 3017 (version "0.5.3")
e62be58f
RW
3018 (source
3019 (origin
3020 (method url-fetch)
3021 (uri (string-append "https://github.com/JuliaLang/openspecfun/archive/v"
3022 version ".tar.gz"))
3023 (file-name (string-append name "-" version ".tar.gz"))
3024 (sha256
3025 (base32
59cd0ba4 3026 "1rs1bv8jq751fv9vq79890wqf9xlbjc7lvz3ighzyfczbyjcf18m"))))
e62be58f
RW
3027 (build-system gnu-build-system)
3028 (arguments
59cd0ba4 3029 '(#:tests? #f ; no "check" target
e62be58f
RW
3030 #:make-flags
3031 (list (string-append "prefix=" (assoc-ref %outputs "out")))
59cd0ba4
TGR
3032 #:phases
3033 (modify-phases %standard-phases
3034 (delete 'configure)))) ; no configure script
e62be58f 3035 (inputs
19afbea1 3036 `(("fortran" ,gfortran)))
e62be58f
RW
3037 (home-page "https://github.com/JuliaLang/openspecfun")
3038 (synopsis "Collection of special mathematical functions")
3039 (description
3040 "Openspecfun provides AMOS and Faddeeva. AMOS (from Netlib) is a
3041portable package for Bessel Functions of a Complex Argument and Nonnegative
3042Order; it contains subroutines for computing Bessel functions and Airy
3043functions. Faddeeva allows computing the various error functions of arbitrary
3044complex arguments (Faddeeva function, error function, complementary error
3045function, scaled complementary error function, imaginary error function, and
3046Dawson function); given these, one can also easily compute Voigt functions,
3047Fresnel integrals, and similar related functions as well.")
3048 ;; Faddeeva is released under the Expat license; AMOS is included as
3049 ;; public domain software.
3050 (license (list license:expat license:public-domain))))
3051
2742f87e
RW
3052(define-public suitesparse
3053 (package
3054 (name "suitesparse")
bd5b5ac0 3055 (version "4.5.5")
2742f87e
RW
3056 (source
3057 (origin
3058 (method url-fetch)
3059 (uri (string-append
3060 "http://faculty.cse.tamu.edu/davis/SuiteSparse/SuiteSparse-"
3061 version ".tar.gz"))
3062 (sha256
3063 (base32
bd5b5ac0
EB
3064 "1dnr6pmjzc2qmbkmb4shigx1l74ilf6abn7svyd6brxgvph8vadr"))
3065 (modules '((guix build utils)))
3066 (snippet
3067 ;; Remove bundled metis source
6cbee49d
MW
3068 '(begin
3069 (delete-file-recursively "metis-5.1.0")
3070 #t))))
2742f87e
RW
3071 (build-system gnu-build-system)
3072 (arguments
bd5b5ac0 3073 '(#:tests? #f ;no "check" target
2742f87e
RW
3074 #:make-flags
3075 (list "CC=gcc"
3076 "BLAS=-lblas"
3077 "TBB=-ltbb"
bd5b5ac0 3078 "MY_METIS_LIB=-lmetis"
2742f87e
RW
3079 (string-append "INSTALL_LIB="
3080 (assoc-ref %outputs "out") "/lib")
3081 (string-append "INSTALL_INCLUDE="
bd5b5ac0
EB
3082 (assoc-ref %outputs "out") "/include")
3083 "library")
2742f87e 3084 #:phases
2509522c 3085 (modify-phases %standard-phases
bd5b5ac0 3086 (delete 'configure)))) ;no configure script
2742f87e
RW
3087 (inputs
3088 `(("tbb" ,tbb)
bd5b5ac0
EB
3089 ("lapack" ,lapack)
3090 ("metis" ,metis)))
2742f87e
RW
3091 (home-page "http://faculty.cse.tamu.edu/davis/suitesparse.html")
3092 (synopsis "Suite of sparse matrix software")
3093 (description
3094 "SuiteSparse is a suite of sparse matrix algorithms, including: UMFPACK,
3095multifrontal LU factorization; CHOLMOD, supernodal Cholesky; SPQR,
3096multifrontal QR; KLU and BTF, sparse LU factorization, well-suited for circuit
3097simulation; ordering methods (AMD, CAMD, COLAMD, and CCOLAMD); CSparse and
3098CXSparse, a concise sparse Cholesky factorization package; and many other
3099packages.")
3100 ;; LGPLv2.1+:
3101 ;; AMD, CAMD, BTF, COLAMD, CCOLAMD, CSparse, CXSparse, KLU, LDL
3102 ;; GPLv2+:
3103 ;; GPUQREngine, RBio, SuiteSparse_GPURuntime, SuiteSparseQR, UMFPACK
3104 (license (list license:gpl2+ license:lgpl2.1+))))
3105
ec322be2
FB
3106(define-public atlas
3107 (package
3108 (name "atlas")
3c98ac02 3109 (version "3.10.3")
ec322be2
FB
3110 (source (origin
3111 (method url-fetch)
de67e922
LF
3112 (uri (string-append "mirror://sourceforge/math-atlas/Stable/"
3113 version "/atlas" version ".tar.bz2"))
ec322be2
FB
3114 (sha256
3115 (base32
3c98ac02 3116 "1dyjlq3fiparvm8ypwk6rsmjzmnwk81l88gkishphpvc79ryp216"))))
ec322be2
FB
3117 (build-system gnu-build-system)
3118 (home-page "http://math-atlas.sourceforge.net/")
19afbea1 3119 (inputs `(("gfortran" ,gfortran)
ec322be2
FB
3120 ("lapack-tar" ,(package-source lapack))))
3121 (outputs '("out" "doc"))
01480b9e
FB
3122 ;; For the moment we drop support for MIPS at it fails to compile. See
3123 ;; https://lists.gnu.org/archive/html/guix-devel/2014-11/msg00516.html
3124 (supported-systems (delete "mips64el-linux" %supported-systems))
ec322be2
FB
3125 (arguments
3126 `(#:parallel-build? #f
3127 #:parallel-tests? #f
f15615b1
LC
3128
3129 ;; ATLAS tunes itself for the machine it is built on, as explained at
3130 ;; <http://lists.gnu.org/archive/html/guix-devel/2014-10/msg00305.html>.
3131 ;; For this reason, we want users to build it locally instead of using
3132 ;; substitutes.
3133 #:substitutable? #f
3134
ec322be2
FB
3135 #:modules ((srfi srfi-26)
3136 (srfi srfi-1)
3137 (guix build gnu-build-system)
3138 (guix build utils))
40029cbe 3139 #:configure-flags
ec322be2
FB
3140 `(;; Generate position independent code suitable for dynamic libraries
3141 ;; and use WALL timer to get more accurate timing.
3142 "-Fa" "alg" "-fPIC" "-D" "c" "-DWALL"
3143 ;; Set word width.
3144 "-b"
3145 ,,(if (string-match "64" (%current-system))
3146 "64"
3147 "32")
3148 ;; Disable parallel build as it gives errors: atlas_pthread.h is
3149 ;; needed to compile C files before it is generated.
3150 "-Ss" "pmake" "make -j 1"
af89a667
FB
3151 ;; Probe is failing for MIPS. We therefore define the system
3152 ;; architecture explicitly by setting (-A) MACHINETYPE = 49
3153 ;; 'MIPSR1xK' and (-V) ISA = 1 'none'.
3154 ,,@(if (string-prefix? "mips" (%current-system))
3155 (list "-A" "49" "-V" "1")
3156 (list))
ec322be2
FB
3157 ;; Generate shared libraries.
3158 "--shared"
3159 ;; Build a full LAPACK library.
3160 ,(string-append "--with-netlib-lapack-tarfile="
3161 (assoc-ref %build-inputs "lapack-tar")))
3162 #:phases
e5b4b96b
EF
3163 (modify-phases %standard-phases
3164 (add-after 'install 'install-doc
3165 (lambda* (#:key outputs inputs #:allow-other-keys)
3166 (let ((doc (string-append (assoc-ref outputs "doc")
3167 "/share/doc/atlas")))
3168 (mkdir-p doc)
3169 (fold (lambda (file previous)
3170 (and previous (zero? (system* "cp" file doc))))
3171 #t (find-files "../ATLAS/doc" ".*")))))
3172 (add-after 'check 'check-pt
3173 (lambda _ (zero? (system* "make" "ptcheck"))))
3174 ;; Fix files required to run configure.
3175 (add-before 'configure 'fix-/bin/sh
ec322be2
FB
3176 (lambda _
3177 ;; Use `sh', not `/bin/sh'.
3178 (substitute* (find-files "." "Makefile|configure|SpewMakeInc\\.c")
3179 (("/bin/sh")
e5b4b96b
EF
3180 "sh"))))
3181 ;; Fix /bin/sh in generated make files.
3182 (add-after 'configure 'fix-/bin/sh-in-generated-files
3183 (lambda _
3184 (substitute* (find-files "." "^[Mm]ake\\.inc.*")
3185 (("/bin/sh")
3186 "sh"))))
3187 ;; ATLAS configure program does not accepts the default flags
3188 ;; passed by the 'gnu-build-system'.
3189 (replace 'configure
3190 (lambda* (#:key native-inputs inputs outputs
3191 (configure-flags '())
3192 #:allow-other-keys #:rest args)
3193 (let* ((prefix (assoc-ref outputs "out"))
3194 (bash (or (and=> (assoc-ref
3195 (or native-inputs inputs) "bash")
3196 (cut string-append <> "/bin/bash"))
3197 "/bin/sh"))
3198 (flags `(,(string-append "--prefix=" prefix)
3199 ,@configure-flags))
3200 (abs-srcdir (getcwd))
3201 (srcdir (string-append "../" (basename abs-srcdir))))
3202 (format #t "source directory: ~s (relative from build: ~s)~%"
3203 abs-srcdir srcdir)
3204 (mkdir "../build")
3205 (chdir "../build")
3206 (format #t "build directory: ~s~%" (getcwd))
3207 (format #t "configure flags: ~s~%" flags)
3208 (zero? (apply system* bash
3209 (string-append srcdir "/configure")
3210 flags))))))))
ec322be2
FB
3211 (synopsis "Automatically Tuned Linear Algebra Software")
3212 (description
3213 "ATLAS is an automatically tuned linear algebra software library
3214providing C and Fortran77 interfaces to a portably efficient BLAS
3215implementation, as well as a few routines from LAPACK.
3216
f15615b1
LC
3217Optimization occurs at build time. For this reason, the library is built on
3218the machine where it is installed, without resorting to pre-built substitutes.
ec322be2 3219
f15615b1 3220Before building the library, CPU throttling should be disabled. This can be
d97c429a 3221done in the BIOS, or, on GNU/Linux, with the following command:
ec322be2 3222
8e9ba611 3223@example
d97c429a 3224# cpupower --governor performance
8e9ba611 3225@end example
ec322be2 3226
d97c429a 3227Failure to do so will result in a library with poor performance.")
ec322be2 3228 (license license:bsd-3)))
c12efc72
AE
3229
3230(define-public glm
3231 (package
3232 (name "glm")
4d679255 3233 (version "0.9.9.2")
c12efc72
AE
3234 (source
3235 (origin
3236 (method url-fetch)
5ea4b594
MB
3237 (uri (string-append "https://github.com/g-truc/glm/releases/download/"
3238 version "/glm-" version ".zip"))
c12efc72
AE
3239 (sha256
3240 (base32
4d679255 3241 "1m2gws1d7l6h4mdn0ap74pfnm3vva3kk8rybdqd5x4lksd1mk6r0"))))
c12efc72
AE
3242 (build-system cmake-build-system)
3243 (native-inputs
3244 `(("unzip" ,unzip)))
46bda5eb 3245 (home-page "https://glm.g-truc.net/")
c12efc72
AE
3246 (synopsis "OpenGL Mathematics library")
3247 (description "OpenGL Mathematics (GLM) is a header-only C++ mathematics
3248library for graphics software based on the OpenGL Shading Language (GLSL)
3249specifications.")
3250 (license license:expat)))
7f18257b
AE
3251
3252(define-public lpsolve
3253 (package
3254 (name "lpsolve")
a89e0cf5 3255 (version "5.5.2.5")
7f18257b
AE
3256 (source
3257 (origin
3258 (method url-fetch)
3259 (uri (string-append "mirror://sourceforge/lpsolve/lpsolve/" version
3260 "/lp_solve_" version "_source.tar.gz"))
3261 (sha256
3262 (base32
a89e0cf5 3263 "12pj1idjz31r7c2mb5w03vy1cmvycvbkx9z29s40qdmkp1i7q6i0"))
7f18257b
AE
3264 (modules '((guix build utils)))
3265 (snippet
6cbee49d
MW
3266 '(begin
3267 (substitute* (list "lp_solve/ccc" "lpsolve55/ccc")
3268 (("^c=cc") "c=gcc")
3269 ;; Pretend to be on a 64 bit platform to obtain a common directory
3270 ;; name for the build results on all architectures; nothing else
3271 ;; seems to depend on it.
3272 (("^PLATFORM=.*$") "PLATFORM=ux64\n")
3273
3274 ;; The check for 'isnan' as it is written fails with
3275 ;; "non-floating-point argument in call to function
3276 ;; ‘__builtin_isnan’", which leads to the 'NOISNAN' cpp macro
3277 ;; definition, which in turn leads to bad things. Fix the feature
3278 ;; test.
3279 (("isnan\\(0\\)") "isnan(0.)"))
3280 #t))))
7f18257b
AE
3281 (build-system gnu-build-system)
3282 (arguments
6c96b545 3283 `(#:tests? #f ; no check target
7f18257b
AE
3284 #:phases
3285 (modify-phases %standard-phases
6c96b545 3286 (delete 'configure) ; no configure script
7f18257b
AE
3287 (replace 'build
3288 (lambda _
6c96b545
TGR
3289 (with-directory-excursion "lpsolve55"
3290 (invoke "bash" "ccc"))
3291 (with-directory-excursion "lp_solve"
3292 (invoke "bash" "ccc"))
3293 #t))
7f18257b
AE
3294 (replace 'install
3295 (lambda* (#:key outputs #:allow-other-keys)
3296 (let* ((out (assoc-ref outputs "out"))
3297 (bin (string-append out "/bin"))
3298 (lib (string-append out "/lib"))
3299 ;; This is where LibreOffice expects to find the header
3300 ;; files, and where they are installed by Debian.
3301 (include (string-append out "/include/lpsolve")))
6c96b545
TGR
3302 (install-file "lpsolve55/bin/ux64/liblpsolve55.a" lib)
3303 (install-file "lpsolve55/bin/ux64/liblpsolve55.so" lib)
96c46210
LC
3304 (install-file "lp_solve/bin/ux64/lp_solve" bin)
3305
7f18257b
AE
3306 ;; Install a subset of the header files as on Debian
3307 ;; (plus lp_bit.h, which matches the regular expression).
96c46210
LC
3308 (for-each (lambda (name)
3309 (install-file name include))
3310 (find-files "." "lp_[HMSa-z].*\\.h$"))
7f18257b 3311 (with-directory-excursion "shared"
96c46210
LC
3312 (for-each (lambda (name)
3313 (install-file name include))
3314 (find-files "." "\\.h$")))
7f18257b
AE
3315 #t))))))
3316 (home-page "http://lpsolve.sourceforge.net/")
3317 (synopsis "Mixed integer linear programming (MILP) solver")
3318 (description
3319 "lp_solve is a mixed integer linear programming solver based on the
3320revised simplex and the branch-and-bound methods.")
3321 (license license:lgpl2.1+)))
a17d4564
EB
3322
3323(define-public dealii
3324 (package
3325 (name "dealii")
24404eaf 3326 (version "8.5.1")
a17d4564
EB
3327 (source
3328 (origin
3329 (method url-fetch)
3330 (uri (string-append "https://github.com/dealii/dealii/releases/"
3331 "download/v" version "/dealii-" version ".tar.gz"))
3332 (sha256
3333 (base32
24404eaf 3334 "1bh9rsmkrg0zi70n27b11djmac9lximghsiy7mg7w7x544n82gnk"))
a17d4564
EB
3335 (modules '((guix build utils)))
3336 (snippet
3337 ;; Remove bundled sources: UMFPACK, TBB, muParser, and boost
6cbee49d
MW
3338 '(begin
3339 (delete-file-recursively "bundled")
3340 #t))))
a17d4564
EB
3341 (build-system cmake-build-system)
3342 (inputs
3343 `(("tbb" ,tbb)
3344 ("zlib" ,zlib)
3345 ("boost" ,boost)
3346 ("p4est" ,p4est)
3347 ("blas" ,openblas)
3348 ("lapack" ,lapack)
3349 ("arpack" ,arpack-ng)
3350 ("muparser" ,muparser)
3351 ("gfortran" ,gfortran)
3352 ("suitesparse" ,suitesparse))) ;for UMFPACK
3353 (arguments
3354 `(#:build-type "DebugRelease" ;only supports Release, Debug, or DebugRelease
d84b09e9
EB
3355 #:configure-flags
3356 ;; Work around a bug in libsuitesparseconfig linking
3357 ;; see https://github.com/dealii/dealii/issues/4745
3358 '("-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON")))
a17d4564
EB
3359 (home-page "https://www.dealii.org")
3360 (synopsis "Finite element library")
3361 (description
3362 "Deal.II is a C++ program library targeted at the computational solution
3363of partial differential equations using adaptive finite elements. The main
3364aim of deal.II is to enable rapid development of modern finite element codes,
3365using among other aspects adaptive meshes and a wide array of tools often used
3366in finite element programs.")
3367 (license license:lgpl2.1+)))
3368
3369(define-public dealii-openmpi
3370 (package (inherit dealii)
3371 (name "dealii-openmpi")
3372 (inputs
3373 `(("mpi" ,openmpi)
3374 ;;Supported only with MPI:
3375 ("p4est" ,p4est-openmpi)
3376 ("petsc" ,petsc-openmpi)
3377 ("slepc" ,slepc-openmpi)
3378 ("metis" ,metis) ;for MUMPS
3379 ("scalapack" ,scalapack) ;for MUMPS
3380 ("mumps" ,mumps-metis-openmpi) ;configure supports only metis orderings
3381 ("arpack" ,arpack-ng-openmpi)
3382 ,@(fold alist-delete (package-inputs dealii)
3383 '("p4est" "arpack"))))
3384 (arguments
3385 (substitute-keyword-arguments (package-arguments dealii)
3386 ((#:configure-flags cf)
3387 ``("-DMPI_C_COMPILER=mpicc"
3388 "-DMPI_CXX_COMPILER=mpicxx"
3389 "-DMPI_Fortran_COMPILER=mpifort"
3390 ,@,cf))))
3391 (synopsis "Finite element library (with MPI support)")))
194c7f95
AE
3392
3393(define-public flann
3394 (package
3395 (name "flann")
3396 (version "1.8.4")
3397 (source
3398 (origin
3399 (method url-fetch)
3400 (uri
3401 (string-append
3402 "http://www.cs.ubc.ca/research/flann/uploads/FLANN/flann-"
3403 version "-src.zip"))
3404 (sha256
3405 (base32
b5edc479
LC
3406 "022w8hph7bli5zbpnk3z1qh1c2sl5hm8fw2ccim651ynn0hr7fyz"))
3407 (patches (search-patches "flann-cmake-3.11.patch"))))
194c7f95 3408 (build-system cmake-build-system)
6b6aca9b
LC
3409 (outputs '("out"
3410 "octave")) ;46 MiB .mex file that pulls Octave
194c7f95
AE
3411 (native-inputs
3412 `(("unzip" ,unzip)))
3413 (inputs
3414 `(("hdf5" ,hdf5)
3415 ("octave" ,octave)
3416 ("python" ,python-2) ; print syntax
3417 ;; ("python2-numpy" ,python2-numpy) ; only required for the tests
3418 ("zlib" ,zlib)))
3419 (arguments
39b30337
LC
3420 `(;; The 'share/flann/octave' contains a .mex file, which is an ELF file
3421 ;; taken 46 MiB unstripped, and 6 MiB stripped.
3422 #:strip-directories '("lib" "lib64" "libexec"
3423 "bin" "sbin" "share/flann/octave")
3424
9684e30b
LC
3425 ;; Save 12 MiB by not installing .a files. Passing
3426 ;; '-DBUILD_STATIC_LIBS=OFF' has no effect.
3427 #:phases (modify-phases %standard-phases
6b6aca9b
LC
3428 (add-before 'configure 'set-octave-directory
3429 (lambda* (#:key outputs #:allow-other-keys)
3430 ;; Install the .mex file in the "octave" output.
3431 (let ((out (assoc-ref outputs "octave")))
3432 (substitute* "src/matlab/CMakeLists.txt"
3433 (("share/flann/octave")
3434 (string-append out "/share/flann/octave")))
3435 #t)))
9684e30b
LC
3436 (add-after 'install 'remove-static-libraries
3437 (lambda* (#:key outputs #:allow-other-keys)
3438 (let* ((out (assoc-ref outputs "out"))
3439 (lib (string-append out "/lib")))
3440 (for-each delete-file
3441 (find-files lib "\\.a$"))
3442 #t))))
3443
39b30337 3444 #:tests? #f)) ; The test data are downloaded from the Internet.
194c7f95
AE
3445 (home-page "http://www.cs.ubc.ca/research/flann/")
3446 (synopsis "Library for approximate nearest neighbors computation")
3447 (description "FLANN is a library for performing fast approximate
3448nearest neighbor searches in high dimensional spaces. It implements a
3449collection of algorithms and a system for automatically choosing the best
3450algorithm and optimum parameters depending on the dataset.
3451
3452FLANN is written in C++ and contains bindings for C, Octave and Python.")
3453 (license (license:non-copyleft "file://COPYING"
3454 "See COPYING in the distribution."))))
d8c97beb
EF
3455
3456(define-public wcalc
3457 (package
3458 (name "wcalc")
3459 (version "2.5")
3460 (source
3461 (origin
3462 (method url-fetch)
de67e922
LF
3463 (uri (string-append "mirror://sourceforge/w-calc/Wcalc/" version "/"
3464 "wcalc-" version ".tar.bz2"))
d8c97beb
EF
3465 (sha256
3466 (base32
3467 "1vi8dl6rccqiq1apmpwawyg2ywx6a1ic1d3cvkf2hlwk1z11fb0f"))))
3468 (build-system gnu-build-system)
3469 (inputs
3470 `(("mpfr" ,mpfr)
3471 ("readline" ,readline)))
3472 (home-page "http://w-calc.sourceforge.net/index.php")
3473 (synopsis "Flexible command-line scientific calculator")
3474 (description "Wcalc is a very capable calculator. It has standard functions
3475(sin, asin, and sinh for example, in either radians or degrees), many
3476pre-defined constants (pi, e, c, etc.), support for using variables, \"active\"
3477variables, a command history, hex/octal/binary input and output, unit
3478conversions, embedded comments, and an expandable expression entry field. It
3479evaluates expressions using the standard order of operations.")
3480 (license license:gpl2+)))
45147b0c
FH
3481
3482(define-public xaos
3483 (package
3484 (name "xaos")
3485 (version "3.6")
3486 (source (origin
3487 (method url-fetch)
de67e922
LF
3488 (uri (string-append "mirror://sourceforge/xaos/XaoS/" version
3489 "/xaos-" version ".tar.gz"))
45147b0c
FH
3490 (sha256
3491 (base32
3492 "15cd1cx1dyygw6g2nhjqq3bsfdj8sj8m4va9n75i0f3ryww3x7wq"))))
3493 (build-system gnu-build-system)
b94a6ca0 3494 (native-inputs `(("gettext" ,gettext-minimal)))
45147b0c
FH
3495 (inputs `(("libx11" ,libx11)
3496 ("zlib" ,zlib)
3497 ("libpng" ,libpng)
3498 ("gsl" ,gsl)))
3499 (arguments
3500 `(#:tests? #f ;no "check" target
3501 #:make-flags '("LOCALEDIR=$DATAROOTDIR/locale")))
3502 (synopsis "Real-time fractal zoomer")
3503 (description "GNU XaoS is a graphical program that generates fractal
3504patterns and allows you to zoom in and out of them infinitely in a fluid,
3505continuous manner. It also includes tutorials that help to explain how fractals
3506are built. It can generate many different fractal types such as the Mandelbrot
3507set.")
6fd52309 3508 (home-page "https://www.gnu.org/software/xaos/")
45147b0c 3509 (license license:gpl2+)))
528bb464
EB
3510
3511(define-public hypre
3512 (package
3513 (name "hypre")
220458b0 3514 (version "2.14.0")
528bb464
EB
3515 (source (origin
3516 (method url-fetch)
3517 (uri (string-append "https://github.com/LLNL/hypre/archive/"
3518 "v" version ".tar.gz"))
3519 (file-name (string-append name "-" version ".tar.gz"))
3520 (sha256
3521 (base32
220458b0 3522 "0v515i73bvaz378h5465b1dy9v2gf924zy2q94cpq4qqarawvkqh"))
528bb464
EB
3523 (modules '((guix build utils)))
3524 (snippet
3525 '(begin
3526 ;; Remove use of __DATE__ and __TIME__ for reproducibility;
3527 ;; substitute the tarball creation time.
3528 (substitute* "src/utilities/HYPRE_utilities.h"
3529 (("Date Compiled: .*$")
220458b0 3530 "Date Compiled: Apr 11 2018 16:24:59 +0000\"\n"))
528bb464
EB
3531 #t))))
3532 (build-system gnu-build-system)
3533 (outputs '("out" ;6.1 MiB of headers and libraries
3534 "doc")) ;4.8 MiB of documentation
3535 (native-inputs
3536 `(("doc++" ,doc++)
3537 ("netpbm" ,netpbm)
e18e7cb9 3538 ("perl" ,perl) ;needed to run 'ppmquant' during tests
528bb464
EB
3539 ("texlive" ,texlive) ;full package required for fonts
3540 ("ghostscript" ,ghostscript)))
3541 (inputs
3542 `(("blas" ,openblas)
3543 ("lapack" ,lapack)))
3544 (arguments
3545 `(#:modules ((srfi srfi-1)
3546 ,@%gnu-build-system-modules)
3547 #:configure-flags '("--enable-shared"
3548 "--disable-fortran"
3549 "--without-MPI"
3550 "--with-openmp"
3551 "--with-fei"
3552 "--with-lapack"
3553 "--with-blas")
3554 #:phases
3555 (modify-phases %standard-phases
3556 (add-before 'configure 'chdir-src
3557 (lambda _ (chdir "src")))
3558 (replace 'configure
3559 (lambda* (#:key build target configure-flags
3560 #:allow-other-keys #:rest args)
3561 (let* ((configure (assoc-ref %standard-phases 'configure)))
3562 (apply configure
3563 (append args
3564 (list #:configure-flags
3565 (cons (string-append
3566 "--host=" (or target build))
3567 configure-flags)))))))
3568 (add-after 'build 'build-docs
3569 (lambda _
3570 (zero? (system* "make" "-Cdocs" "pdf" "html"))))
3571 (replace 'check
3572 (lambda _
3573 (setenv "LD_LIBRARY_PATH" (string-append (getcwd) "/hypre/lib"))
3574 (setenv "PATH" (string-append "." ":" (getenv "PATH")))
3575 (and (system* "make" "check" "CHECKRUN=")
3576 (fold (lambda (filename result)
3577 (and result
3578 (let ((size (stat:size (stat filename))))
3579 (when (not (zero? size))
3580 (format #t "~a size ~d; error indication~%"
3581 filename size))
3582 (zero? size))))
3583 #t
3584 (find-files "test" ".*\\.err$")))))
3585 (add-after 'install 'install-docs
3586 (lambda* (#:key outputs #:allow-other-keys)
3587 ;; Custom install because docs/Makefile doesn't honor ${docdir}.
3588 (let* ((doc (assoc-ref outputs "doc"))
3589 (docdir (string-append doc "/share/doc/hypre-" ,version)))
528bb464
EB
3590 (with-directory-excursion "docs"
3591 (for-each (lambda (base)
3592 (install-file (string-append base ".pdf") docdir)
3593 (copy-recursively base docdir)) ;html docs
3594 '("HYPRE_usr_manual"
3595 "HYPRE_ref_manual")))
3596 #t))))))
3597 (home-page "http://www.llnl.gov/casc/hypre/")
3598 (synopsis "Library of solvers and preconditioners for linear equations")
3599 (description
3600 "HYPRE is a software library of high performance preconditioners and
3601solvers for the solution of large, sparse linear systems of equations. It
3602features multigrid solvers for both structured and unstructured grid
3603problems.")
3604 (license license:lgpl2.1)))
3605
3606(define-public hypre-openmpi
3607 (package (inherit hypre)
3608 (name "hypre-openmpi")
3609 (inputs
3610 `(("mpi" ,openmpi)
3611 ,@(package-inputs hypre)))
3612 (arguments
3613 (substitute-keyword-arguments (package-arguments hypre)
3614 ((#:configure-flags flags)
3615 ``("--with-MPI"
6df2a50a
LC
3616 ,@(delete "--without-MPI" ,flags)))
3617 ((#:phases phases)
3618 `(modify-phases ,phases
bbe46a4a
EB
3619 (add-before 'check 'mpi-setup
3620 ,%openmpi-setup)))))
528bb464
EB
3621 (synopsis "Parallel solvers and preconditioners for linear equations")
3622 (description
3623 "HYPRE is a software library of high performance preconditioners and
3624solvers for the solution of large, sparse linear systems of equations on
3625parallel computers. It features parallel multigrid solvers for both
3626structured and unstructured grid problems.")))
6c90e183
EB
3627
3628(define-public matio
3629 (package
3630 (name "matio")
3631 (version "1.5.6")
3632 (source
3633 (origin
3634 (method url-fetch)
de67e922 3635 (uri (string-append "mirror://sourceforge/matio/matio/" version "/"
6c90e183
EB
3636 "matio-" version ".tar.gz"))
3637 (sha256
3638 (base32
3639 "0y2qymgxank8wdiwc68ap8bxdzrhvyw86i29yh3xgn4z1njfd9ir"))))
3640 (build-system gnu-build-system)
3641 (inputs
3642 `(("zlib" ,zlib)
3643 ("hdf5" ,hdf5)))
3644 (home-page "http://matio.sourceforge.net/")
3645 (synopsis "Library for reading and writing MAT files")
3646 (description "Matio is a library for reading and writing MAT files. It
3647supports compressed MAT files, as well as newer (version 7.3) MAT files.")
3648 (license license:bsd-2)))
d721c83a 3649
517318ad
LF
3650(define-public vc
3651 (package
3652 (name "vc")
853b0292 3653 (version "1.3.3")
517318ad
LF
3654 (source
3655 (origin (method url-fetch)
3656 (uri (string-append "https://github.com/VcDevel/Vc/releases/"
3657 "download/" version "/Vc-" version ".tar.gz"))
3658 (sha256
3659 (base32
853b0292 3660 "1zmlpn32jzb38smp3j834llmbix3whsrbw0h397qxysbw792kih8"))))
517318ad
LF
3661 (build-system cmake-build-system)
3662 (arguments
3663 '(#:configure-flags
33d82486
MB
3664 '("-DBUILD_TESTING=ON"
3665 ;; By default, Vc will optimize for the CPU of the build machine.
3666 ;; Setting this to "none" makes it create portable binaries. See
3667 ;; "cmake/OptimizeForArchitecture.cmake".
3668 "-DTARGET_ARCHITECTURE=none")))
517318ad
LF
3669 (synopsis "SIMD vector classes for C++")
3670 (description "Vc provides portable, zero-overhead C++ types for explicitly
3671data-parallel programming. It is a library designed to ease explicit
3672vectorization of C++ code. Its types enable explicitly stating data-parallel
3673operations on multiple values. The parallelism is therefore added via the type
3674system. Vc has an intuitive API and provides portability between different
3675compilers and compiler versions as well as portability between different vector
3676instruction sets. Thus, an application written with Vc can be compiled for:
3677@enumerate
3678@item AVX and AVX2
d1e4ad1b 3679@item SSE2 up to SSE4.2 or SSE4a
517318ad
LF
3680@item Scalar
3681@item MIC
3682@item NEON (in development)
3683@item NVIDIA GPUs / CUDA (in development)
3684@end enumerate\n")
3685 (home-page "https://github.com/VcDevel/Vc")
a8ead6f9
EF
3686 ;; "No support_???.cpp file exists for this architecture."
3687 (supported-systems '("x86_64-linux" "i686-linux"))
517318ad 3688 (license license:bsd-3)))
54052a54 3689
3690(define-public reducelcs
3691 ;; This is the last commit which is available upstream, no
3692 ;; release happened since 2010.
3693 (let ((commit "474f88deb968061abe8cf11c959e02319b8ae5c0")
3694 (revision "1"))
3695 (package
3696 (name "reducelcs")
3697 (version (string-append "1.0-" revision "." (string-take commit 7)))
3698 (source
3699 (origin
3700 (method git-fetch)
3701 (uri (git-reference
3702 (url "https://github.com/gdv/Reduce-Expand-for-LCS")
3703 (commit commit)))
3704 (file-name (string-append name "-" version "-checkout"))
3705 (sha256
3706 (base32
3707 "1rllzcfwc042c336mhq262a8ha90x6afq30kvk60r7i4761j4yjm"))))
3708 (build-system gnu-build-system)
3709 (inputs
3710 `(("openlibm" ,openlibm)))
3711 (arguments
3712 `(#:tests? #f ; no tests
3713 #:phases
3714 (modify-phases %standard-phases
3715 (delete 'configure) ; No configure script exists.
3716 (replace 'install ; No install phase exists.
3717 (lambda* (#:key outputs #:allow-other-keys)
3718 (let* ((out (assoc-ref outputs "out"))
3719 (bin (string-append out "/bin")))
3720 (install-file "Approximation" bin)
3721 (install-file "CollectResults" bin)
3722 (install-file "GenerateInstances" bin)
3723 #t))))))
3724 (synopsis "Approximate Longest Commons Subsequence computation tool")
3725 (description
3726 "@code{reduceLCS} is an implementation of the Reduce-Expand
3727algorithm for LCS. It is a fast program to compute the approximate
3728Longest Commons Subsequence of a set of strings.")
3729 (home-page "https://github.com/gdv/Reduce-Expand-for-LCS")
c000b6b1 3730 (license license:gpl3+))))
479c4273
JD
3731
3732(define-public jacal
3733 (package
3734 (name "jacal")
3735 (version "1c4")
3736 (source (origin
3737 (method url-fetch)
3738 (uri (string-append
3739 "http://groups.csail.mit.edu/mac/ftpdir/scm/jacal-"
3740 version ".zip"))
3741 (sha256 (base32
3742 "055zrn12a1dmy0dqkwrkq3fklbhg3yir6vn0lacp4mvbg8573a3q"))
3743 (patches (search-patches "jacal-fix-texinfo.patch"))))
3744 (build-system gnu-build-system)
3745 (arguments
3746 `(#:phases
3747 (modify-phases %standard-phases
3748 (add-before 'build 'pre-build
3749 ;; Don't use upstream's script - it really doesn't fit into
3750 ;; Guix's functional paradigm.
3751 (lambda* (#:key inputs outputs #:allow-other-keys)
3752 (substitute* "Makefile"
3753 (("^install: install-script") "install: "))))
3754 (add-after 'install 'post-install
3755 ;; Instead, we provide our own simplified script.
3756 (lambda* (#:key inputs outputs #:allow-other-keys)
3757 (let ((wrapper (string-append (assoc-ref outputs "out")
3758 "/bin/jacal")))
3759 (format (open wrapper (logior O_WRONLY O_CREAT))
3760 (string-append "#!~a\nexec ~a/bin/scm -ip1 "
3761 "-e '(slib:load \"~a/lib/jacal/math\") "
3762 "(math)' \"$@\"\n")
3763 (which "bash")
3764 (assoc-ref inputs "scm")
3765 (assoc-ref outputs "out"))
3766 (chmod wrapper #o555))))
3767 (replace 'configure
3768 (lambda* (#:key inputs outputs #:allow-other-keys)
3769 (zero? (system* "./configure"
3770 (string-append "--prefix="
3771 (assoc-ref outputs "out")))))))))
3772 (inputs `(("scm" ,scm)))
3773 (native-inputs `(("unzip" ,unzip)
3774 ("texinfo" ,texinfo)))
3775 (synopsis "Symbolic mathematics system")
3776 (description "GNU JACAL is an interactive symbolic mathematics program based on
3777Scheme. It manipulate and simplify a range of mathematical expressions such
3778as equations, scalars, vectors, and matrices.")
6fd52309 3779 (home-page "https://www.gnu.org/software/jacal/")
479c4273
JD
3780 (license license:gpl3+)))
3781
313844d9
TF
3782(define-public z3
3783 (package
3784 (name "z3")
3785 (version "4.5.0")
3786 (source (origin
3787 (method url-fetch)
3788 (uri (string-append
3789 "https://github.com/Z3Prover/z3/archive/z3-"
3790 version ".tar.gz"))
3791 (sha256
3792 (base32
3793 "032a5lvji2liwmc25jv52bdrhimqflvqbpg77ccaq1jykhiivbmf"))))
cf684d87 3794 (build-system cmake-build-system)
313844d9 3795 (arguments
cf684d87
TF
3796 `(#:configure-flags
3797 (list "-DBUILD_PYTHON_BINDINGS=true"
3798 "-DINSTALL_PYTHON_BINDINGS=true"
3799 (string-append "-DCMAKE_INSTALL_PYTHON_PKG_DIR="
3800 %output
677bc34d 3801 "/lib/python2.7/site-packages"))
313844d9
TF
3802 #:phases
3803 (modify-phases %standard-phases
cf684d87
TF
3804 (add-before 'configure 'bootstrap
3805 (lambda _
313844d9 3806 (zero?
cf684d87
TF
3807 (system* "python" "contrib/cmake/bootstrap.py" "create"))))
3808 (add-before 'check 'make-test-z3
313844d9 3809 (lambda _
cf684d87
TF
3810 ;; Build the test suite executable.
3811 (zero? (system* "make" "test-z3" "-j"
3812 (number->string (parallel-job-count))))))
3813 (replace 'check
3814 (lambda _
3815 ;; Run all the tests that don't require arguments.
3816 (zero? (system* "./test-z3" "/a")))))))
313844d9
TF
3817 (native-inputs
3818 `(("python" ,python-2)))
3819 (synopsis "Theorem prover")
3820 (description "Z3 is a theorem prover and @dfn{satisfiability modulo
cf684d87 3821theories} (SMT) solver. It provides a C/C++ API, as well as Python bindings.")
313844d9
TF
3822 (home-page "https://github.com/Z3Prover/z3")
3823 (license license:expat)))
3d5d87a3
JL
3824
3825(define-public cubicle
3826 (package
3827 (name "cubicle")
3828 (version "1.1.1")
3829 (source (origin
3830 (method url-fetch)
3831 (uri (string-append "http://cubicle.lri.fr/cubicle-"
3832 version ".tar.gz"))
3833 (sha256
3834 (base32
3835 "1sny9c4fm14k014pk62ibpwbrjjirkx8xmhs9jg7q1hk7y7x3q2h"))))
3836 (build-system gnu-build-system)
3837 (native-inputs
3838 `(("ocaml" ,ocaml)
83fef82b 3839 ("which" ,(@@ (gnu packages base) which))))
3d5d87a3
JL
3840 (propagated-inputs
3841 `(("z3" ,z3)))
3842 (arguments
3843 `(#:configure-flags (list "--with-z3")
3844 #:tests? #f
3845 #:phases
3846 (modify-phases %standard-phases
3847 (add-before 'configure 'configure-for-release
3848 (lambda _
3849 (substitute* "Makefile.in"
3850 (("SVNREV=") "#SVNREV="))))
3851 (add-before 'configure 'fix-/bin/sh
3852 (lambda _
3853 (substitute* "configure"
3854 (("/bin/sh") (which "sh")))))
3855 (add-before 'configure 'fix-smt-z3wrapper.ml
3856 (lambda _
3857 (substitute* "Makefile.in"
3858 (("\\\\n") "")))))))
3859 (home-page "http://cubicle.lri.fr/")
3860 (synopsis "Model checker for array-based systems")
5a80c15c
RW
3861 (description "Cubicle is a model checker for verifying safety properties
3862of array-based systems. This is a syntactically restricted class of
3863parametrized transition systems with states represented as arrays indexed by
3864an arbitrary number of processes. Cache coherence protocols and mutual
3865exclusion algorithms are typical examples of such systems.")
3d5d87a3 3866 (license license:asl2.0)))
e01397b4
EB
3867
3868(define-public elemental
3869 (package
3870 (name "elemental")
3871 (version "0.87.7")
3872 (source (origin
3873 (method url-fetch)
3874 (uri (string-append "https://github.com/elemental/Elemental/"
3875 "archive/v" version ".tar.gz"))
3876 (file-name (string-append name "-" version ".tar.gz"))
3877 (sha256
3878 (base32
3879 "1nfp82w22pi8x8fg9sc37z8kf84dqi1dhxp8bbk7571y4aygvv3v"))))
3880 (build-system cmake-build-system)
3881 (home-page "http://libelemental.org")
3882 (native-inputs
3883 `(("gfortran" ,gfortran)))
3884 (inputs
3885 `(("blas" ,openblas)
3886 ("gfortran:lib" ,gfortran "lib")
3887 ("gmp" ,gmp)
3888 ("lapack" ,lapack)
3889 ("metis" ,metis)
3890 ("mpc" ,mpc)
3891 ("mpfr" ,mpfr)
3892 ("mpi" ,openmpi)
3893 ("qd" ,qd)))
3894 (arguments
3895 `(#:build-type "Release" ;default RelWithDebInfo not supported
3896 #:configure-flags `("-DEL_DISABLE_PARMETIS:BOOL=YES"
3897 "-DEL_AVOID_COMPLEX_MPI:BOOL=NO"
3898 "-DEL_CACHE_WARNINGS:BOOL=YES"
3899 "-DEL_TESTS:BOOL=YES"
3900 "-DCMAKE_INSTALL_LIBDIR=lib"
3901 "-DGFORTRAN_LIB=gfortran")
3902 #:phases (modify-phases %standard-phases
bbe46a4a
EB
3903 (add-before 'check 'mpi-setup
3904 ,%openmpi-setup)
e01397b4
EB
3905 (add-before 'check 'setup-tests
3906 (lambda _
3907 ;; Parallelism is done at the MPI layer.
3908 (setenv "OMP_NUM_THREADS" "1")
3909 #t))
3910 (add-after 'install 'remove-tests
3911 (lambda* (#:key outputs #:allow-other-keys)
3912 ;; Tests are installed, with no easy configuration
3913 ;; switch to prevent this, so delete them.
3914 (delete-file-recursively
3915 (string-append (assoc-ref outputs "out") "/bin"))
3916 #t)))))
3917 (synopsis "Dense and sparse-direct linear algebra and optimization")
3918 (description "Elemental is a modern C++ library for distributed-memory
3919dense and sparse-direct linear algebra, conic optimization, and lattice
3920reduction.")
3921 (license license:bsd-2)))
5b05dce7
JN
3922
3923(define-public mcrl2
3924 (package
3925 (name "mcrl2")
3926 (version "201707.1.15162")
3927 (source (origin
3928 (method url-fetch)
3929 (uri (string-append "http://www.mcrl2.org/download/devel/mcrl2-"
3930 version
3931 ".tar.gz"))
3932 (sha256
3933 (base32
3934 "1ziww2fchsklm25hl9p2mngssxfh9w07nc114cncqaxfibqp2p8f"))))
3935 (native-inputs
3936 `(("subversion" ,subversion)))
3937 (inputs
3938 `(("boost" ,boost)
3939 ("glu" ,glu)
3940 ("mesa" ,mesa)
077d66ed 3941 ("qtbase" ,qtbase)))
5b05dce7 3942 (build-system cmake-build-system)
ed0c5d3c 3943 (synopsis "Toolset for the mCRL2 formal specification language")
5b05dce7 3944 (description
ed0c5d3c
TGR
3945 "@dfn{mCRL2} (micro Common Representation Language 2) is a formal
3946specification language for describing concurrent discrete event systems. Its
3947toolset supports analysis and automatic verification, linearisation, simulation,
3948state-space exploration and generation, and tools to optimise and analyse
5b05dce7
JN
3949specifications. Also, state spaces can be manipulated, visualised and
3950analysed.")
b3882709 3951 (home-page "https://mcrl2.org")
5b05dce7 3952 (license license:boost1.0)))
41835f94
LF
3953
3954(define-public r-subplex
3955 (package
3956 (name "r-subplex")
2bcf5fd3 3957 (version "1.5-4")
41835f94
LF
3958 (source
3959 (origin
3960 (method url-fetch)
3961 (uri (cran-uri "subplex" version))
3962 (sha256
3963 (base32
2bcf5fd3 3964 "10cbgbx1bgsax5z7gz6716g360xpq4mvq19cf4qqrxv02mmwz57z"))))
41835f94
LF
3965 (build-system r-build-system)
3966 (native-inputs
3967 `(("gfortran" ,gfortran)))
3968 (home-page "https://cran.r-project.org/web/packages/subplex")
3969 (synopsis "Unconstrained optimization using the subplex algorithm")
3970 (description "This package implements the Subplex optimization algorithm.
3971It solves unconstrained optimization problems using a simplex method on
3972subspaces. The method is well suited for optimizing objective functions that
3973are noisy or are discontinuous at the solution.")
3974 (license license:gpl3+)))
799ad71b
LF
3975
3976(define-public r-desolve
3977 (package
3978 (name "r-desolve")
9a2ac95d 3979 (version "1.21")
799ad71b
LF
3980 (source
3981 (origin
3982 (method url-fetch)
3983 (uri (cran-uri "deSolve" version))
3984 (sha256
3985 (base32
9a2ac95d 3986 "0qqc4mknw1jblzcmph1dg3k1p6w42yal0k1xjh8pqk7yb3a75hs5"))))
799ad71b
LF
3987 (properties `((upstream-name . "deSolve")))
3988 (build-system r-build-system)
3989 (native-inputs
3990 `(("gfortran" ,gfortran)))
3991 (home-page "https://desolve.r-forge.r-project.org/")
3992 (synopsis "Solvers for initial value problems of differential equations")
3993 (description "This package provides functions that solve initial
3994value problems of a system of first-order ordinary differential equations (ODE),
3995of partial differential equations (PDE), of differential algebraic equations
3996(DAE), and of delay differential equations. The functions provide an interface
3997to the FORTRAN functions lsoda, lsodar, lsode, lsodes of the ODEPACK collection,
3998to the FORTRAN functions dvode and daspk and a C-implementation of solvers of
3999the Runge-Kutta family with fixed or variable time steps. The package contains
4000routines designed for solving ODEs resulting from 1-D, 2-D and 3-D partial
4001differential equations (PDE) that have been converted to ODEs by numerical
4002differencing.")
4003 (license license:gpl2+)))
910deec6
NV
4004
4005(define-public tcalc
4006 (package
4007 (name "tcalc")
4008 (version "2.0")
4009 (source
4010 (origin
4011 (method url-fetch)
4012 (uri (string-append "https://sites.google.com/site/mohammedisam2000/tcalc/tcalc-"
4013 version ".tar.gz"))
4014 (sha256
4015 (base32
4016 "0jq806m4dqfia85nppfm75mml9w57g0cgv4cdw9bp3zymda83s0m"))))
4017 (build-system gnu-build-system)
4018 (synopsis "The terminal calculator")
4019 (description
4020 "The terminal calculator is a small program to help users of the GNU/Linux
4021terminal do calculations simply and quickly. The formula to be calculated can
4022be fed to @command{tcalc} through the command line.")
4023 (home-page "https://sites.google.com/site/mohammedisam2000/tcalc")
4024 (license license:gpl3+)))
b26e4f26
EB
4025
4026(define-public sundials
4027 (package
4028 (name "sundials")
4029 (version "3.1.1")
4030 (source
4031 (origin
4032 (method url-fetch)
4033 (uri (string-append "https://computation.llnl.gov/projects/sundials/download/"
4034 "sundials-" version ".tar.gz"))
4035 (sha256
4036 (base32
4037 "090s8ymhd0g1s1d44fa73r5yi32hb4biwahhbfi327zd64yn8kd2"))))
4038 (build-system cmake-build-system)
4039 (native-inputs
4040 `(("python" ,python-2))) ;for tests; syntax incompatible with python 3
4041 (inputs
4042 `(("fortran" ,gfortran) ;for fcmix
4043 ("blas" ,openblas)
4044 ("suitesparse" ,suitesparse))) ;TODO: Add hypre
4045 (arguments
4046 `(#:configure-flags `("-DEXAMPLES_ENABLE_C:BOOL=ON"
4047 "-DEXAMPLES_ENABLE_CXX:BOOL=ON"
4048 "-DEXAMPLES_ENABLE_F77:BOOL=ON"
4049 "-DEXAMPLES_ENABLE_F90:BOOL=ON"
4050 "-DEXAMPLES_INSTALL:BOOL=OFF"
4051
4052 "-DFCMIX_ENABLE:BOOL=ON"
4053
4054 "-DKLU_ENABLE:BOOL=ON"
4055 ,(string-append "-DKLU_INCLUDE_DIR="
4056 (assoc-ref %build-inputs "suitesparse")
4057 "/include")
4058 ,(string-append "-DKLU_LIBRARY_DIR="
4059 (assoc-ref %build-inputs "suitesparse")
4060 "/lib"))))
4061 (home-page "https://computation.llnl.gov/projects/sundials")
4062 (synopsis "Suite of nonlinear and differential/algebraic equation solvers")
4063 (description "SUNDIALS is a family of software packages implemented with
4064the goal of providing robust time integrators and nonlinear solvers that can
4065easily be incorporated into existing simulation codes.")
4066 (license license:bsd-3)))
4067
4068(define-public sundials-openmpi
4069 (package (inherit sundials)
4070 (name "sundials-openmpi")
4071 (inputs
4072 `(("mpi" ,openmpi)
4073 ("petsc" ,petsc-openmpi) ;support in SUNDIALS requires MPI
4074 ,@(package-inputs sundials)))
4075 (arguments
4076 (substitute-keyword-arguments (package-arguments sundials)
4077 ((#:configure-flags flags '())
4078 `(cons* "-DMPI_ENABLE:BOOL=ON"
4079 "-DPETSC_ENABLE:BOOL=ON"
4080 (string-append "-DPETSC_INCLUDE_DIR="
4081 (assoc-ref %build-inputs "petsc")
4082 "/include")
4083 (string-append "-DPETSC_LIBRARY_DIR="
4084 (assoc-ref %build-inputs "petsc")
4085 "/lib")
4086 ,flags))
4087 ((#:phases phases '%standard-phases)
4088 `(modify-phases ,phases
bbe46a4a
EB
4089 (add-before 'check 'mpi-setup
4090 ,%openmpi-setup)))))
b26e4f26 4091 (synopsis "SUNDIALS with OpenMPI support")))