gnu: sbcl-trivial-backtrace: Fix 'license' field.
[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.")
608 (license (license:bsd-style "file://LICENSE"
609 "See LICENSE in the distribution."))))
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
652 (method url-fetch)
653 (uri (string-append "https://github.com/OkoSanto/GCTP/archive/v"
654 version ".tar.gz"))
655 (file-name (string-append name "-" version ".tar.gz"))
656 (sha256
657 (base32
658 "0l9aqnqynh9laicn5dxf3rsb1n14xiks79wbyqccirzmjqd1c1x4"))))
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
1557 (method url-fetch)
1558 (uri (string-append
1559 "https://github.com/tpaviot/oce/archive/OCE-"
1560 version
1561 ".tar.gz"))
a4f393b7 1562 (patches (search-patches "opencascade-oce-glibc-2.26.patch"))
5d4bd4cc
PG
1563 (sha256
1564 (base32
1565 "0vpmnb0k5y2f7lpmwx9pg9yfq24zjvnsak5alzacncfm1hv9b6cd"))))
1566 (build-system cmake-build-system)
1567 (arguments
1568 '(#:configure-flags
1569 (list "-DOCE_TESTING:BOOL=ON"
1570 "-DOCE_USE_TCL_TEST_FRAMEWORK:BOOL=ON"
1571 "-DOCE_DRAW:BOOL=ON"
1572 (string-append "-DOCE_INSTALL_PREFIX:PATH="
1573 (assoc-ref %outputs "out"))
1574 "-UCMAKE_INSTALL_RPATH")))
1575 (inputs
1576 `(("freetype" ,freetype)
1577 ("glu" ,glu)
1578 ("libxmu" ,libxmu)
1579 ("mesa" ,mesa)
1580 ("tcl" ,tcl)
1581 ("tk" ,tk)))
1582 (native-inputs
1583 `(("python" ,python-wrapper)))
1584 (home-page "https://github.com/tpaviot/oce")
1585 (synopsis "Libraries for 3D modeling and numerical simulation")
1586 (description
1587 "Open CASCADE is a set of libraries for the development of applications
1588dealing with 3D CAD data or requiring industrial 3D capabilities. It includes
1589C++ class libraries providing services for 3D surface and solid modeling, CAD
1590data exchange, and visualization. It is used for development of specialized
1591software dealing with 3D models in design (CAD), manufacturing (CAM),
1592numerical simulation (CAE), measurement equipment (CMM), and quality
1593control (CAQ) domains.
1594
1595This is the ``Community Edition'' (OCE) of Open CASCADE, which gathers
1596patches, improvements, and experiments contributed by users over the official
1597Open CASCADE library.")
1598 (license (list license:lgpl2.1; OCE libraries, with an exception for the
1599 ; use of header files; see
1600 ; OCCT_LGPL_EXCEPTION.txt
1601 license:public-domain; files
1602 ; src/Standard/Standard_StdAllocator.hxx and
1603 ; src/NCollection/NCollection_StdAllocator.hxx
1604 license:expat; file src/OpenGl/OpenGl_glext.h
1605 license:bsd-3)))); test framework gtest
1606
3de01d3f
EB
1607(define-public gmsh
1608 (package
1609 (name "gmsh")
8a4d14fa 1610 (version "2.16.0")
3de01d3f
EB
1611 (source
1612 (origin
1613 (method url-fetch)
1c79e086 1614 (uri (string-append "http://gmsh.info/src/gmsh-"
3de01d3f
EB
1615 version "-source.tgz"))
1616 (sha256
8a4d14fa 1617 (base32 "1slf0bfkwrcgn6296wb4qhbk4ahz6i4wfb10hnim08x05vrylag8"))
3de01d3f
EB
1618 (modules '((guix build utils)))
1619 (snippet
1620 ;; Remove non-free METIS code
6cbee49d
MW
1621 '(begin
1622 (delete-file-recursively "contrib/Metis")
1623 #t))))
3de01d3f 1624 (build-system cmake-build-system)
3de01d3f
EB
1625 (propagated-inputs
1626 `(("fltk" ,fltk)
19afbea1 1627 ("gfortran" ,gfortran)
3de01d3f 1628 ("gmp" ,gmp)
40029cbe 1629 ("hdf5" ,hdf5)
3de01d3f
EB
1630 ("lapack" ,lapack)
1631 ("mesa" ,mesa)
85f41902 1632 ("glu" ,glu)
45548139 1633 ("opencascade-oce" ,opencascade-oce)
3de01d3f
EB
1634 ("libx11" ,libx11)
1635 ("libxext" ,libxext)))
66395a61
EF
1636 (inputs
1637 `(("fontconfig" ,fontconfig)
1638 ("libxft" ,libxft)))
3de01d3f
EB
1639 (arguments
1640 `(#:configure-flags `("-DENABLE_METIS:BOOL=OFF"
1641 "-DENABLE_BUILD_SHARED:BOOL=ON"
45548139 1642 "-DENABLE_BUILD_DYNAMIC:BOOL=ON")))
3de01d3f
EB
1643 (home-page "http://www.geuz.org/gmsh/")
1644 (synopsis "3D finite element grid generator")
edf684ef
EB
1645 (description "Gmsh is a 3D finite element grid generator with a built-in
1646CAD engine and post-processor. Its design goal is to provide a fast, light
1647and user-friendly meshing tool with parametric input and advanced
1648visualization capabilities. Gmsh is built around four modules: geometry,
1649mesh, solver and post-processing. The specification of any input to these
1650modules is done either interactively using the graphical user interface or in
1651ASCII text files using Gmsh's own scripting language.")
3de01d3f 1652 (license license:gpl2+)))
b9100e2f 1653
6d5f63b6
JD
1654(define-public maxflow
1655 (package
1656 (name "maxflow")
1657 (version "3.04")
1658 (source (origin
1659 (method git-fetch)
1660 (uri (git-reference
1661 (url "https://github.com/gerddie/maxflow.git")
1662 (commit "42401fa54823d16b9da47716f04e5d9ef1605875")))
1663 (file-name (string-append name "-" version "-checkout"))
1664 (sha256
1665 (base32
1666 "0rll38whw55h0vcjrrwdnh9ascvxby0ph7n1l0d12z17cg215kkb"))))
1667 (build-system cmake-build-system)
1668 (home-page "http://pub.ist.ac.at/~vnk/software.html")
1669 (synopsis "Library implementing Maxflow algorithm")
1670 (description "An implementation of the maxflow algorithm described in
1671@cite{An Experimental Comparison of Min-Cut/Max-Flow Algorithms for
1672Energy Minimization in Computer Vision.\n
1673Yuri Boykov and Vladimir Kolmogorov.\n
1674In IEEE Transactions on Pattern Analysis and Machine Intelligence,\n
1675September 2004}")
1676 (license license:gpl3+)))
1677
b9100e2f
EB
1678(define-public petsc
1679 (package
1680 (name "petsc")
b2c52fc9 1681 (version "3.10.4")
b9100e2f
EB
1682 (source
1683 (origin
1684 (method url-fetch)
1685 ;; The *-lite-* tarball does not contain the *large* documentation
1686 (uri (string-append "http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/"
1687 "petsc-lite-" version ".tar.gz"))
1688 (sha256
b2c52fc9
TGR
1689 (base32 "0fk16944zh3473ra198kdkxdn08rq7b6ap838hxy1mh1i0hb488r"))))
1690 (outputs '("out" ; libraries and headers
1691 "examples")) ; ~30MiB of examples
b9100e2f
EB
1692 (build-system gnu-build-system)
1693 (native-inputs
6fec298d 1694 `(("python" ,python-2)))
b9100e2f 1695 (inputs
19afbea1 1696 `(("gfortran" ,gfortran)
b9100e2f 1697 ("lapack" ,lapack)
f258212d 1698 ("superlu" ,superlu)
b9100e2f
EB
1699 ;; leaving out hdf5 and fftw, as petsc expects them to be built with mpi
1700 ;; leaving out opengl, as configuration seems to only be for mac
1701 ))
1702 (arguments
1703 `(#:test-target "test"
b2c52fc9 1704 #:parallel-build? #f ; build is parallel by default
b9100e2f
EB
1705 #:configure-flags
1706 `("--with-mpi=0"
f258212d 1707 "--with-openmp=1"
c15be128 1708 "--with-superlu=1")
9731c412
EB
1709 #:make-flags
1710 ;; Honor (parallel-job-count) for build. Do not use --with-make-np,
1711 ;; whose value is dumped to $out/lib/petsc/conf/petscvariables.
1712 (list (format #f "MAKE_NP=~a" (parallel-job-count)))
b9100e2f 1713 #:phases
64dcc289
EB
1714 (modify-phases %standard-phases
1715 (replace 'configure
1716 ;; PETSc's configure script is actually a python script, so we can't
1717 ;; run it with bash.
1718 (lambda* (#:key outputs (configure-flags '())
1719 #:allow-other-keys)
1720 (let* ((prefix (assoc-ref outputs "out"))
1721 (flags `(,(string-append "--prefix=" prefix)
1722 ,@configure-flags)))
1723 (format #t "build directory: ~s~%" (getcwd))
1724 (format #t "configure flags: ~s~%" flags)
49fdd357 1725 (apply invoke "./configure" flags))))
64dcc289 1726 (add-after 'configure 'clean-local-references
9731c412 1727 (lambda* (#:key outputs #:allow-other-keys)
64dcc289
EB
1728 (let ((out (assoc-ref outputs "out")))
1729 (substitute* (find-files "." "^petsc(conf|machineinfo).h$")
b730b437
EB
1730 ;; Prevent build directory from leaking into compiled code
1731 (((getcwd)) out)
1732 ;; Scrub timestamp for reproducibility
fafd623e 1733 ((".*Libraries compiled on.*") ""))
9731c412
EB
1734 (substitute* (find-files "." "petscvariables")
1735 ;; Do not expose build machine characteristics, set to defaults.
1736 (("MAKE_NP = [:digit:]+") "MAKE_NP = 2")
1737 (("NPMAX = [:digit:]+") "NPMAX = 2"))
fafd623e 1738 #t)))
64dcc289 1739 (add-after 'install 'clean-install
10b11968
EB
1740 ;; Try to keep installed files from leaking build directory names.
1741 (lambda* (#:key inputs outputs #:allow-other-keys)
64dcc289 1742 (let ((out (assoc-ref outputs "out")))
10b11968 1743 (substitute* (map (lambda (file)
9a899cce 1744 (string-append out "/lib/petsc/conf/" file))
fafd623e 1745 '("petscvariables"))
10b11968
EB
1746 (((getcwd)) out))
1747 ;; Make compiler references point to the store
9a899cce 1748 (substitute* (string-append out "/lib/petsc/conf/petscvariables")
dfdf5716
EB
1749 (("= (gcc|g\\+\\+|gfortran)" _ compiler)
1750 (string-append "= " (which compiler))))
10b11968
EB
1751 ;; PETSc installs some build logs, which aren't necessary.
1752 (for-each (lambda (file)
9a899cce 1753 (let ((f (string-append out "/lib/petsc/conf/" file)))
10b11968
EB
1754 (when (file-exists? f)
1755 (delete-file f))))
9a899cce
EB
1756 '("configure.log" "make.log" "gmake.log"
1757 "test.log" "error.log" "RDict.db"
fafd623e 1758 "PETScBuildInternal.cmake"
10b11968 1759 ;; Once installed, should uninstall with Guix
fafd623e 1760 "uninstall.py"))
a3a99e27
EB
1761 #t)))
1762 (add-after 'install 'move-examples
1763 (lambda* (#:key outputs #:allow-other-keys)
1764 (let* ((out (assoc-ref outputs "out"))
1765 (examples (assoc-ref outputs "examples"))
1766 (exdir (string-append out "/share/petsc/examples"))
1767 (exdir' (string-append examples "/share/petsc/examples")))
1768 (copy-recursively exdir exdir')
1769 (delete-file-recursively exdir)
fafd623e 1770 #t))))))
b9100e2f 1771 (home-page "http://www.mcs.anl.gov/petsc")
16ecf3ff 1772 (synopsis "Library to solve PDEs")
b9100e2f
EB
1773 (description "PETSc, pronounced PET-see (the S is silent), is a suite of
1774data structures and routines for the scalable (parallel) solution of
1775scientific applications modeled by partial differential equations.")
166191b3 1776 (license (license:non-copyleft
b9100e2f
EB
1777 "http://www.mcs.anl.gov/petsc/documentation/copyright.html"))))
1778
1779(define-public petsc-complex
1780 (package (inherit petsc)
1781 (name "petsc-complex")
1782 (arguments
1783 (substitute-keyword-arguments (package-arguments petsc)
1784 ((#:configure-flags cf)
1785 `(cons "--with-scalar-type=complex" ,cf))))
16ecf3ff 1786 (synopsis "Library to solve PDEs (with complex scalars)")))
183e44ae 1787
d8c7eeb9
EB
1788(define-public petsc-openmpi
1789 (package (inherit petsc)
1790 (name "petsc-openmpi")
1791 (inputs
9e2aa70b 1792 `(("hdf5" ,hdf5-parallel-openmpi)
af523673 1793 ("hypre" ,hypre-openmpi)
9e2aa70b
PG
1794 ("metis" ,metis)
1795 ("mumps" ,mumps-openmpi)
1796 ("openmpi" ,openmpi)
1797 ("scalapack" ,scalapack)
72f95783 1798 ("scotch" ,pt-scotch32)
d8c7eeb9
EB
1799 ,@(package-inputs petsc)))
1800 (arguments
1801 (substitute-keyword-arguments (package-arguments petsc)
1802 ((#:configure-flags cf)
af523673
PG
1803 ``("--with-hypre=1"
1804 "--with-mpiexec=mpirun"
9e2aa70b
PG
1805 "--with-metis=1"
1806 "--with-mumps=1"
1807 "--with-scalapack=1"
1808 "--with-ptscotch=1"
d8c7eeb9
EB
1809 ,(string-append "--with-mpi-dir="
1810 (assoc-ref %build-inputs "openmpi"))
71ca16b5
PG
1811 ,(string-append "--with-hdf5-include="
1812 (assoc-ref %build-inputs "hdf5") "/include")
1813 ,(string-append "--with-hdf5-lib="
1814 (assoc-ref %build-inputs "hdf5") "/lib/libhdf5.a")
1815 ,@(delete "--with-mpi=0" ,cf)))
1816 ((#:phases phases)
1817 `(modify-phases ,phases
9e2aa70b 1818 (add-before 'configure 'mpi-setup
bbe46a4a 1819 ,%openmpi-setup)))))
9e2aa70b 1820 (synopsis "Library to solve PDEs (with MUMPS and MPI support)")))
d8c7eeb9
EB
1821
1822(define-public petsc-complex-openmpi
1823 (package (inherit petsc-complex)
1824 (name "petsc-complex-openmpi")
1825 (inputs
1826 `(("openmpi" ,openmpi)
1827 ,@(package-inputs petsc-complex)))
1828 (arguments
1829 (substitute-keyword-arguments (package-arguments petsc-complex)
1830 ((#:configure-flags cf)
1831 ``("--with-mpiexec=mpirun"
1832 ,(string-append "--with-mpi-dir="
1833 (assoc-ref %build-inputs "openmpi"))
1834 ,@(delete "--with-mpi=0" ,cf)))))
16ecf3ff 1835 (synopsis "Library to solve PDEs (with complex scalars and MPI support)")))
d8c7eeb9 1836
90ff2874
PG
1837(define-public python-petsc4py
1838 (package
1839 (name "python-petsc4py")
758439cf 1840 (version "3.10.1")
90ff2874
PG
1841 (source
1842 (origin
1843 (method url-fetch)
1844 (uri (pypi-uri "petsc4py" version))
1845 (sha256
1846 (base32
758439cf 1847 "094hcnran0r2z1wlvmjswsz3ski1m9kqrl5l0ax8jjhnk55x0flh"))))
90ff2874
PG
1848 (build-system python-build-system)
1849 (arguments
1850 `(#:phases
1851 (modify-phases %standard-phases
1852 (add-before 'build 'pre-build
1853 (lambda _
1854 ;; Define path to PETSc installation.
1855 (setenv "PETSC_DIR" (assoc-ref %build-inputs "petsc"))
1856 #t))
1857 (add-before 'check 'mpi-setup
1858 ,%openmpi-setup))))
1859 (inputs
1860 `(("petsc" ,petsc-openmpi)
1861 ("python-numpy" ,python-numpy)))
1862 (home-page "https://bitbucket.org/petsc/petsc4py/")
1863 (synopsis "Python bindings for PETSc")
1864 (description "PETSc, the Portable, Extensible Toolkit for
1865Scientific Computation, is a suite of data structures and routines for
1866the scalable (parallel) solution of scientific applications modeled by
1867partial differential equations. It employs the MPI standard for all
1868message-passing communication. @code{petsc4py} provides Python
1869bindings to almost all functions of PETSc.")
1870 (license license:bsd-3)))
1871
560acf25
MB
1872(define-public python-kiwisolver
1873 (package
1874 (name "python-kiwisolver")
1875 (version "1.0.1")
1876 (source (origin
1877 (method url-fetch)
1878 (uri (pypi-uri "kiwisolver" version))
1879 (sha256
1880 (base32
1881 "0y22ci86znwwwfhbmvbgdfnbi6lv5gv2xkdlxvjw7lml43ayafyf"))))
1882 (build-system python-build-system)
1883 (home-page "https://github.com/nucleic/kiwi")
1884 (synopsis "Fast implementation of the Cassowary constraint solver")
1885 (description
1886 "Kiwi is an efficient C++ implementation of the Cassowary constraint
1887solving algorithm. Kiwi has been designed from the ground up to be
1888lightweight and fast. Kiwi ranges from 10x to 500x faster than the original
1889Cassowary solver with typical use cases gaining a 40x improvement. Memory
1890savings are consistently > 5x.")
1891 (license license:bsd-3)))
1892
1893(define-public python2-kiwisolver
1894 (package-with-python2 python-kiwisolver))
1895
a7f01414
EB
1896(define-public slepc
1897 (package
1898 (name "slepc")
e93da160 1899 (version "3.10.1")
a7f01414
EB
1900 (source
1901 (origin
1902 (method url-fetch)
baeaf882
EB
1903 (uri (string-append "http://slepc.upv.es/download/distrib/slepc-"
1904 version ".tar.gz"))
a7f01414
EB
1905 (sha256
1906 (base32
e93da160 1907 "188j1a133q91h8pivpnzwcf78kz8dvz2nzf6ndnjygdbqb48fizn"))))
a7f01414
EB
1908 (build-system gnu-build-system)
1909 (native-inputs
1910 `(("python" ,python-2)))
1911 (inputs
1912 `(("arpack" ,arpack-ng)
1913 ("gfortran" ,gfortran)))
1914 (propagated-inputs
1915 `(("petsc" ,petsc)))
1916 (arguments
1917 `(#:parallel-build? #f ;build is parallel by default
1918 #:configure-flags
1919 `(,(string-append "--with-arpack-dir="
9cf52454 1920 (assoc-ref %build-inputs "arpack") "/lib"))
9731c412
EB
1921 #:make-flags ;honor (parallel-job-count)
1922 `(,(format #f "MAKE_NP=~a" (parallel-job-count)))
a7f01414
EB
1923 #:phases
1924 (modify-phases %standard-phases
8787c555 1925 (replace 'configure
a7f01414
EB
1926 ;; configure is a python script, so we can't run it with bash.
1927 (lambda* (#:key inputs outputs (configure-flags '())
1928 #:allow-other-keys)
1929 (let* ((prefix (assoc-ref outputs "out"))
1930 (flags `(,(string-append "--prefix=" prefix)
1931 ,@configure-flags)))
1932 (format #t "build directory: ~s~%" (getcwd))
1933 (format #t "configure flags: ~s~%" flags)
1934 (setenv "SLEPC_DIR" (getcwd))
9cf52454 1935 (setenv "PETSC_DIR" (assoc-ref inputs "petsc"))
c6840089 1936 (apply invoke "./configure" flags))))
8787c555 1937 (add-after 'install 'delete-doc
a7f01414
EB
1938 ;; TODO: SLEPc installs HTML documentation alongside headers in
1939 ;; $out/include. We'd like to move them to share/doc, but delete
1940 ;; them for now, as they are incomplete and installing the complete
1941 ;; documentation is difficult.
1942 (lambda* (#:key outputs #:allow-other-keys)
1943 (let* ((out (assoc-ref outputs "out")))
0f6dc120
TGR
1944 (for-each delete-file (find-files out "\\.html$"))
1945 #t)))
8787c555 1946 (add-after 'install 'clean-install
a7f01414
EB
1947 ;; Clean up unnecessary build logs from installation.
1948 (lambda* (#:key outputs #:allow-other-keys)
1949 (let ((out (assoc-ref outputs "out")))
1950 (for-each (lambda (file)
1951 (let ((f (string-append out "/lib/slepc/conf/" file)))
1952 (when (file-exists? f)
1953 (delete-file f))))
1954 '("configure.log" "make.log" "gmake.log"
1955 "test.log" "error.log" "RDict.db"
0f6dc120
TGR
1956 "uninstall.py"))
1957 #t))))))
a7f01414
EB
1958 (home-page "http://slepc.upv.es")
1959 (synopsis "Scalable library for eigenproblems")
1960 (description "SLEPc is a software library for the solution of large sparse
1961eigenproblems on parallel computers. It can be used for the solution of
1962linear eigenvalue problems formulated in either standard or generalized form,
1963as well as other related problems such as the singular value decomposition.
1964The emphasis of the software is on methods and techniques appropriate for
1965problems in which the associated matrices are sparse, for example, those
1966arising after the discretization of partial differential equations.")
3c524f21 1967 (license license:bsd-2)))
a7f01414
EB
1968
1969(define-public slepc-complex
1970 (package (inherit slepc)
1971 (name "slepc-complex")
1972 (propagated-inputs
1973 `(("petsc" ,petsc-complex)
1974 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
1975 (synopsis "Scalable library for eigenproblems (with complex scalars)")))
1976
1977(define-public slepc-openmpi
1978 (package (inherit slepc)
1979 (name "slepc-openmpi")
6df2a50a
LC
1980 (arguments
1981 (substitute-keyword-arguments (package-arguments slepc)
1982 ((#:phases phases '%standard-phases)
1983 `(modify-phases ,phases
bbe46a4a
EB
1984 (add-before 'check 'mpi-setup
1985 ,%openmpi-setup)))))
a7f01414
EB
1986 (inputs
1987 `(("mpi" ,openmpi)
1988 ("arpack" ,arpack-ng-openmpi)
1989 ,@(alist-delete "arpack" (package-inputs slepc))))
1990 (propagated-inputs
1991 `(("petsc" ,petsc-openmpi)
1992 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
1993 (synopsis "Scalable library for eigenproblems (with MPI support)")))
1994
1995(define-public slepc-complex-openmpi
1996 (package (inherit slepc-openmpi)
1997 (name "slepc-complex-openmpi")
1998 (propagated-inputs
1999 `(("petsc" ,petsc-complex-openmpi)
2000 ,@(alist-delete "petsc" (package-propagated-inputs slepc-openmpi))))
2001 (synopsis "Scalable library for eigenproblems (with complex scalars and MPI support)")))
2002
6b5687d0
PG
2003(define-public python-slepc4py
2004 (package
2005 (name "python-slepc4py")
57d30004 2006 (version "3.10.0")
6b5687d0
PG
2007 (source
2008 (origin
2009 (method url-fetch)
2010 (uri (pypi-uri "slepc4py" version))
2011 (sha256
2012 (base32
57d30004 2013 "0x049dyc8frgh79fvvavf4vlbqp4mgm61nsaivzdav4316vvlv1j"))))
6b5687d0
PG
2014 (build-system python-build-system)
2015 (arguments
2016 `(#:phases
2017 (modify-phases %standard-phases
2018 (add-before 'build 'pre-build
2019 (lambda _
2020 ;; Define path to PETSc installation.
2021 (setenv "PETSC_DIR" (assoc-ref %build-inputs "petsc"))
2022 ;; Define path to SLEPc installation.
2023 (setenv "SLEPC_DIR" (assoc-ref %build-inputs "slepc"))
2024 #t))
2025 (add-before 'check 'mpi-setup
2026 ,%openmpi-setup))))
2027 (inputs
2028 `(("python-numpy" ,python-numpy)
2029 ("python-petsc4py" ,python-petsc4py)
2030 ("slepc" ,slepc-openmpi)))
2031 (home-page "https://bitbucket.org/slepc/slepc4py/")
2032 (synopsis "Python bindings for SLEPc")
2033 (description "SLEPc, the Scalable Library for Eigenvalue Problem
2034Computations, is based on PETSc, the Portable, Extensible Toolkit for
2035Scientific Computation. It employs the MPI standard for all
2036message-passing communication. @code{slepc4py} provides Python
2037bindings to almost all functions of SLEPc.")
2038 (license license:bsd-3)))
2039
cec86422
EB
2040(define-public mumps
2041 (package
2042 (name "mumps")
e7323f4c 2043 (version "5.1.2")
cec86422
EB
2044 (source
2045 (origin
2046 (method url-fetch)
2047 (uri (string-append "http://mumps.enseeiht.fr/MUMPS_"
2048 version ".tar.gz"))
2049 (sha256
2050 (base32
e7323f4c 2051 "1s9asin08zqzmh08257sdghhivvy9vjif7c53fhaxaax2kd5qd7b"))
fc1adab1 2052 (patches (search-patches "mumps-build-parallelism.patch"))))
cec86422
EB
2053 (build-system gnu-build-system)
2054 (inputs
2055 `(("fortran" ,gfortran)
2056 ;; These are required for linking against mumps, but we let the user
2057 ;; declare the dependency.
2058 ("blas" ,openblas)
2059 ("metis" ,metis)
2060 ("scotch" ,scotch)))
2061 (arguments
2062 `(#:modules ((ice-9 match)
2063 (ice-9 popen)
2064 (srfi srfi-1)
2065 ,@%gnu-build-system-modules)
2066 #:phases
2067 (modify-phases %standard-phases
fba78d18 2068 (replace 'configure
cec86422
EB
2069 (lambda* (#:key inputs #:allow-other-keys)
2070 (call-with-output-file "Makefile.inc"
2071 (lambda (port)
2072 (format port "
2073PLAT =
2074LIBEXT = .a
2075OUTC = -o
2076OUTF = -o
2077RM = rm -f~:[
2078CC = gcc
2079FC = gfortran
2080FL = gfortran
2081INCSEQ = -I$(topdir)/libseq
2082LIBSEQ = -L$(topdir)/libseq -lmpiseq
2083LIBSEQNEEDED = libseqneeded~;
2084CC = mpicc
2085FC = mpifort
2086FL = mpifort~]
2087AR = ar vr # rules require trailing space, ugh...
2088RANLIB = ranlib
2089LIBBLAS = -L~a -lopenblas~@[
2090SCALAP = -L~a -lscalapack~]
2091LIBOTHERS = -pthread
2092CDEFS = -DAdd_
2093PIC = -fPIC
2094OPTF = -O2 -DALLOW_NON_INIT $(PIC)
2095OPTL = -O2 $(PIC)
2096OPTC = -O2 $(PIC)
2097INCS = $(INCSEQ)
2098LIBS = $(SCALAP) $(LIBSEQ)
2099LPORDDIR = $(topdir)/PORD/lib
2100IPORD = -I$(topdir)/PORD/include
2101LPORD = -L$(LPORDDIR) -lpord
2102ORDERINGSF = -Dpord~@[
2103METISDIR = ~a
2104IMETIS = -I$(METISDIR)/include
2105LMETIS = -L$(METISDIR)/lib -lmetis
2106ORDERINGSF += -Dmetis~]~@[~:{
2107SCOTCHDIR = ~a
2108ISCOTCH = -I$(SCOTCHDIR)/include
2109LSCOTCH = -L$(SCOTCHDIR)/lib ~a-lesmumps -lscotch -lscotcherr
2110ORDERINGSF += ~a~}~]
2111ORDERINGSC = $(ORDERINGSF)
2112LORDERINGS = $(LPORD) $(LMETIS) $(LSCOTCH)
2113IORDERINGSF = $(ISCOTCH)
2114IORDERINGSC = $(IPORD) $(IMETIS) $(ISCOTCH)"
2115 (assoc-ref inputs "mpi")
2116 (assoc-ref inputs "blas")
2117 (assoc-ref inputs "scalapack")
2118 (assoc-ref inputs "metis")
2119 (match (list (assoc-ref inputs "pt-scotch")
2120 (assoc-ref inputs "scotch"))
2121 ((#f #f)
2122 #f)
2123 ((#f scotch)
2124 `((,scotch "" "-Dscotch")))
2125 ((ptscotch _)
2126 `((,ptscotch
2127 "-lptesmumps -lptscotch -lptscotcherr "
2128 "-Dptscotch")))))))))
fba78d18 2129 (replace 'build
cec86422
EB
2130 ;; By default only the d-precision library is built. Make with "all"
2131 ;; target so that all precision libraries and examples are built.
2132 (lambda _
b414cf52
TGR
2133 (invoke "make" "all"
2134 (format #f "-j~a" (parallel-job-count)))))
fba78d18 2135 (replace 'check
cec86422
EB
2136 ;; Run the simple test drivers, which read test input from stdin:
2137 ;; from the "real" input for the single- and double-precision
2138 ;; testers, and from the "cmplx" input for complex-precision
2139 ;; testers. The EXEC-PREFIX key is used by the mumps-openmpi
2140 ;; package to prefix execution with "mpirun".
2141 (lambda* (#:key (exec-prefix '()) #:allow-other-keys)
2142 (with-directory-excursion "examples"
2143 (every
2144 (lambda (prec type)
2145 (let ((tester (apply open-pipe*
2146 `(,OPEN_WRITE
2147 ,@exec-prefix
2148 ,(string-append "./" prec
2149 "simpletest"))))
2150 (input (open-input-file
2151 (string-append "input_simpletest_" type))))
2152 (begin
2153 (dump-port input tester)
2154 (close-port input)
2155 (zero? (close-pipe tester)))))
2156 '("s" "d" "c" "z")
2157 '("real" "real" "cmplx" "cmplx")))))
fba78d18
EB
2158 (replace 'install
2159 (lambda* (#:key outputs #:allow-other-keys)
2160 (let* ((out (assoc-ref outputs "out"))
2161 (libdir (string-append out "/lib")))
2162 (copy-recursively "lib" libdir)
2163 (copy-recursively "include" (string-append out "/include"))
2164 (when (file-exists? "libseq/libmpiseq.a")
2165 (install-file "libseq/libmpiseq.a" libdir))
2166 #t))))))
cec86422
EB
2167 (home-page "http://mumps.enseeiht.fr")
2168 (synopsis "Multifrontal sparse direct solver")
2169 (description
2170 "MUMPS (MUltifrontal Massively Parallel sparse direct Solver) solves a
2171sparse system of linear equations A x = b using Guassian elimination.")
2172 (license license:cecill-c)))
2173
2174(define-public mumps-metis
2175 (package (inherit mumps)
2176 (name "mumps-metis")
2177 (inputs
2178 (alist-delete "scotch" (package-inputs mumps)))))
2179
2180(define-public mumps-openmpi
2181 (package (inherit mumps)
2182 (name "mumps-openmpi")
2183 (inputs
2184 `(("mpi" ,openmpi)
2185 ("scalapack" ,scalapack)
2186 ("pt-scotch" ,pt-scotch)
2187 ,@(alist-delete "scotch" (package-inputs mumps))))
2188 (arguments
2189 (substitute-keyword-arguments (package-arguments mumps)
2190 ((#:phases phases)
2191 `(modify-phases ,phases
bbe46a4a
EB
2192 (add-before 'check 'mpi-setup
2193 ,%openmpi-setup)
6df2a50a
LC
2194 (replace 'check
2195 (lambda _
2196 ((assoc-ref ,phases 'check)
2197 #:exec-prefix '("mpirun" "-n" "2"))))))))
cec86422
EB
2198 (synopsis "Multifrontal sparse direct solver (with MPI)")))
2199
2200(define-public mumps-metis-openmpi
2201 (package (inherit mumps-openmpi)
2202 (name "mumps-metis-openmpi")
2203 (inputs
2204 (alist-delete "pt-scotch" (package-inputs mumps-openmpi)))))
2205
2d047896
RW
2206(define-public r-quadprog
2207 (package
2208 (name "r-quadprog")
2209 (version "1.5-5")
2210 (source
2211 (origin
2212 (method url-fetch)
2213 (uri (cran-uri "quadprog" version))
2214 (sha256
2215 (base32
2216 "0jg3r6abmhp8r9vkbhpx9ldjfw6vyl1m4c5vwlyjhk1mi03656fr"))))
2217 (build-system r-build-system)
2218 (native-inputs
2219 `(("gfortran" ,gfortran)))
e9960d8c 2220 (home-page "https://cran.r-project.org/web/packages/quadprog")
2d047896
RW
2221 (synopsis "Functions to solve quadratic programming problems")
2222 (description
2223 "This package contains routines and documentation for solving quadratic
2224programming problems.")
2225 (license license:gpl3+)))
2226
ec8c7e47
RJ
2227(define-public r-pracma
2228 (package
2229 (name "r-pracma")
0aad198e 2230 (version "2.2.2")
ec8c7e47
RJ
2231 (source (origin
2232 (method url-fetch)
2233 (uri (cran-uri "pracma" version))
2234 (sha256
0aad198e 2235 (base32 "18zhni05gwnxbphl6bmjjxmsgg5wwnnkwlb4g971cqyw3dsd83ki"))))
ec8c7e47 2236 (build-system r-build-system)
39528a5e 2237 (home-page "https://cran.r-project.org/web/packages/pracma/")
ec8c7e47
RJ
2238 (synopsis "Practical numerical math functions")
2239 (description "This package provides functions for numerical analysis and
2240linear algebra, numerical optimization, differential equations, plus some
2241special functions. It uses Matlab function names where appropriate to simplify
2242porting.")
2243 (license license:gpl3+)))
2244
63e07468
BW
2245(define-public ruby-asciimath
2246 (package
2247 (name "ruby-asciimath")
2248 (version "1.0.4")
2249 (source
2250 (origin
2251 (method url-fetch)
2252 (uri (rubygems-uri "asciimath" version))
2253 (sha256
2254 (base32
2255 "1d80kiph5mc78zps7si1hv48kv4k12mzaq8jk5kb3pqpjdr72qmc"))))
2256 (build-system ruby-build-system)
2257 (arguments
2258 '(#:phases
2259 (modify-phases %standard-phases
2260 ;; Apply this patch
2261 ;; https://github.com/asciidoctor/asciimath/commit/1c06fdc8086077f4785479f78b0823a4a72d7948
2262 (add-after 'unpack 'patch-remove-spurious-backslashes
2263 (lambda _
2264 (substitute* "spec/parser_spec.rb"
2265 (("\\\\\"")
9923d5a4
TGR
2266 "\""))
2267 #t)))))
63e07468
BW
2268 (native-inputs
2269 `(("bundler" ,bundler)
2270 ("ruby-rspec" ,ruby-rspec)))
2271 (synopsis "AsciiMath parsing and conversion library")
2272 (description
2273 "A pure Ruby AsciiMath parsing and conversion library. AsciiMath is an
2274easy-to-write markup language for mathematics.")
2275 (home-page "https://github.com/asciidoctor/asciimath")
2276 (license license:expat)))
2277
183e44ae
EB
2278(define-public superlu
2279 (package
2280 (name "superlu")
995a09e0 2281 (version "5.2.1")
183e44ae
EB
2282 (source
2283 (origin
2284 (method url-fetch)
2285 (uri (string-append "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/"
2286 "superlu_" version ".tar.gz"))
2287 (sha256
995a09e0
EB
2288 (base32 "0qzlb7cd608q62kyppd0a8c65l03vrwqql6gsm465rky23b6dyr8"))
2289 (modules '((guix build utils)))
2290 (snippet
2291 ;; Replace the non-free implementation of MC64 with a stub adapted
2292 ;; from Debian
2293 '(begin
2294 (use-modules (ice-9 regex)
2295 (ice-9 rdelim))
2296 (call-with-output-file "SRC/mc64ad.c"
2297 (lambda (port)
2298 (display "
2299#include <stdio.h>
2300#include <stdlib.h>
2301void mc64id_(int *a) {
2302 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
2303 abort ();
2304}
2305void mc64ad_ (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
2306 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
2307 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
2308 abort ();
2309}\n" port)))
2310 ;; Remove the corresponding license verbiage. MC64 license follows
2311 ;; a "------" line separator.
2312 (with-atomic-file-replacement "License.txt"
2313 (let ((rx (make-regexp "-{8}")))
2314 (lambda (in out)
2315 (let loop ()
2316 (let ((line (read-line in 'concat)))
2317 (unless (regexp-exec rx line)
2318 (display line out)
6cbee49d
MW
2319 (loop))))
2320 #t)))))))
995a09e0 2321 (build-system cmake-build-system)
183e44ae
EB
2322 (native-inputs
2323 `(("tcsh" ,tcsh)))
2324 (inputs
995a09e0 2325 `(("blas" ,openblas)
19afbea1 2326 ("gfortran" ,gfortran)))
183e44ae 2327 (arguments
995a09e0
EB
2328 `(#:configure-flags '("-Denable_blaslib:BOOL=NO" ;do not use internal cblas
2329 "-DTPL_BLAS_LIBRARIES=openblas"
677bc34d 2330 "-DBUILD_SHARED_LIBS:BOOL=YES")))
183e44ae
EB
2331 (home-page "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/")
2332 (synopsis "Supernodal direct solver for sparse linear systems")
2333 (description
2334 "SuperLU is a general purpose library for the direct solution of large,
2335sparse, nonsymmetric systems of linear equations on high performance machines.
2336The library is written in C and is callable from either C or Fortran. The
2337library routines perform an LU decomposition with partial pivoting and
2338triangular system solves through forward and back substitution. The library
2339also provides threshold-based ILU factorization preconditioners.")
995a09e0
EB
2340 (license (list license:bsd-3
2341 license:gpl2+ ;EXAMPLE/*fgmr.c
2342 (license:fsf-free "file://SRC/colamd.h")))))
f8ed036a 2343
a54aefea
EB
2344(define-public superlu-dist
2345 (package
2346 (name "superlu-dist")
6161141e 2347 (version "6.1.0")
a54aefea
EB
2348 (source
2349 (origin
2350 (method url-fetch)
2351 (uri (string-append "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/"
2352 "superlu_dist_" version ".tar.gz"))
2353 (sha256
6161141e 2354 (base32 "0pqgcgh1yxhfzs99fas3mggajzd5wca3nbyp878rziy74gfk03dl"))
0921eff2 2355 (modules '((guix build utils)))
29080870
EB
2356 (snippet
2357 ;; Replace the non-free implementation of MC64 with a stub
2358 '(begin
0921eff2 2359 (call-with-output-file "SRC/mc64ad_dist.c"
29080870
EB
2360 (lambda (port)
2361 (display "
2362#include <stdio.h>
2363#include <stdlib.h>
0921eff2 2364void mc64id_dist(int *a) {
29080870
EB
2365 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
2366 abort ();
2367}
0921eff2 2368void mc64ad_dist (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
29080870
EB
2369 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
2370 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
2371 abort ();
2372}\n" port)))
29080870 2373 (substitute* "SRC/util.c" ;adjust default algorithm
6161141e
EB
2374 (("RowPerm[[:blank:]]*=[[:blank:]]*LargeDiag_MC64;")
2375 ;; TODO: set to "LargeDiag_AWPM" once combinatorial-blas has
2376 ;; general (i.e. non-square) processor-grid support.
2377 "RowPerm = NOROWPERM;"))
6cbee49d 2378 #t))
6161141e 2379 (patches (search-patches "superlu-dist-scotchmetis.patch"
2bdf26f1
EB
2380 "superlu-dist-awpm-grid.patch"
2381 "superlu-dist-fix-mpi-deprecations.patch"))))
6161141e 2382 (build-system cmake-build-system)
a54aefea
EB
2383 (native-inputs
2384 `(("tcsh" ,tcsh)))
2385 (inputs
6161141e
EB
2386 `(("gfortran" ,gfortran)
2387 ("blas" ,openblas)
2388 ("lapack" ,lapack)
2389 ("combblas" ,combinatorial-blas)))
a54aefea 2390 (propagated-inputs
6161141e
EB
2391 `(("mpi" ,openmpi) ;headers include MPI heades
2392 ("parmetis" ,pt-scotch32 "metis")
2393 ("pt-scotch" ,pt-scotch32)))
a54aefea 2394 (arguments
6161141e
EB
2395 `(#:parallel-tests? #f ;tests use MPI and OpenMP
2396 #:configure-flags (list "-DBUILD_SHARED_LIBS:BOOL=YES"
2397 "-DTPL_ENABLE_COMBBLASLIB=YES"
2398 "-DTPL_BLAS_LIBRARIES=-lopenblas"
2399 "-DTPL_LAPACK_LIBRARIES=-llapack"
2400 (string-append "-DTPL_PARMETIS_LIBRARIES="
2401 (string-join
2402 '("ptscotchparmetis" "ptscotch" "ptscotcherr"
2403 "scotchmetis" "scotch" "scotcherr")
2404 ";"))
2405 (string-append "-DTPL_PARMETIS_INCLUDE_DIRS="
2406 (assoc-ref %build-inputs "parmetis")
2407 "/include")
2408 "-DTPL_ENABLE_COMBBLASLIB=ON"
2409 (string-append "-DTPL_COMBBLAS_INCLUDE_DIRS="
2410 (assoc-ref %build-inputs "combblas")
2411 "/include/CombBLAS;"
2412 (assoc-ref %build-inputs "combblas")
2413 "/include/BipartiteMatchings")
2414 "-DTPL_COMBBLAS_LIBRARIES=CombBLAS")
a54aefea 2415 #:phases
dc1d3cde 2416 (modify-phases %standard-phases
6161141e 2417 (add-before 'configure 'set-c++-standard
dc1d3cde 2418 (lambda _
6161141e
EB
2419 (substitute* "CMakeLists.txt"
2420 ;; AWPM headers require C++14
2421 (("CMAKE_CXX_STANDARD 11") "CMAKE_CXX_STANDARD 14"))))
bbe46a4a
EB
2422 (add-before 'check 'mpi-setup
2423 ,%openmpi-setup)
6161141e
EB
2424 (add-before 'check 'omp-setup
2425 (lambda _ (setenv "OMP_NUM_THREADS" "1") #t)))))
a54aefea
EB
2426 (home-page (package-home-page superlu))
2427 (synopsis "Parallel supernodal direct solver")
2428 (description
2429 "SuperLU_DIST is a parallel extension to the serial SuperLU library.
2430It is targeted for distributed memory parallel machines. SuperLU_DIST is
2431implemented in ANSI C, and MPI for communications.")
2432 (license license:bsd-3)))
2433
f8ed036a
EB
2434(define-public scotch
2435 (package
2436 (name "scotch")
fd373343 2437 (version "6.0.6")
f8ed036a
EB
2438 (source
2439 (origin
2440 (method url-fetch)
1dc31097
TGR
2441 (uri (string-append "https://gforge.inria.fr/frs/download.php/"
2442 "latestfile/298/scotch_" version ".tar.gz"))
f8ed036a 2443 (sha256
fd373343
EB
2444 (base32 "1ky4k9r6jvajhqaqnnx6h8fkmds2yxgp70dpr1qzwcyhi2nhqvv8"))
2445 (patches (search-patches "scotch-build-parallelism.patch"
2446 "scotch-integer-declarations.patch"))))
f8ed036a
EB
2447 (build-system gnu-build-system)
2448 (inputs
2449 `(("zlib" ,zlib)
5e54f4ad 2450 ("flex" ,flex)
f8ed036a 2451 ("bison" ,bison)))
fd373343 2452 (outputs '("out" "metis"))
f8ed036a 2453 (arguments
fd373343
EB
2454 `(#:make-flags (list (string-append "prefix=" %output))
2455 #:phases
d6602ee9
EB
2456 (modify-phases %standard-phases
2457 (add-after
2458 'unpack 'chdir-to-src
d67a7e9e 2459 (lambda _ (chdir "src") #t))
d6602ee9
EB
2460 (replace
2461 'configure
2462 (lambda _
2463 (call-with-output-file "Makefile.inc"
2464 (lambda (port)
2465 (format port "
f8ed036a
EB
2466EXE =
2467LIB = .a
2468OBJ = .o
2469MAKE = make
2470AR = ar
2471ARFLAGS = -ruv
cf0ec6c4 2472CAT = cat
f8ed036a
EB
2473CCS = gcc
2474CCP = mpicc
2475CCD = gcc
2476CPPFLAGS =~{ -D~a~}
6c798540 2477CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
f8ed036a
EB
2478LDFLAGS = -lz -lm -lrt -lpthread
2479CP = cp
2480LEX = flex -Pscotchyy -olex.yy.c
2481LN = ln
2482MKDIR = mkdir
2483MV = mv
2484RANLIB = ranlib
2485YACC = bison -pscotchyy -y -b y
2486"
d6602ee9
EB
2487 '("COMMON_FILE_COMPRESS_GZ"
2488 "COMMON_PTHREAD"
2489 "COMMON_RANDOM_FIXED_SEED"
fd373343 2490 "INTSIZE64" ;use 'int64_t'
cf0ec6c4
EB
2491 ;; Prevents symbolc clashes with libesmumps
2492 "SCOTCH_RENAME"
d6602ee9
EB
2493 ;; XXX: Causes invalid frees in superlu-dist tests
2494 ;; "SCOTCH_PTHREAD"
2495 ;; "SCOTCH_PTHREAD_NUMBER=2"
d67a7e9e
TGR
2496 "restrict=__restrict"))))
2497 #t))
bbe46a4a 2498 (add-after 'build 'build-esmumps
cf0ec6c4 2499 (lambda _
d67a7e9e
TGR
2500 (invoke "make"
2501 (format #f "-j~a" (parallel-job-count))
2502 "esmumps")))
fd373343
EB
2503 (add-before 'install 'make-install-dirs
2504 (lambda* (#:key outputs #:allow-other-keys)
2505 (mkdir (assoc-ref outputs "out"))))
2506 (add-after 'install 'install-metis
2507 (lambda* (#:key outputs #:allow-other-keys)
2508 (let ((out (assoc-ref outputs "metis")))
2509 (mkdir out)
2510 ;; metis files are not installed with 'make install'
2511 (for-each (lambda (f)
2512 (install-file f (string-append out "/include")))
2513 (find-files "../include/" ".*metis\\.h"))
2514 (for-each (lambda (f)
2515 (install-file f (string-append out "/lib")))
2516 (find-files "../lib/" ".*metis\\..*"))
2517 #t))))))
f8ed036a
EB
2518 (home-page "http://www.labri.fr/perso/pelegrin/scotch/")
2519 (synopsis "Programs and libraries for graph algorithms")
2520 (description "SCOTCH is a set of programs and libraries which implement
2521the static mapping and sparse matrix reordering algorithms developed within
2522the SCOTCH project. Its purpose is to apply graph theory, with a divide and
2523conquer approach, to scientific computing problems such as graph and mesh
2524partitioning, static mapping, and sparse matrix ordering, in application
2525domains ranging from structural mechanics to operating systems or
2526bio-chemistry.")
2527 ;; See LICENSE_en.txt
2528 (license license:cecill-c)))
6acb4adb 2529
1c39f3b8
PG
2530(define-public scotch32
2531 ;; This is the 'INTSIZE32' variant, which uses 32-bit integers, as needed by
2532 ;; some applications.
2533 (package (inherit scotch)
2534 (name "scotch32")
2535 (arguments
2536 (substitute-keyword-arguments (package-arguments scotch)
2537 ((#:phases scotch-phases)
2538 `(modify-phases ,scotch-phases
2539 (replace
2540 'configure
2541 (lambda _
2542 (call-with-output-file "Makefile.inc"
2543 (lambda (port)
2544 (format port "
2545EXE =
2546LIB = .a
2547OBJ = .o
2548MAKE = make
2549AR = ar
2550ARFLAGS = -ruv
2551CAT = cat
2552CCS = gcc
2553CCP = mpicc
2554CCD = gcc
2555CPPFLAGS =~{ -D~a~}
2556CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
2557LDFLAGS = -lz -lm -lrt -lpthread
2558CP = cp
2559LEX = flex -Pscotchyy -olex.yy.c
2560LN = ln
2561MKDIR = mkdir
2562MV = mv
2563RANLIB = ranlib
2564YACC = bison -pscotchyy -y -b y
2565"
2566 '("COMMON_FILE_COMPRESS_GZ"
2567 "COMMON_PTHREAD"
2568 "COMMON_RANDOM_FIXED_SEED"
2569 "INTSIZE32" ;use 32-bit integers. See INSTALL.txt
2570 ;; Prevents symbolc clashes with libesmumps
2571 "SCOTCH_RENAME"
2572 ;; XXX: Causes invalid frees in superlu-dist tests
2573 ;; "SCOTCH_PTHREAD"
2574 ;; "SCOTCH_PTHREAD_NUMBER=2"
2575 "restrict=__restrict"))))))))))
2576 (synopsis
2577 "Programs and libraries for graph algorithms (32-bit integers)")))
2578
6acb4adb
EB
2579(define-public pt-scotch
2580 (package (inherit scotch)
2581 (name "pt-scotch")
2582 (propagated-inputs
2583 `(("openmpi" ,openmpi))) ;Headers include MPI headers
2584 (arguments
2585 (substitute-keyword-arguments (package-arguments scotch)
2586 ((#:phases scotch-phases)
d6602ee9
EB
2587 `(modify-phases ,scotch-phases
2588 (replace
2589 'build
d6602ee9 2590 (lambda _
c491f7f8
LC
2591 (invoke "make" (format #f "-j~a" (parallel-job-count))
2592 "ptscotch" "ptesmumps")
2593
2594 ;; Install the serial metis compatibility library
2595 (invoke "make" "-C" "libscotchmetis" "install")))
2596 (add-before 'check 'mpi-setup
2597 ,%openmpi-setup)
2598 (replace 'check
2599 (lambda _
2600 (invoke "make" "ptcheck")))))))
6acb4adb 2601 (synopsis "Programs and libraries for graph algorithms (with MPI)")))
5698b8b8 2602
1c25a52c
PG
2603(define-public pt-scotch32
2604 (package (inherit scotch32)
2605 (name "pt-scotch32")
2606 (propagated-inputs
2607 `(("openmpi" ,openmpi))) ;headers include MPI headers
2608 (arguments
c4d4a779
PG
2609 (substitute-keyword-arguments (package-arguments scotch32)
2610 ((#:phases scotch32-phases)
2611 `(modify-phases ,scotch32-phases
1c25a52c
PG
2612 (replace 'build
2613 (lambda _
c491f7f8
LC
2614 (invoke "make" (format #f "-j~a" (parallel-job-count))
2615 "ptscotch" "ptesmumps")
2616 ;; Install the serial metis compatibility library
2617 (invoke "make" "-C" "libscotchmetis" "install")))
2618 (add-before 'check 'mpi-setup
2619 ,%openmpi-setup)
1c25a52c
PG
2620 (replace 'check
2621 (lambda _
c491f7f8 2622 (invoke "make" "ptcheck")))))))
1c25a52c
PG
2623 (synopsis
2624 "Programs and libraries for graph algorithms (with MPI and 32-bit integers)")))
2625
aa75ad00
EB
2626(define-public metis
2627 (package
2628 (name "metis")
2629 (version "5.1.0")
2630 (source
2631 (origin
2632 (method url-fetch)
2633 (uri (string-append "http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/"
2634 "metis-" version ".tar.gz"))
2635 (sha256
2636 (base32
2637 "1cjxgh41r8k6j029yxs8msp3z6lcnpm16g5pvckk35kc7zhfpykn"))))
2638 (build-system cmake-build-system)
2639 (inputs
2640 `(("blas" ,openblas)))
2641 (arguments
2642 `(#:tests? #f ;no tests
2643 #:configure-flags `("-DSHARED=ON"
2644 ,(string-append "-DGKLIB_PATH=" (getcwd)
2645 "/metis-" ,version "/GKlib"))))
2646 (home-page "http://glaros.dtc.umn.edu/gkhome/metis/metis/overview")
2647 (synopsis "Graph partitioning and fill-reducing matrix ordering library")
2648 (description
2649 "METIS is a set of serial programs for partitioning graphs, partitioning
2650finite element meshes, and producing fill-reducing orderings for sparse
2651matrices. The algorithms implemented in METIS are based on the multilevel
2652recursive-bisection, multilevel k-way, and multi-constraint partitioning
2653schemes.")
2654 (license license:asl2.0))) ;As of version 5.0.3
2655
700ff222
EB
2656(define-public p4est
2657 (package
2658 (name "p4est")
4150da63 2659 (version "2.0")
700ff222
EB
2660 (source
2661 (origin
2662 (method url-fetch)
2663 (uri (string-append "http://p4est.github.io/release/p4est-"
2664 version ".tar.gz"))
2665 (sha256
2666 (base32
4150da63 2667 "16h267z256kxcxfjs390qqzv19hr58vrj4x8lndb7alnk2vca8n5"))))
700ff222
EB
2668 (build-system gnu-build-system)
2669 (inputs
2670 `(("fortran" ,gfortran)
2671 ("blas" ,openblas)
2672 ("lapack" ,lapack)
2673 ("zlib" ,zlib)))
2674 (arguments
2675 `(#:configure-flags `(,(string-append "BLAS_LIBS=-L"
2676 (assoc-ref %build-inputs "blas")
2677 " -lopenblas")
2678 ,(string-append "LAPACK_LIBS=-L"
2679 (assoc-ref %build-inputs "lapack")
6df2a50a
LC
2680 " -llapack"))
2681 #:phases (modify-phases %standard-phases
bbe46a4a
EB
2682 (add-before 'check 'mpi-setup
2683 ,%openmpi-setup))))
700ff222
EB
2684 (home-page "http://www.p4est.org")
2685 (synopsis "Adaptive mesh refinement on forests of octrees")
2686 (description
2687 "The p4est software library enables the dynamic management of a
2688collection of adaptive octrees, conveniently called a forest of octrees.
2689p4est is designed to work in parallel and scales to hundreds of thousands of
2690processor cores.")
2691 (license license:gpl2+)))
2692
2693(define-public p4est-openmpi
2694 (package (inherit p4est)
2695 (name "p4est-openmpi")
2696 (inputs
2697 `(("mpi" ,openmpi)
2698 ,@(package-inputs p4est)))
2699 (arguments
2700 (substitute-keyword-arguments (package-arguments p4est)
2701 ((#:configure-flags cf)
2702 ``("--enable-mpi" ,@,cf))))
2703 (synopsis "Parallel adaptive mesh refinement on forests of octrees")))
2704
5698b8b8
JD
2705(define-public gsegrafix
2706 (package
2707 (name "gsegrafix")
2708 (version "1.0.6")
2709 (source
2710 (origin
2711 (method url-fetch)
2712 (uri (string-append "mirror://gnu/" name "/" name "-"
2713 version ".tar.gz"))
2714 (sha256
2715 (base32
2716 "1b13hvx063zv970y750bx41wpx6hwd5ngjhbdrna8w8yy5kmxcda"))))
2717 (build-system gnu-build-system)
2718 (arguments
2719 `(#:configure-flags '("LDFLAGS=-lm")))
2720 (inputs
2721 `(("libgnomecanvas" ,libgnomecanvas)
2722 ("libbonoboui" ,libbonoboui)
2723 ("libgnomeui" ,libgnomeui)
2724 ("libgnomeprintui" ,libgnomeprintui)
2725 ("popt" ,popt)))
2726 (native-inputs
2727 `(("pkg-config" ,pkg-config)))
6fd52309 2728 (home-page "https://www.gnu.org/software/gsegrafix/")
5698b8b8
JD
2729 (synopsis "GNOME application to create scientific and engineering plots")
2730 (description "GSEGrafix is an application which produces high-quality graphical
2731plots for science and engineering. Plots are specified via simple ASCII
2732parameter files and data files and are presented in an anti-aliased GNOME
2733canvas. The program supports rectangular two-dimensional plots, histograms,
2734polar-axis plots and three-dimensional plots. Plots can be printed or saved
2735to BMP, JPEG or PNG image formats.")
2736 (license license:gpl3+)))
8731e527
JD
2737
2738(define-public maxima
2739 (package
2740 (name "maxima")
a4362fba 2741 (version "5.42.2")
8731e527
JD
2742 (source
2743 (origin
2744 (method url-fetch)
2745 (uri (string-append "mirror://sourceforge/maxima/Maxima-source/"
2746 version "-source/" name "-" version ".tar.gz"))
2747 (sha256
2748 (base32
a4362fba 2749 "0kdncy6137sg3rradirxzj10mkcvafxd892zlclwhr9sa7b12zhn"))
fc1adab1 2750 (patches (search-patches "maxima-defsystem-mkdir.patch"))))
8731e527 2751 (build-system gnu-build-system)
df354a77 2752 (inputs
6b2eafaa 2753 `(("gcl" ,gcl)
df354a77 2754 ("gnuplot" ,gnuplot) ;for plots
fc9c47bd 2755 ("sed" ,sed)
f36afe4d 2756 ("tk" ,tk))) ;Tcl/Tk is used by 'xmaxima'
df354a77
FB
2757 (native-inputs
2758 `(("texinfo" ,texinfo)
ccbc5758
KK
2759 ("perl" ,perl)
2760 ("python" ,python)))
8731e527 2761 (arguments
df354a77
FB
2762 `(#:configure-flags
2763 (list "--enable-gcl"
2764 (string-append "--with-posix-shell="
2765 (assoc-ref %build-inputs "bash")
2766 "/bin/sh")
2767 (string-append "--with-wish="
2768 (assoc-ref %build-inputs "tk")
2769 "/bin/wish"
2770 (let ((v ,(package-version tk)))
2771 (string-take v (string-index-right v #\.)))))
df354a77 2772 ;; By default Maxima attempts to write temporary files to
77af7b24
MW
2773 ;; '/tmp/nix-build-maxima-*', which won't exist at run time.
2774 ;; Work around that.
df354a77 2775 #:make-flags (list "TMPDIR=/tmp")
0093b126
KK
2776 #:phases
2777 (modify-phases %standard-phases
fc9c47bd
KK
2778 (add-after 'unpack 'patch-paths
2779 (lambda* (#:key inputs #:allow-other-keys)
2780 (let* ((sed (string-append (assoc-ref inputs "sed") "/bin/sed"))
2781 (coreutils (assoc-ref inputs "coreutils"))
2782 (dirname (string-append coreutils "/bin/dirname"))
2783 (head (string-append coreutils "/bin/head")))
2784 (substitute* "src/maxima.in"
2785 (("sed ") (string-append sed " "))
2786 (("dirname") dirname)
2787 (("head") head))
2788 #t)))
0093b126
KK
2789 (add-before 'check 'pre-check
2790 (lambda _
2791 (chmod "src/maxima" #o555)
2792 #t))
1472d19a
KK
2793 (replace 'check
2794 (lambda _
2795 ;; This is derived from the testing code in the "debian/rules" file
2796 ;; of Debian's Maxima package.
2797 ;; If Maxima can successfully run this, the binary to be installed
2798 ;; should be fine.
2799 (zero?
2800 (system
2801 (string-append "./maxima-local "
2802 "--lisp=gcl "
2803 "--batch-string=\"run_testsuite();\" "
2804 "| grep -q \"No unexpected errors found\"")))))
0093b126
KK
2805 ;; Make sure the doc and emacs files are found in the
2806 ;; standard location. Also configure maxima to find gnuplot
2807 ;; without having it on the PATH.
2808 (add-after 'install 'post-install
2809 (lambda* (#:key outputs inputs #:allow-other-keys)
2810 (let* ((gnuplot (assoc-ref inputs "gnuplot"))
2811 (out (assoc-ref outputs "out"))
2812 (datadir (string-append out "/share/maxima/" ,version))
2813 (binutils (string-append (assoc-ref inputs "binutils")
2814 "/bin")))
2815 (with-directory-excursion out
2816 (mkdir-p "share/emacs")
2817 (mkdir-p "share/doc")
2818 (symlink
2819 (string-append datadir "/emacs/")
2820 (string-append out "/share/emacs/site-lisp"))
2821 (symlink
2822 (string-append datadir "/doc/")
2823 (string-append out "/share/doc/maxima"))
2824 (with-atomic-file-replacement
2825 (string-append datadir "/share/maxima-init.lisp")
2826 (lambda (in out)
2827 (format out "~a ~s~a~%"
2828 "(setf $gnuplot_command "
2829 (string-append gnuplot "/bin/gnuplot") ")")
2830 (dump-port in out))))
2831 ;; Ensure that Maxima will have access to the GNU binutils
2832 ;; components at runtime.
2833 (wrap-program (string-append out "/bin/maxima")
2834 `("PATH" prefix (,binutils))))
2835 #t)))))
8731e527
JD
2836 (home-page "http://maxima.sourceforge.net")
2837 (synopsis "Numeric and symbolic expression manipulation")
2838 (description "Maxima is a system for the manipulation of symbolic and
2839numerical expressions. It yields high precision numeric results by using
2840exact fractions, arbitrary precision integers, and variable precision floating
e881752c 2841point numbers.")
8731e527
JD
2842 ;; Some files are lgpl2.1+. Some are gpl2+. Some explicitly state gpl1+.
2843 ;; Others simply say "GNU General Public License" without stating a
2844 ;; version (which implicitly means gpl1+).
2845 ;; At least one file (src/maxima.asd) says "version 2."
2846 ;; GPLv2 only is therefore the smallest subset.
f36afe4d 2847 (license license:gpl2)))
ec322be2 2848
9aafbc0c
MW
2849(define-public wxmaxima
2850 (package
2851 (name "wxmaxima")
932d6e27 2852 (version "19.03.1")
9aafbc0c
MW
2853 (source
2854 (origin
c93b77ad
KK
2855 (method git-fetch)
2856 (uri (git-reference
2857 (url "https://github.com/wxMaxima-developers/wxmaxima.git")
2858 (commit (string-append "Version-" version))))
2859 (file-name (git-file-name name version))
9aafbc0c
MW
2860 (sha256
2861 (base32
932d6e27 2862 "1qkf4jg86xnn3wk3782ffmfz12axb92dkjagcz3ffzw2wi1rclml"))))
0181df53 2863 (build-system cmake-build-system)
5143517c 2864 (native-inputs
0181df53 2865 `(("gettext" ,gettext-minimal)))
9aafbc0c
MW
2866 (inputs
2867 `(("wxwidgets" ,wxwidgets)
de477809
SB
2868 ("maxima" ,maxima)
2869 ;; Runtime support.
2870 ("adwaita-icon-theme" ,adwaita-icon-theme)
2871 ("gtk+" ,gtk+)
2872 ("shared-mime-info" ,shared-mime-info)))
9aafbc0c 2873 (arguments
0181df53
KK
2874 `(#:tests? #f ; no check target
2875 #:phases
ac2ddcc6 2876 (modify-phases %standard-phases
ac2ddcc6
KK
2877 (add-after 'install 'wrap-program
2878 (lambda* (#:key inputs outputs #:allow-other-keys)
2879 (wrap-program (string-append (assoc-ref outputs "out")
2880 "/bin/wxmaxima")
2881 `("PATH" ":" prefix
2882 (,(string-append (assoc-ref inputs "maxima")
2883 "/bin")))
2884 ;; For GtkFileChooserDialog.
2885 `("GSETTINGS_SCHEMA_DIR" =
2886 (,(string-append (assoc-ref inputs "gtk+")
2887 "/share/glib-2.0/schemas")))
2888 `("XDG_DATA_DIRS" ":" prefix
2889 (;; Needed by gdk-pixbuf to know supported icon formats.
2890 ,(string-append
2891 (assoc-ref inputs "shared-mime-info") "/share")
2892 ;; The default icon theme of GTK+.
2893 ,(string-append
2894 (assoc-ref inputs "adwaita-icon-theme") "/share"))))
2895 #t)))))
9aafbc0c
MW
2896 (home-page "https://andrejv.github.io/wxmaxima/")
2897 (synopsis "Graphical user interface for the Maxima computer algebra system")
2898 (description
2899 "wxMaxima is a graphical user interface for the Maxima computer algebra
2900system. It eases the use of Maxima by making most of its commands available
2901through a menu system and by providing input dialogs for commands that require
2902more than one argument. It also implements its own display engine that
2903outputs mathematical symbols directly instead of depicting them with ASCII
2904characters.
2905
2906wxMaxima also features 2D and 3D inline plots, simple animations, mixing of
2907text and mathematical calculations to create documents, exporting of input and
2908output to TeX, and a browser for Maxima's manual including command index and
2909full text searching.")
2910 (license license:gpl2+)))
2911
b15e47f9
RW
2912(define-public armadillo
2913 (package
2914 (name "armadillo")
f133e244 2915 (version "9.100.5")
b15e47f9
RW
2916 (source (origin
2917 (method url-fetch)
2918 (uri (string-append "mirror://sourceforge/arma/armadillo-"
7397cd9e 2919 version ".tar.xz"))
b15e47f9
RW
2920 (sha256
2921 (base32
f133e244 2922 "1ka1vd9fcmvp12qkcm4888dkfqwnalvv00x04wy29f3nx3qwczby"))))
b15e47f9 2923 (build-system cmake-build-system)
e405c0bc 2924 (arguments `(#:tests? #f)) ; no test target
b15e47f9
RW
2925 (inputs
2926 `(("openblas" ,openblas)
2927 ("lapack" ,lapack)
2928 ("arpack" ,arpack-ng)))
2929 (home-page "http://arma.sourceforge.net/")
2930 (synopsis "C++ linear algebra library")
2931 (description
2932 "Armadillo is a C++ linear algebra library, aiming towards a good balance
2933between speed and ease of use. It is useful for algorithm development
2934directly in C++, or quick conversion of research code into production
2935environments. It can be used for machine learning, pattern recognition,
2936signal processing, bioinformatics, statistics, econometrics, etc. The library
2937provides efficient classes for vectors, matrices and cubes, as well as 150+
2938associated functions (eg. contiguous and non-contiguous submatrix views).")
fe418cc5 2939 (license license:asl2.0)))
b15e47f9 2940
279663ef 2941(define-public muparser
d7cff656
LF
2942 ;; When switching download sites, muparser re-issued a 2.2.5 release with a
2943 ;; different hash. In order to make `guix package --upgrade` work correctly,
2944 ;; we set a Guix packaging revision.
2945 ;; When the next version of muparser is released, we can remove
2946 ;; UPSTREAM-VERSION and REVISION and use the plain VERSION.
2947 (let ((upstream-version "2.2.5")
2948 (revision "2"))
2949 (package
2950 (name "muparser")
2951 (version (string-append upstream-version "-" revision))
2952 (source
2953 (origin
2954 (method url-fetch)
2955 (uri (string-append "https://github.com/beltoforion/muparser/archive/v"
2956 upstream-version ".tar.gz"))
2957 (file-name (string-append name "-" version ".tar.gz"))
2958 (sha256
2959 (base32
2960 "0277qsi5l23jsck1vhn383bmvc2n9l4a1dl5r9bf7hvjv9ayyrh6"))))
2961 (build-system gnu-build-system)
2962 (arguments
2963 `(#:configure-flags '("--enable-samples=no")
2964 #:tests? #f)) ;no "check" target
2965 (home-page "http://muparser.beltoforion.de/")
2966 (synopsis "Fast parser library for mathematical expressions")
2967 (description
2968 "muParser is an extensible high performance math parser library. It is
2969based on transforming an expression into a bytecode and precalculating constant
2970parts of it.")
2971 (license license:expat))))
279663ef 2972
e73b49fb
RW
2973(define-public openblas
2974 (package
2975 (name "openblas")
16b940a0 2976 (version "0.3.4")
e73b49fb
RW
2977 (source
2978 (origin
2979 (method url-fetch)
a617fd55
MB
2980 (uri (string-append "mirror://sourceforge/openblas/v" version "/OpenBLAS%20"
2981 version "%20version.tar.gz"))
e73b49fb
RW
2982 (file-name (string-append name "-" version ".tar.gz"))
2983 (sha256
2984 (base32
16b940a0 2985 "1s56lgilyyw86dzmj3jkci9zsg24n60wq4d0zri1hrxlxb6ihimj"))))
e73b49fb
RW
2986 (build-system gnu-build-system)
2987 (arguments
5789566a 2988 `(#:test-target "test"
bd0b4379
RW
2989 ;; DYNAMIC_ARCH is only supported on x86. When it is disabled and no
2990 ;; TARGET is specified, OpenBLAS will tune itself to the build host, so
2991 ;; we need to disable substitutions.
71923a91
AE
2992 #:substitutable?
2993 ,(let ((system (or (%current-target-system) (%current-system))))
2994 (or (string-prefix? "x86_64" system)
bd0b4379 2995 (string-prefix? "i686" system)
83a34647
EF
2996 (string-prefix? "mips" system)
2997 (string-prefix? "aarch64" system)))
e73b49fb
RW
2998 #:make-flags
2999 (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
3000 "SHELL=bash"
af5b817e
RW
3001 ;; Build the library for all supported CPUs. This allows
3002 ;; switching CPU targets at runtime with the environment variable
3003 ;; OPENBLAS_CORETYPE=<type>, where "type" is a supported CPU type.
71923a91
AE
3004 ;; Unfortunately, this is not supported on non-x86 architectures,
3005 ;; where it leads to failed builds.
3006 ,@(let ((system (or (%current-target-system) (%current-system))))
8a637e79
RW
3007 (cond
3008 ((or (string-prefix? "x86_64" system)
71923a91 3009 (string-prefix? "i686" system))
8a637e79
RW
3010 '("DYNAMIC_ARCH=1"))
3011 ;; On MIPS we force the "SICORTEX" TARGET, as for the other
3012 ;; two available MIPS targets special extended instructions
3013 ;; for Loongson cores are used.
3014 ((string-prefix? "mips" system)
3015 '("TARGET=SICORTEX"))
83a34647
EF
3016 ;; On aarch64 force the generic 'armv8-a' target
3017 ((string-prefix? "aarch64" system)
3018 '("TARGET=ARMV8"))
8a637e79 3019 (else '()))))
e73b49fb 3020 ;; no configure script
493937ae
DL
3021 #:phases
3022 (modify-phases %standard-phases
3023 (delete 'configure)
3024 (add-before 'build 'set-extralib
3025 (lambda* (#:key inputs #:allow-other-keys)
3026 ;; Get libgfortran found when building in utest.
3027 (setenv "FEXTRALIB"
3028 (string-append "-L" (assoc-ref inputs "fortran-lib")
3029 "/lib"))
3030 #t)))))
e73b49fb 3031 (inputs
493937ae 3032 `(("fortran-lib" ,gfortran "lib")))
e73b49fb
RW
3033 (native-inputs
3034 `(("cunit" ,cunit)
493937ae 3035 ("fortran" ,gfortran)
e73b49fb
RW
3036 ("perl" ,perl)))
3037 (home-page "http://www.openblas.net/")
3038 (synopsis "Optimized BLAS library based on GotoBLAS")
3039 (description
3040 "OpenBLAS is a BLAS library forked from the GotoBLAS2-1.13 BSD version.")
3041 (license license:bsd-3)))
3042
daa6036f
EB
3043(define-public openblas-ilp64
3044 (package (inherit openblas)
3045 (name "openblas-ilp64")
3046 (supported-systems '("x86_64-linux" "aarch64-linux" "mips64el-linux"))
3047 (arguments
3048 (substitute-keyword-arguments (package-arguments openblas)
3049 ((#:make-flags flags '())
3050 `(append (list "INTERFACE64=1" "LIBNAMESUFFIX=ilp64")
3051 ,flags))))
3052 (synopsis "Optimized BLAS library based on GotoBLAS (ILP64 version)")
3053 (license license:bsd-3)))
3054
5a7deb11
LC
3055(define* (make-blis implementation #:optional substitutable?)
3056 "Return a BLIS package with the given IMPLEMENTATION (see config/ in the
3057source tree for a list of implementations.)
3058
3059SUBSTITUTABLE? determines whether the package is made available as a
3060substitute.
3061
3062Currently the specialization must be selected at configure-time, but work is
3063underway to allow BLIS to select the right optimized kernels at run time:
3064<https://github.com/flame/blis/issues/129>."
3065 (package
3066 (name (if (string=? implementation "reference")
3067 "blis"
3068 (string-append "blis-" implementation)))
3069 (version "0.2.2")
3070 (home-page "https://github.com/flame/blis")
3071 (source (origin
3072 (method git-fetch)
3073 (uri (git-reference (url home-page) (commit version)))
3074 (sha256
3075 (base32
3076 "1wr79a50nm4abhw8w3sn96nmwp5mrzifcigk7khw9qcgyyyqayfh"))
3077 (file-name (git-file-name "blis" version))))
3078 (build-system gnu-build-system)
3079 (arguments
3080 `(#:test-target "test"
3081
3082 #:substitutable? ,substitutable?
3083
3084 #:phases (modify-phases %standard-phases
3085 (replace 'configure
3086 (lambda* (#:key outputs #:allow-other-keys)
3087 ;; This is a home-made 'configure' script.
3088 (let ((out (assoc-ref outputs "out")))
3089 (zero? (system* "./configure" "-p" out
3090 "-d" "opt"
3091 "--disable-static"
3092 "--enable-shared"
3093 "--enable-threading=openmp"
3094
3095 ,implementation)))))
3096 (add-before 'check 'show-test-output
3097 (lambda _
3098 ;; By default "make check" is silent. Make it verbose.
3099 (system "tail -F output.testsuite &")
3100 #t)))))
3101 (synopsis "High-performance basic linear algebra (BLAS) routines")
3102 (description
3103 "BLIS is a portable software framework for instantiating high-performance
3104BLAS-like dense linear algebra libraries. The framework was designed to
3105isolate essential kernels of computation that, when optimized, immediately
3106enable optimized implementations of most of its commonly used and
3107computationally intensive operations. While BLIS exports a new BLAS-like API,
3108it also includes a BLAS compatibility layer which gives application developers
3109access to BLIS implementations via traditional BLAS routine calls.")
3110 (license license:bsd-3)))
3111
3112(define-public blis
3113 ;; This is the "reference" implementation, which is the non-optimized but
3114 ;; portable variant (no assembly).
3115 (make-blis "reference" #t))
3116
3117(define ignorance blis)
3118
3119(define-syntax-rule (blis/x86_64 processor)
3120 "Expand to a package specialized for PROCESSOR."
3121 (package
3122 (inherit (make-blis processor))
3123 (supported-systems '("x86_64-linux"))))
3124
3125(define-public blis-sandybridge
3126 ;; BLIS specialized for Sandy Bridge processors (launched 2011):
3127 ;; <http://ark.intel.com/products/codename/29900/Sandy-Bridge>.
3128 (blis/x86_64 "sandybridge"))
3129
3130(define-public blis-haswell
3131 ;; BLIS specialized for Haswell processors (launched 2013):
3132 ;; <http://ark.intel.com/products/codename/42174/Haswell>.
3133 (blis/x86_64 "haswell"))
3134
3135(define-public blis-knl
3136 ;; BLIS specialized for Knights Landing processor (launched 2016):
3137 ;; <http://ark.intel.com/products/series/92650/Intel-Xeon-Phi-x200-Product-Family>.
3138 (blis/x86_64 "knl"))
3139
3140
e1605e36
RW
3141(define-public openlibm
3142 (package
3143 (name "openlibm")
48d7ac17 3144 (version "0.6.0")
e1605e36
RW
3145 (source
3146 (origin
3147 (method url-fetch)
3148 (uri (string-append "https://github.com/JuliaLang/openlibm/archive/v"
3149 version ".tar.gz"))
3150 (file-name (string-append name "-" version ".tar.gz"))
3151 (sha256
3152 (base32
48d7ac17 3153 "0a5fpm8nra5ldhjk0cqd2rx1qh32wiarkxmcqcm5xl8z7l4kjm6l"))))
e1605e36
RW
3154 (build-system gnu-build-system)
3155 (arguments
3156 `(#:make-flags
3157 (list (string-append "prefix=" (assoc-ref %outputs "out")))
3158 #:phases
3159 ;; no configure script
dc1d3cde 3160 (modify-phases %standard-phases (delete 'configure))
e1605e36
RW
3161 #:tests? #f)) ;the tests are part of the default target
3162 (home-page "http://openlibm.org/")
3163 (synopsis "Portable C mathematical library (libm)")
3164 (description
3165 "OpenLibm is an effort to have a high quality, portable, standalone C
3166mathematical library (libm). It can be used standalone in applications and
3167programming language implementations. The project was born out of a need to
e881752c 3168have a good libm for the Julia programming language that worked consistently
e1605e36
RW
3169across compilers and operating systems, and in 32-bit and 64-bit
3170environments.")
538c0e3b
EF
3171 ;; Each architecture has its own make target, and there is none for mips.
3172 (supported-systems (delete "mips64el-linux" %supported-systems))
e1605e36
RW
3173 ;; See LICENSE.md for details.
3174 (license (list license:expat
3175 license:isc
3176 license:bsd-2
3177 license:public-domain
3178 license:lgpl2.1+))))
3179
e62be58f
RW
3180(define-public openspecfun
3181 (package
3182 (name "openspecfun")
59cd0ba4 3183 (version "0.5.3")
e62be58f
RW
3184 (source
3185 (origin
3186 (method url-fetch)
3187 (uri (string-append "https://github.com/JuliaLang/openspecfun/archive/v"
3188 version ".tar.gz"))
3189 (file-name (string-append name "-" version ".tar.gz"))
3190 (sha256
3191 (base32
59cd0ba4 3192 "1rs1bv8jq751fv9vq79890wqf9xlbjc7lvz3ighzyfczbyjcf18m"))))
e62be58f
RW
3193 (build-system gnu-build-system)
3194 (arguments
59cd0ba4 3195 '(#:tests? #f ; no "check" target
e62be58f
RW
3196 #:make-flags
3197 (list (string-append "prefix=" (assoc-ref %outputs "out")))
59cd0ba4
TGR
3198 #:phases
3199 (modify-phases %standard-phases
3200 (delete 'configure)))) ; no configure script
e62be58f 3201 (inputs
19afbea1 3202 `(("fortran" ,gfortran)))
e62be58f
RW
3203 (home-page "https://github.com/JuliaLang/openspecfun")
3204 (synopsis "Collection of special mathematical functions")
3205 (description
3206 "Openspecfun provides AMOS and Faddeeva. AMOS (from Netlib) is a
3207portable package for Bessel Functions of a Complex Argument and Nonnegative
3208Order; it contains subroutines for computing Bessel functions and Airy
3209functions. Faddeeva allows computing the various error functions of arbitrary
3210complex arguments (Faddeeva function, error function, complementary error
3211function, scaled complementary error function, imaginary error function, and
3212Dawson function); given these, one can also easily compute Voigt functions,
3213Fresnel integrals, and similar related functions as well.")
3214 ;; Faddeeva is released under the Expat license; AMOS is included as
3215 ;; public domain software.
3216 (license (list license:expat license:public-domain))))
3217
2742f87e
RW
3218(define-public suitesparse
3219 (package
3220 (name "suitesparse")
bd5b5ac0 3221 (version "4.5.5")
2742f87e
RW
3222 (source
3223 (origin
3224 (method url-fetch)
3225 (uri (string-append
3226 "http://faculty.cse.tamu.edu/davis/SuiteSparse/SuiteSparse-"
3227 version ".tar.gz"))
3228 (sha256
3229 (base32
bd5b5ac0
EB
3230 "1dnr6pmjzc2qmbkmb4shigx1l74ilf6abn7svyd6brxgvph8vadr"))
3231 (modules '((guix build utils)))
3232 (snippet
3233 ;; Remove bundled metis source
6cbee49d
MW
3234 '(begin
3235 (delete-file-recursively "metis-5.1.0")
3236 #t))))
2742f87e
RW
3237 (build-system gnu-build-system)
3238 (arguments
bd5b5ac0 3239 '(#:tests? #f ;no "check" target
2742f87e
RW
3240 #:make-flags
3241 (list "CC=gcc"
3242 "BLAS=-lblas"
3243 "TBB=-ltbb"
bd5b5ac0 3244 "MY_METIS_LIB=-lmetis"
2742f87e
RW
3245 (string-append "INSTALL_LIB="
3246 (assoc-ref %outputs "out") "/lib")
3247 (string-append "INSTALL_INCLUDE="
bd5b5ac0
EB
3248 (assoc-ref %outputs "out") "/include")
3249 "library")
2742f87e 3250 #:phases
2509522c 3251 (modify-phases %standard-phases
bd5b5ac0 3252 (delete 'configure)))) ;no configure script
2742f87e
RW
3253 (inputs
3254 `(("tbb" ,tbb)
bd5b5ac0
EB
3255 ("lapack" ,lapack)
3256 ("metis" ,metis)))
2742f87e
RW
3257 (home-page "http://faculty.cse.tamu.edu/davis/suitesparse.html")
3258 (synopsis "Suite of sparse matrix software")
3259 (description
3260 "SuiteSparse is a suite of sparse matrix algorithms, including: UMFPACK,
3261multifrontal LU factorization; CHOLMOD, supernodal Cholesky; SPQR,
3262multifrontal QR; KLU and BTF, sparse LU factorization, well-suited for circuit
3263simulation; ordering methods (AMD, CAMD, COLAMD, and CCOLAMD); CSparse and
3264CXSparse, a concise sparse Cholesky factorization package; and many other
3265packages.")
3266 ;; LGPLv2.1+:
3267 ;; AMD, CAMD, BTF, COLAMD, CCOLAMD, CSparse, CXSparse, KLU, LDL
3268 ;; GPLv2+:
3269 ;; GPUQREngine, RBio, SuiteSparse_GPURuntime, SuiteSparseQR, UMFPACK
3270 (license (list license:gpl2+ license:lgpl2.1+))))
3271
ec322be2
FB
3272(define-public atlas
3273 (package
3274 (name "atlas")
3c98ac02 3275 (version "3.10.3")
ec322be2
FB
3276 (source (origin
3277 (method url-fetch)
de67e922
LF
3278 (uri (string-append "mirror://sourceforge/math-atlas/Stable/"
3279 version "/atlas" version ".tar.bz2"))
ec322be2
FB
3280 (sha256
3281 (base32
3c98ac02 3282 "1dyjlq3fiparvm8ypwk6rsmjzmnwk81l88gkishphpvc79ryp216"))))
ec322be2
FB
3283 (build-system gnu-build-system)
3284 (home-page "http://math-atlas.sourceforge.net/")
19afbea1 3285 (inputs `(("gfortran" ,gfortran)
ec322be2
FB
3286 ("lapack-tar" ,(package-source lapack))))
3287 (outputs '("out" "doc"))
01480b9e
FB
3288 ;; For the moment we drop support for MIPS at it fails to compile. See
3289 ;; https://lists.gnu.org/archive/html/guix-devel/2014-11/msg00516.html
3290 (supported-systems (delete "mips64el-linux" %supported-systems))
ec322be2
FB
3291 (arguments
3292 `(#:parallel-build? #f
3293 #:parallel-tests? #f
f15615b1
LC
3294
3295 ;; ATLAS tunes itself for the machine it is built on, as explained at
3296 ;; <http://lists.gnu.org/archive/html/guix-devel/2014-10/msg00305.html>.
3297 ;; For this reason, we want users to build it locally instead of using
3298 ;; substitutes.
3299 #:substitutable? #f
3300
ec322be2
FB
3301 #:modules ((srfi srfi-26)
3302 (srfi srfi-1)
3303 (guix build gnu-build-system)
3304 (guix build utils))
40029cbe 3305 #:configure-flags
ec322be2
FB
3306 `(;; Generate position independent code suitable for dynamic libraries
3307 ;; and use WALL timer to get more accurate timing.
3308 "-Fa" "alg" "-fPIC" "-D" "c" "-DWALL"
3309 ;; Set word width.
3310 "-b"
3311 ,,(if (string-match "64" (%current-system))
3312 "64"
3313 "32")
3314 ;; Disable parallel build as it gives errors: atlas_pthread.h is
3315 ;; needed to compile C files before it is generated.
3316 "-Ss" "pmake" "make -j 1"
af89a667
FB
3317 ;; Probe is failing for MIPS. We therefore define the system
3318 ;; architecture explicitly by setting (-A) MACHINETYPE = 49
3319 ;; 'MIPSR1xK' and (-V) ISA = 1 'none'.
3320 ,,@(if (string-prefix? "mips" (%current-system))
3321 (list "-A" "49" "-V" "1")
3322 (list))
ec322be2
FB
3323 ;; Generate shared libraries.
3324 "--shared"
3325 ;; Build a full LAPACK library.
3326 ,(string-append "--with-netlib-lapack-tarfile="
3327 (assoc-ref %build-inputs "lapack-tar")))
3328 #:phases
e5b4b96b
EF
3329 (modify-phases %standard-phases
3330 (add-after 'install 'install-doc
3331 (lambda* (#:key outputs inputs #:allow-other-keys)
3332 (let ((doc (string-append (assoc-ref outputs "doc")
3333 "/share/doc/atlas")))
3334 (mkdir-p doc)
3335 (fold (lambda (file previous)
3336 (and previous (zero? (system* "cp" file doc))))
3337 #t (find-files "../ATLAS/doc" ".*")))))
3338 (add-after 'check 'check-pt
3339 (lambda _ (zero? (system* "make" "ptcheck"))))
3340 ;; Fix files required to run configure.
3341 (add-before 'configure 'fix-/bin/sh
ec322be2
FB
3342 (lambda _
3343 ;; Use `sh', not `/bin/sh'.
3344 (substitute* (find-files "." "Makefile|configure|SpewMakeInc\\.c")
3345 (("/bin/sh")
e5b4b96b
EF
3346 "sh"))))
3347 ;; Fix /bin/sh in generated make files.
3348 (add-after 'configure 'fix-/bin/sh-in-generated-files
3349 (lambda _
3350 (substitute* (find-files "." "^[Mm]ake\\.inc.*")
3351 (("/bin/sh")
3352 "sh"))))
3353 ;; ATLAS configure program does not accepts the default flags
3354 ;; passed by the 'gnu-build-system'.
3355 (replace 'configure
3356 (lambda* (#:key native-inputs inputs outputs
3357 (configure-flags '())
3358 #:allow-other-keys #:rest args)
3359 (let* ((prefix (assoc-ref outputs "out"))
3360 (bash (or (and=> (assoc-ref
3361 (or native-inputs inputs) "bash")
3362 (cut string-append <> "/bin/bash"))
3363 "/bin/sh"))
3364 (flags `(,(string-append "--prefix=" prefix)
3365 ,@configure-flags))
3366 (abs-srcdir (getcwd))
3367 (srcdir (string-append "../" (basename abs-srcdir))))
3368 (format #t "source directory: ~s (relative from build: ~s)~%"
3369 abs-srcdir srcdir)
3370 (mkdir "../build")
3371 (chdir "../build")
3372 (format #t "build directory: ~s~%" (getcwd))
3373 (format #t "configure flags: ~s~%" flags)
3374 (zero? (apply system* bash
3375 (string-append srcdir "/configure")
3376 flags))))))))
ec322be2
FB
3377 (synopsis "Automatically Tuned Linear Algebra Software")
3378 (description
3379 "ATLAS is an automatically tuned linear algebra software library
3380providing C and Fortran77 interfaces to a portably efficient BLAS
3381implementation, as well as a few routines from LAPACK.
3382
f15615b1
LC
3383Optimization occurs at build time. For this reason, the library is built on
3384the machine where it is installed, without resorting to pre-built substitutes.
ec322be2 3385
f15615b1 3386Before building the library, CPU throttling should be disabled. This can be
d97c429a 3387done in the BIOS, or, on GNU/Linux, with the following command:
ec322be2 3388
8e9ba611 3389@example
d97c429a 3390# cpupower --governor performance
8e9ba611 3391@end example
ec322be2 3392
d97c429a 3393Failure to do so will result in a library with poor performance.")
ec322be2 3394 (license license:bsd-3)))
c12efc72
AE
3395
3396(define-public glm
3397 (package
3398 (name "glm")
81866208 3399 (version "0.9.9.5")
c12efc72
AE
3400 (source
3401 (origin
3402 (method url-fetch)
5ea4b594
MB
3403 (uri (string-append "https://github.com/g-truc/glm/releases/download/"
3404 version "/glm-" version ".zip"))
c12efc72
AE
3405 (sha256
3406 (base32
81866208 3407 "1vmg7hb4xvsa77zpbwiw6lqc7pyaj56dihx6xriny5b9rrh4iqsg"))))
c12efc72
AE
3408 (build-system cmake-build-system)
3409 (native-inputs
3410 `(("unzip" ,unzip)))
46bda5eb 3411 (home-page "https://glm.g-truc.net/")
c12efc72
AE
3412 (synopsis "OpenGL Mathematics library")
3413 (description "OpenGL Mathematics (GLM) is a header-only C++ mathematics
3414library for graphics software based on the OpenGL Shading Language (GLSL)
3415specifications.")
3416 (license license:expat)))
7f18257b
AE
3417
3418(define-public lpsolve
3419 (package
3420 (name "lpsolve")
a89e0cf5 3421 (version "5.5.2.5")
7f18257b
AE
3422 (source
3423 (origin
3424 (method url-fetch)
3425 (uri (string-append "mirror://sourceforge/lpsolve/lpsolve/" version
3426 "/lp_solve_" version "_source.tar.gz"))
3427 (sha256
3428 (base32
a89e0cf5 3429 "12pj1idjz31r7c2mb5w03vy1cmvycvbkx9z29s40qdmkp1i7q6i0"))
7f18257b
AE
3430 (modules '((guix build utils)))
3431 (snippet
6cbee49d
MW
3432 '(begin
3433 (substitute* (list "lp_solve/ccc" "lpsolve55/ccc")
3434 (("^c=cc") "c=gcc")
3435 ;; Pretend to be on a 64 bit platform to obtain a common directory
3436 ;; name for the build results on all architectures; nothing else
3437 ;; seems to depend on it.
3438 (("^PLATFORM=.*$") "PLATFORM=ux64\n")
3439
3440 ;; The check for 'isnan' as it is written fails with
3441 ;; "non-floating-point argument in call to function
3442 ;; ‘__builtin_isnan’", which leads to the 'NOISNAN' cpp macro
3443 ;; definition, which in turn leads to bad things. Fix the feature
3444 ;; test.
3445 (("isnan\\(0\\)") "isnan(0.)"))
3446 #t))))
7f18257b
AE
3447 (build-system gnu-build-system)
3448 (arguments
6c96b545 3449 `(#:tests? #f ; no check target
7f18257b
AE
3450 #:phases
3451 (modify-phases %standard-phases
6c96b545 3452 (delete 'configure) ; no configure script
7f18257b
AE
3453 (replace 'build
3454 (lambda _
6c96b545
TGR
3455 (with-directory-excursion "lpsolve55"
3456 (invoke "bash" "ccc"))
3457 (with-directory-excursion "lp_solve"
3458 (invoke "bash" "ccc"))
3459 #t))
7f18257b
AE
3460 (replace 'install
3461 (lambda* (#:key outputs #:allow-other-keys)
3462 (let* ((out (assoc-ref outputs "out"))
3463 (bin (string-append out "/bin"))
3464 (lib (string-append out "/lib"))
3465 ;; This is where LibreOffice expects to find the header
3466 ;; files, and where they are installed by Debian.
3467 (include (string-append out "/include/lpsolve")))
6c96b545
TGR
3468 (install-file "lpsolve55/bin/ux64/liblpsolve55.a" lib)
3469 (install-file "lpsolve55/bin/ux64/liblpsolve55.so" lib)
96c46210
LC
3470 (install-file "lp_solve/bin/ux64/lp_solve" bin)
3471
7f18257b
AE
3472 ;; Install a subset of the header files as on Debian
3473 ;; (plus lp_bit.h, which matches the regular expression).
96c46210
LC
3474 (for-each (lambda (name)
3475 (install-file name include))
3476 (find-files "." "lp_[HMSa-z].*\\.h$"))
7f18257b 3477 (with-directory-excursion "shared"
96c46210
LC
3478 (for-each (lambda (name)
3479 (install-file name include))
3480 (find-files "." "\\.h$")))
7f18257b
AE
3481 #t))))))
3482 (home-page "http://lpsolve.sourceforge.net/")
3483 (synopsis "Mixed integer linear programming (MILP) solver")
3484 (description
3485 "lp_solve is a mixed integer linear programming solver based on the
3486revised simplex and the branch-and-bound methods.")
3487 (license license:lgpl2.1+)))
a17d4564
EB
3488
3489(define-public dealii
3490 (package
3491 (name "dealii")
40b114c0 3492 (version "9.0.1")
a17d4564
EB
3493 (source
3494 (origin
3495 (method url-fetch)
3496 (uri (string-append "https://github.com/dealii/dealii/releases/"
3497 "download/v" version "/dealii-" version ".tar.gz"))
3498 (sha256
3499 (base32
40b114c0
EB
3500 "0r7f8rhl3xr94imd372plizdcbqk0a70w73lwc3vw912dxk0sbyz"))
3501 (patches (search-patches "dealii-mpi-deprecations.patch"))
a17d4564
EB
3502 (modules '((guix build utils)))
3503 (snippet
3504 ;; Remove bundled sources: UMFPACK, TBB, muParser, and boost
6cbee49d
MW
3505 '(begin
3506 (delete-file-recursively "bundled")
3507 #t))))
a17d4564
EB
3508 (build-system cmake-build-system)
3509 (inputs
3510 `(("tbb" ,tbb)
3511 ("zlib" ,zlib)
3512 ("boost" ,boost)
3513 ("p4est" ,p4est)
3514 ("blas" ,openblas)
3515 ("lapack" ,lapack)
3516 ("arpack" ,arpack-ng)
3517 ("muparser" ,muparser)
3518 ("gfortran" ,gfortran)
3519 ("suitesparse" ,suitesparse))) ;for UMFPACK
3520 (arguments
3521 `(#:build-type "DebugRelease" ;only supports Release, Debug, or DebugRelease
d84b09e9
EB
3522 #:configure-flags
3523 ;; Work around a bug in libsuitesparseconfig linking
3524 ;; see https://github.com/dealii/dealii/issues/4745
3525 '("-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON")))
a17d4564
EB
3526 (home-page "https://www.dealii.org")
3527 (synopsis "Finite element library")
3528 (description
3529 "Deal.II is a C++ program library targeted at the computational solution
3530of partial differential equations using adaptive finite elements. The main
3531aim of deal.II is to enable rapid development of modern finite element codes,
3532using among other aspects adaptive meshes and a wide array of tools often used
3533in finite element programs.")
3534 (license license:lgpl2.1+)))
3535
3536(define-public dealii-openmpi
3537 (package (inherit dealii)
3538 (name "dealii-openmpi")
3539 (inputs
3540 `(("mpi" ,openmpi)
3541 ;;Supported only with MPI:
3542 ("p4est" ,p4est-openmpi)
3543 ("petsc" ,petsc-openmpi)
3544 ("slepc" ,slepc-openmpi)
3545 ("metis" ,metis) ;for MUMPS
3546 ("scalapack" ,scalapack) ;for MUMPS
3547 ("mumps" ,mumps-metis-openmpi) ;configure supports only metis orderings
3548 ("arpack" ,arpack-ng-openmpi)
3549 ,@(fold alist-delete (package-inputs dealii)
3550 '("p4est" "arpack"))))
3551 (arguments
3552 (substitute-keyword-arguments (package-arguments dealii)
3553 ((#:configure-flags cf)
40b114c0
EB
3554 `(cons "-DDEAL_II_WITH_MPI:BOOL=ON"
3555 ,cf))
7e309e8a
EB
3556 ((#:phases phases '%standard-phases)
3557 `(modify-phases ,phases
3558 (add-before 'check 'mpi-setup
3559 ,%openmpi-setup)))))
a17d4564 3560 (synopsis "Finite element library (with MPI support)")))
194c7f95
AE
3561
3562(define-public flann
3563 (package
3564 (name "flann")
3565 (version "1.8.4")
3566 (source
3567 (origin
3568 (method url-fetch)
3569 (uri
3570 (string-append
3571 "http://www.cs.ubc.ca/research/flann/uploads/FLANN/flann-"
3572 version "-src.zip"))
3573 (sha256
3574 (base32
b5edc479
LC
3575 "022w8hph7bli5zbpnk3z1qh1c2sl5hm8fw2ccim651ynn0hr7fyz"))
3576 (patches (search-patches "flann-cmake-3.11.patch"))))
194c7f95 3577 (build-system cmake-build-system)
6b6aca9b
LC
3578 (outputs '("out"
3579 "octave")) ;46 MiB .mex file that pulls Octave
194c7f95
AE
3580 (native-inputs
3581 `(("unzip" ,unzip)))
3582 (inputs
3583 `(("hdf5" ,hdf5)
5537603f 3584 ("octave" ,octave-cli)
194c7f95
AE
3585 ("python" ,python-2) ; print syntax
3586 ;; ("python2-numpy" ,python2-numpy) ; only required for the tests
3587 ("zlib" ,zlib)))
3588 (arguments
39b30337
LC
3589 `(;; The 'share/flann/octave' contains a .mex file, which is an ELF file
3590 ;; taken 46 MiB unstripped, and 6 MiB stripped.
3591 #:strip-directories '("lib" "lib64" "libexec"
3592 "bin" "sbin" "share/flann/octave")
3593
9684e30b
LC
3594 ;; Save 12 MiB by not installing .a files. Passing
3595 ;; '-DBUILD_STATIC_LIBS=OFF' has no effect.
3596 #:phases (modify-phases %standard-phases
6b6aca9b
LC
3597 (add-before 'configure 'set-octave-directory
3598 (lambda* (#:key outputs #:allow-other-keys)
3599 ;; Install the .mex file in the "octave" output.
3600 (let ((out (assoc-ref outputs "octave")))
3601 (substitute* "src/matlab/CMakeLists.txt"
3602 (("share/flann/octave")
3603 (string-append out "/share/flann/octave")))
3604 #t)))
9684e30b
LC
3605 (add-after 'install 'remove-static-libraries
3606 (lambda* (#:key outputs #:allow-other-keys)
3607 (let* ((out (assoc-ref outputs "out"))
3608 (lib (string-append out "/lib")))
3609 (for-each delete-file
3610 (find-files lib "\\.a$"))
3611 #t))))
3612
39b30337 3613 #:tests? #f)) ; The test data are downloaded from the Internet.
194c7f95
AE
3614 (home-page "http://www.cs.ubc.ca/research/flann/")
3615 (synopsis "Library for approximate nearest neighbors computation")
3616 (description "FLANN is a library for performing fast approximate
3617nearest neighbor searches in high dimensional spaces. It implements a
3618collection of algorithms and a system for automatically choosing the best
3619algorithm and optimum parameters depending on the dataset.
3620
3621FLANN is written in C++ and contains bindings for C, Octave and Python.")
3622 (license (license:non-copyleft "file://COPYING"
3623 "See COPYING in the distribution."))))
d8c97beb
EF
3624
3625(define-public wcalc
3626 (package
3627 (name "wcalc")
3628 (version "2.5")
3629 (source
3630 (origin
3631 (method url-fetch)
de67e922
LF
3632 (uri (string-append "mirror://sourceforge/w-calc/Wcalc/" version "/"
3633 "wcalc-" version ".tar.bz2"))
d8c97beb
EF
3634 (sha256
3635 (base32
3636 "1vi8dl6rccqiq1apmpwawyg2ywx6a1ic1d3cvkf2hlwk1z11fb0f"))))
3637 (build-system gnu-build-system)
3638 (inputs
3639 `(("mpfr" ,mpfr)
3640 ("readline" ,readline)))
3641 (home-page "http://w-calc.sourceforge.net/index.php")
3642 (synopsis "Flexible command-line scientific calculator")
3643 (description "Wcalc is a very capable calculator. It has standard functions
3644(sin, asin, and sinh for example, in either radians or degrees), many
3645pre-defined constants (pi, e, c, etc.), support for using variables, \"active\"
3646variables, a command history, hex/octal/binary input and output, unit
3647conversions, embedded comments, and an expandable expression entry field. It
3648evaluates expressions using the standard order of operations.")
3649 (license license:gpl2+)))
45147b0c
FH
3650
3651(define-public xaos
3652 (package
3653 (name "xaos")
3654 (version "3.6")
3655 (source (origin
3656 (method url-fetch)
de67e922
LF
3657 (uri (string-append "mirror://sourceforge/xaos/XaoS/" version
3658 "/xaos-" version ".tar.gz"))
45147b0c
FH
3659 (sha256
3660 (base32
3661 "15cd1cx1dyygw6g2nhjqq3bsfdj8sj8m4va9n75i0f3ryww3x7wq"))))
3662 (build-system gnu-build-system)
b94a6ca0 3663 (native-inputs `(("gettext" ,gettext-minimal)))
45147b0c
FH
3664 (inputs `(("libx11" ,libx11)
3665 ("zlib" ,zlib)
3666 ("libpng" ,libpng)
3667 ("gsl" ,gsl)))
3668 (arguments
3669 `(#:tests? #f ;no "check" target
3670 #:make-flags '("LOCALEDIR=$DATAROOTDIR/locale")))
3671 (synopsis "Real-time fractal zoomer")
3672 (description "GNU XaoS is a graphical program that generates fractal
3673patterns and allows you to zoom in and out of them infinitely in a fluid,
3674continuous manner. It also includes tutorials that help to explain how fractals
3675are built. It can generate many different fractal types such as the Mandelbrot
3676set.")
6fd52309 3677 (home-page "https://www.gnu.org/software/xaos/")
45147b0c 3678 (license license:gpl2+)))
528bb464
EB
3679
3680(define-public hypre
3681 (package
3682 (name "hypre")
220458b0 3683 (version "2.14.0")
528bb464
EB
3684 (source (origin
3685 (method url-fetch)
3686 (uri (string-append "https://github.com/LLNL/hypre/archive/"
3687 "v" version ".tar.gz"))
3688 (file-name (string-append name "-" version ".tar.gz"))
3689 (sha256
3690 (base32
220458b0 3691 "0v515i73bvaz378h5465b1dy9v2gf924zy2q94cpq4qqarawvkqh"))
528bb464
EB
3692 (modules '((guix build utils)))
3693 (snippet
3694 '(begin
3695 ;; Remove use of __DATE__ and __TIME__ for reproducibility;
3696 ;; substitute the tarball creation time.
3697 (substitute* "src/utilities/HYPRE_utilities.h"
3698 (("Date Compiled: .*$")
220458b0 3699 "Date Compiled: Apr 11 2018 16:24:59 +0000\"\n"))
528bb464
EB
3700 #t))))
3701 (build-system gnu-build-system)
3702 (outputs '("out" ;6.1 MiB of headers and libraries
3703 "doc")) ;4.8 MiB of documentation
3704 (native-inputs
3705 `(("doc++" ,doc++)
3706 ("netpbm" ,netpbm)
e18e7cb9 3707 ("perl" ,perl) ;needed to run 'ppmquant' during tests
9b405aea
PN
3708 ("texlive" ,(texlive-union (list texlive-generic-xypic
3709 texlive-fonts-xypic
3710 texlive-latex-hyperref
9b405aea 3711 texlive-bibtex)))
528bb464
EB
3712 ("ghostscript" ,ghostscript)))
3713 (inputs
3714 `(("blas" ,openblas)
3715 ("lapack" ,lapack)))
3716 (arguments
3717 `(#:modules ((srfi srfi-1)
3718 ,@%gnu-build-system-modules)
3719 #:configure-flags '("--enable-shared"
3720 "--disable-fortran"
3721 "--without-MPI"
3722 "--with-openmp"
3723 "--with-fei"
3724 "--with-lapack"
3725 "--with-blas")
3726 #:phases
3727 (modify-phases %standard-phases
9b405aea
PN
3728 (add-before 'build 'set-HOME
3729 (lambda _
3730 ;; FIXME: texlive-union does not find the built
3731 ;; metafonts, so it tries to generate them in HOME.
3732 (setenv "HOME" "/tmp")
3733 #t))
528bb464
EB
3734 (add-before 'configure 'chdir-src
3735 (lambda _ (chdir "src")))
3736 (replace 'configure
3737 (lambda* (#:key build target configure-flags
3738 #:allow-other-keys #:rest args)
3739 (let* ((configure (assoc-ref %standard-phases 'configure)))
3740 (apply configure
3741 (append args
3742 (list #:configure-flags
3743 (cons (string-append
3744 "--host=" (or target build))
3745 configure-flags)))))))
3746 (add-after 'build 'build-docs
3747 (lambda _
9b405aea 3748 (invoke "make" "-Cdocs" "pdf" "html")))
528bb464
EB
3749 (replace 'check
3750 (lambda _
3751 (setenv "LD_LIBRARY_PATH" (string-append (getcwd) "/hypre/lib"))
3752 (setenv "PATH" (string-append "." ":" (getenv "PATH")))
3753 (and (system* "make" "check" "CHECKRUN=")
3754 (fold (lambda (filename result)
3755 (and result
3756 (let ((size (stat:size (stat filename))))
3757 (when (not (zero? size))
3758 (format #t "~a size ~d; error indication~%"
3759 filename size))
3760 (zero? size))))
3761 #t
3762 (find-files "test" ".*\\.err$")))))
3763 (add-after 'install 'install-docs
3764 (lambda* (#:key outputs #:allow-other-keys)
3765 ;; Custom install because docs/Makefile doesn't honor ${docdir}.
3766 (let* ((doc (assoc-ref outputs "doc"))
3767 (docdir (string-append doc "/share/doc/hypre-" ,version)))
528bb464
EB
3768 (with-directory-excursion "docs"
3769 (for-each (lambda (base)
3770 (install-file (string-append base ".pdf") docdir)
3771 (copy-recursively base docdir)) ;html docs
3772 '("HYPRE_usr_manual"
3773 "HYPRE_ref_manual")))
3774 #t))))))
3775 (home-page "http://www.llnl.gov/casc/hypre/")
3776 (synopsis "Library of solvers and preconditioners for linear equations")
3777 (description
3778 "HYPRE is a software library of high performance preconditioners and
3779solvers for the solution of large, sparse linear systems of equations. It
3780features multigrid solvers for both structured and unstructured grid
3781problems.")
3782 (license license:lgpl2.1)))
3783
3784(define-public hypre-openmpi
3785 (package (inherit hypre)
3786 (name "hypre-openmpi")
3787 (inputs
3788 `(("mpi" ,openmpi)
3789 ,@(package-inputs hypre)))
3790 (arguments
3791 (substitute-keyword-arguments (package-arguments hypre)
3792 ((#:configure-flags flags)
3793 ``("--with-MPI"
6df2a50a
LC
3794 ,@(delete "--without-MPI" ,flags)))
3795 ((#:phases phases)
3796 `(modify-phases ,phases
bbe46a4a
EB
3797 (add-before 'check 'mpi-setup
3798 ,%openmpi-setup)))))
528bb464
EB
3799 (synopsis "Parallel solvers and preconditioners for linear equations")
3800 (description
3801 "HYPRE is a software library of high performance preconditioners and
3802solvers for the solution of large, sparse linear systems of equations on
3803parallel computers. It features parallel multigrid solvers for both
3804structured and unstructured grid problems.")))
6c90e183
EB
3805
3806(define-public matio
3807 (package
3808 (name "matio")
3809 (version "1.5.6")
3810 (source
3811 (origin
3812 (method url-fetch)
de67e922 3813 (uri (string-append "mirror://sourceforge/matio/matio/" version "/"
6c90e183
EB
3814 "matio-" version ".tar.gz"))
3815 (sha256
3816 (base32
3817 "0y2qymgxank8wdiwc68ap8bxdzrhvyw86i29yh3xgn4z1njfd9ir"))))
3818 (build-system gnu-build-system)
3819 (inputs
3820 `(("zlib" ,zlib)
3821 ("hdf5" ,hdf5)))
3822 (home-page "http://matio.sourceforge.net/")
3823 (synopsis "Library for reading and writing MAT files")
3824 (description "Matio is a library for reading and writing MAT files. It
3825supports compressed MAT files, as well as newer (version 7.3) MAT files.")
3826 (license license:bsd-2)))
d721c83a 3827
517318ad
LF
3828(define-public vc
3829 (package
3830 (name "vc")
853b0292 3831 (version "1.3.3")
517318ad
LF
3832 (source
3833 (origin (method url-fetch)
3834 (uri (string-append "https://github.com/VcDevel/Vc/releases/"
3835 "download/" version "/Vc-" version ".tar.gz"))
3836 (sha256
3837 (base32
853b0292 3838 "1zmlpn32jzb38smp3j834llmbix3whsrbw0h397qxysbw792kih8"))))
517318ad
LF
3839 (build-system cmake-build-system)
3840 (arguments
3841 '(#:configure-flags
33d82486
MB
3842 '("-DBUILD_TESTING=ON"
3843 ;; By default, Vc will optimize for the CPU of the build machine.
3844 ;; Setting this to "none" makes it create portable binaries. See
3845 ;; "cmake/OptimizeForArchitecture.cmake".
3846 "-DTARGET_ARCHITECTURE=none")))
517318ad
LF
3847 (synopsis "SIMD vector classes for C++")
3848 (description "Vc provides portable, zero-overhead C++ types for explicitly
3849data-parallel programming. It is a library designed to ease explicit
3850vectorization of C++ code. Its types enable explicitly stating data-parallel
3851operations on multiple values. The parallelism is therefore added via the type
3852system. Vc has an intuitive API and provides portability between different
3853compilers and compiler versions as well as portability between different vector
3854instruction sets. Thus, an application written with Vc can be compiled for:
3855@enumerate
3856@item AVX and AVX2
d1e4ad1b 3857@item SSE2 up to SSE4.2 or SSE4a
517318ad
LF
3858@item Scalar
3859@item MIC
3860@item NEON (in development)
3861@item NVIDIA GPUs / CUDA (in development)
3862@end enumerate\n")
3863 (home-page "https://github.com/VcDevel/Vc")
a8ead6f9
EF
3864 ;; "No support_???.cpp file exists for this architecture."
3865 (supported-systems '("x86_64-linux" "i686-linux"))
517318ad 3866 (license license:bsd-3)))
54052a54 3867
3868(define-public reducelcs
3869 ;; This is the last commit which is available upstream, no
3870 ;; release happened since 2010.
3871 (let ((commit "474f88deb968061abe8cf11c959e02319b8ae5c0")
3872 (revision "1"))
3873 (package
3874 (name "reducelcs")
3875 (version (string-append "1.0-" revision "." (string-take commit 7)))
3876 (source
3877 (origin
3878 (method git-fetch)
3879 (uri (git-reference
3880 (url "https://github.com/gdv/Reduce-Expand-for-LCS")
3881 (commit commit)))
3882 (file-name (string-append name "-" version "-checkout"))
3883 (sha256
3884 (base32
3885 "1rllzcfwc042c336mhq262a8ha90x6afq30kvk60r7i4761j4yjm"))))
3886 (build-system gnu-build-system)
3887 (inputs
3888 `(("openlibm" ,openlibm)))
3889 (arguments
3890 `(#:tests? #f ; no tests
3891 #:phases
3892 (modify-phases %standard-phases
3893 (delete 'configure) ; No configure script exists.
3894 (replace 'install ; No install phase exists.
3895 (lambda* (#:key outputs #:allow-other-keys)
3896 (let* ((out (assoc-ref outputs "out"))
3897 (bin (string-append out "/bin")))
3898 (install-file "Approximation" bin)
3899 (install-file "CollectResults" bin)
3900 (install-file "GenerateInstances" bin)
3901 #t))))))
3902 (synopsis "Approximate Longest Commons Subsequence computation tool")
3903 (description
3904 "@code{reduceLCS} is an implementation of the Reduce-Expand
3905algorithm for LCS. It is a fast program to compute the approximate
3906Longest Commons Subsequence of a set of strings.")
3907 (home-page "https://github.com/gdv/Reduce-Expand-for-LCS")
c000b6b1 3908 (license license:gpl3+))))
479c4273
JD
3909
3910(define-public jacal
3911 (package
3912 (name "jacal")
3913 (version "1c4")
3914 (source (origin
3915 (method url-fetch)
3916 (uri (string-append
3917 "http://groups.csail.mit.edu/mac/ftpdir/scm/jacal-"
3918 version ".zip"))
3919 (sha256 (base32
3920 "055zrn12a1dmy0dqkwrkq3fklbhg3yir6vn0lacp4mvbg8573a3q"))
3921 (patches (search-patches "jacal-fix-texinfo.patch"))))
3922 (build-system gnu-build-system)
3923 (arguments
3924 `(#:phases
3925 (modify-phases %standard-phases
3926 (add-before 'build 'pre-build
3927 ;; Don't use upstream's script - it really doesn't fit into
3928 ;; Guix's functional paradigm.
3929 (lambda* (#:key inputs outputs #:allow-other-keys)
3930 (substitute* "Makefile"
3931 (("^install: install-script") "install: "))))
3932 (add-after 'install 'post-install
3933 ;; Instead, we provide our own simplified script.
3934 (lambda* (#:key inputs outputs #:allow-other-keys)
3935 (let ((wrapper (string-append (assoc-ref outputs "out")
3936 "/bin/jacal")))
3937 (format (open wrapper (logior O_WRONLY O_CREAT))
3938 (string-append "#!~a\nexec ~a/bin/scm -ip1 "
3939 "-e '(slib:load \"~a/lib/jacal/math\") "
3940 "(math)' \"$@\"\n")
3941 (which "bash")
3942 (assoc-ref inputs "scm")
3943 (assoc-ref outputs "out"))
3944 (chmod wrapper #o555))))
3945 (replace 'configure
3946 (lambda* (#:key inputs outputs #:allow-other-keys)
3947 (zero? (system* "./configure"
3948 (string-append "--prefix="
3949 (assoc-ref outputs "out")))))))))
3950 (inputs `(("scm" ,scm)))
3951 (native-inputs `(("unzip" ,unzip)
3952 ("texinfo" ,texinfo)))
3953 (synopsis "Symbolic mathematics system")
3954 (description "GNU JACAL is an interactive symbolic mathematics program based on
3955Scheme. It manipulate and simplify a range of mathematical expressions such
3956as equations, scalars, vectors, and matrices.")
6fd52309 3957 (home-page "https://www.gnu.org/software/jacal/")
479c4273
JD
3958 (license license:gpl3+)))
3959
313844d9
TF
3960(define-public z3
3961 (package
3962 (name "z3")
6654f8c1 3963 (version "4.8.4")
fb525bfd 3964 (home-page "https://github.com/Z3Prover/z3")
313844d9 3965 (source (origin
fb525bfd
MB
3966 (method git-fetch)
3967 (uri (git-reference (url home-page)
3968 (commit (string-append "z3-" version))))
2d7b99b3 3969 (file-name (git-file-name name version))
313844d9
TF
3970 (sha256
3971 (base32
6654f8c1 3972 "014igqm5vwswz0yhz0cdxsj3a6dh7i79hvhgc3jmmmz3z0xm1gyn"))))
fa574a6d 3973 (build-system gnu-build-system)
313844d9 3974 (arguments
fa574a6d 3975 `(#:phases
313844d9 3976 (modify-phases %standard-phases
ad6c6a5b
EF
3977 (add-after 'unpack 'fix-compatability
3978 ;; Versions after 4.8.3 have immintrin.h IFDEFed for Windows only.
3979 (lambda _
3980 (substitute* "src/util/mpz.cpp"
3981 (("#include <immintrin.h>") ""))
3982 #t))
cf684d87
TF
3983 (add-before 'configure 'bootstrap
3984 (lambda _
313844d9 3985 (zero?
fa574a6d
AB
3986 (system* "python" "scripts/mk_make.py"))))
3987 ;; work around gnu-build-system's setting --enable-fast-install
3988 ;; (z3's `configure' is a wrapper around the above python file,
3989 ;; which fails when passed --enable-fast-install)
3990 (replace 'configure
3991 (lambda* (#:key inputs outputs #:allow-other-keys)
3992 (invoke "./configure"
3993 (string-append "--prefix=" (assoc-ref outputs "out")))))
3994 (add-after 'configure 'change-directory
3995 (lambda _
3996 (chdir "build")
3997 #t))
cf684d87 3998 (add-before 'check 'make-test-z3
313844d9 3999 (lambda _
cf684d87
TF
4000 ;; Build the test suite executable.
4001 (zero? (system* "make" "test-z3" "-j"
4002 (number->string (parallel-job-count))))))
4003 (replace 'check
4004 (lambda _
4005 ;; Run all the tests that don't require arguments.
4006 (zero? (system* "./test-z3" "/a")))))))
313844d9 4007 (native-inputs
fa574a6d
AB
4008 `(("which" ,which)
4009 ("python" ,python-wrapper)))
313844d9
TF
4010 (synopsis "Theorem prover")
4011 (description "Z3 is a theorem prover and @dfn{satisfiability modulo
cf684d87 4012theories} (SMT) solver. It provides a C/C++ API, as well as Python bindings.")
313844d9 4013 (license license:expat)))
3d5d87a3 4014
6d433d6e
EB
4015(define-public elpa
4016 (package
4017 (name "elpa")
4018 (version "2018.11.001")
4019 (source (origin
4020 (method url-fetch)
4021 (uri (string-append "http://elpa.mpcdf.mpg.de/html/Releases/"
4022 version "/elpa-" version ".tar.gz"))
4023 (sha256
4024 (base32
4025 "05hv3v5i6xmziaizw350ff72y1c3k662r85fm3xfdrkclj5zw9yc"))))
4026 (build-system gnu-build-system)
4027 (native-inputs
4028 `(("fortran" ,gfortran)
4029 ("perl" ,perl))) ;for configure and deps
4030 (inputs
4031 `(("blas" ,openblas)))
4032 (arguments
4033 `(#:configure-flags
4034 `("--enable-openmp"
4035 "--with-mpi=no"
4036 ;; ELPA unfortunately does not support runtime dispatch, so we can
4037 ;; only enable the "generic" kernels. See the "Cross compilation"
4038 ;; section of INSTALL.md.
4039 "--enable-generic"
4040 "--disable-sse" "--disable-sse-assembly" ;Require SSE3
4041 "--disable-avx" "--disable-avx2" "--disable-avx512"
4042 ,(string-append "CFLAGS=-O3 "
4043 "-funsafe-loop-optimizations -funsafe-math-optimizations "
4044 "-ftree-vect-loop-version -ftree-vectorize "
4045 ,(let ((system (or (%current-target-system)
4046 (%current-system))))
4047 (cond
4048 ((or (string-prefix? "x86_64" system)
4049 (string-prefix? "i686" system))
4050 "-msse2")
4051 (else "")))))
4052 #:parallel-tests? #f ;tests are multi-threaded, via BLAS
4053 #:phases
4054 (modify-phases %standard-phases
4055 (add-before 'configure 'patch-header-generation
4056 (lambda _
4057 (substitute* "configure"
4058 (("^ *make.*top_srcdir=\"\\$srcdir\"" &)
4059 (string-append & " CPP=\"$CPP\"")))
4060 #t))
4061 (add-before 'check 'setup-tests
4062 (lambda _
4063 ;; Decrease test time and RAM use by computing fewer eigenvalues.
4064 ;; The flags are (MATRIX-SIZE, EIGENVALUES, BLOCK-SIZE), where
4065 ;; the default is (500, 250, 16) for C tests and (5000, 150, 16)
4066 ;; for Fortran. This also causes several tests to pass that
4067 ;; otherwise would otherwise fail with matrix size 5000; possibly
4068 ;; due to floating point tolerances that are too tight.
4069 (setenv "TEST_FLAGS" "1500 50 16") ;from elpa.spec
4070 (setenv "OMP_NUM_THREADS" (number->string (parallel-job-count)))
4071 (substitute* "Makefile"
4072 ;; Test scripts are generated, patch the shebang
4073 (("#!/bin/bash") (string-append "#!" (which "sh"))))
4074 #t)))))
4075 (home-page "http://elpa.mpcdf.mpg.de")
4076 (synopsis "Eigenvalue solvers for symmetric matrices")
4077 (description
4078 "The ELPA library provides efficient and scalable direct eigensolvers for
4079symmetric matrices.")
4080 (license license:lgpl3)))
4081
4082(define-public elpa-openmpi
4083 (package (inherit elpa)
4084 (name "elpa-openmpi")
4085 (inputs
4086 `(("mpi" ,openmpi)
4087 ("scalapack" ,scalapack)
4088 ,@(package-inputs elpa)))
4089 (arguments
4090 (substitute-keyword-arguments (package-arguments elpa)
4091 ((#:configure-flags cf '())
4092 `(cons "--with-mpi=yes" (delete "--with-mpi=no" ,cf)))
4093 ((#:phases phases '%standard-phases)
4094 `(modify-phases ,phases
4095 (add-before 'check 'mpi-setup
4096 (lambda _
4097 ;; Tests use 2 mpi tasks by default, use our remaining build
4098 ;; cores as OpenMP threads.
4099 (setenv "OMP_NUM_THREADS" (number->string
4100 (max (quotient (parallel-job-count) 2)
4101 1)))
4102 (,%openmpi-setup)))))))
4103 (synopsis "Eigenvalue solvers for symmetric matrices (with MPI support)")))
4104
e01397b4
EB
4105(define-public elemental
4106 (package
4107 (name "elemental")
4108 (version "0.87.7")
4109 (source (origin
5c0b6d1b
EF
4110 (method git-fetch)
4111 (uri (git-reference
4112 (url "https://github.com/elemental/Elemental.git")
4113 (commit (string-append "v" version))))
4114 (file-name (git-file-name name version))
e01397b4
EB
4115 (sha256
4116 (base32
5c0b6d1b 4117 "1687xpjjzig27y2pnqv7hv09smpijyfdpz7qjgmcxf4shfajlfkc"))))
e01397b4
EB
4118 (build-system cmake-build-system)
4119 (home-page "http://libelemental.org")
4120 (native-inputs
4121 `(("gfortran" ,gfortran)))
4122 (inputs
4123 `(("blas" ,openblas)
4124 ("gfortran:lib" ,gfortran "lib")
4125 ("gmp" ,gmp)
4126 ("lapack" ,lapack)
4127 ("metis" ,metis)
4128 ("mpc" ,mpc)
4129 ("mpfr" ,mpfr)
4130 ("mpi" ,openmpi)
4131 ("qd" ,qd)))
4132 (arguments
4133 `(#:build-type "Release" ;default RelWithDebInfo not supported
4134 #:configure-flags `("-DEL_DISABLE_PARMETIS:BOOL=YES"
4135 "-DEL_AVOID_COMPLEX_MPI:BOOL=NO"
4136 "-DEL_CACHE_WARNINGS:BOOL=YES"
4137 "-DEL_TESTS:BOOL=YES"
4138 "-DCMAKE_INSTALL_LIBDIR=lib"
4139 "-DGFORTRAN_LIB=gfortran")
4140 #:phases (modify-phases %standard-phases
3b42e2be
EF
4141 (add-before 'check 'mpi-setup
4142 ,%openmpi-setup)
e01397b4
EB
4143 (add-before 'check 'setup-tests
4144 (lambda _
4145 ;; Parallelism is done at the MPI layer.
4146 (setenv "OMP_NUM_THREADS" "1")
4147 #t))
4148 (add-after 'install 'remove-tests
4149 (lambda* (#:key outputs #:allow-other-keys)
4150 ;; Tests are installed, with no easy configuration
4151 ;; switch to prevent this, so delete them.
4152 (delete-file-recursively
3b42e2be 4153 (string-append (assoc-ref outputs "out") "/bin"))
e01397b4
EB
4154 #t)))))
4155 (synopsis "Dense and sparse-direct linear algebra and optimization")
4156 (description "Elemental is a modern C++ library for distributed-memory
4157dense and sparse-direct linear algebra, conic optimization, and lattice
4158reduction.")
4159 (license license:bsd-2)))
5b05dce7
JN
4160
4161(define-public mcrl2
4162 (package
4163 (name "mcrl2")
4164 (version "201707.1.15162")
4165 (source (origin
4166 (method url-fetch)
4167 (uri (string-append "http://www.mcrl2.org/download/devel/mcrl2-"
4168 version
4169 ".tar.gz"))
4170 (sha256
4171 (base32
4172 "1ziww2fchsklm25hl9p2mngssxfh9w07nc114cncqaxfibqp2p8f"))))
4173 (native-inputs
4174 `(("subversion" ,subversion)))
4175 (inputs
4176 `(("boost" ,boost)
4177 ("glu" ,glu)
4178 ("mesa" ,mesa)
077d66ed 4179 ("qtbase" ,qtbase)))
5b05dce7 4180 (build-system cmake-build-system)
ed0c5d3c 4181 (synopsis "Toolset for the mCRL2 formal specification language")
5b05dce7 4182 (description
ed0c5d3c
TGR
4183 "@dfn{mCRL2} (micro Common Representation Language 2) is a formal
4184specification language for describing concurrent discrete event systems. Its
4185toolset supports analysis and automatic verification, linearisation, simulation,
4186state-space exploration and generation, and tools to optimise and analyse
5b05dce7
JN
4187specifications. Also, state spaces can be manipulated, visualised and
4188analysed.")
b3882709 4189 (home-page "https://mcrl2.org")
5b05dce7 4190 (license license:boost1.0)))
41835f94
LF
4191
4192(define-public r-subplex
4193 (package
4194 (name "r-subplex")
2bcf5fd3 4195 (version "1.5-4")
41835f94
LF
4196 (source
4197 (origin
4198 (method url-fetch)
4199 (uri (cran-uri "subplex" version))
4200 (sha256
4201 (base32
2bcf5fd3 4202 "10cbgbx1bgsax5z7gz6716g360xpq4mvq19cf4qqrxv02mmwz57z"))))
41835f94
LF
4203 (build-system r-build-system)
4204 (native-inputs
4205 `(("gfortran" ,gfortran)))
4206 (home-page "https://cran.r-project.org/web/packages/subplex")
4207 (synopsis "Unconstrained optimization using the subplex algorithm")
4208 (description "This package implements the Subplex optimization algorithm.
4209It solves unconstrained optimization problems using a simplex method on
4210subspaces. The method is well suited for optimizing objective functions that
4211are noisy or are discontinuous at the solution.")
4212 (license license:gpl3+)))
799ad71b
LF
4213
4214(define-public r-desolve
4215 (package
4216 (name "r-desolve")
9a2ac95d 4217 (version "1.21")
799ad71b
LF
4218 (source
4219 (origin
4220 (method url-fetch)
4221 (uri (cran-uri "deSolve" version))
4222 (sha256
4223 (base32
9a2ac95d 4224 "0qqc4mknw1jblzcmph1dg3k1p6w42yal0k1xjh8pqk7yb3a75hs5"))))
799ad71b
LF
4225 (properties `((upstream-name . "deSolve")))
4226 (build-system r-build-system)
4227 (native-inputs
4228 `(("gfortran" ,gfortran)))
4229 (home-page "https://desolve.r-forge.r-project.org/")
4230 (synopsis "Solvers for initial value problems of differential equations")
4231 (description "This package provides functions that solve initial
4232value problems of a system of first-order ordinary differential equations (ODE),
4233of partial differential equations (PDE), of differential algebraic equations
4234(DAE), and of delay differential equations. The functions provide an interface
4235to the FORTRAN functions lsoda, lsodar, lsode, lsodes of the ODEPACK collection,
4236to the FORTRAN functions dvode and daspk and a C-implementation of solvers of
4237the Runge-Kutta family with fixed or variable time steps. The package contains
4238routines designed for solving ODEs resulting from 1-D, 2-D and 3-D partial
4239differential equations (PDE) that have been converted to ODEs by numerical
4240differencing.")
4241 (license license:gpl2+)))
910deec6
NV
4242
4243(define-public tcalc
4244 (package
4245 (name "tcalc")
4246 (version "2.0")
4247 (source
4248 (origin
4249 (method url-fetch)
4250 (uri (string-append "https://sites.google.com/site/mohammedisam2000/tcalc/tcalc-"
4251 version ".tar.gz"))
4252 (sha256
4253 (base32
4254 "0jq806m4dqfia85nppfm75mml9w57g0cgv4cdw9bp3zymda83s0m"))))
4255 (build-system gnu-build-system)
4256 (synopsis "The terminal calculator")
4257 (description
4258 "The terminal calculator is a small program to help users of the GNU/Linux
4259terminal do calculations simply and quickly. The formula to be calculated can
4260be fed to @command{tcalc} through the command line.")
4261 (home-page "https://sites.google.com/site/mohammedisam2000/tcalc")
4262 (license license:gpl3+)))
b26e4f26
EB
4263
4264(define-public sundials
4265 (package
4266 (name "sundials")
4267 (version "3.1.1")
4268 (source
4269 (origin
4270 (method url-fetch)
4271 (uri (string-append "https://computation.llnl.gov/projects/sundials/download/"
4272 "sundials-" version ".tar.gz"))
4273 (sha256
4274 (base32
4275 "090s8ymhd0g1s1d44fa73r5yi32hb4biwahhbfi327zd64yn8kd2"))))
4276 (build-system cmake-build-system)
4277 (native-inputs
4278 `(("python" ,python-2))) ;for tests; syntax incompatible with python 3
4279 (inputs
4280 `(("fortran" ,gfortran) ;for fcmix
4281 ("blas" ,openblas)
4282 ("suitesparse" ,suitesparse))) ;TODO: Add hypre
4283 (arguments
4284 `(#:configure-flags `("-DEXAMPLES_ENABLE_C:BOOL=ON"
4285 "-DEXAMPLES_ENABLE_CXX:BOOL=ON"
4286 "-DEXAMPLES_ENABLE_F77:BOOL=ON"
4287 "-DEXAMPLES_ENABLE_F90:BOOL=ON"
4288 "-DEXAMPLES_INSTALL:BOOL=OFF"
4289
4290 "-DFCMIX_ENABLE:BOOL=ON"
4291
4292 "-DKLU_ENABLE:BOOL=ON"
4293 ,(string-append "-DKLU_INCLUDE_DIR="
4294 (assoc-ref %build-inputs "suitesparse")
4295 "/include")
4296 ,(string-append "-DKLU_LIBRARY_DIR="
4297 (assoc-ref %build-inputs "suitesparse")
4298 "/lib"))))
4299 (home-page "https://computation.llnl.gov/projects/sundials")
4300 (synopsis "Suite of nonlinear and differential/algebraic equation solvers")
4301 (description "SUNDIALS is a family of software packages implemented with
4302the goal of providing robust time integrators and nonlinear solvers that can
4303easily be incorporated into existing simulation codes.")
4304 (license license:bsd-3)))
4305
4306(define-public sundials-openmpi
4307 (package (inherit sundials)
4308 (name "sundials-openmpi")
4309 (inputs
4310 `(("mpi" ,openmpi)
4311 ("petsc" ,petsc-openmpi) ;support in SUNDIALS requires MPI
4312 ,@(package-inputs sundials)))
4313 (arguments
4314 (substitute-keyword-arguments (package-arguments sundials)
4315 ((#:configure-flags flags '())
4316 `(cons* "-DMPI_ENABLE:BOOL=ON"
4317 "-DPETSC_ENABLE:BOOL=ON"
4318 (string-append "-DPETSC_INCLUDE_DIR="
4319 (assoc-ref %build-inputs "petsc")
4320 "/include")
4321 (string-append "-DPETSC_LIBRARY_DIR="
4322 (assoc-ref %build-inputs "petsc")
4323 "/lib")
4324 ,flags))
4325 ((#:phases phases '%standard-phases)
4326 `(modify-phases ,phases
bbe46a4a
EB
4327 (add-before 'check 'mpi-setup
4328 ,%openmpi-setup)))))
b26e4f26 4329 (synopsis "SUNDIALS with OpenMPI support")))
a6b9ebc2
EB
4330
4331(define-public combinatorial-blas
4332 (package
4333 (name "combinatorial-blas")
4334 (version "1.6.2")
4335 (source
4336 (origin
4337 (method url-fetch)
4338 (uri (string-append "http://eecs.berkeley.edu/~aydin/CombBLAS_FILES/"
4339 "CombBLAS_beta_"
4340 (match (string-split version #\.)
4341 ((major minor patch)
4342 (string-append major minor "_" patch))) ;e.g. "16_2"
4343 ".tgz"))
4344 (sha256
4345 (base32
4346 "1a9wbgdqyy1whhfc0yl0yqkax3amnqa6iihhq48d063gc0jwfd9a"))
4347 (patches (search-patches "combinatorial-blas-awpm.patch"
4348 "combinatorial-blas-io-fix.patch"))))
4349 (build-system cmake-build-system)
4350 (inputs
4351 `(("mpi" ,openmpi)
4352 ("test-data" ,(origin
4353 (method url-fetch)
4354 (uri (string-append "https://people.eecs.berkeley.edu/~aydin/"
4355 "CombBLAS_FILES/testdata_combblas1.6.1.tgz"))
4356 (sha256
4357 (base32
4358 "01y2781cy3fww7znmidrp85mf8zx0c905w5vzvk1mgrmhhynim87"))))))
4359 (arguments
4360 `(#:configure-flags '("-DBUILD_SHARED_LIBS:BOOL=YES"
4361 "-DCMAKE_CXX_FLAGS=-DUSE_FUNNEL")
4362 #:parallel-tests? #f ;tests use 'mpiexec -n4'
4363 #:phases
4364 (modify-phases %standard-phases
4365 (add-before 'check 'mpi-setup
4366 ,%openmpi-setup)
4367 (add-before 'check 'test-setup
4368 (lambda* (#:key inputs #:allow-other-keys)
4369 (setenv "OMP_NUM_THREADS" "2")
4370 (invoke "tar" "xf" (assoc-ref inputs "test-data")))))))
4371 (home-page "https://people.eecs.berkeley.edu/~aydin/CombBLAS/html/")
4372 (synopsis "Linear algebra primitives for graph analytics")
4373 (description "The Combinatorial BLAS (CombBLAS) is an extensible
4374distributed-memory parallel graph library offering a small but powerful set of
4375linear algebra primitives specifically targeting graph analytics.")
4376 (license (list
4377 license:gpl2+ ;include/psort/(funnel|sort)*.h
4378 license:x11 ;usort and psort
4379 license:bsd-3)))) ;CombBLAS and MersenneTwister.h
3847d1f2
RW
4380
4381(define-public dune-common
4382 (package
4383 (name "dune-common")
4384 (version "2.6.0")
4385 (source
4386 (origin
4387 (method url-fetch)
4388 (uri (string-append "https://dune-project.org/download/"
4389 version "/dune-common-" version ".tar.gz"))
4390 (sha256
4391 (base32
4392 "019wcr1qf7jwyxx1y5y290wdlglylskvbb2m01ljkzcza2xnlmhw"))))
4393 (build-system cmake-build-system)
4394 (arguments
4395 `(#:phases
4396 (modify-phases %standard-phases
4397 (add-after 'build 'build-tests
4398 (lambda* (#:key make-flags #:allow-other-keys)
4399 (apply invoke "make" "build_tests" make-flags)))
4400 ;; These tests fail because they require a fully functional MPI
4401 ;; environment.
4402 (add-after 'unpack 'disable-failing-tests
4403 (lambda _
4404 (setenv "ARGS"
4405 (string-append "--exclude-regex '("
4406 (string-join
4407 (list
4408 "remoteindicestest"
4409 "remoteindicestest-mpi-2"
4410 "syncertest"
4411 "syncertest-mpi-2"
4412 "variablesizecommunicatortest"
4413 "variablesizecommunicatortest-mpi-2"
4414 "arithmetictestsuitetest"
4415 "assertandreturntest"
4416 "assertandreturntest_ndebug"
4417 "concept"
4418 "debugaligntest"
4419 "mpicollectivecommunication"
4420 "mpicollectivecommunication-mpi-2"
4421 "mpiguardtest"
4422 "mpiguardtest-mpi-2"
4423 "mpihelpertest"
4424 "mpihelpertest-mpi-2"
4425 "mpihelpertest2"
4426 "mpihelpertest2-mpi-2")
4427 "|")
4428 ")'"))
4429 #t)))))
4430 (inputs
4431 `(("gmp" ,gmp)
4432 ("metis" ,metis)
4433 ("openmpi" ,openmpi)
4434 ("openblas" ,openblas)
4435 ("python" ,python)
4436 ("superlu" ,superlu)))
4437 (native-inputs
4438 `(("gfortran" ,gfortran)
4439 ("pkg-config" ,pkg-config)))
4440 (home-page "https://dune-project.org/")
4441 (synopsis "Distributed and Unified Numerics Environment")
4442 (description "DUNE, the Distributed and Unified Numerics Environment is a
4443modular toolbox for solving @dfn{partial differential equations} (PDEs) with
4444grid-based methods. It supports the easy implementation of methods like
4445@dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
4446Differences} (FD).")
4447 ;; GPL version 2 with "runtime exception" to make it behave like LGPLv2.
4448 (license license:gpl2)))
242dbd8e
RW
4449
4450(define-public dune-geometry
4451 (package
4452 (name "dune-geometry")
4453 (version "2.6.0")
4454 (source
4455 (origin
4456 (method url-fetch)
4457 (uri (string-append "https://dune-project.org/download/"
4458 version "/dune-geometry-" version ".tar.gz"))
4459 (sha256
4460 (base32
4461 "0hlaaxjyv9j05blasvb67sy02hd0w4g9znf68gdh3l731dd1aqbn"))))
4462 (build-system cmake-build-system)
4463 (arguments
4464 `(#:phases
4465 (modify-phases %standard-phases
4466 (add-after 'build 'build-tests
4467 (lambda* (#:key make-flags #:allow-other-keys)
4468 (apply invoke "make" "build_tests" make-flags))))))
4469 (inputs
4470 `(("dune-common" ,dune-common)
4471 ("openmpi" ,openmpi)
4472 ;; Optional
4473 ("openblas" ,openblas)
4474 ("gmp" ,gmp)
4475 ("python" ,python)))
4476 (native-inputs
4477 `(("gfortran" ,gfortran)
4478 ("pkg-config" ,pkg-config)))
4479 (home-page "https://dune-project.org/")
4480 (synopsis "Distributed and Unified Numerics Environment")
4481 (description "DUNE, the Distributed and Unified Numerics Environment is a
4482modular toolbox for solving @dfn{partial differential equations} (PDEs) with
4483grid-based methods. It supports the easy implementation of methods like
4484@dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
4485Differences} (FD).
4486
4487This package contains the basic DUNE geometry classes.")
4488 ;; GPL version 2 with "runtime exception"
4489 (license license:gpl2)))
ef6e69fd
RW
4490
4491(define-public dune-grid
4492 (package
4493 (name "dune-grid")
4494 (version "2.6.0")
4495 (source
4496 (origin
4497 (method url-fetch)
4498 (uri (string-append "https://dune-project.org/download/"
4499 version "/dune-grid-" version ".tar.gz"))
4500 (sha256
4501 (base32
4502 "1jp4vscm9yb9xg0lh7apzccfkhvgbnk652yahigmh3cvzpl4acd0"))))
4503 (build-system cmake-build-system)
4504 (arguments
4505 `(#:phases
4506 (modify-phases %standard-phases
4507 (add-after 'build 'build-tests
4508 (lambda* (#:key make-flags #:allow-other-keys)
4509 (apply invoke "make" "build_tests" make-flags)))
4510 ;; These tests fail because they require a fully functional MPI
4511 ;; environment.
4512 (add-after 'unpack 'disable-failing-tests
4513 (lambda _
4514 (setenv "ARGS"
4515 (string-append "--exclude-regex '("
4516 (string-join
4517 (list
4518 "scsgmappertest"
4519 "conformvolumevtktest"
4520 "gnuplottest"
4521 "nonconformboundaryvtktest"
4522 "subsamplingvtktest"
4523 "vtktest"
4524 "vtktest-mpi-2"
4525 "vtksequencetest"
4526 "gmshtest-onedgrid"
4527 "test-dgf-yasp"
4528 "test-dgf-yasp-offset"
4529 "test-dgf-oned"
4530 "test-geogrid-yaspgrid"
4531 "test-gridinfo"
4532 "test-identitygrid"
4533 "testiteratorranges"
4534 "test-hierarchicsearch"
4535 "test-parallel-ug-mpi-2"
4536 "test-yaspgrid-backuprestore-equidistant"
4537 "test-yaspgrid-backuprestore-equidistant-mpi-2"
4538 "test-yaspgrid-backuprestore-equidistantoffset"
4539 "test-yaspgrid-backuprestore-equidistantoffset-mpi-2"
4540 "test-yaspgrid-backuprestore-tensor"
4541 "test-yaspgrid-backuprestore-tensor-mpi-2"
4542 "test-yaspgrid-tensorgridfactory"
4543 "test-yaspgrid-tensorgridfactory-mpi-2"
4544 "test-yaspgrid-yaspfactory-1d"
4545 "test-yaspgrid-yaspfactory-1d-mpi-2"
4546 "test-yaspgrid-yaspfactory-2d"
4547 "test-yaspgrid-yaspfactory-2d-mpi-2"
4548 "test-yaspgrid-yaspfactory-3d"
4549 "test-yaspgrid-yaspfactory-3d-mpi-2"
4550 "globalindexsettest"
4551 "persistentcontainertest"
4552 "structuredgridfactorytest"
4553 "tensorgridfactorytest"
4554 "vertexordertest")
4555 "|")
4556 ")'"))
4557 #t)))))
4558 (inputs
4559 `(("dune-common" ,dune-common)
4560 ("dune-geometry" ,dune-geometry)
4561 ("gmp" ,gmp)
4562 ("metis" ,metis)
4563 ("openblas" ,openblas)
4564 ("openmpi" ,openmpi)
4565 ("python" ,python)))
4566 (native-inputs
4567 `(("gfortran" ,gfortran)
4568 ("pkg-config" ,pkg-config)))
4569 (home-page "https://dune-project.org/")
4570 (synopsis "Distributed and Unified Numerics Environment")
4571 (description "DUNE, the Distributed and Unified Numerics Environment is a
4572modular toolbox for solving @dfn{partial differential equations} (PDEs) with
4573grid-based methods. It supports the easy implementation of methods like
4574@dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
4575Differences} (FD).
4576
4577This package contains the basic DUNE grid classes.")
4578 ;; GPL version 2 with "runtime exception"
4579 (license license:gpl2)))
ea51d357
RW
4580
4581(define-public dune-istl
4582 (package
4583 (name "dune-istl")
4584 (version "2.6.0")
4585 (source
4586 (origin
4587 (method url-fetch)
4588 (uri (string-append "https://dune-project.org/download/"
4589 version "/dune-istl-" version ".tar.gz"))
4590 (sha256
4591 (base32
4592 "0l2gyrvys5w6wsmk0ckbb7295s80b7yk7qrl7x66akv2jv1nzq2w"))))
4593 (build-system cmake-build-system)
4594 (arguments
4595 `(#:phases
4596 (modify-phases %standard-phases
4597 (add-after 'build 'build-tests
4598 (lambda* (#:key make-flags #:allow-other-keys)
4599 (apply invoke "make" "build_tests" make-flags)))
4600 ;; These tests fail because they require a fully functional MPI
4601 ;; environment.
4602 (add-after 'unpack 'disable-failing-tests
4603 (lambda _
4604 (setenv "ARGS"
4605 (string-append "--exclude-regex '("
4606 (string-join
4607 (list
4608 "galerkintest"
4609 "hierarchytest"
4610 "pamgtest"
4611 "pamg_comm_repart_test"
4612 "matrixredisttest"
4613 "vectorcommtest"
4614 "matrixmarkettest")
4615 "|")
4616 ")'"))
4617 #t)))))
4618 (inputs
4619 `(("dune-common" ,dune-common)
4620 ("openmpi" ,openmpi)
4621 ;; Optional
4622 ("metis" ,metis)
4623 ("superlu" ,superlu)
4624 ("openblas" ,openblas)
4625 ("gmp" ,gmp)
4626 ("python" ,python)))
4627 (native-inputs
4628 `(("gfortran" ,gfortran)
4629 ("pkg-config" ,pkg-config)))
4630 (home-page "https://dune-project.org/")
4631 (synopsis "Distributed and Unified Numerics Environment")
4632 (description "DUNE, the Distributed and Unified Numerics Environment is a
4633modular toolbox for solving @dfn{partial differential equations} (PDEs) with
4634grid-based methods.
4635
4636This is the iterative solver template library which provides generic sparse
4637matrix/vector classes and a variety of solvers based on these classes. A
4638special feature is the use of templates to exploit the recursive block
4639structure of finite element matrices at compile time. Available solvers
4640include Krylov methods, (block-) incomplete decompositions and
4641aggregation-based algebraic multigrid.")
4642 ;; GPL version 2 with "runtime exception"
4643 (license license:gpl2)))
5a70aa7d
RW
4644
4645(define-public dune-localfunctions
4646 (package
4647 (name "dune-localfunctions")
4648 (version "2.6.0")
4649 (source
4650 (origin
4651 (method url-fetch)
4652 (uri (string-append "https://dune-project.org/download/"
4653 version "/dune-localfunctions-" version ".tar.gz"))
4654 (sha256
4655 (base32
4656 "19c6zjinwwpy8jh4v4prhphyd438rapd4x80fj93apmwgw04nrhl"))))
4657 (build-system cmake-build-system)
4658 (arguments
4659 `(#:phases
4660 (modify-phases %standard-phases
4661 (add-after 'build 'build-tests
4662 (lambda* (#:key make-flags #:allow-other-keys)
4663 (apply invoke "make" "build_tests" make-flags))))))
4664 (inputs
4665 `(("dune-common" ,dune-common)
4666 ("dune-geometry" ,dune-geometry)
4667 ("openmpi" ,openmpi)
4668 ;; Optional
4669 ("metis" ,metis)
4670 ("superlu" ,superlu)
4671 ("gmp" ,gmp)))
4672 (native-inputs
4673 `(("gfortran" ,gfortran)
4674 ("pkg-config" ,pkg-config)))
4675 (home-page "https://dune-project.org/")
4676 (synopsis "Distributed and Unified Numerics Environment") ; TODO
4677 (description "This DUNE module provides interface and implementation for
4678shape functions defined on the DUNE reference elements. In addition to the
4679shape function, interpolation operators and special keys are provided which
4680can be used to assemble global function spaces on finite-element grids.
4681
4682This package provides an interface and implementation for shape functions
4683defined on the DUNE reference elements. In addition to the shape function,
4684interpolation operators and special keys are provided which can be used to
4685assemble global function spaces on finite-element grids.")
4686 ;; GPL version 2 with "runtime exception"
4687 (license license:gpl2)))
ab03d899
RW
4688
4689(define-public dune-alugrid
4690 (package
4691 (name "dune-alugrid")
4692 (version "2.6.0")
4693 (source
4694 (origin
4695 (method url-fetch)
4696 (uri (string-append "https://dune-project.org/download/"
4697 version "/dune-alugrid-" version ".tar.gz"))
4698 (sha256
4699 (base32
4700 "1l9adgyjpra8mvwm445s0lpjshnb63jag85fb2hisbjn6bm320yj"))))
4701 (build-system cmake-build-system)
4702 (arguments
4703 `(#:tests? #f ; 7 of 8 tests fail because they need a full MPI
4704 ; environment
4705 #:phases
4706 (modify-phases %standard-phases
4707 (add-after 'unpack 'patch-include
4708 (lambda _
4709 (substitute* "dune/alugrid/test/test-alugrid.cc"
4710 (("doc/grids/gridfactory/testgrids")
4711 "doc/dune-grid/grids/gridfactory/testgrids"))
4712 #t))
4713 (add-after 'build 'build-tests
4714 (lambda* (#:key inputs make-flags #:allow-other-keys)
4715 (setenv "CPLUS_INCLUDE_PATH"
4716 (string-append (assoc-ref inputs "dune-grid") "/share:"
4717 (getenv "CPLUS_INCLUDE_PATH")))
4718 (apply invoke "make" "build_tests" make-flags))))))
4719 (inputs
4720 `(("dune-common" ,dune-common)
4721 ("dune-geometry" ,dune-geometry)
4722 ("dune-grid" ,dune-grid)
4723 ("openmpi" ,openmpi)
4724 ;; Optional
4725 ("metis" ,metis)
4726 ("openblas" ,openblas)
4727 ("python" ,python)
4728 ("superlu" ,superlu)
4729 ("gmp" ,gmp)
4730 ("zlib" ,zlib)))
4731 (native-inputs
4732 `(("gfortran" ,gfortran)
4733 ("pkg-config" ,pkg-config)))
4734 (home-page "https://dune-project.org/")
4735 (synopsis "Distributed and Unified Numerics Environment")
4736 (description "ALUGrid is an adaptive, loadbalancing, unstructured
4737implementation of the DUNE grid interface supporting either simplices or
4738cubes.")
4739 (license license:gpl2+)))
0e50630f
RW
4740
4741(define-public dune-typetree
4742 (package
4743 (name "dune-typetree")
4744 (version "2.6.0")
4745 (source
4746 (origin
4747 (method git-fetch)
4748 (uri (git-reference
4749 (url "https://gitlab.dune-project.org/staging/dune-typetree.git")
4750 (commit (string-append "v" version))))
4751 (file-name (git-file-name name version))
4752 (sha256
4753 (base32
4754 "0mnv6w2f22lz3j4bdpdjq55vjm8xxfx9v4vvhg9bd36xpsbjpjp9"))))
4755 (build-system cmake-build-system)
4756 (arguments
4757 `(#:phases
4758 (modify-phases %standard-phases
4759 (add-after 'build 'build-tests
4760 (lambda* (#:key make-flags #:allow-other-keys)
4761 (apply invoke "make" "build_tests" make-flags))))))
4762 (inputs
4763 `(("dune-common" ,dune-common)
4764 ("openmpi" ,openmpi)
4765 ;; Optional
4766 ("openblas" ,openblas)
4767 ("python" ,python)
4768 ("metis" ,metis)
4769 ("superlu" ,superlu)
4770 ("gmp" ,gmp)))
4771 (native-inputs
4772 `(("gfortran" ,gfortran)
4773 ("pkg-config" ,pkg-config)))
4774 (home-page "https://dune-project.org/")
4775 (synopsis "Distributed and Unified Numerics Environment")
4776 (description "TypeTree is a template library for constructing and
4777operating on statically typed trees of objects.")
4778 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
4779 (license (list license:lgpl3+ license:gpl2))))
85b9371c
RW
4780
4781(define-public dune-functions
4782 (package
4783 (name "dune-functions")
4784 (version "2.6.0")
4785 (source
4786 (origin
4787 (method git-fetch)
4788 (uri (git-reference
4789 (url "https://gitlab.dune-project.org/staging/dune-functions.git")
4790 (commit (string-append "v" version))))
4791 (file-name (git-file-name name version))
4792 (sha256
4793 (base32
4794 "1an8gb477n8j0kzpbrv7nr1snh8pxip0gsxq6w63jc83gg3dj200"))))
4795 (build-system cmake-build-system)
4796 (arguments `(#:tests? #f)) ; FIXME: tests require dune-uugrid
4797 (inputs
4798 `(("dune-common" ,dune-common)
4799 ("dune-istl" ,dune-istl)
4800 ("dune-localfunctions" ,dune-localfunctions)
4801 ("dune-grid" ,dune-grid)
4802 ("dune-geometry" ,dune-geometry)
4803 ("dune-typetree" ,dune-typetree)
4804 ("openmpi" ,openmpi)
4805 ("openblas" ,openblas)
4806 ("metis" ,metis)
4807 ("python" ,python)
4808 ("superlu" ,superlu)
4809 ("gmp" ,gmp)))
4810 (native-inputs
4811 `(("gfortran" ,gfortran)
4812 ("pkg-config" ,pkg-config)))
4813 (home-page "https://dune-project.org/")
4814 (synopsis "Distributed and Unified Numerics Environment")
4815 (description "The dune-functions module provides an abstraction layer for
4816global finite element functions. Its two main concepts are functions
4817implemented as callable objects, and bases of finite element spaces.")
4818 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
4819 (license (list license:lgpl3+ license:gpl2))))
4714b00e
RW
4820
4821(define-public dune-pdelab
4822 (package
4823 (name "dune-pdelab")
4824 (version "2.6.0-rc1")
4825 (source
4826 (origin
4827 (method git-fetch)
4828 (uri (git-reference
4829 (url "https://gitlab.dune-project.org/pdelab/dune-pdelab")
4830 (commit (string-append "v" version))))
4831 (file-name (git-file-name name version))
4832 (sha256
4833 (base32
4834 "07g0s9448z65vjrq88g5rv3340iifil85k170n8kbqchsvi4ny5v"))))
4835 (build-system cmake-build-system)
4836 (arguments '(#:tests? #f)) ; XXX: the tests cannot be compiled
4837 (inputs
4838 `(("dune-common" ,dune-common)
4839 ("dune-istl" ,dune-istl)
4840 ("dune-localfunctions" ,dune-localfunctions)
4841 ("dune-geometry" ,dune-geometry)
4842 ("dune-grid" ,dune-grid)
4843 ("dune-typetree" ,dune-typetree)
4844 ("dune-functions" ,dune-functions)
4845 ("openmpi" ,openmpi)
4846 ;; Optional
4847 ("openblas" ,openblas)
4848 ("eigen" ,eigen)
4849 ("metis" ,metis)
4850 ("python" ,python)
4851 ("superlu" ,superlu)
4852 ("gmp" ,gmp)))
4853 (native-inputs
4854 `(("gfortran" ,gfortran)
4855 ("pkg-config" ,pkg-config)))
4856 (home-page "https://dune-project.org/")
4857 (synopsis "Differential equations solver toolbox")
4858 (description "PDELab is a partial differential equations solver toolbox
4859built on top of DUNE, the Distributed and Unified Numerics Environment.")
4860 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
4861 (license (list license:lgpl3+ license:gpl2))))
413f6126
AI
4862
4863(define-public mlucas
4864 (package
4865 (name "mlucas")
4866 (version "18")
4867 (source
4868 (origin
4869 (method url-fetch)
4870 (uri (string-append
4871 "https://mersenneforum.org/mayer/src/C/mlucas_v" version ".txz"))
4872 (sha256
4873 (base32
4874 "1ax12qj9lyvnx4vs3gx7l8r3wx5gjbsdswp5f00ik9z0wz7xf297"))))
4875 (build-system gnu-build-system)
4876 (inputs
4877 `(("python2" ,python-2)))
4878 (arguments
4879 `(#:tests? #f ; no tests
4880 #:phases
4881 (modify-phases %standard-phases
4882 (replace 'configure
4883 (lambda _
4884 (chdir "src")
4885 (call-with-output-file "Makefile"
4886 (lambda (port)
4887 (format port "CC = gcc
4888CFLAGS = -O3 ~a -DUSE_THREADS
4889LDLIBS = -lm -lpthread -lrt
4890Mlucas: $(addsuffix .o,$(basename $(wildcard *.c)))
4891"
4892 ,(let ((system (or (%current-target-system)
4893 (%current-system))))
4894 (cond
4895 ((string-prefix? "x86_64" system) "-DUSE_SSE2")
4896 (else ""))))))
4897 #t))
4898 (replace 'install
4899 (lambda* (#:key outputs #:allow-other-keys)
4900 (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
4901 (install-file "Mlucas" bin)
4902 (install-file "primenet.py" bin))
4903 #t)))))
4904 (home-page "https://www.mersenne.org")
4905 (synopsis "Great Internet Mersenne Prime Search (GIMPS) distributed computing client")
4906 (description "Mlucas performs Lucas-Lehmer primality testing of Mersenne
4907numbers in search of a world-record prime. You may use it to test any
4908suitable number as you wish, but it is preferable that you do so in a
4909coordinated fashion, as part of the Great Internet Mersenne Prime
4910Search (GIMPS). Mlucas also includes a simple Python script for assignment
4911management via the GIMPS project's Primenet server.")
4912 (license license:gpl2+)))