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