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