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