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