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