gnu: mbedtls-apache: Update to 2.7.3.
[jackhill/guix/guix.git] / gnu / packages / maths.scm
CommitLineData
8f8b2451 1;;; GNU Guix --- Functional package management for GNU
b146763a 2;;; Copyright © 2013, 2014, 2015, 2016 Andreas Enge <andreas@enge.fr>
da95c817 3;;; Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org>
a53d6719 4;;; Copyright © 2014, 2016, 2017 John Darrington <jmd@gnu.org>
e01397b4 5;;; Copyright © 2014, 2015, 2016, 2017, 2018 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>
4dba441c 8;;; Copyright © 2015, 2016, 2017, 2018 Ricardo Wurmus <rekado@elephly.net>
32158110 9;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com>
9aafbc0c 10;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
bd041e7f 11;;; Copyright © 2015, 2016, 2017, 2018 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>
c0edb5b5 15;;; Copyright © 2016, 2017, 2018 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>
5d4bd4cc 18;;; Copyright © 2017 Paul Garlick <pgarlick@tourbillion-technology.com>
4a78fd46 19;;; Copyright © 2017 Nils Gillmann <ng0@n0.is>
ba1be533 20;;; Copyright © 2017 Ben Woodcroft <donttrustben@gmail.com>
d109b1e8 21;;; Copyright © 2017 Theodoros Foradis <theodoros@foradis.org>
5ca4fe96 22;;; Copyright © 2017 Arun Isaac <arunisaac@systemreboot.net>
59cd0ba4 23;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
dc7d6d4e 24;;; Copyright © 2017 Dave Love <me@fx@gnu.org>
5b05dce7 25;;; Copyright © 2018 Jan Nieuwenhuizen <janneke@gnu.org>
41835f94 26;;; Copyright © 2018 Joshua Sierles, Nextjournal <joshua@nextjournal.com>
910deec6 27;;; Copyright © 2018 Nadya Voronova <voronovank@gmail.com>
07254d8b 28;;; Copyright © 2018 Adam Massmann <massmannak@gmail.com>
8f8b2451
AE
29;;;
30;;; This file is part of GNU Guix.
31;;;
32;;; GNU Guix is free software; you can redistribute it and/or modify it
33;;; under the terms of the GNU General Public License as published by
34;;; the Free Software Foundation; either version 3 of the License, or (at
35;;; your option) any later version.
36;;;
37;;; GNU Guix is distributed in the hope that it will be useful, but
38;;; WITHOUT ANY WARRANTY; without even the implied warranty of
39;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
40;;; GNU General Public License for more details.
41;;;
42;;; You should have received a copy of the GNU General Public License
43;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
44
45(define-module (gnu packages maths)
ec322be2 46 #:use-module (ice-9 regex)
8f8b2451 47 #:use-module (gnu packages)
b5b73a82 48 #:use-module ((guix licenses) #:prefix license:)
8f8b2451
AE
49 #:use-module (guix packages)
50 #:use-module (guix download)
54052a54 51 #:use-module (guix git-download)
0e2672ae 52 #:use-module (guix utils)
cec86422 53 #:use-module (guix build utils)
da95c817 54 #:use-module (guix build-system cmake)
c9dfa3c7 55 #:use-module (guix build-system gnu)
ba1be533 56 #:use-module (guix build-system ocaml)
ec8c7e47 57 #:use-module (guix build-system r)
63e07468 58 #:use-module (guix build-system ruby)
3de01d3f 59 #:use-module (gnu packages algebra)
ab5f3f21 60 #:use-module (gnu packages audio)
5143517c 61 #:use-module (gnu packages autotools)
3de01d3f 62 #:use-module (gnu packages bison)
a17d4564 63 #:use-module (gnu packages boost)
e73b49fb 64 #:use-module (gnu packages check)
3de01d3f 65 #:use-module (gnu packages cmake)
c9dfa3c7 66 #:use-module (gnu packages compression)
668c06ac 67 #:use-module (gnu packages curl)
b7b27a8f 68 #:use-module (gnu packages cyrus-sasl)
528bb464 69 #:use-module (gnu packages documentation)
57e544e8 70 #:use-module (gnu packages elf)
3de01d3f 71 #:use-module (gnu packages flex)
668c06ac 72 #:use-module (gnu packages fltk)
f3929800 73 #:use-module (gnu packages fontutils)
1dba6407 74 #:use-module (gnu packages gettext)
da95c817 75 #:use-module (gnu packages gcc)
73fed4f8 76 #:use-module (gnu packages gd)
668c06ac 77 #:use-module (gnu packages ghostscript)
889187a4 78 #:use-module (gnu packages graphviz)
f3929800 79 #:use-module (gnu packages gtk)
45147b0c 80 #:use-module (gnu packages image)
2fd26d05 81 #:use-module (gnu packages java)
668c06ac 82 #:use-module (gnu packages less)
8731e527 83 #:use-module (gnu packages lisp)
ab5f3f21 84 #:use-module (gnu packages linux)
bc3a2e35 85 #:use-module (gnu packages logging)
6e64766a 86 #:use-module (gnu packages lua)
5698b8b8 87 #:use-module (gnu packages gnome)
1b39a196 88 #:use-module (gnu packages guile)
668c06ac
JD
89 #:use-module (gnu packages xorg)
90 #:use-module (gnu packages gl)
9f913401 91 #:use-module (gnu packages imagemagick)
8731e527 92 #:use-module (gnu packages m4)
d8c7eeb9 93 #:use-module (gnu packages mpi)
b92eee75 94 #:use-module (gnu packages multiprecision)
528bb464 95 #:use-module (gnu packages netpbm)
ba1be533 96 #:use-module (gnu packages ocaml)
668c06ac 97 #:use-module (gnu packages pcre)
5698b8b8 98 #:use-module (gnu packages popt)
c9dfa3c7
AE
99 #:use-module (gnu packages perl)
100 #:use-module (gnu packages pkg-config)
ab5f3f21 101 #:use-module (gnu packages pulseaudio)
da95c817 102 #:use-module (gnu packages python)
589e3f4e 103 #:use-module (gnu packages python-web)
5b05dce7 104 #:use-module (gnu packages qt)
c9dfa3c7 105 #:use-module (gnu packages readline)
63e07468 106 #:use-module (gnu packages ruby)
2742f87e 107 #:use-module (gnu packages tbb)
479c4273 108 #:use-module (gnu packages scheme)
b7194849 109 #:use-module (gnu packages shells)
df354a77 110 #:use-module (gnu packages tcl)
668c06ac 111 #:use-module (gnu packages texinfo)
8f9ac901 112 #:use-module (gnu packages tex)
b7b27a8f 113 #:use-module (gnu packages tls)
5b05dce7 114 #:use-module (gnu packages version-control)
9aafbc0c 115 #:use-module (gnu packages wxwidgets)
c12efc72 116 #:use-module (gnu packages xml)
a17d4564 117 #:use-module (srfi srfi-1))
8f8b2451 118
193abc82
JD
119(define-public aris
120 (package
1f45f18a
JD
121 (name "aris")
122 (version "2.2")
123 (source (origin
124 (method url-fetch)
125 (uri (string-append "mirror://gnu/" name "/" name "-" version ".tar.gz"))
126 (sha256 (base32
127 "1q1887ryqdr9sn0522hc7p16kqwlxxyz5dkmma8ar2nxplhgll7q"))))
128 (build-system gnu-build-system)
129 (inputs `(("gtk+" ,gtk+)
130 ("libxml2" ,libxml2)))
131 (native-inputs `(("pkg-config" ,pkg-config)))
132 (synopsis "Natural deduction first-order logic interface")
133 (description "Aris is a program for performing logical proofs. It supports
134propositional and predicate logic, as well as Boolean algebra and
135arithmetical logic. In addition to its predefined inference and equivalence
136rules, Aris also supports references to older proofs. Its use of standard
137logical symbols and its natural deduction interface make it easy to use for
138beginners.")
139 (license license:gpl3+)
6fd52309 140 (home-page "https://www.gnu.org/software/aris/")))
193abc82 141
9c45c519
JD
142(define-public c-graph
143 (package
144 (name "c-graph")
145 (version "2.0")
146 (source (origin
147 (method url-fetch)
148 (uri (string-append "mirror://gnu/c-graph/c-graph-" version
149 ".tar.gz"))
150 (sha256 (base32
151 "1hlvpzrh7hzzf533diyfiabzskddi8zx92av9hwkjw3l46z7qv01"))))
152 (build-system gnu-build-system)
153 (inputs
154 `(("fortran" ,gfortran)))
a3947cb1 155 (synopsis "Visualizing and demonstrating convolution")
9c45c519 156 (description
a3947cb1
LC
157 "GNU C-Graph is a tool for demonstrating the theory of convolution.
158Thus, it can serve as an excellent aid to students of signal and systems
159theory in visualizing the convolution process. Rather than forcing the
160student to write code, the program offers an intuitive interface with
161interactive dialogs to guide them.")
9c45c519 162 (license license:gpl3+)
6fd52309 163 (home-page "https://www.gnu.org/software/c-graph/")))
9c45c519 164
d91025e3
TD
165(define-public coda
166 (package
167 (name "coda")
440c4273 168 (version "2.18.3")
d91025e3
TD
169 (source
170 (origin
171 (method url-fetch)
172 (uri (string-append "https://github.com/stcorp/coda/releases/download/"
173 version "/coda-" version ".tar.gz"))
174 (sha256
440c4273 175 (base32 "1zlzgcvwmmjm8mw8w4rg2rqy0pjilz7kyyxm0y4p8cbljbbjxxz0"))
4b12fe5c
TD
176 (patches (search-patches "coda-use-system-libs.patch"))
177 (modules '((guix build utils)))
178 (snippet
179 ;; Make sure we don't use the bundled software.
180 '(for-each (lambda (d)
181 (delete-file-recursively (string-append "libcoda/" d)))
182 '("zlib" "pcre" "expat")))))
d91025e3
TD
183 (native-inputs
184 `(("fortran" ,gfortran)
185 ("python" ,python)
186 ("python-numpy" ,python-numpy)))
187 (inputs
188 `(("zlib" ,zlib)
4b12fe5c
TD
189 ("pcre" ,pcre)
190 ("expat" ,expat)
d91025e3
TD
191 ("hdf4" ,hdf4-alt)
192 ("hdf5" ,hdf5)))
193 (build-system gnu-build-system)
194 (arguments
4b12fe5c
TD
195 '(#:configure-flags '("--with-hdf4" "--with-hdf5" "--enable-python"
196 "LIBS= -lz -lpcre -lexpat")))
d91025e3
TD
197 (synopsis "A common interface to various earth observation data formats")
198 (description
199 "The Common Data Access toolbox (CODA) provides a set of interfaces for
200reading remote sensing data from earth observation data files. It consists of
201command line applications and interfaces to the C, Fortran, Python, and Java
202programming languages.")
203 (home-page "https://stcorp.nl/coda")
204 (license license:gpl2+)))
205
8f8b2451
AE
206(define-public units
207 (package
208 (name "units")
f11d2849 209 (version "2.16")
8f8b2451
AE
210 (source (origin
211 (method url-fetch)
212 (uri (string-append "mirror://gnu/units/units-" version
213 ".tar.gz"))
214 (sha256 (base32
f11d2849 215 "11hnp3gcmcc5kci2caxw4hs6m08h2mhqs3xzqq7iafx1ha2ggwyw"))))
8f8b2451 216 (build-system gnu-build-system)
0498d248 217 (inputs
a2549713
EB
218 `(("readline" ,readline)
219 ("python" ,python-wrapper) ;for 'units_cur' script
0498d248
EB
220 ("python-requests" ,python-requests)))
221 (arguments
222 `(#:phases (modify-phases %standard-phases
223 (add-after 'install 'wrap-units_cur
224 (lambda* (#:key outputs #:allow-other-keys)
225 (let* ((out (assoc-ref outputs "out"))
226 (bin (string-append out "/bin")))
227 (wrap-program (string-append bin "/units_cur")
228 `("PYTHONPATH" ":" prefix
229 ,(search-path-as-string->list (getenv "PYTHONPATH"))))
230 #t))))))
8f8b2451
AE
231 (synopsis "Conversion between thousands of scales")
232 (description
574e86f9 233 "GNU Units converts numeric quantities between units of measure. It
7c125ce0
AK
234can handle scale changes through adaptive usage of standard scale
235prefixes (micro-, kilo-, etc.). It can also handle nonlinear
236conversions such as Fahrenheit to Celsius. Its interpreter is powerful
237enough to be used effectively as a scientific calculator.")
8f8b2451 238 (license license:gpl3+)
6fd52309 239 (home-page "https://www.gnu.org/software/units/")))
c9dfa3c7 240
61a529b4
RW
241(define-public double-conversion
242 (package
243 (name "double-conversion")
244 (version "1.1.5")
245 (source (origin
246 (method url-fetch)
247 (uri (string-append
248 "https://github.com/floitsch/double-conversion/archive/v"
249 version ".tar.gz"))
250 (file-name (string-append name "-" version ".tar.gz"))
251 (sha256
252 (base32
253 "0cnr8xhyjfxijay8ymkqcph3672wp2lj23qhdmr3m4kia5kpdf83"))))
254 (build-system cmake-build-system)
255 (arguments
256 '(#:test-target "test"
257 #:configure-flags '("-DBUILD_SHARED_LIBS=ON"
258 "-DBUILD_TESTING=ON")))
259 (home-page "https://github.com/floitsch/double-conversion")
260 (synopsis "Conversion routines for IEEE doubles")
261 (description
262 "The double-conversion library provides binary-decimal and decimal-binary
263routines for IEEE doubles. The library consists of efficient conversion
264routines that have been extracted from the V8 JavaScript engine.")
265 (license license:bsd-3)))
266
182d6311
ML
267(define-public dionysus
268 (package
269 (name "dionysus")
bd041e7f 270 (version "1.4.0")
182d6311
ML
271 (source (origin
272 (method url-fetch)
273 (uri (string-append "mirror://gnu/dionysus/dionysus-" version
bd041e7f 274 ".tar.xz"))
182d6311
ML
275 (sha256
276 (base32
bd041e7f 277 "194pzs1mlsj4ww6v37qq3961h5hckm5h805cv0r14xj3g9wfx2sk"))))
182d6311
ML
278 (build-system gnu-build-system)
279 (inputs `(("tcl" ,tcl))) ;for 'tclsh'
280 (synopsis "Local search for universal constants and scientific values")
281 (description
282 "GNU Dionysus is a convenient system for quickly retrieving the values of
283mathematical constants used in science and engineering. Values can be
284searched using a simple command-line tool, choosing from three databases:
285universal constants, atomic numbers, and constants related to
286semiconductors.")
287 (license license:gpl3+)
6fd52309 288 (home-page "https://www.gnu.org/software/dionysus/")))
182d6311 289
88bd1804
AE
290(define-public gsl
291 (package
292 (name "gsl")
f885fc05 293 (version "2.4")
ab2cc5cd
LC
294 (source (origin
295 (method url-fetch)
296 (uri (string-append "mirror://gnu/gsl/gsl-"
297 version ".tar.gz"))
298 (sha256
299 (base32
f885fc05 300 "16yfs5n444s03np1naj6yp1fsysd42kdscxzkg0k2yvfjixx0ijd"))
ab2cc5cd 301 (patches (search-patches "gsl-test-i686.patch"))))
88bd1804 302 (build-system gnu-build-system)
71e0f288 303 (arguments
f885fc05 304 `(;; Currently there are numerous tests that fail on "exotic"
6f766069
EF
305 ;; architectures such as aarch64 and ppc64le.
306 ,@(if (string-prefix? "aarch64-linux"
307 (or (%current-target-system) (%current-system)))
308 '(#:tests? #f)
309 '())))
310 (home-page "https://www.gnu.org/software/gsl/")
88bd1804
AE
311 (synopsis "Numerical library for C and C++")
312 (description
a22dc0c4
LC
313 "The GNU Scientific Library is a library for numerical analysis in C
314and C++. It includes a wide range of mathematical routines, with over 1000
315functions in total. Subject areas covered by the library include:
316differential equations, linear algebra, Fast Fourier Transforms and random
317numbers.")
88bd1804
AE
318 (license license:gpl3+)))
319
ba1be533
BW
320(define-public ocaml-gsl
321 (package
322 (name "ocaml-gsl")
323 (version "1.19.3")
324 (source
325 (origin
326 (method url-fetch)
327 (uri
328 (string-append
329 "https://github.com/mmottl/gsl-ocaml/releases/download/v"
330 version"/gsl-ocaml-" version ".tar.gz"))
331 (sha256
332 (base32
333 "0nzp43hp8pbjqkrxnwp5lgjrabxayf61h18fjaydi0s5faq6f3xh"))))
334 (build-system ocaml-build-system)
335 (inputs
336 `(("gsl" ,gsl)))
337 (home-page "https://mmottl.github.io/gsl-ocaml")
338 (synopsis "Bindings to the GNU Scientific Library")
339 (description
340 "GSL-OCaml is an interface to the @dfn{GNU scientific library} (GSL) for
341the OCaml language.")
342 (license license:gpl3+)))
343
7adaab9f
BW
344(define-public ocaml4.01-gsl
345 (package-with-ocaml4.01 ocaml-gsl))
346
b92eee75
AE
347(define-public glpk
348 (package
349 (name "glpk")
445929e0 350 (version "4.65")
b92eee75
AE
351 (source
352 (origin
353 (method url-fetch)
354 (uri (string-append "mirror://gnu/glpk/glpk-"
355 version ".tar.gz"))
356 (sha256
357 (base32
445929e0 358 "040sfaa9jclg2nqdh83w71sv9rc1sznpnfiripjdyr48cady50a2"))))
b92eee75
AE
359 (build-system gnu-build-system)
360 (inputs
361 `(("gmp" ,gmp)))
362 (arguments
363 `(#:configure-flags '("--with-gmp")))
82110ef6 364 (home-page "https://www.gnu.org/software/glpk/")
79c311b8 365 (synopsis "GNU Linear Programming Kit, supporting the MathProg language")
b92eee75
AE
366 (description
367 "GLPK is a C library for solving large-scale linear programming (LP),
368mixed integer programming (MIP), and other related problems. It supports the
369GNU MathProg modeling language, a subset of the AMPL language, and features a
370translator for the language. In addition to the C library, a stand-alone
371LP/MIP solver is included in the package.")
372 (license license:gpl3+)))
373
b146763a
AE
374(define-public 4ti2
375 (package
376 (name "4ti2")
377 (version "1.6.7")
378 (source
379 (origin
380 (method url-fetch)
381 (uri (string-append "http://www.4ti2.de/version_" version
382 "/4ti2-" version ".tar.gz"))
383 (sha256
384 (base32
385 "1frix3rnm9ffr93alqzw4cavxbfpf524l8rfbmcpyhwd3n1km0yl"))))
386 (build-system gnu-build-system)
387 (native-inputs
388 `(("which" ,(@ (gnu packages base) which)))) ; for the tests
389 (inputs
390 `(("glpk" ,glpk)
391 ("gmp" ,gmp)))
392 (home-page "http://www.4ti2.de/")
393 (synopsis "Mathematical tool suite for problems on linear spaces")
394 (description
395 "4ti2 implements algorithms for solving algebraic, geometric and
396combinatorial problems on linear spaces. Among others, it solves systems
397of linear equations, computes extreme rays of polyhedral cones, solves
398integer programming problems and computes Markov bases for statistics.")
399 (license license:gpl2+)))
400
53696f10
AE
401(define-public cddlib
402 (package
403 (name "cddlib")
404 (version "0.94h")
405 (source
406 (origin
407 (method url-fetch)
182dde82 408 (uri (string-append "ftp://ftp.math.ethz.ch/users/fukudak/cdd/cddlib-"
53696f10
AE
409 (string-delete #\. version) ".tar.gz"))
410 (sha256
411 (base32
412 "1dasasscwfg793q8fwzgwf64xwj7w62yfvszpr8x8g38jka08vgy"))))
413 (build-system gnu-build-system)
414 (inputs
415 `(("gmp" ,gmp)))
416 (home-page "https://www.inf.ethz.ch/personal/fukudak/cdd_home/index.html")
417 (synopsis "Library for convex hulls and extreme rays of polyhedra")
418 (description
419 "The C-library cddlib implements the Double Description Method of
420Motzkin et al. for generating all vertices (i.e. extreme points) and extreme
421rays of a general convex polyhedron given by a system of linear inequalities
422in arbitrary dimension. It can also be used for the converse operation of
423computing convex hulls.")
424 (license license:gpl2+)))
425
865a69dd
RW
426(define-public arpack-ng
427 (package
428 (name "arpack-ng")
c0edb5b5
LC
429 (version "3.5.0")
430 (home-page "https://github.com/opencollab/arpack-ng")
865a69dd
RW
431 (source
432 (origin
433 (method url-fetch)
c0edb5b5 434 (uri (string-append home-page "/archive/" version ".tar.gz"))
f586c877 435 (file-name (string-append name "-" version ".tar.gz"))
865a69dd
RW
436 (sha256
437 (base32
c0edb5b5 438 "0f8jx3fifmj9qdp289zr7r651y1q48k1jya859rqxq62mvis7xsh"))))
865a69dd 439 (build-system gnu-build-system)
c0edb5b5
LC
440 (arguments
441 '(#:phases (modify-phases %standard-phases
442 (add-after 'unpack 'autoreconf
443 (lambda _
444 (invoke "autoreconf" "-vfi"))))))
445 (native-inputs
446 `(("autoconf" ,autoconf)
447 ("automake" ,automake)
448 ("libtool" ,libtool)))
865a69dd
RW
449 (inputs
450 `(("lapack" ,lapack)
19afbea1 451 ("fortran" ,gfortran)))
865a69dd
RW
452 (synopsis "Fortran subroutines for solving eigenvalue problems")
453 (description
454 "ARPACK-NG is a collection of Fortran77 subroutines designed to solve
455large scale eigenvalue problems.")
166191b3 456 (license (license:non-copyleft "file://COPYING"
865a69dd
RW
457 "See COPYING in the distribution."))))
458
c0edb5b5
LC
459(define-public arpack-ng-3.3.0
460 (package
461 (inherit arpack-ng)
462 (version "3.3.0")
463 (name (package-name arpack-ng))
464 (home-page (package-home-page arpack-ng))
465 (source
466 (origin
467 (method url-fetch)
468 (uri (string-append home-page "/archive/" version ".tar.gz"))
469 (file-name (string-append name "-" version ".tar.gz"))
470 (sha256
471 (base32
472 "1cz53wqzcf6czmcpfb3vb61xi0rn5bwhinczl65hpmbrglg82ndd"))))))
473
8c94c886
EB
474(define-public arpack-ng-openmpi
475 (package (inherit arpack-ng)
476 (name "arpack-ng-openmpi")
477 (inputs
478 `(("mpi" ,openmpi)
479 ,@(package-inputs arpack-ng)))
480 (arguments `(#:configure-flags '("--enable-mpi")))
481 (synopsis "Fortran subroutines for solving eigenvalue problems with MPI")))
482
da95c817
NK
483(define-public lapack
484 (package
485 (name "lapack")
ef39a177 486 (version "3.7.1")
da95c817
NK
487 (source
488 (origin
489 (method url-fetch)
490 (uri (string-append "http://www.netlib.org/lapack/lapack-"
491 version ".tgz"))
492 (sha256
493 (base32
7c0d4c3a 494 "1j51r7n5w4k7r3lrvy7710xrpkg40wf4rqnmngfz6ck9ypckzign"))))
da95c817
NK
495 (build-system cmake-build-system)
496 (home-page "http://www.netlib.org/lapack/")
19afbea1 497 (inputs `(("fortran" ,gfortran)
da95c817
NK
498 ("python" ,python-2)))
499 (arguments
3ab869b6 500 `(#:configure-flags (list
3ab869b6
LC
501 "-DBUILD_SHARED_LIBS:BOOL=YES"
502 "-DLAPACKE=ON"
503
504 ;; Build the 'LAPACKE_clatms' functions.
505 "-DLAPACKE_WITH_TMG=ON")
dc1d3cde
KK
506 #:phases
507 (modify-phases %standard-phases
508 (add-before 'check 'patch-python
509 (lambda* (#:key inputs #:allow-other-keys)
510 (let ((python (assoc-ref inputs "python")))
511 (substitute* "lapack_testing.py"
512 (("/usr/bin/env python") python)))
513 #t)))))
da95c817
NK
514 (synopsis "Library for numerical linear algebra")
515 (description
516 "LAPACK is a Fortran 90 library for solving the most commonly occurring
517problems in numerical linear algebra.")
166191b3 518 (license (license:non-copyleft "file://LICENSE"
da95c817 519 "See LICENSE in the distribution."))))
73fed4f8 520
b509efb3
TF
521(define-public lapack-3.5
522 (package
523 (inherit lapack)
524 (version "3.5.0")
525 (source
526 (origin
527 (method url-fetch)
528 (uri (string-append "http://www.netlib.org/lapack/lapack-"
529 version ".tgz"))
530 (sha256
531 (base32
532 "0lk3f97i9imqascnlf6wr5mjpyxqcdj73pgj97dj2mgvyg9z1n4s"))))))
533
e1ff597a
EB
534(define-public scalapack
535 (package
536 (name "scalapack")
537 (version "2.0.2")
538 (source
539 (origin
540 (method url-fetch)
541 (uri (string-append "http://www.netlib.org/scalapack/scalapack-"
542 version ".tgz"))
543 (sha256
544 (base32
545 "0p1r61ss1fq0bs8ynnx7xq4wwsdvs32ljvwjnx6yxr8gd6pawx0c"))))
546 (build-system cmake-build-system)
547 (inputs
548 `(("mpi" ,openmpi)
549 ("fortran" ,gfortran)
550 ("lapack" ,lapack))) ;for testing only
551 (arguments
552 `(#:configure-flags `("-DBUILD_SHARED_LIBS:BOOL=YES")))
553 (home-page "http://www.netlib.org/scalapack/")
554 (synopsis "Library for scalable numerical linear algebra")
555 (description
556 "ScaLAPACK is a Fortran 90 library of high-performance linear algebra
557routines on parallel distributed memory machines. ScaLAPACK solves dense and
558banded linear systems, least squares problems, eigenvalue problems, and
559singular value problems.")
560 (license (license:bsd-style "file://LICENSE"
561 "See LICENSE in the distribution."))))
562
73fed4f8 563(define-public gnuplot
5f800540
KK
564 (package
565 (name "gnuplot")
07254d8b 566 (version "5.2.2")
5f800540
KK
567 (source (origin
568 (method url-fetch)
569 (uri (string-append "mirror://sourceforge/gnuplot/gnuplot/"
570 version "/gnuplot-"
571 version ".tar.gz"))
572 (sha256
573 (base32
07254d8b 574 "18diyy7aib9mn098x07g25c7jij1x7wbfpicz0z8gwxx08px45m4"))))
5f800540
KK
575 (build-system gnu-build-system)
576 (inputs `(("readline" ,readline)
577 ("cairo" ,cairo)
578 ("pango" ,pango)
6e64766a
DM
579 ("gd" ,gd)
580 ("lua" ,lua)))
612a387f
RW
581 (native-inputs
582 `(("pkg-config" ,pkg-config)
583 ("texlive" ,texlive-tiny)))
07254d8b
AM
584 (arguments `(#:configure-flags (list (string-append
585 "--with-texdir=" %output
586 "/texmf-local/tex/latex/gnuplot"))))
5f800540
KK
587 (home-page "http://www.gnuplot.info")
588 (synopsis "Command-line driven graphing utility")
589 (description "Gnuplot is a portable command-line driven graphing
35b9e423 590utility. It was originally created to allow scientists and students to
73fed4f8 591visualize mathematical functions and data interactively, but has grown to
35b9e423 592support many non-interactive uses such as web scripting. It is also used as a
73fed4f8 593plotting engine by third-party applications like Octave.")
5f800540
KK
594 ;; X11 Style with the additional restriction that derived works may only be
595 ;; distributed as patches to the original.
596 (license (license:fsf-free
597 "http://gnuplot.cvs.sourceforge.net/gnuplot/gnuplot/Copyright"))))
668c06ac 598
32f70e1f
TD
599(define-public gctp
600 (package
601 (name "gctp")
602 (version "2.0.0")
603 (source
604 (origin
605 (method url-fetch)
606 (uri (string-append "https://github.com/OkoSanto/GCTP/archive/v"
607 version ".tar.gz"))
608 (file-name (string-append name "-" version ".tar.gz"))
609 (sha256
610 (base32
611 "0l9aqnqynh9laicn5dxf3rsb1n14xiks79wbyqccirzmjqd1c1x4"))))
612 (native-inputs
613 `(("fortran" ,gfortran)))
614 (build-system gnu-build-system)
615 (synopsis "General Cartographic Transformation Package (GCTP)")
616 (description
617 "The General Cartographic Transformation Package (GCTP) is a system of
618software routines designed to permit the transformation of coordinate pairs
619from one map projection to another. The GCTP is the standard computer
620software used by the National Mapping Division for map projection
621computations.")
622 (home-page "https://github.com/OkoSanto/GCTP")
0f7cd95b 623 (license license:public-domain))) ;https://www2.usgs.gov/laws/info_policies.html
32f70e1f 624
becbbefc
TD
625(define-public hdf4
626 (package
627 (name "hdf4")
0abf5264 628 (version "4.2.13")
becbbefc
TD
629 (source
630 (origin
631 (method url-fetch)
632 (uri (string-append "https://support.hdfgroup.org/ftp/HDF/releases/HDF"
633 version "/src/hdf-" version ".tar.bz2"))
634 (sha256
0abf5264 635 (base32 "1wz0586zh91pqb95wvr0pbh71a8rz358fdj6n2ksp85x2cis9lsm"))
15ca49b2
AE
636 (patches (search-patches "hdf4-architectures.patch"
637 "hdf4-reproducibility.patch"
becbbefc 638 "hdf4-shared-fortran.patch"))))
becbbefc
TD
639 (build-system gnu-build-system)
640 (native-inputs
641 `(("gfortran" ,gfortran)
642 ("bison" ,bison)
643 ("flex" ,flex)))
644 (inputs
645 `(("zlib" ,zlib)
646 ("libjpeg" ,libjpeg)))
647 (arguments
648 `(#:parallel-tests? #f
649 #:configure-flags '("--enable-shared")
650 #:phases
651 (modify-phases %standard-phases
953a12fa
EF
652 ;; This is inspired by two of Debian's patches.
653 (add-before 'configure 'add-more-aarch64-support
654 (lambda _
655 (substitute* '("mfhdf/ncgen/ncgen.l"
656 "mfhdf/ncgen/ncgenyy.c"
657 "mfhdf/libsrc/netcdf.h.in")
658 (("AIX5L64") "__aarch64__"))
659 #t))
becbbefc
TD
660 (add-before 'configure 'patchbuild
661 (lambda _
662 (substitute*
663 '("mfhdf/hdfimport/testutil.sh.in" "hdf/util/testutil.sh.in")
664 (("/bin/rm") "rm")
665 (("/bin/mkdir") "mkdir"))
666 (substitute* (find-files "." "^Makefile\\.in$")
667 (("@HDF_BUILD_XDR_TRUE@XDR_ADD = \
668-R\\$\\(abs_top_builddir\\)/mfhdf/xdr/\\.libs") "")
669 (("@HDF_BUILD_SHARED_TRUE@AM_LDFLAGS = \
670-R\\$\\(abs_top_builddir\\)/mfhdf/libsrc/\\.libs \
953a12fa 671-R\\$\\(abs_top_builddir\\)/hdf/src/\\.libs \\$\\(XDR_ADD\\)") ""))
e464b455
TD
672 #t))
673 (add-after 'configure 'patch-settings
674 (lambda _
675 ;; libhdf4.settings contains the full path of the
676 ;; compilers used, and its contents are included in
677 ;; .so-files. We truncate the hashes to avoid
678 ;; unnecessary store references to those compilers:
679 (substitute* "libhdf4.settings"
680 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
681 (string-append prefix (string-take hash 10) "...")))
682 #t))
683 )))
becbbefc
TD
684 (home-page "https://www.hdfgroup.org/products/hdf4/")
685 (synopsis
686 "Library and multi-object file format for storing and managing data")
687 (description "HDF4 is a library and multi-object file format for storing
688and managing data between machines. HDF4 is an older hierarchical data format,
689incompatible with HDF5.")
690 (license
691 (license:non-copyleft
692 "https://www.hdfgroup.org/ftp/HDF/HDF_Current/src/unpacked/COPYING"))))
693
694(define-public hdf4-alt
695 (package
696 (inherit hdf4)
697 (name "hdf4-alt")
698 (arguments
699 (substitute-keyword-arguments (package-arguments hdf4)
700 ((#:configure-flags flags) `(cons* "--disable-netcdf" ,flags))))
701 (synopsis
702 "HDF4 without netCDF API, can be combined with the regular netCDF library")))
703
7ee3f1a2
JD
704(define-public hdf5
705 (package
706 (name "hdf5")
2da63064 707 (version "1.8.19")
7ee3f1a2
JD
708 (source
709 (origin
710 (method url-fetch)
2da63064
TD
711 (uri (list (string-append "https://support.hdfgroup.org/ftp/HDF5/releases/"
712 "hdf5-" (version-major+minor version)
713 "/hdf5-" version "/src/hdf5-"
dcd9d163
LF
714 version ".tar.bz2")
715 (string-append "https://support.hdfgroup.org/ftp/HDF5/"
716 "current"
717 (apply string-append
718 (take (string-split version #\.) 2))
719 "/src/hdf5-" version ".tar.bz2")))
7ee3f1a2 720 (sha256
2da63064 721 (base32 "0f3jfbqpaaq21ighi40qzs52nb52kc2d2yjk541rjmsx20b3ih2r"))
b8d9c93b 722 (patches (list (search-patch "hdf5-config-date.patch")))))
7ee3f1a2 723 (build-system gnu-build-system)
12ed1216
AE
724 (inputs
725 `(("zlib" ,zlib)))
e3a1a1de
TD
726 (native-inputs
727 `(("gfortran" ,gfortran)))
728 (outputs '("out" ; core library
729 "fortran")) ; fortran interface
7ee3f1a2 730 (arguments
62126576 731 `(;; Some of the users, notably Flann, need the C++ interface.
e3a1a1de
TD
732 #:configure-flags '("--enable-cxx"
733 "--enable-fortran"
734 "--enable-fortran2003")
4dba441c
RW
735 ;; Use -fPIC to allow the R bindings to link with the static libraries
736 #:make-flags (list "CFLAGS=-fPIC"
737 "CXXFLAGS=-fPIC")
62126576 738 #:phases
f622e212
EB
739 (modify-phases %standard-phases
740 (add-before 'configure 'patch-configure
e3a1a1de 741 (lambda* (#:key outputs #:allow-other-keys)
f622e212 742 (substitute* "configure"
b8d9c93b 743 (("/bin/mv") "mv"))
e3a1a1de
TD
744 (substitute* "fortran/src/Makefile.in"
745 (("libhdf5_fortran_la_LDFLAGS =")
746 (string-append "libhdf5_fortran_la_LDFLAGS = -Wl-rpath="
747 (assoc-ref outputs "fortran") "/lib")))
748 (substitute* "hl/fortran/src/Makefile.in"
749 (("libhdf5hl_fortran_la_LDFLAGS =")
750 (string-append "libhdf5hl_fortran_la_LDFLAGS = -Wl,-rpath="
751 (assoc-ref outputs "fortran") "/lib")))
b8d9c93b 752 #t))
fd0378a1
TD
753 (add-after 'configure 'patch-settings
754 (lambda _
755 ;; libhdf5.settings contains the full path of the
756 ;; compilers used, and its contents are included in
757 ;; libhdf5.so. We truncate the hashes to avoid
758 ;; unnecessary store references to those compilers:
759 (substitute* "src/libhdf5.settings"
760 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
d8f46d52
RW
761 (string-append prefix (string-take hash 10) "..."))
762 ;; Don't record the build-time kernel version to make the
763 ;; settings file reproducible.
764 (("Uname information:.*")
765 "Uname information: Linux\n"))
b8d9c93b 766 #t))
f622e212
EB
767 (add-after 'install 'patch-references
768 (lambda* (#:key inputs outputs #:allow-other-keys)
769 (let ((bin (string-append (assoc-ref outputs "out") "/bin"))
770 (zlib (assoc-ref inputs "zlib")))
771 (substitute* (find-files bin "h5p?cc")
772 (("-lz" lib)
773 (string-append "-L" zlib "/lib " lib)))
e3a1a1de
TD
774 #t)))
775 (add-after 'install 'split
776 (lambda* (#:key inputs outputs #:allow-other-keys)
777 ;; Move all fortran-related files
778 (let* ((out (assoc-ref outputs "out"))
779 (bin (string-append out "/bin"))
780 (lib (string-append out "/lib"))
781 (inc (string-append out "/include"))
782 (ex (string-append out "/share/hdf5_examples/fortran"))
783 (fort (assoc-ref outputs "fortran"))
784 (fbin (string-append fort "/bin"))
785 (flib (string-append fort "/lib"))
786 (finc (string-append fort "/include"))
787 (fex (string-append fort "/share/hdf5_examples/fortran")))
788 (mkdir-p fbin)
789 (mkdir-p flib)
790 (mkdir-p finc)
791 (mkdir-p fex)
792 (rename-file (string-append bin "/h5fc")
793 (string-append fbin "/h5fc"))
794 (for-each (lambda (file)
795 (rename-file file
796 (string-append flib "/" (basename file))))
797 (find-files lib ".*fortran.*"))
798 (for-each (lambda (file)
799 (rename-file file
800 (string-append finc "/" (basename file))))
801 (find-files inc ".*mod"))
802 (for-each (lambda (file)
803 (rename-file file
804 (string-append fex "/" (basename file))))
805 (find-files ex ".*"))
806 (delete-file-recursively ex))
807 #t)))))
7ee3f1a2 808 (home-page "http://www.hdfgroup.org")
516e93f8 809 (synopsis "Management suite for extremely large and complex data")
7ee3f1a2
JD
810 (description "HDF5 is a suite that makes possible the management of
811extremely large and complex data collections.")
d4bf49b1
EB
812 (license (license:x11-style
813 "http://www.hdfgroup.org/ftp/HDF5/current/src/unpacked/COPYING"))))
7ee3f1a2 814
2fd26d05
TD
815(define-public hdf-java
816 (package
817 (name "hdf-java")
818 (version "3.3.2")
819 (source
820 (origin
821 (method url-fetch)
822 (uri (string-append
823 "http://www.hdfgroup.org/ftp/HDF5/releases/HDF-JAVA/hdfjni-"
824 version "/src/CMake-hdfjava-" version ".tar.gz"))
825 (sha256
826 (base32 "0m1gp2aspcblqzmpqbdpfp6giskws85ds6p5gz8sx7asyp7wznpr"))
827 (modules '((guix build utils)))
828 (snippet ; Make sure we don't use the bundled sources and binaries.
829 `(begin
830 (for-each delete-file
831 (list "SZip.tar.gz" "ZLib.tar.gz" "JPEG8d.tar.gz"
832 "HDF4.tar.gz" "HDF5.tar.gz"))
833 (delete-file-recursively ,(string-append "hdfjava-" version "/lib"))))))
834 (build-system gnu-build-system)
835 (native-inputs
836 `(("jdk" ,icedtea "jdk")
837 ("automake" ,automake) ; For up to date 'config.guess' and 'config.sub'.
838 ;; For tests:
839 ("hamcrest-core" ,java-hamcrest-core)
840 ("junit" ,java-junit)
841 ("slf4j-simple" ,java-slf4j-simple)))
842 (inputs
843 `(("hdf4" ,hdf4)
844 ("hdf5" ,hdf5)
845 ("zlib" ,zlib)
846 ("libjpeg" ,libjpeg)
847 ("slf4j-api" ,java-slf4j-api)))
848 (arguments
849 `(#:configure-flags
850 (list (string-append "--target=" ,(or (%current-target-system) (%current-system)))
851 (string-append "--with-jdk=" (assoc-ref %build-inputs "jdk") "/include,"
852 (assoc-ref %build-inputs "jdk") "/lib" )
853 (string-append "--with-hdf4=" (assoc-ref %build-inputs "hdf4") "/lib")
854 (string-append "--with-hdf5=" (assoc-ref %build-inputs "hdf5") "/lib"))
855
856 #:make-flags
857 (list (string-append "HDFLIB=" (assoc-ref %build-inputs "hdf4") "/lib")
858 (string-append "HDF5LIB=" (assoc-ref %build-inputs "hdf5") "/lib")
859 (string-append "ZLIB=" (assoc-ref %build-inputs "zlib") "/lib/libz.so")
860 (string-append "JPEGLIB="
861 (assoc-ref %build-inputs "libjpeg") "/lib/libjpeg.so")
862 "LLEXT=so")
863
864 #:phases
865 (modify-phases %standard-phases
866 (add-before 'configure 'chdir-to-source
867 (lambda _ (chdir ,(string-append "hdfjava-" version))))
868 (add-before 'configure 'patch-build
869 (lambda* (#:key inputs outputs #:allow-other-keys)
870 (substitute* "configure"
871 (("COPT=\"") "COPT=\"-O2 ") ; CFLAGS is ignored in Makefiles
872 (("/bin/cat") (which "cat")))
873 ;; Set classpath for compilation
874 (substitute* '("hdf/hdf5lib/Makefile.in"
875 "hdf/hdf5lib/exceptions/Makefile.in"
876 "hdf/hdflib/Makefile.in")
877 (("\\$\\(TOP\\)/lib/slf4j-api-1\\.7\\.5\\.jar")
878 (string-append (assoc-ref inputs "slf4j-api")
879 "/share/java/slf4j-api.jar")))
880 ;; Replace outdated config.sub and config.guess:
881 (with-directory-excursion "config"
882 (for-each (lambda (file)
883 (copy-file
884 (string-append (assoc-ref inputs "automake")
885 "/share/automake-1.15/" file) file))
886 '("config.sub" "config.guess")))
887 (mkdir-p (string-append (assoc-ref outputs "out")))
888 ;; Set classpath for tests
889 (let* ((build-dir (getcwd))
890 (lib (string-append build-dir "/lib"))
891 (jhdf (string-append lib "/jhdf.jar"))
892 (jhdf5 (string-append lib "/jhdf5.jar"))
893 (testjars
894 (map (lambda (i)
895 (string-append (assoc-ref inputs i)
896 "/share/java/" i ".jar"))
897 '("junit" "hamcrest-core" "slf4j-api" "slf4j-simple")))
898 (class-path
899 (string-join `("." ,build-dir ,jhdf ,jhdf5 ,@testjars) ":")))
900
901 (substitute* '("test/hdf5lib/Makefile.in"
902 "test/hdf5lib/junit.sh.in"
903 "examples/runExample.sh.in")
904 (("/usr/bin/test")
905 (string-append (assoc-ref inputs "coreutils")
906 "/bin/test"))
907 (("/usr/bin/uname")
908 (string-append (assoc-ref inputs "coreutils")
909 "/bin/uname"))
910 (("CLASSPATH=[^\n]*")
911 (string-append "CLASSPATH=" class-path)))
912 (setenv "CLASSPATH" class-path))
913 #t))
914 (add-before 'check 'build-examples
915 (lambda _
916 (zero? (apply system* `("javac"
917 ,@(find-files "examples" ".*\\.java")))))))
918
919 #:parallel-build? #f
920
921 #:parallel-tests? #f ))
922 (home-page "https://support.hdfgroup.org/products/java")
923 (synopsis "Java interface for the HDF4 and HDF5 libraries")
924 (description "Java HDF Interface (JHI) and Java HDF5 Interface (JHI5) use
925the Java Native Interface to wrap the HDF4 and HDF5 libraries, which are
926implemented in C.")
927
928 ;; BSD-style license:
929 (license (license:x11-style
930 "https://support.hdfgroup.org/ftp/HDF5/hdf-java\
931/current/src/unpacked/COPYING"))))
932
d3c4f3bb
TD
933(define-public hdf-eos2
934 (package
935 (name "hdf-eos2")
936 (version "19.1.0")
937 (source
938 (origin
939 (method url-fetch)
940 (uri "ftp://edhs1.gsfc.nasa.gov\
941/edhs/hdfeos/latest_release/HDF-EOS2.19v1.00.tar.Z")
942 (sha256
943 (base32 "0c9fcz25s292ldap12wxmlrvnyz99z24p63d8fwx51bf8s0s1zrz"))
944 (patches (search-patches "hdf-eos2-remove-gctp.patch"
945 "hdf-eos2-build-shared.patch"
946 "hdf-eos2-fortrantests.patch"))))
947 (build-system gnu-build-system)
948 (native-inputs
949 `(("gfortran" ,gfortran)))
950 (inputs
951 `(("hdf4" ,hdf4-alt) ; assume most HDF-EOS2 users won't use the HDF4 netCDF API
952 ("zlib" ,zlib)
953 ("libjpeg" ,libjpeg)
954 ("gctp" ,gctp)))
955 (arguments
956 `( #:configure-flags '("--enable-install-include" "--enable-shared"
957 "CC=h4cc -Df2cFortran" "LIBS=-lgctp")
958 #:parallel-tests? #f))
959 (home-page "http://hdfeos.org/software/library.php#HDF-EOS2")
960 (synopsis "HDF4-based data format for NASA's Earth Observing System")
961 (description "HDF-EOS2 is a software library built on HDF4 which supports
962the construction of data structures used in NASA's Earth Observing
963System (Grid, Point and Swath).")
964
965 ;; Source files carry a permissive license header.
966 (license (license:non-copyleft home-page))))
967
0f43f835
TD
968(define-public hdf-eos5
969 (package
970 (name "hdf-eos5")
971 (version "1.15")
972 (source (origin
973 (method url-fetch)
974 (uri (string-append "ftp://edhs1.gsfc.nasa.gov\
975/edhs/hdfeos5/latest_release/HDF-EOS5." version ".tar.Z"))
976 (sha256
977 (base32
978 "1p83333nzzy8rn5chxlm0hrkjjnhh2w1ji8ac0f9q4xzg838i58i"))
979 (patches (search-patches "hdf-eos5-build-shared.patch"
980 "hdf-eos5-remove-gctp.patch"
981 "hdf-eos5-fix-szip.patch"
982 "hdf-eos5-fortrantests.patch"))))
983 (native-inputs
984 `(("gfortran" ,gfortran)))
985 (build-system gnu-build-system)
986 (inputs
987 `(("hdf5" ,hdf5)
988 ("zlib" ,zlib)
989 ("gctp" ,gctp)))
990 (arguments
991 `(#:configure-flags '("--enable-install-include" "--enable-shared"
992 "CC=h5cc -Df2cFortran" "LIBS=-lgctp")
993 #:parallel-tests? #f))
994 (synopsis "HDF5-based data format for NASA's Earth Observing System")
995 (description
996 "HDF-EOS5 is a software library built on HDF5 to support the construction
997of data structures used in NASA's Earth Observing System (Grid, Point and
998Swath).")
999 (home-page "http://www.hdfeos.org/software/library.php#HDF-EOS5")
1000
1001 ;; Source files carry a permissive license header.
1002 (license (license:non-copyleft home-page))))
1003
c8378eea
EB
1004(define-public hdf5-parallel-openmpi
1005 (package (inherit hdf5)
1006 (name "hdf5-parallel-openmpi")
1007 (inputs
1008 `(("mpi" ,openmpi)
1009 ,@(package-inputs hdf5)))
1010 (arguments
1011 (substitute-keyword-arguments `(#:configure-flags '("--enable-parallel")
1012 ,@(package-arguments hdf5))
1013 ((#:phases phases)
1014 `(modify-phases ,phases
1015 (add-before 'check 'patch-tests
1016 (lambda _
1017 ;; OpenMPI's mpirun will exit with non-zero status if it
1018 ;; detects an "abnormal termination", i.e. any process not
1019 ;; calling MPI_Finalize(). Since the test is explicitely
1020 ;; avoiding MPI_Finalize so as not to have at_exit and thus
1021 ;; H5C_flush_cache from being called, mpirun will always
1022 ;; complain, so turn this test off.
1023 (substitute* "testpar/Makefile"
1024 (("(^TEST_PROG_PARA.*)t_pflush1(.*)" front back)
1025 (string-append front back "\n")))
1026 (substitute* "tools/h5diff/testph5diff.sh"
1027 (("/bin/sh") (which "sh")))
1028 #t))))))
1029 (synopsis "Management suite for data with parallel IO support")))
1030
00775104
EB
1031(define-public h5check
1032 (package
1033 (name "h5check")
1034 (version "2.0.1")
1035 (source
1036 (origin
1037 (method url-fetch)
1038 (uri (string-append "http://www.hdfgroup.org/ftp/HDF5/tools/"
1039 "h5check/src/h5check-" version ".tar.gz"))
1040 (sha256
1041 (base32
1042 "1gm76jbwhz9adbxgn14zx8cj33dmjdr2g5xcy0m9c2gakp8w59kj"))))
1043 (build-system gnu-build-system)
1044 (inputs `(("hdf5" ,hdf5))) ;h5cc for tests
1045 (home-page "https://www.hdfgroup.org/products/hdf5_tools/h5check.html")
1046 (synopsis "HDF5 format checker")
1047 (description "@code{h5check} is a validation tool for verifying that an
1048HDF5 file is encoded according to the HDF File Format Specification.")
1049 (license (license:x11-style "file://COPYING"))))
1050
a53d6719
JD
1051(define-public itpp
1052 (package
1053 (name "itpp")
1054 (version "4.3.1")
1055 (source (origin
1056 (method url-fetch)
1057 (uri (string-append "mirror://sourceforge/itpp/itpp/"
1058 version "/itpp-"
1059 version ".tar.gz"))
1060 (sha256
1061 (base32
1062 "14ddy2xnb6sgp4hiax9v5sv4pr4l4dd4ps76nfha3nrpr1ikhcqm"))))
1063 (build-system cmake-build-system)
1064 (arguments `(#:tests? #f)) ; Tests require googletest *sources*
1065 (inputs `(("lapack" ,lapack)
1066 ("fftw" ,fftw)))
3a4d5df2
RW
1067 ;; FIXME: Even though the fonts are available dvips complains:
1068 ;; "Font cmmi10 not found; characters will be left blank."
1069 (native-inputs
1070 `(("texlive" ,texlive-tiny)
1071 ("ghostscript" ,ghostscript)
1072 ("doxygen" ,doxygen)))
a53d6719
JD
1073 (home-page "http://itpp.sourceforge.net")
1074 (synopsis "C++ library of maths, signal processing and communication classes")
1075 (description "IT++ is a C++ library of mathematical, signal processing and
1076communication classes and functions. Its main use is in simulation of
1077communication systems and for performing research in the area of
1078communications. The kernel of the library consists of generic vector and
1079matrix classes, and a set of accompanying routines. Such a kernel makes IT++
1080similar to MATLAB, GNU Octave or SciPy.")
1081 (license license:gpl3+)))
1082
889187a4
EB
1083(define-public netcdf
1084 (package
1085 (name "netcdf")
a4b0bfb1 1086 (version "4.4.1.1")
889187a4
EB
1087 (source
1088 (origin
1089 (method url-fetch)
1090 (uri (string-append "ftp://ftp.unidata.ucar.edu/pub/netcdf/"
1091 "netcdf-" version ".tar.gz"))
1092 (sha256
1093 (base32
a4b0bfb1
EB
1094 "1blc7ik5yin7i0ls2kag0a9xjk12m0dzx6v1x88az3ras3scci2d"))
1095 (patches (search-patches "netcdf-date-time.patch"
1096 "netcdf-tst_h_par.patch"))))
889187a4
EB
1097 (build-system gnu-build-system)
1098 (native-inputs
1099 `(("m4" ,m4)
1100 ("doxygen" ,doxygen)
1101 ("graphviz" ,graphviz)))
1102 (inputs
db825570
TD
1103 `(("hdf4" ,hdf4-alt)
1104 ("hdf5" ,hdf5)
1105 ("zlib" ,zlib)
1106 ("libjpeg" ,libjpeg)))
889187a4 1107 (arguments
db825570 1108 `(#:configure-flags '("--enable-doxygen" "--enable-dot" "--enable-hdf4")
43d01672
TD
1109
1110 #:phases (modify-phases %standard-phases
1111 (add-before 'configure 'fix-source-date
1112 (lambda _
1113 ;; As we ${SOURCE_DATE_EPOCH} evaluates to "1" in the build
1114 ;; environment, `date -u -d ${SOURCE_DATE_EPOCH}` will evaluate
1115 ;; to '1st hour of the current day', and therefore makes the
1116 ;; package not reproducible.
1117 (substitute* "./configure"
1118 (("date -u -d \"\\$\\{SOURCE_DATE_EPOCH\\}\"")
1119 "date --date='@0'"))
1120 #t))
1121 (add-after 'configure 'patch-settings
1122 (lambda _
1123 ;; libnetcdf.settings contains the full filename of the compilers
1124 ;; used to build the library. We truncate the hashes of those
1125 ;; filenames to avoid unnecessary references to the corresponding
1126 ;; store items.
1127 (substitute* "libnetcdf.settings"
1128 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
1129 (string-append prefix (string-take hash 10) "...")))
1130 #t)))
1131
889187a4
EB
1132 #:parallel-tests? #f)) ;various race conditions
1133 (home-page "http://www.unidata.ucar.edu/software/netcdf/")
1134 (synopsis "Library for scientific data")
1135 (description "NetCDF is an interface for scientific data access and a
1136software library that provides an implementation of the interface. The netCDF
1137library defines a machine-independent format for representing scientific data.
1138Together, the interface, library, and format support the creation, access, and
1139sharing of scientific data.")
1140 (license (license:x11-style "file://COPYRIGHT"))))
1141
1142(define-public netcdf-parallel-openmpi
1143 (package (inherit netcdf)
1144 (name "netcdf-parallel-openmpi")
1145 (inputs
1146 `(("mpi" ,openmpi)
1147 ,@(alist-replace "hdf5" (list hdf5-parallel-openmpi)
1148 (package-inputs netcdf))))
1149 ;; TODO: Replace pkg-config references in nc-config with absolute references
1150 (arguments
1151 (substitute-keyword-arguments (package-arguments netcdf)
1152 ((#:configure-flags flags)
1153 `(cons* "CC=mpicc" "CXX=mpicxx"
1154 "--enable-parallel-tests"
1155 ;; Shared libraries not supported with parallel IO.
1156 "--disable-shared" "--with-pic"
1157 ,flags))))))
1158
300200b6
TD
1159(define-public netcdf-fortran
1160 (package
1161 (name "netcdf-fortran")
1162 (version "4.4.4")
1163 (source (origin
1164 (method url-fetch)
1165 (uri (string-append
1166 "ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-fortran-"
1167 version ".tar.gz"))
1168 (sha256
1169 (base32
1170 "0xaxdcg1p83zmypwml3swsnr3ccn38inwldyr1l3wa4dbwbrblxj"))))
1171 (build-system gnu-build-system)
1172 (arguments
1173 `(#:parallel-tests? #f))
1174 (inputs
1175 `(("netcdf" ,netcdf)))
1176 (native-inputs
1177 `(("gfortran" ,gfortran)))
1178 (synopsis "Fortran interface for the netCDF library")
1179 (description (package-description netcdf))
1180 (home-page (package-home-page netcdf))
1181 (license (package-license netcdf))))
1182
1b39a196
RJ
1183(define-public nlopt
1184 (package
1185 (name "nlopt")
1186 (version "2.4.2")
1187 (source (origin
1188 (method url-fetch)
1189 (uri (string-append "http://ab-initio.mit.edu/nlopt/nlopt-"
1190 version ".tar.gz"))
1191 (sha256
1192 (base32 "12cfkkhcdf4zmb6h7y6qvvdvqjs2xf9sjpa3rl3bq76px4yn76c0"))))
1193 (build-system gnu-build-system)
1194 (arguments
1195 `(;; Shared libraries are not built by default. They are required to
1196 ;; build the Guile, Octave, and Python bindings.
1197 #:configure-flags '("--enable-shared")
1198
1199 #:phases
1200 (modify-phases %standard-phases
1201 (add-before 'configure 'set-libnlopt-file-name
1202 (lambda* (#:key outputs #:allow-other-keys)
1203 ;; Make sure the Scheme module refers to the library by its
1204 ;; absolute file name (we cannot do that from a snippet
1205 ;; because the expansion of @libdir@ contains
1206 ;; ${exec_prefix}.)
1207 (let ((out (assoc-ref outputs "out")))
1208 (substitute* "swig/nlopt.scm.in"
1209 (("libnlopt")
1210 (string-append out "/lib/libnlopt")))
1211 #t))))))
1212 (inputs `(("guile" ,guile-2.0)))
1213 (native-inputs `(("pkg-config" ,pkg-config)))
1214 (home-page "http://ab-initio.mit.edu/wiki/")
1215 (synopsis "Library for nonlinear optimization")
1216 (description "NLopt is a library for nonlinear optimization, providing a
1217common interface for a number of different free optimization routines available
1218online as well as original implementations of various other algorithms.")
1219 (license license:lgpl2.1+)))
1220
005c787d
LC
1221(define-public ipopt
1222 (package
1223 (name "ipopt")
1224 (version "3.12.5")
1225 (source (origin
1226 (method url-fetch)
1227 (uri (string-append
1228 "http://www.coin-or.org/download/source/Ipopt/Ipopt-"
1229 version".tgz"))
1230 (sha256
1231 (base32
1232 "09bk2hqy2vgi4yi76xng9zxakddwqy3wij9nx7wf2vfbxxpazrsk"))
1233 (modules '((guix build utils)))
1234 (snippet
1235 ;; Make sure we don't use the bundled software.
1236 '(delete-file-recursively "ThirdParty"))))
1237 (build-system gnu-build-system)
ad1c4537
LC
1238 (arguments
1239 '(#:phases (modify-phases %standard-phases
1240 (add-after 'install 'add--L-flags-in-ipopt.pc
1241 (lambda* (#:key inputs outputs #:allow-other-keys)
1242 ;; The '.pc' file lists '-llapack -lblas' in "Libs";
1243 ;; move it to "Libs.private" where it belongs, and add a
1244 ;; '-L' flag for LAPACK.
1245 (let ((out (assoc-ref outputs "out"))
1246 (lapack (assoc-ref inputs "lapack")))
1247 (substitute* (string-append out "/lib/pkgconfig/"
1248 "ipopt.pc")
1249 (("Libs: (.*)-llapack -lblas(.*)$" _ before after)
1250 (string-append "Libs: " before " " after "\n"
1251 "Libs.private: " before
1252 "-L" lapack "/lib -llapack -lblas "
1253 after "\n")))
1254 #t))))))
005c787d
LC
1255 (native-inputs
1256 `(("gfortran" ,gfortran)))
1257 (inputs
1258 ;; TODO: Maybe add dependency on COIN-MUMPS, ASL, and HSL.
ad1c4537 1259 `(("lapack" ,lapack))) ;for both libblas and liblapack
005c787d
LC
1260 (home-page "http://www.coin-or.org")
1261 (synopsis "Large-scale nonlinear optimizer")
1262 (description
1263 "The Interior Point Optimizer (IPOPT) is a software package for
1264large-scale nonlinear optimization. It provides C++, C, and Fortran
1265interfaces.")
1266 (license license:epl1.0)))
1267
f9940ef1
LC
1268(define-public ceres
1269 (package
1270 (name "ceres-solver")
e0bee0de 1271 (version "1.14.0")
f9940ef1
LC
1272 (home-page "http://ceres-solver.org/")
1273 (source (origin
1274 (method url-fetch)
1275 (uri (string-append home-page "ceres-solver-"
1276 version ".tar.gz"))
1277 (sha256
1278 (base32
e0bee0de 1279 "13lfxy8x58w8vprr0nkbzziaijlh0vvqshgahvcgw0mrqdgh0i27"))))
f9940ef1
LC
1280 (build-system cmake-build-system)
1281 (arguments
1282 ;; TODO: Build HTML user documentation and install separately.
bc3a2e35 1283 '(#:configure-flags '("-DBUILD_EXAMPLES=OFF"
f9940ef1
LC
1284 "-DBUILD_SHARED_LIBS=ON")
1285
1286 #:phases (modify-phases %standard-phases
1287 (add-before 'configure 'set-library-directory
1288 (lambda _
1289 ;; Install libraries to lib/, not lib64/.
1290 (substitute* "internal/ceres/CMakeLists.txt"
1291 (("set\\(LIB_SUFFIX \"64\"\\)")
1292 "set(LIB_SUFFIX \"\")"))
1293 #t)))))
1294 (native-inputs
1295 `(("pkg-config" ,pkg-config)))
468e0b18
LC
1296 (propagated-inputs
1297 `(("glog" ,glog))) ;for #include <glog/glog.h>
f9940ef1
LC
1298 (inputs
1299 `(("eigen" ,eigen)
1300 ("blas" ,openblas)
1301 ("lapack" ,lapack)
1302 ("suitesparse" ,suitesparse)
1303 ("gflags" ,gflags)))
1304 (synopsis "C++ library for solving large optimization problems")
1305 (description
1306 "Ceres Solver is a C++ library for modeling and solving large,
1307complicated optimization problems. It is a feature rich, mature and
1308performant library which has been used in production since 2010. Ceres Solver
1309can solve two kinds of problems:
1310@enumerate
1311@item non-linear least squares problems with bounds constraints;
1312@item general unconstrained optimization problems.
1313@end enumerate\n")
1314 (license license:bsd-3)))
1315
668c06ac 1316;; For a fully featured Octave, users are strongly recommended also to install
5ca4fe96 1317;; the following packages: less, ghostscript, gnuplot.
668c06ac
JD
1318(define-public octave
1319 (package
1320 (name "octave")
47653b39 1321 (version "4.2.2")
668c06ac
JD
1322 (source
1323 (origin
1324 (method url-fetch)
1325 (uri (string-append "mirror://gnu/octave/octave-"
f5a077b1 1326 version ".tar.lz"))
668c06ac
JD
1327 (sha256
1328 (base32
47653b39 1329 "0pkkz1vazsh7ipffb09q0nc2jgx6q27pkkngygjij6jrpcly5zsp"))))
668c06ac
JD
1330 (build-system gnu-build-system)
1331 (inputs
1332 `(("lapack" ,lapack)
1333 ("readline" ,readline)
181170c6 1334 ("gl2ps" ,gl2ps)
668c06ac 1335 ("glpk" ,glpk)
1ec78e9d
EB
1336 ("fftw" ,fftw)
1337 ("fftwf" ,fftwf)
1338 ("arpack" ,arpack-ng)
668c06ac
JD
1339 ("pcre" ,pcre)
1340 ("fltk" ,fltk)
1341 ("fontconfig" ,fontconfig)
1342 ("freetype" ,freetype)
40029cbe 1343 ("hdf5" ,hdf5)
668c06ac
JD
1344 ("libxft" ,libxft)
1345 ("mesa" ,mesa)
1ec78e9d 1346 ("glu" ,glu)
9f913401
AI
1347 ("zlib" ,zlib)
1348 ("curl" ,curl)
5ca4fe96 1349 ("texinfo" ,texinfo)
ab5f3f21
KK
1350 ("graphicsmagick" ,graphicsmagick)
1351 ("suitesparse" ,suitesparse)
1352 ("libsndfile" ,libsndfile)
1353 ("portaudio" ,portaudio)
1354 ("alsa-lib" ,alsa-lib)))
668c06ac 1355 (native-inputs
f5a077b1
EF
1356 `(("lzip" ,lzip)
1357 ("gfortran" ,gfortran)
668c06ac
JD
1358 ("pkg-config" ,pkg-config)
1359 ("perl" ,perl)
1ec78e9d
EB
1360 ;; The following inputs are not actually used in the build process.
1361 ;; However, the ./configure gratuitously tests for their existence and
1362 ;; assumes that programs not present at build time are also not, and
1363 ;; can never be, available at run time! If these inputs are therefore
1364 ;; not present, support for them will be built out. However, Octave
1365 ;; will still run without them, albeit without the features they
668c06ac
JD
1366 ;; provide.
1367 ("less" ,less)
668c06ac
JD
1368 ("ghostscript" ,ghostscript)
1369 ("gnuplot" ,gnuplot)))
1370 (arguments
b7b27a8f
KY
1371 `(#:configure-flags
1372 (list (string-append "--with-shell="
1373 (assoc-ref %build-inputs "bash")
5ca4fe96
AI
1374 "/bin/sh"))
1375 #:phases
1376 (modify-phases %standard-phases
1377 (add-after 'configure 'configure-makeinfo
1378 (lambda* (#:key inputs #:allow-other-keys)
1379 (substitute* "libinterp/corefcn/help.cc"
1380 (("Vmakeinfo_program = \"makeinfo\"")
1381 (string-append "Vmakeinfo_program = \""
1382 (assoc-ref inputs "texinfo")
1383 "/bin/makeinfo\"")))
1384 #t)))))
f5a077b1 1385 (home-page "https://www.gnu.org/software/octave/")
668c06ac 1386 (synopsis "High-level language for numerical computation")
1ec78e9d
EB
1387 (description "GNU Octave is a high-level interpreted language that is
1388specialized for numerical computations. It can be used for both linear and
1389non-linear applications and it provides great support for visualizing results.
1390Work may be performed both at the interactive command-line as well as via
1391script files.")
668c06ac 1392 (license license:gpl3+)))
3de01d3f 1393
36ce25f0
KK
1394(define-public qtoctave
1395 (package (inherit octave)
1396 (name "qtoctave")
1397 (inputs
1398 `(("qscintilla" ,qscintilla)
1399 ("qt" ,qtbase)
1400 ,@(package-inputs octave)))
1401 (native-inputs
1402 `(("qttools" , qttools) ;for lrelease
1403 ,@(package-native-inputs octave)))
1404 (arguments
1405 (substitute-keyword-arguments (package-arguments octave)
1406 ((#:phases phases)
1407 `(modify-phases ,phases
1408 (add-before 'configure 'patch-qscintilla-library-name
1409 (lambda* (#:key inputs #:allow-other-keys)
1410 ;; The QScintilla library that the Octave configure script tries
1411 ;; to link with should be named libqscintilla-qt5.so, but the
1412 ;; QScintilla input provides the shared library as
1413 ;; libqscintilla2_qt5.so.
1414 (substitute* "configure"
1415 (("qscintilla2-qt5")
1416 "qscintilla2_qt5"))
1417 #t))))))))
1418
5d4bd4cc
PG
1419(define-public opencascade-oce
1420 (package
1421 (name "opencascade-oce")
1422 (version "0.17.2")
1423 (source
1424 (origin
1425 (method url-fetch)
1426 (uri (string-append
1427 "https://github.com/tpaviot/oce/archive/OCE-"
1428 version
1429 ".tar.gz"))
a4f393b7 1430 (patches (search-patches "opencascade-oce-glibc-2.26.patch"))
5d4bd4cc
PG
1431 (sha256
1432 (base32
1433 "0vpmnb0k5y2f7lpmwx9pg9yfq24zjvnsak5alzacncfm1hv9b6cd"))))
1434 (build-system cmake-build-system)
1435 (arguments
1436 '(#:configure-flags
1437 (list "-DOCE_TESTING:BOOL=ON"
1438 "-DOCE_USE_TCL_TEST_FRAMEWORK:BOOL=ON"
1439 "-DOCE_DRAW:BOOL=ON"
1440 (string-append "-DOCE_INSTALL_PREFIX:PATH="
1441 (assoc-ref %outputs "out"))
1442 "-UCMAKE_INSTALL_RPATH")))
1443 (inputs
1444 `(("freetype" ,freetype)
1445 ("glu" ,glu)
1446 ("libxmu" ,libxmu)
1447 ("mesa" ,mesa)
1448 ("tcl" ,tcl)
1449 ("tk" ,tk)))
1450 (native-inputs
1451 `(("python" ,python-wrapper)))
1452 (home-page "https://github.com/tpaviot/oce")
1453 (synopsis "Libraries for 3D modeling and numerical simulation")
1454 (description
1455 "Open CASCADE is a set of libraries for the development of applications
1456dealing with 3D CAD data or requiring industrial 3D capabilities. It includes
1457C++ class libraries providing services for 3D surface and solid modeling, CAD
1458data exchange, and visualization. It is used for development of specialized
1459software dealing with 3D models in design (CAD), manufacturing (CAM),
1460numerical simulation (CAE), measurement equipment (CMM), and quality
1461control (CAQ) domains.
1462
1463This is the ``Community Edition'' (OCE) of Open CASCADE, which gathers
1464patches, improvements, and experiments contributed by users over the official
1465Open CASCADE library.")
1466 (license (list license:lgpl2.1; OCE libraries, with an exception for the
1467 ; use of header files; see
1468 ; OCCT_LGPL_EXCEPTION.txt
1469 license:public-domain; files
1470 ; src/Standard/Standard_StdAllocator.hxx and
1471 ; src/NCollection/NCollection_StdAllocator.hxx
1472 license:expat; file src/OpenGl/OpenGl_glext.h
1473 license:bsd-3)))); test framework gtest
1474
3de01d3f
EB
1475(define-public gmsh
1476 (package
1477 (name "gmsh")
8a4d14fa 1478 (version "2.16.0")
3de01d3f
EB
1479 (source
1480 (origin
1481 (method url-fetch)
1c79e086 1482 (uri (string-append "http://gmsh.info/src/gmsh-"
3de01d3f
EB
1483 version "-source.tgz"))
1484 (sha256
8a4d14fa 1485 (base32 "1slf0bfkwrcgn6296wb4qhbk4ahz6i4wfb10hnim08x05vrylag8"))
3de01d3f
EB
1486 (modules '((guix build utils)))
1487 (snippet
1488 ;; Remove non-free METIS code
1489 '(delete-file-recursively "contrib/Metis"))))
1490 (build-system cmake-build-system)
3de01d3f
EB
1491 (propagated-inputs
1492 `(("fltk" ,fltk)
19afbea1 1493 ("gfortran" ,gfortran)
3de01d3f 1494 ("gmp" ,gmp)
40029cbe 1495 ("hdf5" ,hdf5)
3de01d3f
EB
1496 ("lapack" ,lapack)
1497 ("mesa" ,mesa)
85f41902 1498 ("glu" ,glu)
45548139 1499 ("opencascade-oce" ,opencascade-oce)
3de01d3f
EB
1500 ("libx11" ,libx11)
1501 ("libxext" ,libxext)))
66395a61
EF
1502 (inputs
1503 `(("fontconfig" ,fontconfig)
1504 ("libxft" ,libxft)))
3de01d3f
EB
1505 (arguments
1506 `(#:configure-flags `("-DENABLE_METIS:BOOL=OFF"
1507 "-DENABLE_BUILD_SHARED:BOOL=ON"
45548139 1508 "-DENABLE_BUILD_DYNAMIC:BOOL=ON")))
3de01d3f
EB
1509 (home-page "http://www.geuz.org/gmsh/")
1510 (synopsis "3D finite element grid generator")
edf684ef
EB
1511 (description "Gmsh is a 3D finite element grid generator with a built-in
1512CAD engine and post-processor. Its design goal is to provide a fast, light
1513and user-friendly meshing tool with parametric input and advanced
1514visualization capabilities. Gmsh is built around four modules: geometry,
1515mesh, solver and post-processing. The specification of any input to these
1516modules is done either interactively using the graphical user interface or in
1517ASCII text files using Gmsh's own scripting language.")
3de01d3f 1518 (license license:gpl2+)))
b9100e2f 1519
6d5f63b6
JD
1520(define-public maxflow
1521 (package
1522 (name "maxflow")
1523 (version "3.04")
1524 (source (origin
1525 (method git-fetch)
1526 (uri (git-reference
1527 (url "https://github.com/gerddie/maxflow.git")
1528 (commit "42401fa54823d16b9da47716f04e5d9ef1605875")))
1529 (file-name (string-append name "-" version "-checkout"))
1530 (sha256
1531 (base32
1532 "0rll38whw55h0vcjrrwdnh9ascvxby0ph7n1l0d12z17cg215kkb"))))
1533 (build-system cmake-build-system)
1534 (home-page "http://pub.ist.ac.at/~vnk/software.html")
1535 (synopsis "Library implementing Maxflow algorithm")
1536 (description "An implementation of the maxflow algorithm described in
1537@cite{An Experimental Comparison of Min-Cut/Max-Flow Algorithms for
1538Energy Minimization in Computer Vision.\n
1539Yuri Boykov and Vladimir Kolmogorov.\n
1540In IEEE Transactions on Pattern Analysis and Machine Intelligence,\n
1541September 2004}")
1542 (license license:gpl3+)))
1543
b9100e2f
EB
1544(define-public petsc
1545 (package
1546 (name "petsc")
6fec298d 1547 (version "3.8.0")
b9100e2f
EB
1548 (source
1549 (origin
1550 (method url-fetch)
1551 ;; The *-lite-* tarball does not contain the *large* documentation
1552 (uri (string-append "http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/"
1553 "petsc-lite-" version ".tar.gz"))
1554 (sha256
6fec298d 1555 (base32 "1lajbk3c29hnh83v6cbmm3a8wv6bdykh0p70kwrr4vrnizalk88s"))))
b9100e2f
EB
1556 (build-system gnu-build-system)
1557 (native-inputs
6fec298d 1558 `(("python" ,python-2)))
b9100e2f 1559 (inputs
19afbea1 1560 `(("gfortran" ,gfortran)
b9100e2f 1561 ("lapack" ,lapack)
f258212d 1562 ("superlu" ,superlu)
b9100e2f
EB
1563 ;; leaving out hdf5 and fftw, as petsc expects them to be built with mpi
1564 ;; leaving out opengl, as configuration seems to only be for mac
1565 ))
1566 (arguments
1567 `(#:test-target "test"
9a899cce 1568 #:parallel-build? #f ;build is parallel by default
b9100e2f
EB
1569 #:configure-flags
1570 `("--with-mpi=0"
f258212d
EB
1571 "--with-openmp=1"
1572 "--with-superlu=1"
1573 ,(string-append "--with-superlu-include="
1574 (assoc-ref %build-inputs "superlu") "/include")
1575 ,(string-append "--with-superlu-lib="
1576 (assoc-ref %build-inputs "superlu") "/lib/libsuperlu.a"))
9731c412
EB
1577 #:make-flags
1578 ;; Honor (parallel-job-count) for build. Do not use --with-make-np,
1579 ;; whose value is dumped to $out/lib/petsc/conf/petscvariables.
1580 (list (format #f "MAKE_NP=~a" (parallel-job-count)))
b9100e2f 1581 #:phases
64dcc289
EB
1582 (modify-phases %standard-phases
1583 (replace 'configure
1584 ;; PETSc's configure script is actually a python script, so we can't
1585 ;; run it with bash.
1586 (lambda* (#:key outputs (configure-flags '())
1587 #:allow-other-keys)
1588 (let* ((prefix (assoc-ref outputs "out"))
1589 (flags `(,(string-append "--prefix=" prefix)
1590 ,@configure-flags)))
1591 (format #t "build directory: ~s~%" (getcwd))
1592 (format #t "configure flags: ~s~%" flags)
1593 (zero? (apply system* "./configure" flags)))))
1594 (add-after 'configure 'clean-local-references
9731c412 1595 (lambda* (#:key outputs #:allow-other-keys)
64dcc289
EB
1596 (let ((out (assoc-ref outputs "out")))
1597 (substitute* (find-files "." "^petsc(conf|machineinfo).h$")
b730b437
EB
1598 ;; Prevent build directory from leaking into compiled code
1599 (((getcwd)) out)
1600 ;; Scrub timestamp for reproducibility
fafd623e 1601 ((".*Libraries compiled on.*") ""))
9731c412
EB
1602 (substitute* (find-files "." "petscvariables")
1603 ;; Do not expose build machine characteristics, set to defaults.
1604 (("MAKE_NP = [:digit:]+") "MAKE_NP = 2")
1605 (("NPMAX = [:digit:]+") "NPMAX = 2"))
fafd623e 1606 #t)))
64dcc289 1607 (add-after 'install 'clean-install
10b11968
EB
1608 ;; Try to keep installed files from leaking build directory names.
1609 (lambda* (#:key inputs outputs #:allow-other-keys)
64dcc289 1610 (let ((out (assoc-ref outputs "out")))
10b11968 1611 (substitute* (map (lambda (file)
9a899cce 1612 (string-append out "/lib/petsc/conf/" file))
fafd623e 1613 '("petscvariables"))
10b11968
EB
1614 (((getcwd)) out))
1615 ;; Make compiler references point to the store
9a899cce 1616 (substitute* (string-append out "/lib/petsc/conf/petscvariables")
dfdf5716
EB
1617 (("= (gcc|g\\+\\+|gfortran)" _ compiler)
1618 (string-append "= " (which compiler))))
10b11968
EB
1619 ;; PETSc installs some build logs, which aren't necessary.
1620 (for-each (lambda (file)
9a899cce 1621 (let ((f (string-append out "/lib/petsc/conf/" file)))
10b11968
EB
1622 (when (file-exists? f)
1623 (delete-file f))))
9a899cce
EB
1624 '("configure.log" "make.log" "gmake.log"
1625 "test.log" "error.log" "RDict.db"
fafd623e 1626 "PETScBuildInternal.cmake"
10b11968 1627 ;; Once installed, should uninstall with Guix
fafd623e
EB
1628 "uninstall.py"))
1629 #t))))))
b9100e2f 1630 (home-page "http://www.mcs.anl.gov/petsc")
16ecf3ff 1631 (synopsis "Library to solve PDEs")
b9100e2f
EB
1632 (description "PETSc, pronounced PET-see (the S is silent), is a suite of
1633data structures and routines for the scalable (parallel) solution of
1634scientific applications modeled by partial differential equations.")
166191b3 1635 (license (license:non-copyleft
b9100e2f
EB
1636 "http://www.mcs.anl.gov/petsc/documentation/copyright.html"))))
1637
1638(define-public petsc-complex
1639 (package (inherit petsc)
1640 (name "petsc-complex")
1641 (arguments
1642 (substitute-keyword-arguments (package-arguments petsc)
1643 ((#:configure-flags cf)
1644 `(cons "--with-scalar-type=complex" ,cf))))
16ecf3ff 1645 (synopsis "Library to solve PDEs (with complex scalars)")))
183e44ae 1646
d8c7eeb9
EB
1647(define-public petsc-openmpi
1648 (package (inherit petsc)
1649 (name "petsc-openmpi")
1650 (inputs
1651 `(("openmpi" ,openmpi)
1652 ,@(package-inputs petsc)))
1653 (arguments
1654 (substitute-keyword-arguments (package-arguments petsc)
1655 ((#:configure-flags cf)
1656 ``("--with-mpiexec=mpirun"
1657 ,(string-append "--with-mpi-dir="
1658 (assoc-ref %build-inputs "openmpi"))
1659 ,@(delete "--with-mpi=0" ,cf)))))
16ecf3ff 1660 (synopsis "Library to solve PDEs (with MPI support)")))
d8c7eeb9
EB
1661
1662(define-public petsc-complex-openmpi
1663 (package (inherit petsc-complex)
1664 (name "petsc-complex-openmpi")
1665 (inputs
1666 `(("openmpi" ,openmpi)
1667 ,@(package-inputs petsc-complex)))
1668 (arguments
1669 (substitute-keyword-arguments (package-arguments petsc-complex)
1670 ((#:configure-flags cf)
1671 ``("--with-mpiexec=mpirun"
1672 ,(string-append "--with-mpi-dir="
1673 (assoc-ref %build-inputs "openmpi"))
1674 ,@(delete "--with-mpi=0" ,cf)))))
16ecf3ff 1675 (synopsis "Library to solve PDEs (with complex scalars and MPI support)")))
d8c7eeb9 1676
a7f01414
EB
1677(define-public slepc
1678 (package
1679 (name "slepc")
cc809f16 1680 (version "3.8.2")
a7f01414
EB
1681 (source
1682 (origin
1683 (method url-fetch)
baeaf882
EB
1684 (uri (string-append "http://slepc.upv.es/download/distrib/slepc-"
1685 version ".tar.gz"))
a7f01414
EB
1686 (sha256
1687 (base32
cc809f16 1688 "04zd48p43rnvg68p6cp28zll0px5whglc5v0sc3s6vdj1v920z8y"))))
a7f01414
EB
1689 (build-system gnu-build-system)
1690 (native-inputs
1691 `(("python" ,python-2)))
1692 (inputs
1693 `(("arpack" ,arpack-ng)
1694 ("gfortran" ,gfortran)))
1695 (propagated-inputs
1696 `(("petsc" ,petsc)))
1697 (arguments
1698 `(#:parallel-build? #f ;build is parallel by default
1699 #:configure-flags
1700 `(,(string-append "--with-arpack-dir="
9cf52454 1701 (assoc-ref %build-inputs "arpack") "/lib"))
9731c412
EB
1702 #:make-flags ;honor (parallel-job-count)
1703 `(,(format #f "MAKE_NP=~a" (parallel-job-count)))
a7f01414
EB
1704 #:phases
1705 (modify-phases %standard-phases
8787c555 1706 (replace 'configure
a7f01414
EB
1707 ;; configure is a python script, so we can't run it with bash.
1708 (lambda* (#:key inputs outputs (configure-flags '())
1709 #:allow-other-keys)
1710 (let* ((prefix (assoc-ref outputs "out"))
1711 (flags `(,(string-append "--prefix=" prefix)
1712 ,@configure-flags)))
1713 (format #t "build directory: ~s~%" (getcwd))
1714 (format #t "configure flags: ~s~%" flags)
1715 (setenv "SLEPC_DIR" (getcwd))
9cf52454 1716 (setenv "PETSC_DIR" (assoc-ref inputs "petsc"))
c6840089 1717 (apply invoke "./configure" flags))))
8787c555 1718 (add-after 'install 'delete-doc
a7f01414
EB
1719 ;; TODO: SLEPc installs HTML documentation alongside headers in
1720 ;; $out/include. We'd like to move them to share/doc, but delete
1721 ;; them for now, as they are incomplete and installing the complete
1722 ;; documentation is difficult.
1723 (lambda* (#:key outputs #:allow-other-keys)
1724 (let* ((out (assoc-ref outputs "out")))
1725 (for-each delete-file (find-files out "\\.html$")))))
8787c555 1726 (add-after 'install 'clean-install
a7f01414
EB
1727 ;; Clean up unnecessary build logs from installation.
1728 (lambda* (#:key outputs #:allow-other-keys)
1729 (let ((out (assoc-ref outputs "out")))
1730 (for-each (lambda (file)
1731 (let ((f (string-append out "/lib/slepc/conf/" file)))
1732 (when (file-exists? f)
1733 (delete-file f))))
1734 '("configure.log" "make.log" "gmake.log"
1735 "test.log" "error.log" "RDict.db"
1736 "uninstall.py"))))))))
1737 (home-page "http://slepc.upv.es")
1738 (synopsis "Scalable library for eigenproblems")
1739 (description "SLEPc is a software library for the solution of large sparse
1740eigenproblems on parallel computers. It can be used for the solution of
1741linear eigenvalue problems formulated in either standard or generalized form,
1742as well as other related problems such as the singular value decomposition.
1743The emphasis of the software is on methods and techniques appropriate for
1744problems in which the associated matrices are sparse, for example, those
1745arising after the discretization of partial differential equations.")
3c524f21 1746 (license license:bsd-2)))
a7f01414
EB
1747
1748(define-public slepc-complex
1749 (package (inherit slepc)
1750 (name "slepc-complex")
1751 (propagated-inputs
1752 `(("petsc" ,petsc-complex)
1753 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
1754 (synopsis "Scalable library for eigenproblems (with complex scalars)")))
1755
1756(define-public slepc-openmpi
1757 (package (inherit slepc)
1758 (name "slepc-openmpi")
1759 (inputs
1760 `(("mpi" ,openmpi)
1761 ("arpack" ,arpack-ng-openmpi)
1762 ,@(alist-delete "arpack" (package-inputs slepc))))
1763 (propagated-inputs
1764 `(("petsc" ,petsc-openmpi)
1765 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
1766 (synopsis "Scalable library for eigenproblems (with MPI support)")))
1767
1768(define-public slepc-complex-openmpi
1769 (package (inherit slepc-openmpi)
1770 (name "slepc-complex-openmpi")
1771 (propagated-inputs
1772 `(("petsc" ,petsc-complex-openmpi)
1773 ,@(alist-delete "petsc" (package-propagated-inputs slepc-openmpi))))
1774 (synopsis "Scalable library for eigenproblems (with complex scalars and MPI support)")))
1775
cec86422
EB
1776(define-public mumps
1777 (package
1778 (name "mumps")
e7323f4c 1779 (version "5.1.2")
cec86422
EB
1780 (source
1781 (origin
1782 (method url-fetch)
1783 (uri (string-append "http://mumps.enseeiht.fr/MUMPS_"
1784 version ".tar.gz"))
1785 (sha256
1786 (base32
e7323f4c 1787 "1s9asin08zqzmh08257sdghhivvy9vjif7c53fhaxaax2kd5qd7b"))
fc1adab1 1788 (patches (search-patches "mumps-build-parallelism.patch"))))
cec86422
EB
1789 (build-system gnu-build-system)
1790 (inputs
1791 `(("fortran" ,gfortran)
1792 ;; These are required for linking against mumps, but we let the user
1793 ;; declare the dependency.
1794 ("blas" ,openblas)
1795 ("metis" ,metis)
1796 ("scotch" ,scotch)))
1797 (arguments
1798 `(#:modules ((ice-9 match)
1799 (ice-9 popen)
1800 (srfi srfi-1)
1801 ,@%gnu-build-system-modules)
1802 #:phases
1803 (modify-phases %standard-phases
fba78d18 1804 (replace 'configure
cec86422
EB
1805 (lambda* (#:key inputs #:allow-other-keys)
1806 (call-with-output-file "Makefile.inc"
1807 (lambda (port)
1808 (format port "
1809PLAT =
1810LIBEXT = .a
1811OUTC = -o
1812OUTF = -o
1813RM = rm -f~:[
1814CC = gcc
1815FC = gfortran
1816FL = gfortran
1817INCSEQ = -I$(topdir)/libseq
1818LIBSEQ = -L$(topdir)/libseq -lmpiseq
1819LIBSEQNEEDED = libseqneeded~;
1820CC = mpicc
1821FC = mpifort
1822FL = mpifort~]
1823AR = ar vr # rules require trailing space, ugh...
1824RANLIB = ranlib
1825LIBBLAS = -L~a -lopenblas~@[
1826SCALAP = -L~a -lscalapack~]
1827LIBOTHERS = -pthread
1828CDEFS = -DAdd_
1829PIC = -fPIC
1830OPTF = -O2 -DALLOW_NON_INIT $(PIC)
1831OPTL = -O2 $(PIC)
1832OPTC = -O2 $(PIC)
1833INCS = $(INCSEQ)
1834LIBS = $(SCALAP) $(LIBSEQ)
1835LPORDDIR = $(topdir)/PORD/lib
1836IPORD = -I$(topdir)/PORD/include
1837LPORD = -L$(LPORDDIR) -lpord
1838ORDERINGSF = -Dpord~@[
1839METISDIR = ~a
1840IMETIS = -I$(METISDIR)/include
1841LMETIS = -L$(METISDIR)/lib -lmetis
1842ORDERINGSF += -Dmetis~]~@[~:{
1843SCOTCHDIR = ~a
1844ISCOTCH = -I$(SCOTCHDIR)/include
1845LSCOTCH = -L$(SCOTCHDIR)/lib ~a-lesmumps -lscotch -lscotcherr
1846ORDERINGSF += ~a~}~]
1847ORDERINGSC = $(ORDERINGSF)
1848LORDERINGS = $(LPORD) $(LMETIS) $(LSCOTCH)
1849IORDERINGSF = $(ISCOTCH)
1850IORDERINGSC = $(IPORD) $(IMETIS) $(ISCOTCH)"
1851 (assoc-ref inputs "mpi")
1852 (assoc-ref inputs "blas")
1853 (assoc-ref inputs "scalapack")
1854 (assoc-ref inputs "metis")
1855 (match (list (assoc-ref inputs "pt-scotch")
1856 (assoc-ref inputs "scotch"))
1857 ((#f #f)
1858 #f)
1859 ((#f scotch)
1860 `((,scotch "" "-Dscotch")))
1861 ((ptscotch _)
1862 `((,ptscotch
1863 "-lptesmumps -lptscotch -lptscotcherr "
1864 "-Dptscotch")))))))))
fba78d18 1865 (replace 'build
cec86422
EB
1866 ;; By default only the d-precision library is built. Make with "all"
1867 ;; target so that all precision libraries and examples are built.
1868 (lambda _
1869 (zero? (system* "make" "all"
1870 (format #f "-j~a" (parallel-job-count))))))
fba78d18 1871 (replace 'check
cec86422
EB
1872 ;; Run the simple test drivers, which read test input from stdin:
1873 ;; from the "real" input for the single- and double-precision
1874 ;; testers, and from the "cmplx" input for complex-precision
1875 ;; testers. The EXEC-PREFIX key is used by the mumps-openmpi
1876 ;; package to prefix execution with "mpirun".
1877 (lambda* (#:key (exec-prefix '()) #:allow-other-keys)
1878 (with-directory-excursion "examples"
1879 (every
1880 (lambda (prec type)
1881 (let ((tester (apply open-pipe*
1882 `(,OPEN_WRITE
1883 ,@exec-prefix
1884 ,(string-append "./" prec
1885 "simpletest"))))
1886 (input (open-input-file
1887 (string-append "input_simpletest_" type))))
1888 (begin
1889 (dump-port input tester)
1890 (close-port input)
1891 (zero? (close-pipe tester)))))
1892 '("s" "d" "c" "z")
1893 '("real" "real" "cmplx" "cmplx")))))
fba78d18
EB
1894 (replace 'install
1895 (lambda* (#:key outputs #:allow-other-keys)
1896 (let* ((out (assoc-ref outputs "out"))
1897 (libdir (string-append out "/lib")))
1898 (copy-recursively "lib" libdir)
1899 (copy-recursively "include" (string-append out "/include"))
1900 (when (file-exists? "libseq/libmpiseq.a")
1901 (install-file "libseq/libmpiseq.a" libdir))
1902 #t))))))
cec86422
EB
1903 (home-page "http://mumps.enseeiht.fr")
1904 (synopsis "Multifrontal sparse direct solver")
1905 (description
1906 "MUMPS (MUltifrontal Massively Parallel sparse direct Solver) solves a
1907sparse system of linear equations A x = b using Guassian elimination.")
1908 (license license:cecill-c)))
1909
1910(define-public mumps-metis
1911 (package (inherit mumps)
1912 (name "mumps-metis")
1913 (inputs
1914 (alist-delete "scotch" (package-inputs mumps)))))
1915
1916(define-public mumps-openmpi
1917 (package (inherit mumps)
1918 (name "mumps-openmpi")
1919 (inputs
1920 `(("mpi" ,openmpi)
1921 ("scalapack" ,scalapack)
1922 ("pt-scotch" ,pt-scotch)
1923 ,@(alist-delete "scotch" (package-inputs mumps))))
1924 (arguments
1925 (substitute-keyword-arguments (package-arguments mumps)
1926 ((#:phases phases)
1927 `(modify-phases ,phases
1928 (replace
1929 'check
1930 (lambda _
1931 ((assoc-ref ,phases 'check)
1932 #:exec-prefix '("mpirun" "-n" "2"))))))))
1933 (synopsis "Multifrontal sparse direct solver (with MPI)")))
1934
1935(define-public mumps-metis-openmpi
1936 (package (inherit mumps-openmpi)
1937 (name "mumps-metis-openmpi")
1938 (inputs
1939 (alist-delete "pt-scotch" (package-inputs mumps-openmpi)))))
1940
2d047896
RW
1941(define-public r-quadprog
1942 (package
1943 (name "r-quadprog")
1944 (version "1.5-5")
1945 (source
1946 (origin
1947 (method url-fetch)
1948 (uri (cran-uri "quadprog" version))
1949 (sha256
1950 (base32
1951 "0jg3r6abmhp8r9vkbhpx9ldjfw6vyl1m4c5vwlyjhk1mi03656fr"))))
1952 (build-system r-build-system)
1953 (native-inputs
1954 `(("gfortran" ,gfortran)))
e9960d8c 1955 (home-page "https://cran.r-project.org/web/packages/quadprog")
2d047896
RW
1956 (synopsis "Functions to solve quadratic programming problems")
1957 (description
1958 "This package contains routines and documentation for solving quadratic
1959programming problems.")
1960 (license license:gpl3+)))
1961
ec8c7e47
RJ
1962(define-public r-pracma
1963 (package
1964 (name "r-pracma")
63758425 1965 (version "2.1.4")
ec8c7e47
RJ
1966 (source (origin
1967 (method url-fetch)
1968 (uri (cran-uri "pracma" version))
1969 (sha256
63758425 1970 (base32 "1ygm81i7mqvh229dp9935djjyb120p3bqvaf4k572sa4q63fzjhc"))))
ec8c7e47 1971 (build-system r-build-system)
ccd9b151
RW
1972 (propagated-inputs
1973 `(("r-quadprog" ,r-quadprog)))
e9960d8c 1974 (home-page "https://cran.r-project.org/web/packages/pracma")
ec8c7e47
RJ
1975 (synopsis "Practical numerical math functions")
1976 (description "This package provides functions for numerical analysis and
1977linear algebra, numerical optimization, differential equations, plus some
1978special functions. It uses Matlab function names where appropriate to simplify
1979porting.")
1980 (license license:gpl3+)))
1981
63e07468
BW
1982(define-public ruby-asciimath
1983 (package
1984 (name "ruby-asciimath")
1985 (version "1.0.4")
1986 (source
1987 (origin
1988 (method url-fetch)
1989 (uri (rubygems-uri "asciimath" version))
1990 (sha256
1991 (base32
1992 "1d80kiph5mc78zps7si1hv48kv4k12mzaq8jk5kb3pqpjdr72qmc"))))
1993 (build-system ruby-build-system)
1994 (arguments
1995 '(#:phases
1996 (modify-phases %standard-phases
1997 ;; Apply this patch
1998 ;; https://github.com/asciidoctor/asciimath/commit/1c06fdc8086077f4785479f78b0823a4a72d7948
1999 (add-after 'unpack 'patch-remove-spurious-backslashes
2000 (lambda _
2001 (substitute* "spec/parser_spec.rb"
2002 (("\\\\\"")
2003 "\"")))))))
2004 (native-inputs
2005 `(("bundler" ,bundler)
2006 ("ruby-rspec" ,ruby-rspec)))
2007 (synopsis "AsciiMath parsing and conversion library")
2008 (description
2009 "A pure Ruby AsciiMath parsing and conversion library. AsciiMath is an
2010easy-to-write markup language for mathematics.")
2011 (home-page "https://github.com/asciidoctor/asciimath")
2012 (license license:expat)))
2013
183e44ae
EB
2014(define-public superlu
2015 (package
2016 (name "superlu")
995a09e0 2017 (version "5.2.1")
183e44ae
EB
2018 (source
2019 (origin
2020 (method url-fetch)
2021 (uri (string-append "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/"
2022 "superlu_" version ".tar.gz"))
2023 (sha256
995a09e0
EB
2024 (base32 "0qzlb7cd608q62kyppd0a8c65l03vrwqql6gsm465rky23b6dyr8"))
2025 (modules '((guix build utils)))
2026 (snippet
2027 ;; Replace the non-free implementation of MC64 with a stub adapted
2028 ;; from Debian
2029 '(begin
2030 (use-modules (ice-9 regex)
2031 (ice-9 rdelim))
2032 (call-with-output-file "SRC/mc64ad.c"
2033 (lambda (port)
2034 (display "
2035#include <stdio.h>
2036#include <stdlib.h>
2037void mc64id_(int *a) {
2038 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
2039 abort ();
2040}
2041void mc64ad_ (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
2042 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
2043 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
2044 abort ();
2045}\n" port)))
2046 ;; Remove the corresponding license verbiage. MC64 license follows
2047 ;; a "------" line separator.
2048 (with-atomic-file-replacement "License.txt"
2049 (let ((rx (make-regexp "-{8}")))
2050 (lambda (in out)
2051 (let loop ()
2052 (let ((line (read-line in 'concat)))
2053 (unless (regexp-exec rx line)
2054 (display line out)
2055 (loop)))))))))))
2056 (build-system cmake-build-system)
183e44ae
EB
2057 (native-inputs
2058 `(("tcsh" ,tcsh)))
2059 (inputs
995a09e0 2060 `(("blas" ,openblas)
19afbea1 2061 ("gfortran" ,gfortran)))
183e44ae 2062 (arguments
995a09e0
EB
2063 `(#:configure-flags '("-Denable_blaslib:BOOL=NO" ;do not use internal cblas
2064 "-DTPL_BLAS_LIBRARIES=openblas"
677bc34d 2065 "-DBUILD_SHARED_LIBS:BOOL=YES")))
183e44ae
EB
2066 (home-page "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/")
2067 (synopsis "Supernodal direct solver for sparse linear systems")
2068 (description
2069 "SuperLU is a general purpose library for the direct solution of large,
2070sparse, nonsymmetric systems of linear equations on high performance machines.
2071The library is written in C and is callable from either C or Fortran. The
2072library routines perform an LU decomposition with partial pivoting and
2073triangular system solves through forward and back substitution. The library
2074also provides threshold-based ILU factorization preconditioners.")
995a09e0
EB
2075 (license (list license:bsd-3
2076 license:gpl2+ ;EXAMPLE/*fgmr.c
2077 (license:fsf-free "file://SRC/colamd.h")))))
f8ed036a 2078
a54aefea
EB
2079(define-public superlu-dist
2080 (package
2081 (name "superlu-dist")
2082 (version "3.3")
2083 (source
2084 (origin
2085 (method url-fetch)
2086 (uri (string-append "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/"
2087 "superlu_dist_" version ".tar.gz"))
2088 (sha256
2089 (base32 "1hnak09yxxp026blq8zhrl7685yip16svwngh1wysqxf8z48vzfj"))
29080870
EB
2090 (modules '((guix build utils)))
2091 (snippet
2092 ;; Replace the non-free implementation of MC64 with a stub
2093 '(begin
2094 (use-modules (ice-9 regex)
2095 (ice-9 rdelim))
2096 (call-with-output-file "SRC/mc64ad.c"
2097 (lambda (port)
2098 (display "
2099#include <stdio.h>
2100#include <stdlib.h>
2101void mc64id_(int *a) {
2102 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
2103 abort ();
2104}
2105void mc64ad_ (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
2106 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
2107 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
2108 abort ();
2109}\n" port)))
2110 (delete-file "SRC/mc64ad.f.bak")
2111 (substitute* "SRC/util.c" ;adjust default algorithm
2112 (("RowPerm[[:blank:]]*=[[:blank:]]*LargeDiag")
2113 "RowPerm = NOROWPERM"))))
fc1adab1 2114 (patches (search-patches "superlu-dist-scotchmetis.patch"))))
a54aefea
EB
2115 (build-system gnu-build-system)
2116 (native-inputs
2117 `(("tcsh" ,tcsh)))
2118 (inputs
19afbea1 2119 `(("gfortran" ,gfortran)))
a54aefea
EB
2120 (propagated-inputs
2121 `(("openmpi" ,openmpi) ;headers include MPI heades
2122 ("lapack" ,lapack) ;required to link with output library
2123 ("pt-scotch" ,pt-scotch))) ;same
2124 (arguments
2125 `(#:parallel-build? #f ;race conditions using ar
2126 #:phases
dc1d3cde
KK
2127 (modify-phases %standard-phases
2128 (replace 'configure
2129 (lambda* (#:key inputs outputs #:allow-other-keys)
2130 (call-with-output-file "make.inc"
2131 (lambda (port)
2132 (format port "
a54aefea
EB
2133PLAT =
2134DSuperLUroot = ~a
2135DSUPERLULIB = ~a/lib/libsuperlu_dist.a
2136BLASDEF = -DUSE_VENDOR_BLAS
2137BLASLIB = -L~a/lib -lblas
2138PARMETISLIB = -L~a/lib \
2139 -lptscotchparmetis -lptscotch -lptscotcherr -lptscotcherrexit \
2140 -lscotch -lscotcherr -lscotcherrexit
2141METISLIB = -L~:*~a/lib \
2142 -lscotchmetis -lscotch -lscotcherr -lscotcherrexit
2143LIBS = $(DSUPERLULIB) $(PARMETISLIB) $(METISLIB) $(BLASLIB)
2144ARCH = ar
2145ARCHFLAGS = cr
2146RANLIB = ranlib
2147CC = mpicc
2148PIC = -fPIC
2149CFLAGS = -O3 -g -DPRNTlevel=0 $(PIC)
2150NOOPTS = -O0 -g $(PIC)
2151FORTRAN = mpifort
2152FFLAGS = -O2 -g $(PIC)
2153LOADER = $(CC)
2154CDEFS = -DAdd_"
dc1d3cde
KK
2155 (getcwd)
2156 (assoc-ref outputs "out")
2157 (assoc-ref inputs "lapack")
2158 (assoc-ref inputs "pt-scotch"))))
2159 #t))
2160 (add-after 'unpack 'remove-broken-symlinks
2161 (lambda _
2162 (for-each delete-file
2163 (find-files "MAKE_INC" "\\.#make\\..*"))
2164 #t))
2165 (add-before 'build 'create-install-directories
2166 (lambda* (#:key outputs #:allow-other-keys)
2167 (for-each
2168 (lambda (dir)
2169 (mkdir-p (string-append (assoc-ref outputs "out")
2170 "/" dir)))
2171 '("lib" "include"))
2172 #t))
2173 (replace 'check
a54aefea
EB
2174 (lambda _
2175 (with-directory-excursion "EXAMPLE"
2176 (and
2177 (zero? (system* "mpirun" "-n" "2"
2178 "./pddrive" "-r" "1" "-c" "2" "g20.rua"))
2179 (zero? (system* "mpirun" "-n" "2"
dc1d3cde
KK
2180 "./pzdrive" "-r" "1" "-c" "2" "cg20.cua"))))))
2181 (replace 'install
2182 (lambda* (#:key outputs #:allow-other-keys)
2183 ;; Library is placed in lib during the build phase. Copy over
2184 ;; headers to include.
2185 (let* ((out (assoc-ref outputs "out"))
2186 (incdir (string-append out "/include")))
2187 (for-each (lambda (file)
2188 (let ((base (basename file)))
2189 (format #t "installing `~a' to `~a'~%"
2190 base incdir)
2191 (copy-file file
2192 (string-append incdir "/" base))))
2193 (find-files "SRC" ".*\\.h$")))
2194 #t)))))
a54aefea
EB
2195 (home-page (package-home-page superlu))
2196 (synopsis "Parallel supernodal direct solver")
2197 (description
2198 "SuperLU_DIST is a parallel extension to the serial SuperLU library.
2199It is targeted for distributed memory parallel machines. SuperLU_DIST is
2200implemented in ANSI C, and MPI for communications.")
2201 (license license:bsd-3)))
2202
f8ed036a
EB
2203(define-public scotch
2204 (package
2205 (name "scotch")
d98e9009 2206 (version "6.0.5a")
f8ed036a
EB
2207 (source
2208 (origin
2209 (method url-fetch)
1dc31097
TGR
2210 (uri (string-append "https://gforge.inria.fr/frs/download.php/"
2211 "latestfile/298/scotch_" version ".tar.gz"))
f8ed036a 2212 (sha256
d98e9009 2213 (base32 "0vsmgjz8qv80di3ljmc7hbdsizxxxwy2b9rgd2fl1mdc6dgbj8av"))
fc1adab1 2214 (patches (search-patches "scotch-test-threading.patch"
d98e9009
EB
2215 "scotch-build-parallelism.patch"
2216 "scotch-graph-induce-type-64.patch"
2217 "scotch-graph-diam-64.patch"))))
f8ed036a
EB
2218 (build-system gnu-build-system)
2219 (inputs
2220 `(("zlib" ,zlib)
5e54f4ad 2221 ("flex" ,flex)
f8ed036a
EB
2222 ("bison" ,bison)))
2223 (arguments
2224 `(#:phases
d6602ee9
EB
2225 (modify-phases %standard-phases
2226 (add-after
2227 'unpack 'chdir-to-src
2228 (lambda _ (chdir "src")))
2229 (replace
2230 'configure
2231 (lambda _
2232 (call-with-output-file "Makefile.inc"
2233 (lambda (port)
2234 (format port "
f8ed036a
EB
2235EXE =
2236LIB = .a
2237OBJ = .o
2238MAKE = make
2239AR = ar
2240ARFLAGS = -ruv
cf0ec6c4 2241CAT = cat
f8ed036a
EB
2242CCS = gcc
2243CCP = mpicc
2244CCD = gcc
2245CPPFLAGS =~{ -D~a~}
6c798540 2246CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
f8ed036a
EB
2247LDFLAGS = -lz -lm -lrt -lpthread
2248CP = cp
2249LEX = flex -Pscotchyy -olex.yy.c
2250LN = ln
2251MKDIR = mkdir
2252MV = mv
2253RANLIB = ranlib
2254YACC = bison -pscotchyy -y -b y
2255"
d6602ee9
EB
2256 '("COMMON_FILE_COMPRESS_GZ"
2257 "COMMON_PTHREAD"
2258 "COMMON_RANDOM_FIXED_SEED"
26599d69 2259 "INTSIZE64" ;use 'long' instead of 'int'
cf0ec6c4
EB
2260 ;; Prevents symbolc clashes with libesmumps
2261 "SCOTCH_RENAME"
d6602ee9
EB
2262 ;; XXX: Causes invalid frees in superlu-dist tests
2263 ;; "SCOTCH_PTHREAD"
2264 ;; "SCOTCH_PTHREAD_NUMBER=2"
2265 "restrict=__restrict"))))))
cf0ec6c4
EB
2266 (add-after
2267 'build 'build-esmumps
2268 (lambda _
2269 (zero? (system* "make"
2270 (format #f "-j~a" (parallel-job-count))
2271 "esmumps"))))
d6602ee9 2272 (replace
f8ed036a
EB
2273 'install
2274 (lambda* (#:key outputs #:allow-other-keys)
2275 (let ((out (assoc-ref outputs "out")))
2276 (mkdir out)
2277 (zero? (system* "make"
2278 (string-append "prefix=" out)
cf0ec6c4
EB
2279 "install"))
2280 ;; esmumps files are not installed with the above
2281 (for-each (lambda (f)
2282 (copy-file f (string-append out "/include/" f)))
2283 (find-files "../include" ".*esmumps.h$"))
2284 (for-each (lambda (f)
2285 (copy-file f (string-append out "/lib/" f)))
2286 (find-files "../lib" "^lib.*esmumps.*"))))))))
f8ed036a
EB
2287 (home-page "http://www.labri.fr/perso/pelegrin/scotch/")
2288 (synopsis "Programs and libraries for graph algorithms")
2289 (description "SCOTCH is a set of programs and libraries which implement
2290the static mapping and sparse matrix reordering algorithms developed within
2291the SCOTCH project. Its purpose is to apply graph theory, with a divide and
2292conquer approach, to scientific computing problems such as graph and mesh
2293partitioning, static mapping, and sparse matrix ordering, in application
2294domains ranging from structural mechanics to operating systems or
2295bio-chemistry.")
2296 ;; See LICENSE_en.txt
2297 (license license:cecill-c)))
6acb4adb 2298
1c39f3b8
PG
2299(define-public scotch32
2300 ;; This is the 'INTSIZE32' variant, which uses 32-bit integers, as needed by
2301 ;; some applications.
2302 (package (inherit scotch)
2303 (name "scotch32")
2304 (arguments
2305 (substitute-keyword-arguments (package-arguments scotch)
2306 ((#:phases scotch-phases)
2307 `(modify-phases ,scotch-phases
2308 (replace
2309 'configure
2310 (lambda _
2311 (call-with-output-file "Makefile.inc"
2312 (lambda (port)
2313 (format port "
2314EXE =
2315LIB = .a
2316OBJ = .o
2317MAKE = make
2318AR = ar
2319ARFLAGS = -ruv
2320CAT = cat
2321CCS = gcc
2322CCP = mpicc
2323CCD = gcc
2324CPPFLAGS =~{ -D~a~}
2325CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
2326LDFLAGS = -lz -lm -lrt -lpthread
2327CP = cp
2328LEX = flex -Pscotchyy -olex.yy.c
2329LN = ln
2330MKDIR = mkdir
2331MV = mv
2332RANLIB = ranlib
2333YACC = bison -pscotchyy -y -b y
2334"
2335 '("COMMON_FILE_COMPRESS_GZ"
2336 "COMMON_PTHREAD"
2337 "COMMON_RANDOM_FIXED_SEED"
2338 "INTSIZE32" ;use 32-bit integers. See INSTALL.txt
2339 ;; Prevents symbolc clashes with libesmumps
2340 "SCOTCH_RENAME"
2341 ;; XXX: Causes invalid frees in superlu-dist tests
2342 ;; "SCOTCH_PTHREAD"
2343 ;; "SCOTCH_PTHREAD_NUMBER=2"
2344 "restrict=__restrict"))))))))))
2345 (synopsis
2346 "Programs and libraries for graph algorithms (32-bit integers)")))
2347
6acb4adb
EB
2348(define-public pt-scotch
2349 (package (inherit scotch)
2350 (name "pt-scotch")
2351 (propagated-inputs
2352 `(("openmpi" ,openmpi))) ;Headers include MPI headers
2353 (arguments
2354 (substitute-keyword-arguments (package-arguments scotch)
2355 ((#:phases scotch-phases)
d6602ee9
EB
2356 `(modify-phases ,scotch-phases
2357 (replace
2358 'build
d6602ee9
EB
2359 (lambda _
2360 (and
cf0ec6c4
EB
2361 (zero? (system* "make"
2362 (format #f "-j~a" (parallel-job-count))
2363 "ptscotch" "ptesmumps"))
d6602ee9
EB
2364 ;; Install the serial metis compatibility library
2365 (zero? (system* "make" "-C" "libscotchmetis" "install")))))
2366 (replace
2367 'check
2368 (lambda _ (zero? (system* "make" "ptcheck"))))))))
6acb4adb 2369 (synopsis "Programs and libraries for graph algorithms (with MPI)")))
5698b8b8 2370
1c25a52c
PG
2371(define-public pt-scotch32
2372 (package (inherit scotch32)
2373 (name "pt-scotch32")
2374 (propagated-inputs
2375 `(("openmpi" ,openmpi))) ;headers include MPI headers
2376 (arguments
c4d4a779
PG
2377 (substitute-keyword-arguments (package-arguments scotch32)
2378 ((#:phases scotch32-phases)
2379 `(modify-phases ,scotch32-phases
1c25a52c
PG
2380 (replace 'build
2381 (lambda _
2382 (and
2383 (zero? (system* "make"
2384 (format #f "-j~a" (parallel-job-count))
2385 "ptscotch" "ptesmumps"))
2386 ;; Install the serial metis compatibility library
2387 (zero? (system* "make" "-C" "libscotchmetis" "install")))))
2388 (replace 'check
2389 (lambda _
2390 (zero? (system* "make" "ptcheck"))))))))
2391 (synopsis
2392 "Programs and libraries for graph algorithms (with MPI and 32-bit integers)")))
2393
aa75ad00
EB
2394(define-public metis
2395 (package
2396 (name "metis")
2397 (version "5.1.0")
2398 (source
2399 (origin
2400 (method url-fetch)
2401 (uri (string-append "http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/"
2402 "metis-" version ".tar.gz"))
2403 (sha256
2404 (base32
2405 "1cjxgh41r8k6j029yxs8msp3z6lcnpm16g5pvckk35kc7zhfpykn"))))
2406 (build-system cmake-build-system)
2407 (inputs
2408 `(("blas" ,openblas)))
2409 (arguments
2410 `(#:tests? #f ;no tests
2411 #:configure-flags `("-DSHARED=ON"
2412 ,(string-append "-DGKLIB_PATH=" (getcwd)
2413 "/metis-" ,version "/GKlib"))))
2414 (home-page "http://glaros.dtc.umn.edu/gkhome/metis/metis/overview")
2415 (synopsis "Graph partitioning and fill-reducing matrix ordering library")
2416 (description
2417 "METIS is a set of serial programs for partitioning graphs, partitioning
2418finite element meshes, and producing fill-reducing orderings for sparse
2419matrices. The algorithms implemented in METIS are based on the multilevel
2420recursive-bisection, multilevel k-way, and multi-constraint partitioning
2421schemes.")
2422 (license license:asl2.0))) ;As of version 5.0.3
2423
700ff222
EB
2424(define-public p4est
2425 (package
2426 (name "p4est")
4150da63 2427 (version "2.0")
700ff222
EB
2428 (source
2429 (origin
2430 (method url-fetch)
2431 (uri (string-append "http://p4est.github.io/release/p4est-"
2432 version ".tar.gz"))
2433 (sha256
2434 (base32
4150da63 2435 "16h267z256kxcxfjs390qqzv19hr58vrj4x8lndb7alnk2vca8n5"))))
700ff222
EB
2436 (build-system gnu-build-system)
2437 (inputs
2438 `(("fortran" ,gfortran)
2439 ("blas" ,openblas)
2440 ("lapack" ,lapack)
2441 ("zlib" ,zlib)))
2442 (arguments
2443 `(#:configure-flags `(,(string-append "BLAS_LIBS=-L"
2444 (assoc-ref %build-inputs "blas")
2445 " -lopenblas")
2446 ,(string-append "LAPACK_LIBS=-L"
2447 (assoc-ref %build-inputs "lapack")
2448 " -llapack"))))
2449 (home-page "http://www.p4est.org")
2450 (synopsis "Adaptive mesh refinement on forests of octrees")
2451 (description
2452 "The p4est software library enables the dynamic management of a
2453collection of adaptive octrees, conveniently called a forest of octrees.
2454p4est is designed to work in parallel and scales to hundreds of thousands of
2455processor cores.")
2456 (license license:gpl2+)))
2457
2458(define-public p4est-openmpi
2459 (package (inherit p4est)
2460 (name "p4est-openmpi")
2461 (inputs
2462 `(("mpi" ,openmpi)
2463 ,@(package-inputs p4est)))
2464 (arguments
2465 (substitute-keyword-arguments (package-arguments p4est)
2466 ((#:configure-flags cf)
2467 ``("--enable-mpi" ,@,cf))))
2468 (synopsis "Parallel adaptive mesh refinement on forests of octrees")))
2469
5698b8b8
JD
2470(define-public gsegrafix
2471 (package
2472 (name "gsegrafix")
2473 (version "1.0.6")
2474 (source
2475 (origin
2476 (method url-fetch)
2477 (uri (string-append "mirror://gnu/" name "/" name "-"
2478 version ".tar.gz"))
2479 (sha256
2480 (base32
2481 "1b13hvx063zv970y750bx41wpx6hwd5ngjhbdrna8w8yy5kmxcda"))))
2482 (build-system gnu-build-system)
2483 (arguments
2484 `(#:configure-flags '("LDFLAGS=-lm")))
2485 (inputs
2486 `(("libgnomecanvas" ,libgnomecanvas)
2487 ("libbonoboui" ,libbonoboui)
2488 ("libgnomeui" ,libgnomeui)
2489 ("libgnomeprintui" ,libgnomeprintui)
2490 ("popt" ,popt)))
2491 (native-inputs
2492 `(("pkg-config" ,pkg-config)))
6fd52309 2493 (home-page "https://www.gnu.org/software/gsegrafix/")
5698b8b8
JD
2494 (synopsis "GNOME application to create scientific and engineering plots")
2495 (description "GSEGrafix is an application which produces high-quality graphical
2496plots for science and engineering. Plots are specified via simple ASCII
2497parameter files and data files and are presented in an anti-aliased GNOME
2498canvas. The program supports rectangular two-dimensional plots, histograms,
2499polar-axis plots and three-dimensional plots. Plots can be printed or saved
2500to BMP, JPEG or PNG image formats.")
2501 (license license:gpl3+)))
8731e527
JD
2502
2503(define-public maxima
2504 (package
2505 (name "maxima")
b3b2efc8 2506 (version "5.41.0")
8731e527
JD
2507 (source
2508 (origin
2509 (method url-fetch)
2510 (uri (string-append "mirror://sourceforge/maxima/Maxima-source/"
2511 version "-source/" name "-" version ".tar.gz"))
2512 (sha256
2513 (base32
b3b2efc8 2514 "0x0n81z0s4pl8nwpf7ivlsbvsdphm9w42250g7qdkizl0132by6s"))
fc1adab1 2515 (patches (search-patches "maxima-defsystem-mkdir.patch"))))
8731e527 2516 (build-system gnu-build-system)
df354a77 2517 (inputs
6b2eafaa 2518 `(("gcl" ,gcl)
df354a77 2519 ("gnuplot" ,gnuplot) ;for plots
f36afe4d 2520 ("tk" ,tk))) ;Tcl/Tk is used by 'xmaxima'
df354a77
FB
2521 (native-inputs
2522 `(("texinfo" ,texinfo)
ccbc5758
KK
2523 ("perl" ,perl)
2524 ("python" ,python)))
8731e527 2525 (arguments
df354a77
FB
2526 `(#:configure-flags
2527 (list "--enable-gcl"
2528 (string-append "--with-posix-shell="
2529 (assoc-ref %build-inputs "bash")
2530 "/bin/sh")
2531 (string-append "--with-wish="
2532 (assoc-ref %build-inputs "tk")
2533 "/bin/wish"
2534 (let ((v ,(package-version tk)))
2535 (string-take v (string-index-right v #\.)))))
df354a77 2536 ;; By default Maxima attempts to write temporary files to
77af7b24
MW
2537 ;; '/tmp/nix-build-maxima-*', which won't exist at run time.
2538 ;; Work around that.
df354a77 2539 #:make-flags (list "TMPDIR=/tmp")
0093b126
KK
2540 #:phases
2541 (modify-phases %standard-phases
2542 (add-before 'check 'pre-check
2543 (lambda _
2544 (chmod "src/maxima" #o555)
2545 #t))
2546 ;; Make sure the doc and emacs files are found in the
2547 ;; standard location. Also configure maxima to find gnuplot
2548 ;; without having it on the PATH.
2549 (add-after 'install 'post-install
2550 (lambda* (#:key outputs inputs #:allow-other-keys)
2551 (let* ((gnuplot (assoc-ref inputs "gnuplot"))
2552 (out (assoc-ref outputs "out"))
2553 (datadir (string-append out "/share/maxima/" ,version))
2554 (binutils (string-append (assoc-ref inputs "binutils")
2555 "/bin")))
2556 (with-directory-excursion out
2557 (mkdir-p "share/emacs")
2558 (mkdir-p "share/doc")
2559 (symlink
2560 (string-append datadir "/emacs/")
2561 (string-append out "/share/emacs/site-lisp"))
2562 (symlink
2563 (string-append datadir "/doc/")
2564 (string-append out "/share/doc/maxima"))
2565 (with-atomic-file-replacement
2566 (string-append datadir "/share/maxima-init.lisp")
2567 (lambda (in out)
2568 (format out "~a ~s~a~%"
2569 "(setf $gnuplot_command "
2570 (string-append gnuplot "/bin/gnuplot") ")")
2571 (dump-port in out))))
2572 ;; Ensure that Maxima will have access to the GNU binutils
2573 ;; components at runtime.
2574 (wrap-program (string-append out "/bin/maxima")
2575 `("PATH" prefix (,binutils))))
2576 #t)))))
8731e527
JD
2577 (home-page "http://maxima.sourceforge.net")
2578 (synopsis "Numeric and symbolic expression manipulation")
2579 (description "Maxima is a system for the manipulation of symbolic and
2580numerical expressions. It yields high precision numeric results by using
2581exact fractions, arbitrary precision integers, and variable precision floating
e881752c 2582point numbers.")
8731e527
JD
2583 ;; Some files are lgpl2.1+. Some are gpl2+. Some explicitly state gpl1+.
2584 ;; Others simply say "GNU General Public License" without stating a
2585 ;; version (which implicitly means gpl1+).
2586 ;; At least one file (src/maxima.asd) says "version 2."
2587 ;; GPLv2 only is therefore the smallest subset.
f36afe4d 2588 (license license:gpl2)))
ec322be2 2589
9aafbc0c
MW
2590(define-public wxmaxima
2591 (package
2592 (name "wxmaxima")
0181df53 2593 (version "18.02.0")
9aafbc0c
MW
2594 (source
2595 (origin
2596 (method url-fetch)
5143517c
KK
2597 (uri (string-append "https://github.com/andrejv/" name "/archive"
2598 "/Version-" version ".tar.gz"))
2599 (file-name (string-append name "-" version ".tar.gz"))
9aafbc0c
MW
2600 (sha256
2601 (base32
0181df53
KK
2602 "03kr2rgfp4hcf3is8m8d8f9hj660c3xgrc50vrrfpixx4syh6wvj"))
2603 (patches
2604 (search-patches "wxmaxima-do-not-use-old-gnuplot-parameters.patch"))))
2605 (build-system cmake-build-system)
5143517c 2606 (native-inputs
0181df53 2607 `(("gettext" ,gettext-minimal)))
9aafbc0c
MW
2608 (inputs
2609 `(("wxwidgets" ,wxwidgets)
de477809
SB
2610 ("maxima" ,maxima)
2611 ;; Runtime support.
2612 ("adwaita-icon-theme" ,adwaita-icon-theme)
2613 ("gtk+" ,gtk+)
2614 ("shared-mime-info" ,shared-mime-info)))
9aafbc0c 2615 (arguments
0181df53
KK
2616 `(#:tests? #f ; no check target
2617 #:phases
ac2ddcc6 2618 (modify-phases %standard-phases
ac2ddcc6
KK
2619 (add-after 'install 'wrap-program
2620 (lambda* (#:key inputs outputs #:allow-other-keys)
2621 (wrap-program (string-append (assoc-ref outputs "out")
2622 "/bin/wxmaxima")
2623 `("PATH" ":" prefix
2624 (,(string-append (assoc-ref inputs "maxima")
2625 "/bin")))
2626 ;; For GtkFileChooserDialog.
2627 `("GSETTINGS_SCHEMA_DIR" =
2628 (,(string-append (assoc-ref inputs "gtk+")
2629 "/share/glib-2.0/schemas")))
2630 `("XDG_DATA_DIRS" ":" prefix
2631 (;; Needed by gdk-pixbuf to know supported icon formats.
2632 ,(string-append
2633 (assoc-ref inputs "shared-mime-info") "/share")
2634 ;; The default icon theme of GTK+.
2635 ,(string-append
2636 (assoc-ref inputs "adwaita-icon-theme") "/share"))))
2637 #t)))))
9aafbc0c
MW
2638 (home-page "https://andrejv.github.io/wxmaxima/")
2639 (synopsis "Graphical user interface for the Maxima computer algebra system")
2640 (description
2641 "wxMaxima is a graphical user interface for the Maxima computer algebra
2642system. It eases the use of Maxima by making most of its commands available
2643through a menu system and by providing input dialogs for commands that require
2644more than one argument. It also implements its own display engine that
2645outputs mathematical symbols directly instead of depicting them with ASCII
2646characters.
2647
2648wxMaxima also features 2D and 3D inline plots, simple animations, mixing of
2649text and mathematical calculations to create documents, exporting of input and
2650output to TeX, and a browser for Maxima's manual including command index and
2651full text searching.")
2652 (license license:gpl2+)))
2653
b15e47f9
RW
2654(define-public armadillo
2655 (package
2656 (name "armadillo")
133cba8c 2657 (version "7.800.2")
b15e47f9
RW
2658 (source (origin
2659 (method url-fetch)
2660 (uri (string-append "mirror://sourceforge/arma/armadillo-"
7397cd9e 2661 version ".tar.xz"))
b15e47f9
RW
2662 (sha256
2663 (base32
133cba8c 2664 "1qqzy7dp891j9v7062mv1599hdwr97vqzrd3j2fl8c3gmc00dmzg"))))
b15e47f9
RW
2665 (build-system cmake-build-system)
2666 (arguments `(#:tests? #f)) ;no test target
2667 (inputs
2668 `(("openblas" ,openblas)
2669 ("lapack" ,lapack)
2670 ("arpack" ,arpack-ng)))
2671 (home-page "http://arma.sourceforge.net/")
2672 (synopsis "C++ linear algebra library")
2673 (description
2674 "Armadillo is a C++ linear algebra library, aiming towards a good balance
2675between speed and ease of use. It is useful for algorithm development
2676directly in C++, or quick conversion of research code into production
2677environments. It can be used for machine learning, pattern recognition,
2678signal processing, bioinformatics, statistics, econometrics, etc. The library
2679provides efficient classes for vectors, matrices and cubes, as well as 150+
2680associated functions (eg. contiguous and non-contiguous submatrix views).")
fe418cc5 2681 (license license:asl2.0)))
b15e47f9 2682
279663ef 2683(define-public muparser
d7cff656
LF
2684 ;; When switching download sites, muparser re-issued a 2.2.5 release with a
2685 ;; different hash. In order to make `guix package --upgrade` work correctly,
2686 ;; we set a Guix packaging revision.
2687 ;; When the next version of muparser is released, we can remove
2688 ;; UPSTREAM-VERSION and REVISION and use the plain VERSION.
2689 (let ((upstream-version "2.2.5")
2690 (revision "2"))
2691 (package
2692 (name "muparser")
2693 (version (string-append upstream-version "-" revision))
2694 (source
2695 (origin
2696 (method url-fetch)
2697 (uri (string-append "https://github.com/beltoforion/muparser/archive/v"
2698 upstream-version ".tar.gz"))
2699 (file-name (string-append name "-" version ".tar.gz"))
2700 (sha256
2701 (base32
2702 "0277qsi5l23jsck1vhn383bmvc2n9l4a1dl5r9bf7hvjv9ayyrh6"))))
2703 (build-system gnu-build-system)
2704 (arguments
2705 `(#:configure-flags '("--enable-samples=no")
2706 #:tests? #f)) ;no "check" target
2707 (home-page "http://muparser.beltoforion.de/")
2708 (synopsis "Fast parser library for mathematical expressions")
2709 (description
2710 "muParser is an extensible high performance math parser library. It is
2711based on transforming an expression into a bytecode and precalculating constant
2712parts of it.")
2713 (license license:expat))))
279663ef 2714
e73b49fb
RW
2715(define-public openblas
2716 (package
2717 (name "openblas")
1b8de87c 2718 (version "0.2.20")
e73b49fb
RW
2719 (source
2720 (origin
2721 (method url-fetch)
2722 (uri (string-append "https://github.com/xianyi/OpenBLAS/tarball/v"
2723 version))
2724 (file-name (string-append name "-" version ".tar.gz"))
2725 (sha256
2726 (base32
1b8de87c 2727 "1bd03c5xni0bla0wg1wba841b36b0sg13sjja955kn5xzvy4i61a"))))
e73b49fb
RW
2728 (build-system gnu-build-system)
2729 (arguments
5789566a 2730 `(#:test-target "test"
bd0b4379
RW
2731 ;; DYNAMIC_ARCH is only supported on x86. When it is disabled and no
2732 ;; TARGET is specified, OpenBLAS will tune itself to the build host, so
2733 ;; we need to disable substitutions.
71923a91
AE
2734 #:substitutable?
2735 ,(let ((system (or (%current-target-system) (%current-system))))
2736 (or (string-prefix? "x86_64" system)
bd0b4379 2737 (string-prefix? "i686" system)
83a34647
EF
2738 (string-prefix? "mips" system)
2739 (string-prefix? "aarch64" system)))
e73b49fb
RW
2740 #:make-flags
2741 (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
2742 "SHELL=bash"
af5b817e
RW
2743 ;; Build the library for all supported CPUs. This allows
2744 ;; switching CPU targets at runtime with the environment variable
2745 ;; OPENBLAS_CORETYPE=<type>, where "type" is a supported CPU type.
71923a91
AE
2746 ;; Unfortunately, this is not supported on non-x86 architectures,
2747 ;; where it leads to failed builds.
2748 ,@(let ((system (or (%current-target-system) (%current-system))))
8a637e79
RW
2749 (cond
2750 ((or (string-prefix? "x86_64" system)
71923a91 2751 (string-prefix? "i686" system))
8a637e79
RW
2752 '("DYNAMIC_ARCH=1"))
2753 ;; On MIPS we force the "SICORTEX" TARGET, as for the other
2754 ;; two available MIPS targets special extended instructions
2755 ;; for Loongson cores are used.
2756 ((string-prefix? "mips" system)
2757 '("TARGET=SICORTEX"))
83a34647
EF
2758 ;; On aarch64 force the generic 'armv8-a' target
2759 ((string-prefix? "aarch64" system)
2760 '("TARGET=ARMV8"))
8a637e79 2761 (else '()))))
e73b49fb 2762 ;; no configure script
493937ae
DL
2763 #:phases
2764 (modify-phases %standard-phases
2765 (delete 'configure)
2766 (add-before 'build 'set-extralib
2767 (lambda* (#:key inputs #:allow-other-keys)
2768 ;; Get libgfortran found when building in utest.
2769 (setenv "FEXTRALIB"
2770 (string-append "-L" (assoc-ref inputs "fortran-lib")
2771 "/lib"))
2772 #t)))))
e73b49fb 2773 (inputs
493937ae 2774 `(("fortran-lib" ,gfortran "lib")))
e73b49fb
RW
2775 (native-inputs
2776 `(("cunit" ,cunit)
493937ae 2777 ("fortran" ,gfortran)
e73b49fb
RW
2778 ("perl" ,perl)))
2779 (home-page "http://www.openblas.net/")
2780 (synopsis "Optimized BLAS library based on GotoBLAS")
2781 (description
2782 "OpenBLAS is a BLAS library forked from the GotoBLAS2-1.13 BSD version.")
2783 (license license:bsd-3)))
2784
5a7deb11
LC
2785(define* (make-blis implementation #:optional substitutable?)
2786 "Return a BLIS package with the given IMPLEMENTATION (see config/ in the
2787source tree for a list of implementations.)
2788
2789SUBSTITUTABLE? determines whether the package is made available as a
2790substitute.
2791
2792Currently the specialization must be selected at configure-time, but work is
2793underway to allow BLIS to select the right optimized kernels at run time:
2794<https://github.com/flame/blis/issues/129>."
2795 (package
2796 (name (if (string=? implementation "reference")
2797 "blis"
2798 (string-append "blis-" implementation)))
2799 (version "0.2.2")
2800 (home-page "https://github.com/flame/blis")
2801 (source (origin
2802 (method git-fetch)
2803 (uri (git-reference (url home-page) (commit version)))
2804 (sha256
2805 (base32
2806 "1wr79a50nm4abhw8w3sn96nmwp5mrzifcigk7khw9qcgyyyqayfh"))
2807 (file-name (git-file-name "blis" version))))
2808 (build-system gnu-build-system)
2809 (arguments
2810 `(#:test-target "test"
2811
2812 #:substitutable? ,substitutable?
2813
2814 #:phases (modify-phases %standard-phases
2815 (replace 'configure
2816 (lambda* (#:key outputs #:allow-other-keys)
2817 ;; This is a home-made 'configure' script.
2818 (let ((out (assoc-ref outputs "out")))
2819 (zero? (system* "./configure" "-p" out
2820 "-d" "opt"
2821 "--disable-static"
2822 "--enable-shared"
2823 "--enable-threading=openmp"
2824
2825 ,implementation)))))
2826 (add-before 'check 'show-test-output
2827 (lambda _
2828 ;; By default "make check" is silent. Make it verbose.
2829 (system "tail -F output.testsuite &")
2830 #t)))))
2831 (synopsis "High-performance basic linear algebra (BLAS) routines")
2832 (description
2833 "BLIS is a portable software framework for instantiating high-performance
2834BLAS-like dense linear algebra libraries. The framework was designed to
2835isolate essential kernels of computation that, when optimized, immediately
2836enable optimized implementations of most of its commonly used and
2837computationally intensive operations. While BLIS exports a new BLAS-like API,
2838it also includes a BLAS compatibility layer which gives application developers
2839access to BLIS implementations via traditional BLAS routine calls.")
2840 (license license:bsd-3)))
2841
2842(define-public blis
2843 ;; This is the "reference" implementation, which is the non-optimized but
2844 ;; portable variant (no assembly).
2845 (make-blis "reference" #t))
2846
2847(define ignorance blis)
2848
2849(define-syntax-rule (blis/x86_64 processor)
2850 "Expand to a package specialized for PROCESSOR."
2851 (package
2852 (inherit (make-blis processor))
2853 (supported-systems '("x86_64-linux"))))
2854
2855(define-public blis-sandybridge
2856 ;; BLIS specialized for Sandy Bridge processors (launched 2011):
2857 ;; <http://ark.intel.com/products/codename/29900/Sandy-Bridge>.
2858 (blis/x86_64 "sandybridge"))
2859
2860(define-public blis-haswell
2861 ;; BLIS specialized for Haswell processors (launched 2013):
2862 ;; <http://ark.intel.com/products/codename/42174/Haswell>.
2863 (blis/x86_64 "haswell"))
2864
2865(define-public blis-knl
2866 ;; BLIS specialized for Knights Landing processor (launched 2016):
2867 ;; <http://ark.intel.com/products/series/92650/Intel-Xeon-Phi-x200-Product-Family>.
2868 (blis/x86_64 "knl"))
2869
2870
e1605e36
RW
2871(define-public openlibm
2872 (package
2873 (name "openlibm")
7112b2f1 2874 (version "0.5.5")
e1605e36
RW
2875 (source
2876 (origin
2877 (method url-fetch)
2878 (uri (string-append "https://github.com/JuliaLang/openlibm/archive/v"
2879 version ".tar.gz"))
2880 (file-name (string-append name "-" version ".tar.gz"))
2881 (sha256
2882 (base32
7112b2f1 2883 "1z8cj5q8ca8kmrakwkpjxf8svi81waw0c568cx8v8pv9kvswbp07"))))
e1605e36
RW
2884 (build-system gnu-build-system)
2885 (arguments
2886 `(#:make-flags
2887 (list (string-append "prefix=" (assoc-ref %outputs "out")))
2888 #:phases
2889 ;; no configure script
dc1d3cde 2890 (modify-phases %standard-phases (delete 'configure))
e1605e36
RW
2891 #:tests? #f)) ;the tests are part of the default target
2892 (home-page "http://openlibm.org/")
2893 (synopsis "Portable C mathematical library (libm)")
2894 (description
2895 "OpenLibm is an effort to have a high quality, portable, standalone C
2896mathematical library (libm). It can be used standalone in applications and
2897programming language implementations. The project was born out of a need to
e881752c 2898have a good libm for the Julia programming language that worked consistently
e1605e36
RW
2899across compilers and operating systems, and in 32-bit and 64-bit
2900environments.")
538c0e3b
EF
2901 ;; Each architecture has its own make target, and there is none for mips.
2902 (supported-systems (delete "mips64el-linux" %supported-systems))
e1605e36
RW
2903 ;; See LICENSE.md for details.
2904 (license (list license:expat
2905 license:isc
2906 license:bsd-2
2907 license:public-domain
2908 license:lgpl2.1+))))
2909
e62be58f
RW
2910(define-public openspecfun
2911 (package
2912 (name "openspecfun")
59cd0ba4 2913 (version "0.5.3")
e62be58f
RW
2914 (source
2915 (origin
2916 (method url-fetch)
2917 (uri (string-append "https://github.com/JuliaLang/openspecfun/archive/v"
2918 version ".tar.gz"))
2919 (file-name (string-append name "-" version ".tar.gz"))
2920 (sha256
2921 (base32
59cd0ba4 2922 "1rs1bv8jq751fv9vq79890wqf9xlbjc7lvz3ighzyfczbyjcf18m"))))
e62be58f
RW
2923 (build-system gnu-build-system)
2924 (arguments
59cd0ba4 2925 '(#:tests? #f ; no "check" target
e62be58f
RW
2926 #:make-flags
2927 (list (string-append "prefix=" (assoc-ref %outputs "out")))
59cd0ba4
TGR
2928 #:phases
2929 (modify-phases %standard-phases
2930 (delete 'configure)))) ; no configure script
e62be58f 2931 (inputs
19afbea1 2932 `(("fortran" ,gfortran)))
e62be58f
RW
2933 (home-page "https://github.com/JuliaLang/openspecfun")
2934 (synopsis "Collection of special mathematical functions")
2935 (description
2936 "Openspecfun provides AMOS and Faddeeva. AMOS (from Netlib) is a
2937portable package for Bessel Functions of a Complex Argument and Nonnegative
2938Order; it contains subroutines for computing Bessel functions and Airy
2939functions. Faddeeva allows computing the various error functions of arbitrary
2940complex arguments (Faddeeva function, error function, complementary error
2941function, scaled complementary error function, imaginary error function, and
2942Dawson function); given these, one can also easily compute Voigt functions,
2943Fresnel integrals, and similar related functions as well.")
2944 ;; Faddeeva is released under the Expat license; AMOS is included as
2945 ;; public domain software.
2946 (license (list license:expat license:public-domain))))
2947
2742f87e
RW
2948(define-public suitesparse
2949 (package
2950 (name "suitesparse")
bd5b5ac0 2951 (version "4.5.5")
2742f87e
RW
2952 (source
2953 (origin
2954 (method url-fetch)
2955 (uri (string-append
2956 "http://faculty.cse.tamu.edu/davis/SuiteSparse/SuiteSparse-"
2957 version ".tar.gz"))
2958 (sha256
2959 (base32
bd5b5ac0
EB
2960 "1dnr6pmjzc2qmbkmb4shigx1l74ilf6abn7svyd6brxgvph8vadr"))
2961 (modules '((guix build utils)))
2962 (snippet
2963 ;; Remove bundled metis source
2964 '(delete-file-recursively "metis-5.1.0"))))
2742f87e
RW
2965 (build-system gnu-build-system)
2966 (arguments
bd5b5ac0 2967 '(#:tests? #f ;no "check" target
2742f87e
RW
2968 #:make-flags
2969 (list "CC=gcc"
2970 "BLAS=-lblas"
2971 "TBB=-ltbb"
bd5b5ac0 2972 "MY_METIS_LIB=-lmetis"
2742f87e
RW
2973 (string-append "INSTALL_LIB="
2974 (assoc-ref %outputs "out") "/lib")
2975 (string-append "INSTALL_INCLUDE="
bd5b5ac0
EB
2976 (assoc-ref %outputs "out") "/include")
2977 "library")
2742f87e 2978 #:phases
2509522c 2979 (modify-phases %standard-phases
bd5b5ac0 2980 (delete 'configure)))) ;no configure script
2742f87e
RW
2981 (inputs
2982 `(("tbb" ,tbb)
bd5b5ac0
EB
2983 ("lapack" ,lapack)
2984 ("metis" ,metis)))
2742f87e
RW
2985 (home-page "http://faculty.cse.tamu.edu/davis/suitesparse.html")
2986 (synopsis "Suite of sparse matrix software")
2987 (description
2988 "SuiteSparse is a suite of sparse matrix algorithms, including: UMFPACK,
2989multifrontal LU factorization; CHOLMOD, supernodal Cholesky; SPQR,
2990multifrontal QR; KLU and BTF, sparse LU factorization, well-suited for circuit
2991simulation; ordering methods (AMD, CAMD, COLAMD, and CCOLAMD); CSparse and
2992CXSparse, a concise sparse Cholesky factorization package; and many other
2993packages.")
2994 ;; LGPLv2.1+:
2995 ;; AMD, CAMD, BTF, COLAMD, CCOLAMD, CSparse, CXSparse, KLU, LDL
2996 ;; GPLv2+:
2997 ;; GPUQREngine, RBio, SuiteSparse_GPURuntime, SuiteSparseQR, UMFPACK
2998 (license (list license:gpl2+ license:lgpl2.1+))))
2999
ec322be2
FB
3000(define-public atlas
3001 (package
3002 (name "atlas")
3c98ac02 3003 (version "3.10.3")
ec322be2
FB
3004 (source (origin
3005 (method url-fetch)
de67e922
LF
3006 (uri (string-append "mirror://sourceforge/math-atlas/Stable/"
3007 version "/atlas" version ".tar.bz2"))
ec322be2
FB
3008 (sha256
3009 (base32
3c98ac02 3010 "1dyjlq3fiparvm8ypwk6rsmjzmnwk81l88gkishphpvc79ryp216"))))
ec322be2
FB
3011 (build-system gnu-build-system)
3012 (home-page "http://math-atlas.sourceforge.net/")
19afbea1 3013 (inputs `(("gfortran" ,gfortran)
ec322be2
FB
3014 ("lapack-tar" ,(package-source lapack))))
3015 (outputs '("out" "doc"))
01480b9e
FB
3016 ;; For the moment we drop support for MIPS at it fails to compile. See
3017 ;; https://lists.gnu.org/archive/html/guix-devel/2014-11/msg00516.html
3018 (supported-systems (delete "mips64el-linux" %supported-systems))
ec322be2
FB
3019 (arguments
3020 `(#:parallel-build? #f
3021 #:parallel-tests? #f
f15615b1
LC
3022
3023 ;; ATLAS tunes itself for the machine it is built on, as explained at
3024 ;; <http://lists.gnu.org/archive/html/guix-devel/2014-10/msg00305.html>.
3025 ;; For this reason, we want users to build it locally instead of using
3026 ;; substitutes.
3027 #:substitutable? #f
3028
ec322be2
FB
3029 #:modules ((srfi srfi-26)
3030 (srfi srfi-1)
3031 (guix build gnu-build-system)
3032 (guix build utils))
40029cbe 3033 #:configure-flags
ec322be2
FB
3034 `(;; Generate position independent code suitable for dynamic libraries
3035 ;; and use WALL timer to get more accurate timing.
3036 "-Fa" "alg" "-fPIC" "-D" "c" "-DWALL"
3037 ;; Set word width.
3038 "-b"
3039 ,,(if (string-match "64" (%current-system))
3040 "64"
3041 "32")
3042 ;; Disable parallel build as it gives errors: atlas_pthread.h is
3043 ;; needed to compile C files before it is generated.
3044 "-Ss" "pmake" "make -j 1"
af89a667
FB
3045 ;; Probe is failing for MIPS. We therefore define the system
3046 ;; architecture explicitly by setting (-A) MACHINETYPE = 49
3047 ;; 'MIPSR1xK' and (-V) ISA = 1 'none'.
3048 ,,@(if (string-prefix? "mips" (%current-system))
3049 (list "-A" "49" "-V" "1")
3050 (list))
ec322be2
FB
3051 ;; Generate shared libraries.
3052 "--shared"
3053 ;; Build a full LAPACK library.
3054 ,(string-append "--with-netlib-lapack-tarfile="
3055 (assoc-ref %build-inputs "lapack-tar")))
3056 #:phases
e5b4b96b
EF
3057 (modify-phases %standard-phases
3058 (add-after 'install 'install-doc
3059 (lambda* (#:key outputs inputs #:allow-other-keys)
3060 (let ((doc (string-append (assoc-ref outputs "doc")
3061 "/share/doc/atlas")))
3062 (mkdir-p doc)
3063 (fold (lambda (file previous)
3064 (and previous (zero? (system* "cp" file doc))))
3065 #t (find-files "../ATLAS/doc" ".*")))))
3066 (add-after 'check 'check-pt
3067 (lambda _ (zero? (system* "make" "ptcheck"))))
3068 ;; Fix files required to run configure.
3069 (add-before 'configure 'fix-/bin/sh
ec322be2
FB
3070 (lambda _
3071 ;; Use `sh', not `/bin/sh'.
3072 (substitute* (find-files "." "Makefile|configure|SpewMakeInc\\.c")
3073 (("/bin/sh")
e5b4b96b
EF
3074 "sh"))))
3075 ;; Fix /bin/sh in generated make files.
3076 (add-after 'configure 'fix-/bin/sh-in-generated-files
3077 (lambda _
3078 (substitute* (find-files "." "^[Mm]ake\\.inc.*")
3079 (("/bin/sh")
3080 "sh"))))
3081 ;; ATLAS configure program does not accepts the default flags
3082 ;; passed by the 'gnu-build-system'.
3083 (replace 'configure
3084 (lambda* (#:key native-inputs inputs outputs
3085 (configure-flags '())
3086 #:allow-other-keys #:rest args)
3087 (let* ((prefix (assoc-ref outputs "out"))
3088 (bash (or (and=> (assoc-ref
3089 (or native-inputs inputs) "bash")
3090 (cut string-append <> "/bin/bash"))
3091 "/bin/sh"))
3092 (flags `(,(string-append "--prefix=" prefix)
3093 ,@configure-flags))
3094 (abs-srcdir (getcwd))
3095 (srcdir (string-append "../" (basename abs-srcdir))))
3096 (format #t "source directory: ~s (relative from build: ~s)~%"
3097 abs-srcdir srcdir)
3098 (mkdir "../build")
3099 (chdir "../build")
3100 (format #t "build directory: ~s~%" (getcwd))
3101 (format #t "configure flags: ~s~%" flags)
3102 (zero? (apply system* bash
3103 (string-append srcdir "/configure")
3104 flags))))))))
ec322be2
FB
3105 (synopsis "Automatically Tuned Linear Algebra Software")
3106 (description
3107 "ATLAS is an automatically tuned linear algebra software library
3108providing C and Fortran77 interfaces to a portably efficient BLAS
3109implementation, as well as a few routines from LAPACK.
3110
f15615b1
LC
3111Optimization occurs at build time. For this reason, the library is built on
3112the machine where it is installed, without resorting to pre-built substitutes.
ec322be2 3113
f15615b1 3114Before building the library, CPU throttling should be disabled. This can be
d97c429a 3115done in the BIOS, or, on GNU/Linux, with the following command:
ec322be2 3116
8e9ba611 3117@example
d97c429a 3118# cpupower --governor performance
8e9ba611 3119@end example
ec322be2 3120
d97c429a 3121Failure to do so will result in a library with poor performance.")
ec322be2 3122 (license license:bsd-3)))
c12efc72
AE
3123
3124(define-public glm
3125 (package
3126 (name "glm")
3127 (version "0.9.6.3")
3128 (source
3129 (origin
3130 (method url-fetch)
de67e922
LF
3131 (uri (string-append "mirror://sourceforge/ogl-math/glm-" version
3132 "/glm-" version ".zip"))
c12efc72
AE
3133 (sha256
3134 (base32
3135 "1cnjmi033a16a95v6xfkr1bvfmkd26hzdjka8j1819hgn5b1nr8l"))))
3136 (build-system cmake-build-system)
3137 (native-inputs
3138 `(("unzip" ,unzip)))
3139 (home-page "http://glm.g-truc.net")
3140 (synopsis "OpenGL Mathematics library")
3141 (description "OpenGL Mathematics (GLM) is a header-only C++ mathematics
3142library for graphics software based on the OpenGL Shading Language (GLSL)
3143specifications.")
3144 (license license:expat)))
7f18257b
AE
3145
3146(define-public lpsolve
3147 (package
3148 (name "lpsolve")
a89e0cf5 3149 (version "5.5.2.5")
7f18257b
AE
3150 (source
3151 (origin
3152 (method url-fetch)
3153 (uri (string-append "mirror://sourceforge/lpsolve/lpsolve/" version
3154 "/lp_solve_" version "_source.tar.gz"))
3155 (sha256
3156 (base32
a89e0cf5 3157 "12pj1idjz31r7c2mb5w03vy1cmvycvbkx9z29s40qdmkp1i7q6i0"))
7f18257b
AE
3158 (modules '((guix build utils)))
3159 (snippet
3160 '(substitute* (list "lp_solve/ccc" "lpsolve55/ccc")
3161 (("^c=cc") "c=gcc")
3162 ;; Pretend to be on a 64 bit platform to obtain a common directory
3163 ;; name for the build results on all architectures; nothing else
3164 ;; seems to depend on it.
5dbfbef7
LC
3165 (("^PLATFORM=.*$") "PLATFORM=ux64\n")
3166
3167 ;; The check for 'isnan' as it is written fails with
3168 ;; "non-floating-point argument in call to function
3169 ;; ‘__builtin_isnan’", which leads to the 'NOISNAN' cpp macro
3170 ;; definition, which in turn leads to bad things. Fix the feature
3171 ;; test.
3172 (("isnan\\(0\\)") "isnan(0.)")))))
7f18257b
AE
3173 (build-system gnu-build-system)
3174 (arguments
6c96b545 3175 `(#:tests? #f ; no check target
7f18257b
AE
3176 #:phases
3177 (modify-phases %standard-phases
6c96b545 3178 (delete 'configure) ; no configure script
7f18257b
AE
3179 (replace 'build
3180 (lambda _
6c96b545
TGR
3181 (with-directory-excursion "lpsolve55"
3182 (invoke "bash" "ccc"))
3183 (with-directory-excursion "lp_solve"
3184 (invoke "bash" "ccc"))
3185 #t))
7f18257b
AE
3186 (replace 'install
3187 (lambda* (#:key outputs #:allow-other-keys)
3188 (let* ((out (assoc-ref outputs "out"))
3189 (bin (string-append out "/bin"))
3190 (lib (string-append out "/lib"))
3191 ;; This is where LibreOffice expects to find the header
3192 ;; files, and where they are installed by Debian.
3193 (include (string-append out "/include/lpsolve")))
6c96b545
TGR
3194 (install-file "lpsolve55/bin/ux64/liblpsolve55.a" lib)
3195 (install-file "lpsolve55/bin/ux64/liblpsolve55.so" lib)
96c46210
LC
3196 (install-file "lp_solve/bin/ux64/lp_solve" bin)
3197
7f18257b
AE
3198 ;; Install a subset of the header files as on Debian
3199 ;; (plus lp_bit.h, which matches the regular expression).
96c46210
LC
3200 (for-each (lambda (name)
3201 (install-file name include))
3202 (find-files "." "lp_[HMSa-z].*\\.h$"))
7f18257b 3203 (with-directory-excursion "shared"
96c46210
LC
3204 (for-each (lambda (name)
3205 (install-file name include))
3206 (find-files "." "\\.h$")))
7f18257b
AE
3207 #t))))))
3208 (home-page "http://lpsolve.sourceforge.net/")
3209 (synopsis "Mixed integer linear programming (MILP) solver")
3210 (description
3211 "lp_solve is a mixed integer linear programming solver based on the
3212revised simplex and the branch-and-bound methods.")
3213 (license license:lgpl2.1+)))
a17d4564
EB
3214
3215(define-public dealii
3216 (package
3217 (name "dealii")
24404eaf 3218 (version "8.5.1")
a17d4564
EB
3219 (source
3220 (origin
3221 (method url-fetch)
3222 (uri (string-append "https://github.com/dealii/dealii/releases/"
3223 "download/v" version "/dealii-" version ".tar.gz"))
3224 (sha256
3225 (base32
24404eaf 3226 "1bh9rsmkrg0zi70n27b11djmac9lximghsiy7mg7w7x544n82gnk"))
a17d4564
EB
3227 (modules '((guix build utils)))
3228 (snippet
3229 ;; Remove bundled sources: UMFPACK, TBB, muParser, and boost
3230 '(delete-file-recursively "bundled"))))
3231 (build-system cmake-build-system)
3232 (inputs
3233 `(("tbb" ,tbb)
3234 ("zlib" ,zlib)
3235 ("boost" ,boost)
3236 ("p4est" ,p4est)
3237 ("blas" ,openblas)
3238 ("lapack" ,lapack)
3239 ("arpack" ,arpack-ng)
3240 ("muparser" ,muparser)
3241 ("gfortran" ,gfortran)
3242 ("suitesparse" ,suitesparse))) ;for UMFPACK
3243 (arguments
3244 `(#:build-type "DebugRelease" ;only supports Release, Debug, or DebugRelease
d84b09e9
EB
3245 #:configure-flags
3246 ;; Work around a bug in libsuitesparseconfig linking
3247 ;; see https://github.com/dealii/dealii/issues/4745
3248 '("-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON")))
a17d4564
EB
3249 (home-page "https://www.dealii.org")
3250 (synopsis "Finite element library")
3251 (description
3252 "Deal.II is a C++ program library targeted at the computational solution
3253of partial differential equations using adaptive finite elements. The main
3254aim of deal.II is to enable rapid development of modern finite element codes,
3255using among other aspects adaptive meshes and a wide array of tools often used
3256in finite element programs.")
3257 (license license:lgpl2.1+)))
3258
3259(define-public dealii-openmpi
3260 (package (inherit dealii)
3261 (name "dealii-openmpi")
3262 (inputs
3263 `(("mpi" ,openmpi)
3264 ;;Supported only with MPI:
3265 ("p4est" ,p4est-openmpi)
3266 ("petsc" ,petsc-openmpi)
3267 ("slepc" ,slepc-openmpi)
3268 ("metis" ,metis) ;for MUMPS
3269 ("scalapack" ,scalapack) ;for MUMPS
3270 ("mumps" ,mumps-metis-openmpi) ;configure supports only metis orderings
3271 ("arpack" ,arpack-ng-openmpi)
3272 ,@(fold alist-delete (package-inputs dealii)
3273 '("p4est" "arpack"))))
3274 (arguments
3275 (substitute-keyword-arguments (package-arguments dealii)
3276 ((#:configure-flags cf)
3277 ``("-DMPI_C_COMPILER=mpicc"
3278 "-DMPI_CXX_COMPILER=mpicxx"
3279 "-DMPI_Fortran_COMPILER=mpifort"
3280 ,@,cf))))
3281 (synopsis "Finite element library (with MPI support)")))
194c7f95
AE
3282
3283(define-public flann
3284 (package
3285 (name "flann")
3286 (version "1.8.4")
3287 (source
3288 (origin
3289 (method url-fetch)
3290 (uri
3291 (string-append
3292 "http://www.cs.ubc.ca/research/flann/uploads/FLANN/flann-"
3293 version "-src.zip"))
3294 (sha256
3295 (base32
3296 "022w8hph7bli5zbpnk3z1qh1c2sl5hm8fw2ccim651ynn0hr7fyz"))))
3297 (build-system cmake-build-system)
6b6aca9b
LC
3298 (outputs '("out"
3299 "octave")) ;46 MiB .mex file that pulls Octave
194c7f95
AE
3300 (native-inputs
3301 `(("unzip" ,unzip)))
3302 (inputs
3303 `(("hdf5" ,hdf5)
3304 ("octave" ,octave)
3305 ("python" ,python-2) ; print syntax
3306 ;; ("python2-numpy" ,python2-numpy) ; only required for the tests
3307 ("zlib" ,zlib)))
3308 (arguments
39b30337
LC
3309 `(;; The 'share/flann/octave' contains a .mex file, which is an ELF file
3310 ;; taken 46 MiB unstripped, and 6 MiB stripped.
3311 #:strip-directories '("lib" "lib64" "libexec"
3312 "bin" "sbin" "share/flann/octave")
3313
9684e30b
LC
3314 ;; Save 12 MiB by not installing .a files. Passing
3315 ;; '-DBUILD_STATIC_LIBS=OFF' has no effect.
3316 #:phases (modify-phases %standard-phases
6b6aca9b
LC
3317 (add-before 'configure 'set-octave-directory
3318 (lambda* (#:key outputs #:allow-other-keys)
3319 ;; Install the .mex file in the "octave" output.
3320 (let ((out (assoc-ref outputs "octave")))
3321 (substitute* "src/matlab/CMakeLists.txt"
3322 (("share/flann/octave")
3323 (string-append out "/share/flann/octave")))
3324 #t)))
9684e30b
LC
3325 (add-after 'install 'remove-static-libraries
3326 (lambda* (#:key outputs #:allow-other-keys)
3327 (let* ((out (assoc-ref outputs "out"))
3328 (lib (string-append out "/lib")))
3329 (for-each delete-file
3330 (find-files lib "\\.a$"))
3331 #t))))
3332
39b30337 3333 #:tests? #f)) ; The test data are downloaded from the Internet.
194c7f95
AE
3334 (home-page "http://www.cs.ubc.ca/research/flann/")
3335 (synopsis "Library for approximate nearest neighbors computation")
3336 (description "FLANN is a library for performing fast approximate
3337nearest neighbor searches in high dimensional spaces. It implements a
3338collection of algorithms and a system for automatically choosing the best
3339algorithm and optimum parameters depending on the dataset.
3340
3341FLANN is written in C++ and contains bindings for C, Octave and Python.")
3342 (license (license:non-copyleft "file://COPYING"
3343 "See COPYING in the distribution."))))
d8c97beb
EF
3344
3345(define-public wcalc
3346 (package
3347 (name "wcalc")
3348 (version "2.5")
3349 (source
3350 (origin
3351 (method url-fetch)
de67e922
LF
3352 (uri (string-append "mirror://sourceforge/w-calc/Wcalc/" version "/"
3353 "wcalc-" version ".tar.bz2"))
d8c97beb
EF
3354 (sha256
3355 (base32
3356 "1vi8dl6rccqiq1apmpwawyg2ywx6a1ic1d3cvkf2hlwk1z11fb0f"))))
3357 (build-system gnu-build-system)
3358 (inputs
3359 `(("mpfr" ,mpfr)
3360 ("readline" ,readline)))
3361 (home-page "http://w-calc.sourceforge.net/index.php")
3362 (synopsis "Flexible command-line scientific calculator")
3363 (description "Wcalc is a very capable calculator. It has standard functions
3364(sin, asin, and sinh for example, in either radians or degrees), many
3365pre-defined constants (pi, e, c, etc.), support for using variables, \"active\"
3366variables, a command history, hex/octal/binary input and output, unit
3367conversions, embedded comments, and an expandable expression entry field. It
3368evaluates expressions using the standard order of operations.")
3369 (license license:gpl2+)))
45147b0c
FH
3370
3371(define-public xaos
3372 (package
3373 (name "xaos")
3374 (version "3.6")
3375 (source (origin
3376 (method url-fetch)
de67e922
LF
3377 (uri (string-append "mirror://sourceforge/xaos/XaoS/" version
3378 "/xaos-" version ".tar.gz"))
45147b0c
FH
3379 (sha256
3380 (base32
3381 "15cd1cx1dyygw6g2nhjqq3bsfdj8sj8m4va9n75i0f3ryww3x7wq"))))
3382 (build-system gnu-build-system)
b94a6ca0 3383 (native-inputs `(("gettext" ,gettext-minimal)))
45147b0c
FH
3384 (inputs `(("libx11" ,libx11)
3385 ("zlib" ,zlib)
3386 ("libpng" ,libpng)
3387 ("gsl" ,gsl)))
3388 (arguments
3389 `(#:tests? #f ;no "check" target
3390 #:make-flags '("LOCALEDIR=$DATAROOTDIR/locale")))
3391 (synopsis "Real-time fractal zoomer")
3392 (description "GNU XaoS is a graphical program that generates fractal
3393patterns and allows you to zoom in and out of them infinitely in a fluid,
3394continuous manner. It also includes tutorials that help to explain how fractals
3395are built. It can generate many different fractal types such as the Mandelbrot
3396set.")
6fd52309 3397 (home-page "https://www.gnu.org/software/xaos/")
45147b0c 3398 (license license:gpl2+)))
528bb464
EB
3399
3400(define-public hypre
3401 (package
3402 (name "hypre")
3403 (version "2.11.0")
3404 (source (origin
3405 (method url-fetch)
3406 (uri (string-append "https://github.com/LLNL/hypre/archive/"
3407 "v" version ".tar.gz"))
3408 (file-name (string-append name "-" version ".tar.gz"))
3409 (sha256
3410 (base32
3411 "0q69ia0jivzcr8p049dn3mg8yjpn6nwq4sw9iqac8vr63vi54l6m"))
3412 (modules '((guix build utils)))
3413 (snippet
3414 '(begin
3415 ;; Remove use of __DATE__ and __TIME__ for reproducibility;
3416 ;; substitute the tarball creation time.
3417 (substitute* "src/utilities/HYPRE_utilities.h"
3418 (("Date Compiled: .*$")
3419 "Date Compiled: Mar 28 2016 20:19:59 +0000\"\n"))
3420 #t))))
3421 (build-system gnu-build-system)
3422 (outputs '("out" ;6.1 MiB of headers and libraries
3423 "doc")) ;4.8 MiB of documentation
3424 (native-inputs
3425 `(("doc++" ,doc++)
3426 ("netpbm" ,netpbm)
3427 ("texlive" ,texlive) ;full package required for fonts
3428 ("ghostscript" ,ghostscript)))
3429 (inputs
3430 `(("blas" ,openblas)
3431 ("lapack" ,lapack)))
3432 (arguments
3433 `(#:modules ((srfi srfi-1)
3434 ,@%gnu-build-system-modules)
3435 #:configure-flags '("--enable-shared"
3436 "--disable-fortran"
3437 "--without-MPI"
3438 "--with-openmp"
3439 "--with-fei"
3440 "--with-lapack"
3441 "--with-blas")
3442 #:phases
3443 (modify-phases %standard-phases
3444 (add-before 'configure 'chdir-src
3445 (lambda _ (chdir "src")))
3446 (replace 'configure
3447 (lambda* (#:key build target configure-flags
3448 #:allow-other-keys #:rest args)
3449 (let* ((configure (assoc-ref %standard-phases 'configure)))
3450 (apply configure
3451 (append args
3452 (list #:configure-flags
3453 (cons (string-append
3454 "--host=" (or target build))
3455 configure-flags)))))))
3456 (add-after 'build 'build-docs
3457 (lambda _
3458 (zero? (system* "make" "-Cdocs" "pdf" "html"))))
3459 (replace 'check
3460 (lambda _
3461 (setenv "LD_LIBRARY_PATH" (string-append (getcwd) "/hypre/lib"))
3462 (setenv "PATH" (string-append "." ":" (getenv "PATH")))
3463 (and (system* "make" "check" "CHECKRUN=")
3464 (fold (lambda (filename result)
3465 (and result
3466 (let ((size (stat:size (stat filename))))
3467 (when (not (zero? size))
3468 (format #t "~a size ~d; error indication~%"
3469 filename size))
3470 (zero? size))))
3471 #t
3472 (find-files "test" ".*\\.err$")))))
3473 (add-after 'install 'install-docs
3474 (lambda* (#:key outputs #:allow-other-keys)
3475 ;; Custom install because docs/Makefile doesn't honor ${docdir}.
3476 (let* ((doc (assoc-ref outputs "doc"))
3477 (docdir (string-append doc "/share/doc/hypre-" ,version)))
528bb464
EB
3478 (with-directory-excursion "docs"
3479 (for-each (lambda (base)
3480 (install-file (string-append base ".pdf") docdir)
3481 (copy-recursively base docdir)) ;html docs
3482 '("HYPRE_usr_manual"
3483 "HYPRE_ref_manual")))
3484 #t))))))
3485 (home-page "http://www.llnl.gov/casc/hypre/")
3486 (synopsis "Library of solvers and preconditioners for linear equations")
3487 (description
3488 "HYPRE is a software library of high performance preconditioners and
3489solvers for the solution of large, sparse linear systems of equations. It
3490features multigrid solvers for both structured and unstructured grid
3491problems.")
3492 (license license:lgpl2.1)))
3493
3494(define-public hypre-openmpi
3495 (package (inherit hypre)
3496 (name "hypre-openmpi")
3497 (inputs
3498 `(("mpi" ,openmpi)
3499 ,@(package-inputs hypre)))
3500 (arguments
3501 (substitute-keyword-arguments (package-arguments hypre)
3502 ((#:configure-flags flags)
3503 ``("--with-MPI"
3504 ,@(delete "--without-MPI" ,flags)))))
3505 (synopsis "Parallel solvers and preconditioners for linear equations")
3506 (description
3507 "HYPRE is a software library of high performance preconditioners and
3508solvers for the solution of large, sparse linear systems of equations on
3509parallel computers. It features parallel multigrid solvers for both
3510structured and unstructured grid problems.")))
6c90e183
EB
3511
3512(define-public matio
3513 (package
3514 (name "matio")
3515 (version "1.5.6")
3516 (source
3517 (origin
3518 (method url-fetch)
de67e922 3519 (uri (string-append "mirror://sourceforge/matio/matio/" version "/"
6c90e183
EB
3520 "matio-" version ".tar.gz"))
3521 (sha256
3522 (base32
3523 "0y2qymgxank8wdiwc68ap8bxdzrhvyw86i29yh3xgn4z1njfd9ir"))))
3524 (build-system gnu-build-system)
3525 (inputs
3526 `(("zlib" ,zlib)
3527 ("hdf5" ,hdf5)))
3528 (home-page "http://matio.sourceforge.net/")
3529 (synopsis "Library for reading and writing MAT files")
3530 (description "Matio is a library for reading and writing MAT files. It
3531supports compressed MAT files, as well as newer (version 7.3) MAT files.")
3532 (license license:bsd-2)))
d721c83a 3533
517318ad
LF
3534(define-public vc
3535 (package
3536 (name "vc")
853b0292 3537 (version "1.3.3")
517318ad
LF
3538 (source
3539 (origin (method url-fetch)
3540 (uri (string-append "https://github.com/VcDevel/Vc/releases/"
3541 "download/" version "/Vc-" version ".tar.gz"))
3542 (sha256
3543 (base32
853b0292 3544 "1zmlpn32jzb38smp3j834llmbix3whsrbw0h397qxysbw792kih8"))))
517318ad
LF
3545 (build-system cmake-build-system)
3546 (arguments
3547 '(#:configure-flags
33d82486
MB
3548 '("-DBUILD_TESTING=ON"
3549 ;; By default, Vc will optimize for the CPU of the build machine.
3550 ;; Setting this to "none" makes it create portable binaries. See
3551 ;; "cmake/OptimizeForArchitecture.cmake".
3552 "-DTARGET_ARCHITECTURE=none")))
517318ad
LF
3553 (synopsis "SIMD vector classes for C++")
3554 (description "Vc provides portable, zero-overhead C++ types for explicitly
3555data-parallel programming. It is a library designed to ease explicit
3556vectorization of C++ code. Its types enable explicitly stating data-parallel
3557operations on multiple values. The parallelism is therefore added via the type
3558system. Vc has an intuitive API and provides portability between different
3559compilers and compiler versions as well as portability between different vector
3560instruction sets. Thus, an application written with Vc can be compiled for:
3561@enumerate
3562@item AVX and AVX2
d1e4ad1b 3563@item SSE2 up to SSE4.2 or SSE4a
517318ad
LF
3564@item Scalar
3565@item MIC
3566@item NEON (in development)
3567@item NVIDIA GPUs / CUDA (in development)
3568@end enumerate\n")
3569 (home-page "https://github.com/VcDevel/Vc")
a8ead6f9
EF
3570 ;; "No support_???.cpp file exists for this architecture."
3571 (supported-systems '("x86_64-linux" "i686-linux"))
517318ad 3572 (license license:bsd-3)))
54052a54 3573
3574(define-public reducelcs
3575 ;; This is the last commit which is available upstream, no
3576 ;; release happened since 2010.
3577 (let ((commit "474f88deb968061abe8cf11c959e02319b8ae5c0")
3578 (revision "1"))
3579 (package
3580 (name "reducelcs")
3581 (version (string-append "1.0-" revision "." (string-take commit 7)))
3582 (source
3583 (origin
3584 (method git-fetch)
3585 (uri (git-reference
3586 (url "https://github.com/gdv/Reduce-Expand-for-LCS")
3587 (commit commit)))
3588 (file-name (string-append name "-" version "-checkout"))
3589 (sha256
3590 (base32
3591 "1rllzcfwc042c336mhq262a8ha90x6afq30kvk60r7i4761j4yjm"))))
3592 (build-system gnu-build-system)
3593 (inputs
3594 `(("openlibm" ,openlibm)))
3595 (arguments
3596 `(#:tests? #f ; no tests
3597 #:phases
3598 (modify-phases %standard-phases
3599 (delete 'configure) ; No configure script exists.
3600 (replace 'install ; No install phase exists.
3601 (lambda* (#:key outputs #:allow-other-keys)
3602 (let* ((out (assoc-ref outputs "out"))
3603 (bin (string-append out "/bin")))
3604 (install-file "Approximation" bin)
3605 (install-file "CollectResults" bin)
3606 (install-file "GenerateInstances" bin)
3607 #t))))))
3608 (synopsis "Approximate Longest Commons Subsequence computation tool")
3609 (description
3610 "@code{reduceLCS} is an implementation of the Reduce-Expand
3611algorithm for LCS. It is a fast program to compute the approximate
3612Longest Commons Subsequence of a set of strings.")
3613 (home-page "https://github.com/gdv/Reduce-Expand-for-LCS")
c000b6b1 3614 (license license:gpl3+))))
479c4273
JD
3615
3616(define-public jacal
3617 (package
3618 (name "jacal")
3619 (version "1c4")
3620 (source (origin
3621 (method url-fetch)
3622 (uri (string-append
3623 "http://groups.csail.mit.edu/mac/ftpdir/scm/jacal-"
3624 version ".zip"))
3625 (sha256 (base32
3626 "055zrn12a1dmy0dqkwrkq3fklbhg3yir6vn0lacp4mvbg8573a3q"))
3627 (patches (search-patches "jacal-fix-texinfo.patch"))))
3628 (build-system gnu-build-system)
3629 (arguments
3630 `(#:phases
3631 (modify-phases %standard-phases
3632 (add-before 'build 'pre-build
3633 ;; Don't use upstream's script - it really doesn't fit into
3634 ;; Guix's functional paradigm.
3635 (lambda* (#:key inputs outputs #:allow-other-keys)
3636 (substitute* "Makefile"
3637 (("^install: install-script") "install: "))))
3638 (add-after 'install 'post-install
3639 ;; Instead, we provide our own simplified script.
3640 (lambda* (#:key inputs outputs #:allow-other-keys)
3641 (let ((wrapper (string-append (assoc-ref outputs "out")
3642 "/bin/jacal")))
3643 (format (open wrapper (logior O_WRONLY O_CREAT))
3644 (string-append "#!~a\nexec ~a/bin/scm -ip1 "
3645 "-e '(slib:load \"~a/lib/jacal/math\") "
3646 "(math)' \"$@\"\n")
3647 (which "bash")
3648 (assoc-ref inputs "scm")
3649 (assoc-ref outputs "out"))
3650 (chmod wrapper #o555))))
3651 (replace 'configure
3652 (lambda* (#:key inputs outputs #:allow-other-keys)
3653 (zero? (system* "./configure"
3654 (string-append "--prefix="
3655 (assoc-ref outputs "out")))))))))
3656 (inputs `(("scm" ,scm)))
3657 (native-inputs `(("unzip" ,unzip)
3658 ("texinfo" ,texinfo)))
3659 (synopsis "Symbolic mathematics system")
3660 (description "GNU JACAL is an interactive symbolic mathematics program based on
3661Scheme. It manipulate and simplify a range of mathematical expressions such
3662as equations, scalars, vectors, and matrices.")
6fd52309 3663 (home-page "https://www.gnu.org/software/jacal/")
479c4273
JD
3664 (license license:gpl3+)))
3665
313844d9
TF
3666(define-public z3
3667 (package
3668 (name "z3")
3669 (version "4.5.0")
3670 (source (origin
3671 (method url-fetch)
3672 (uri (string-append
3673 "https://github.com/Z3Prover/z3/archive/z3-"
3674 version ".tar.gz"))
3675 (sha256
3676 (base32
3677 "032a5lvji2liwmc25jv52bdrhimqflvqbpg77ccaq1jykhiivbmf"))))
cf684d87 3678 (build-system cmake-build-system)
313844d9 3679 (arguments
cf684d87
TF
3680 `(#:configure-flags
3681 (list "-DBUILD_PYTHON_BINDINGS=true"
3682 "-DINSTALL_PYTHON_BINDINGS=true"
3683 (string-append "-DCMAKE_INSTALL_PYTHON_PKG_DIR="
3684 %output
677bc34d 3685 "/lib/python2.7/site-packages"))
313844d9
TF
3686 #:phases
3687 (modify-phases %standard-phases
cf684d87
TF
3688 (add-before 'configure 'bootstrap
3689 (lambda _
313844d9 3690 (zero?
cf684d87
TF
3691 (system* "python" "contrib/cmake/bootstrap.py" "create"))))
3692 (add-before 'check 'make-test-z3
313844d9 3693 (lambda _
cf684d87
TF
3694 ;; Build the test suite executable.
3695 (zero? (system* "make" "test-z3" "-j"
3696 (number->string (parallel-job-count))))))
3697 (replace 'check
3698 (lambda _
3699 ;; Run all the tests that don't require arguments.
3700 (zero? (system* "./test-z3" "/a")))))))
313844d9
TF
3701 (native-inputs
3702 `(("python" ,python-2)))
3703 (synopsis "Theorem prover")
3704 (description "Z3 is a theorem prover and @dfn{satisfiability modulo
cf684d87 3705theories} (SMT) solver. It provides a C/C++ API, as well as Python bindings.")
313844d9
TF
3706 (home-page "https://github.com/Z3Prover/z3")
3707 (license license:expat)))
3d5d87a3
JL
3708
3709(define-public cubicle
3710 (package
3711 (name "cubicle")
3712 (version "1.1.1")
3713 (source (origin
3714 (method url-fetch)
3715 (uri (string-append "http://cubicle.lri.fr/cubicle-"
3716 version ".tar.gz"))
3717 (sha256
3718 (base32
3719 "1sny9c4fm14k014pk62ibpwbrjjirkx8xmhs9jg7q1hk7y7x3q2h"))))
3720 (build-system gnu-build-system)
3721 (native-inputs
3722 `(("ocaml" ,ocaml)
83fef82b 3723 ("which" ,(@@ (gnu packages base) which))))
3d5d87a3
JL
3724 (propagated-inputs
3725 `(("z3" ,z3)))
3726 (arguments
3727 `(#:configure-flags (list "--with-z3")
3728 #:tests? #f
3729 #:phases
3730 (modify-phases %standard-phases
3731 (add-before 'configure 'configure-for-release
3732 (lambda _
3733 (substitute* "Makefile.in"
3734 (("SVNREV=") "#SVNREV="))))
3735 (add-before 'configure 'fix-/bin/sh
3736 (lambda _
3737 (substitute* "configure"
3738 (("/bin/sh") (which "sh")))))
3739 (add-before 'configure 'fix-smt-z3wrapper.ml
3740 (lambda _
3741 (substitute* "Makefile.in"
3742 (("\\\\n") "")))))))
3743 (home-page "http://cubicle.lri.fr/")
3744 (synopsis "Model checker for array-based systems")
5a80c15c
RW
3745 (description "Cubicle is a model checker for verifying safety properties
3746of array-based systems. This is a syntactically restricted class of
3747parametrized transition systems with states represented as arrays indexed by
3748an arbitrary number of processes. Cache coherence protocols and mutual
3749exclusion algorithms are typical examples of such systems.")
3d5d87a3 3750 (license license:asl2.0)))
e01397b4
EB
3751
3752(define-public elemental
3753 (package
3754 (name "elemental")
3755 (version "0.87.7")
3756 (source (origin
3757 (method url-fetch)
3758 (uri (string-append "https://github.com/elemental/Elemental/"
3759 "archive/v" version ".tar.gz"))
3760 (file-name (string-append name "-" version ".tar.gz"))
3761 (sha256
3762 (base32
3763 "1nfp82w22pi8x8fg9sc37z8kf84dqi1dhxp8bbk7571y4aygvv3v"))))
3764 (build-system cmake-build-system)
3765 (home-page "http://libelemental.org")
3766 (native-inputs
3767 `(("gfortran" ,gfortran)))
3768 (inputs
3769 `(("blas" ,openblas)
3770 ("gfortran:lib" ,gfortran "lib")
3771 ("gmp" ,gmp)
3772 ("lapack" ,lapack)
3773 ("metis" ,metis)
3774 ("mpc" ,mpc)
3775 ("mpfr" ,mpfr)
3776 ("mpi" ,openmpi)
3777 ("qd" ,qd)))
3778 (arguments
3779 `(#:build-type "Release" ;default RelWithDebInfo not supported
3780 #:configure-flags `("-DEL_DISABLE_PARMETIS:BOOL=YES"
3781 "-DEL_AVOID_COMPLEX_MPI:BOOL=NO"
3782 "-DEL_CACHE_WARNINGS:BOOL=YES"
3783 "-DEL_TESTS:BOOL=YES"
3784 "-DCMAKE_INSTALL_LIBDIR=lib"
3785 "-DGFORTRAN_LIB=gfortran")
3786 #:phases (modify-phases %standard-phases
3787 (add-before 'check 'setup-tests
3788 (lambda _
3789 ;; Parallelism is done at the MPI layer.
3790 (setenv "OMP_NUM_THREADS" "1")
3791 #t))
3792 (add-after 'install 'remove-tests
3793 (lambda* (#:key outputs #:allow-other-keys)
3794 ;; Tests are installed, with no easy configuration
3795 ;; switch to prevent this, so delete them.
3796 (delete-file-recursively
3797 (string-append (assoc-ref outputs "out") "/bin"))
3798 #t)))))
3799 (synopsis "Dense and sparse-direct linear algebra and optimization")
3800 (description "Elemental is a modern C++ library for distributed-memory
3801dense and sparse-direct linear algebra, conic optimization, and lattice
3802reduction.")
3803 (license license:bsd-2)))
5b05dce7
JN
3804
3805(define-public mcrl2
3806 (package
3807 (name "mcrl2")
3808 (version "201707.1.15162")
3809 (source (origin
3810 (method url-fetch)
3811 (uri (string-append "http://www.mcrl2.org/download/devel/mcrl2-"
3812 version
3813 ".tar.gz"))
3814 (sha256
3815 (base32
3816 "1ziww2fchsklm25hl9p2mngssxfh9w07nc114cncqaxfibqp2p8f"))))
3817 (native-inputs
3818 `(("subversion" ,subversion)))
3819 (inputs
3820 `(("boost" ,boost)
3821 ("glu" ,glu)
3822 ("mesa" ,mesa)
3823 ("qt" ,qt)))
3824 (build-system cmake-build-system)
ed0c5d3c 3825 (synopsis "Toolset for the mCRL2 formal specification language")
5b05dce7 3826 (description
ed0c5d3c
TGR
3827 "@dfn{mCRL2} (micro Common Representation Language 2) is a formal
3828specification language for describing concurrent discrete event systems. Its
3829toolset supports analysis and automatic verification, linearisation, simulation,
3830state-space exploration and generation, and tools to optimise and analyse
5b05dce7
JN
3831specifications. Also, state spaces can be manipulated, visualised and
3832analysed.")
3833 (home-page "http://mcrl2.org")
3834 (license license:boost1.0)))
41835f94
LF
3835
3836(define-public r-subplex
3837 (package
3838 (name "r-subplex")
2bcf5fd3 3839 (version "1.5-4")
41835f94
LF
3840 (source
3841 (origin
3842 (method url-fetch)
3843 (uri (cran-uri "subplex" version))
3844 (sha256
3845 (base32
2bcf5fd3 3846 "10cbgbx1bgsax5z7gz6716g360xpq4mvq19cf4qqrxv02mmwz57z"))))
41835f94
LF
3847 (build-system r-build-system)
3848 (native-inputs
3849 `(("gfortran" ,gfortran)))
3850 (home-page "https://cran.r-project.org/web/packages/subplex")
3851 (synopsis "Unconstrained optimization using the subplex algorithm")
3852 (description "This package implements the Subplex optimization algorithm.
3853It solves unconstrained optimization problems using a simplex method on
3854subspaces. The method is well suited for optimizing objective functions that
3855are noisy or are discontinuous at the solution.")
3856 (license license:gpl3+)))
799ad71b
LF
3857
3858(define-public r-desolve
3859 (package
3860 (name "r-desolve")
3861 (version "1.20")
3862 (source
3863 (origin
3864 (method url-fetch)
3865 (uri (cran-uri "deSolve" version))
3866 (sha256
3867 (base32
3868 "18nx3maww979a8p8ly4hv63y65mnjx8vbj2fpipd6rhcbf1lbsan"))))
3869 (properties `((upstream-name . "deSolve")))
3870 (build-system r-build-system)
3871 (native-inputs
3872 `(("gfortran" ,gfortran)))
3873 (home-page "https://desolve.r-forge.r-project.org/")
3874 (synopsis "Solvers for initial value problems of differential equations")
3875 (description "This package provides functions that solve initial
3876value problems of a system of first-order ordinary differential equations (ODE),
3877of partial differential equations (PDE), of differential algebraic equations
3878(DAE), and of delay differential equations. The functions provide an interface
3879to the FORTRAN functions lsoda, lsodar, lsode, lsodes of the ODEPACK collection,
3880to the FORTRAN functions dvode and daspk and a C-implementation of solvers of
3881the Runge-Kutta family with fixed or variable time steps. The package contains
3882routines designed for solving ODEs resulting from 1-D, 2-D and 3-D partial
3883differential equations (PDE) that have been converted to ODEs by numerical
3884differencing.")
3885 (license license:gpl2+)))
910deec6
NV
3886
3887(define-public tcalc
3888 (package
3889 (name "tcalc")
3890 (version "2.0")
3891 (source
3892 (origin
3893 (method url-fetch)
3894 (uri (string-append "https://sites.google.com/site/mohammedisam2000/tcalc/tcalc-"
3895 version ".tar.gz"))
3896 (sha256
3897 (base32
3898 "0jq806m4dqfia85nppfm75mml9w57g0cgv4cdw9bp3zymda83s0m"))))
3899 (build-system gnu-build-system)
3900 (synopsis "The terminal calculator")
3901 (description
3902 "The terminal calculator is a small program to help users of the GNU/Linux
3903terminal do calculations simply and quickly. The formula to be calculated can
3904be fed to @command{tcalc} through the command line.")
3905 (home-page "https://sites.google.com/site/mohammedisam2000/tcalc")
3906 (license license:gpl3+)))