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