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