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