gnu: wicd: Add template for WPA2-TTLS.
[jackhill/guix/guix.git] / gnu / packages / maths.scm
CommitLineData
8f8b2451 1;;; GNU Guix --- Functional package management for GNU
12ed1216 2;;; Copyright © 2013, 2014, 2015 Andreas Enge <andreas@enge.fr>
da95c817 3;;; Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org>
668c06ac 4;;; Copyright © 2014 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>
865a69dd 8;;; Copyright © 2015 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>
8f8b2451
AE
13;;;
14;;; This file is part of GNU Guix.
15;;;
16;;; GNU Guix is free software; you can redistribute it and/or modify it
17;;; under the terms of the GNU General Public License as published by
18;;; the Free Software Foundation; either version 3 of the License, or (at
19;;; your option) any later version.
20;;;
21;;; GNU Guix is distributed in the hope that it will be useful, but
22;;; WITHOUT ANY WARRANTY; without even the implied warranty of
23;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24;;; GNU General Public License for more details.
25;;;
26;;; You should have received a copy of the GNU General Public License
27;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
28
29(define-module (gnu packages maths)
ec322be2 30 #:use-module (ice-9 regex)
8f8b2451 31 #:use-module (gnu packages)
b5b73a82 32 #:use-module ((guix licenses) #:prefix license:)
8f8b2451
AE
33 #:use-module (guix packages)
34 #:use-module (guix download)
279663ef 35 #:use-module (guix svn-download)
0e2672ae 36 #:use-module (guix utils)
cec86422 37 #:use-module (guix build utils)
da95c817 38 #:use-module (guix build-system cmake)
c9dfa3c7 39 #:use-module (guix build-system gnu)
3de01d3f
EB
40 #:use-module (gnu packages algebra)
41 #:use-module (gnu packages bison)
a17d4564 42 #:use-module (gnu packages boost)
e73b49fb 43 #:use-module (gnu packages check)
3de01d3f 44 #:use-module (gnu packages cmake)
c9dfa3c7 45 #:use-module (gnu packages compression)
668c06ac 46 #:use-module (gnu packages curl)
57e544e8 47 #:use-module (gnu packages elf)
3de01d3f 48 #:use-module (gnu packages flex)
668c06ac 49 #:use-module (gnu packages fltk)
f3929800 50 #:use-module (gnu packages fontutils)
1dba6407 51 #:use-module (gnu packages gettext)
da95c817 52 #:use-module (gnu packages gcc)
73fed4f8 53 #:use-module (gnu packages gd)
668c06ac 54 #:use-module (gnu packages ghostscript)
221ed17a 55 #:use-module (gnu packages glib)
f3929800 56 #:use-module (gnu packages gtk)
45147b0c 57 #:use-module (gnu packages image)
668c06ac 58 #:use-module (gnu packages less)
8731e527 59 #:use-module (gnu packages lisp)
5698b8b8 60 #:use-module (gnu packages gnome)
668c06ac
JD
61 #:use-module (gnu packages xorg)
62 #:use-module (gnu packages gl)
8731e527 63 #:use-module (gnu packages m4)
d8c7eeb9 64 #:use-module (gnu packages mpi)
b92eee75 65 #:use-module (gnu packages multiprecision)
668c06ac 66 #:use-module (gnu packages pcre)
5698b8b8 67 #:use-module (gnu packages popt)
c9dfa3c7
AE
68 #:use-module (gnu packages perl)
69 #:use-module (gnu packages pkg-config)
da95c817 70 #:use-module (gnu packages python)
c9dfa3c7 71 #:use-module (gnu packages readline)
2742f87e 72 #:use-module (gnu packages tbb)
183e44ae 73 #:use-module (gnu packages tcsh)
df354a77 74 #:use-module (gnu packages tcl)
668c06ac 75 #:use-module (gnu packages texinfo)
73fed4f8 76 #:use-module (gnu packages texlive)
9aafbc0c 77 #:use-module (gnu packages wxwidgets)
c12efc72 78 #:use-module (gnu packages xml)
a17d4564
EB
79 #:use-module (gnu packages zip)
80 #:use-module (srfi srfi-1))
8f8b2451
AE
81
82(define-public units
83 (package
84 (name "units")
cbe95057 85 (version "2.12")
8f8b2451
AE
86 (source (origin
87 (method url-fetch)
88 (uri (string-append "mirror://gnu/units/units-" version
89 ".tar.gz"))
90 (sha256 (base32
cbe95057 91 "1jxvjknz2jhq773jrwx9gc1df3gfy73yqmkjkygqxzpi318yls3q"))))
8f8b2451
AE
92 (build-system gnu-build-system)
93 (synopsis "Conversion between thousands of scales")
94 (description
574e86f9 95 "GNU Units converts numeric quantities between units of measure. It
7c125ce0
AK
96can handle scale changes through adaptive usage of standard scale
97prefixes (micro-, kilo-, etc.). It can also handle nonlinear
98conversions such as Fahrenheit to Celsius. Its interpreter is powerful
99enough to be used effectively as a scientific calculator.")
8f8b2451
AE
100 (license license:gpl3+)
101 (home-page "http://www.gnu.org/software/units/")))
c9dfa3c7 102
61a529b4
RW
103(define-public double-conversion
104 (package
105 (name "double-conversion")
106 (version "1.1.5")
107 (source (origin
108 (method url-fetch)
109 (uri (string-append
110 "https://github.com/floitsch/double-conversion/archive/v"
111 version ".tar.gz"))
112 (file-name (string-append name "-" version ".tar.gz"))
113 (sha256
114 (base32
115 "0cnr8xhyjfxijay8ymkqcph3672wp2lj23qhdmr3m4kia5kpdf83"))))
116 (build-system cmake-build-system)
117 (arguments
118 '(#:test-target "test"
119 #:configure-flags '("-DBUILD_SHARED_LIBS=ON"
120 "-DBUILD_TESTING=ON")))
121 (home-page "https://github.com/floitsch/double-conversion")
122 (synopsis "Conversion routines for IEEE doubles")
123 (description
124 "The double-conversion library provides binary-decimal and decimal-binary
125routines for IEEE doubles. The library consists of efficient conversion
126routines that have been extracted from the V8 JavaScript engine.")
127 (license license:bsd-3)))
128
182d6311
ML
129(define-public dionysus
130 (package
131 (name "dionysus")
132 (version "1.3.0")
133 (source (origin
134 (method url-fetch)
135 (uri (string-append "mirror://gnu/dionysus/dionysus-" version
136 ".tar.gz"))
137 (sha256
138 (base32
139 "1aqnvw6z33bzqgd1ga571pnx6vq2zrkckm1cz91grv45h4jr9vgs"))))
140 (build-system gnu-build-system)
141 (inputs `(("tcl" ,tcl))) ;for 'tclsh'
142 (synopsis "Local search for universal constants and scientific values")
143 (description
144 "GNU Dionysus is a convenient system for quickly retrieving the values of
145mathematical constants used in science and engineering. Values can be
146searched using a simple command-line tool, choosing from three databases:
147universal constants, atomic numbers, and constants related to
148semiconductors.")
149 (license license:gpl3+)
150 (home-page "http://www.gnu.org/software/dionysus/")))
151
88bd1804
AE
152(define-public gsl
153 (package
154 (name "gsl")
0534dd93 155 (version "2.1")
88bd1804
AE
156 (source
157 (origin
158 (method url-fetch)
159 (uri (string-append "mirror://gnu/gsl/gsl-"
160 version ".tar.gz"))
161 (sha256
162 (base32
0534dd93 163 "0rhcia9jhr3p1f1wybwyllwqfs9bggz99i3mi5lpyqcpff1hdbar"))))
88bd1804 164 (build-system gnu-build-system)
71e0f288 165 (arguments
5adbe65f 166 `(#:parallel-tests? #f))
88bd1804
AE
167 (home-page "http://www.gnu.org/software/gsl/")
168 (synopsis "Numerical library for C and C++")
169 (description
a22dc0c4
LC
170 "The GNU Scientific Library is a library for numerical analysis in C
171and C++. It includes a wide range of mathematical routines, with over 1000
172functions in total. Subject areas covered by the library include:
173differential equations, linear algebra, Fast Fourier Transforms and random
174numbers.")
88bd1804
AE
175 (license license:gpl3+)))
176
b92eee75
AE
177(define-public glpk
178 (package
179 (name "glpk")
eb4f2cd7 180 (version "4.59")
b92eee75
AE
181 (source
182 (origin
183 (method url-fetch)
184 (uri (string-append "mirror://gnu/glpk/glpk-"
185 version ".tar.gz"))
186 (sha256
187 (base32
eb4f2cd7 188 "1bpbp5z0378kaj5bqmc5m2j5h9c7553p0s2j6a28badqghpbx673"))))
b92eee75
AE
189 (build-system gnu-build-system)
190 (inputs
191 `(("gmp" ,gmp)))
192 (arguments
193 `(#:configure-flags '("--with-gmp")))
194 (home-page "http://www.gnu.org/software/glpk/")
79c311b8 195 (synopsis "GNU Linear Programming Kit, supporting the MathProg language")
b92eee75
AE
196 (description
197 "GLPK is a C library for solving large-scale linear programming (LP),
198mixed integer programming (MIP), and other related problems. It supports the
199GNU MathProg modeling language, a subset of the AMPL language, and features a
200translator for the language. In addition to the C library, a stand-alone
201LP/MIP solver is included in the package.")
202 (license license:gpl3+)))
203
c9dfa3c7
AE
204(define-public pspp
205 (package
206 (name "pspp")
e12f047f 207 (version "0.10.0")
c9dfa3c7
AE
208 (source
209 (origin
210 (method url-fetch)
211 (uri (string-append "mirror://gnu/pspp/pspp-"
212 version ".tar.gz"))
213 (sha256
214 (base32
e12f047f 215 "1nwnxr8mvf8y4lc8h8sd2xn2njwjk42x8mzj91zzv92m2z3vyggg"))))
c9dfa3c7
AE
216 (build-system gnu-build-system)
217 (inputs
f3929800
AE
218 `(("cairo" ,cairo)
219 ("fontconfig" ,fontconfig)
1dba6407 220 ("gettext" ,gnu-gettext)
c9dfa3c7
AE
221 ("gsl" ,gsl)
222 ("libxml2" ,libxml2)
f3929800 223 ("pango" ,pango)
c9dfa3c7 224 ("readline" ,readline)
e12f047f
EF
225 ("gtk" ,gtk+)
226 ("gtksourceview" ,gtksourceview)
c9dfa3c7
AE
227 ("zlib" ,zlib)))
228 (native-inputs
221ed17a
EB
229 `(("glib" ,glib "bin") ;for glib-genmarshal
230 ("perl" ,perl)
c01876b1 231 ("texinfo" ,texinfo)
c9dfa3c7 232 ("pkg-config" ,pkg-config)))
c9dfa3c7
AE
233 (home-page "http://www.gnu.org/software/pspp/")
234 (synopsis "Statistical analysis")
235 (description
79c311b8 236 "GNU PSPP is a statistical analysis program. It can perform
c5779c93
LC
237descriptive statistics, T-tests, linear regression and non-parametric tests.
238It features both a graphical interface as well as command-line input. PSPP
239is designed to interoperate with Gnumeric, LibreOffice and OpenOffice. Data
240can be imported from spreadsheets, text files and database sources and it can
241be output in text, PostScript, PDF or HTML.")
c9dfa3c7 242 (license license:gpl3+)))
da95c817 243
865a69dd
RW
244(define-public arpack-ng
245 (package
246 (name "arpack-ng")
247 (version "3.2.0")
248 (source
249 (origin
250 (method url-fetch)
251 (uri (string-append "https://github.com/opencollab/arpack-ng/archive/"
252 version ".tar.gz"))
f586c877 253 (file-name (string-append name "-" version ".tar.gz"))
865a69dd
RW
254 (sha256
255 (base32
256 "1fwch6vipms1ispzg2djvbzv5wag36f1dmmr3xs3mbp6imfyhvff"))))
257 (build-system gnu-build-system)
258 (home-page "https://github.com/opencollab/arpack-ng")
259 (inputs
260 `(("lapack" ,lapack)
19afbea1 261 ("fortran" ,gfortran)))
865a69dd
RW
262 (synopsis "Fortran subroutines for solving eigenvalue problems")
263 (description
264 "ARPACK-NG is a collection of Fortran77 subroutines designed to solve
265large scale eigenvalue problems.")
166191b3 266 (license (license:non-copyleft "file://COPYING"
865a69dd
RW
267 "See COPYING in the distribution."))))
268
8c94c886
EB
269(define-public arpack-ng-openmpi
270 (package (inherit arpack-ng)
271 (name "arpack-ng-openmpi")
272 (inputs
273 `(("mpi" ,openmpi)
274 ,@(package-inputs arpack-ng)))
275 (arguments `(#:configure-flags '("--enable-mpi")))
276 (synopsis "Fortran subroutines for solving eigenvalue problems with MPI")))
277
da95c817
NK
278(define-public lapack
279 (package
280 (name "lapack")
566146ab 281 (version "3.5.0")
da95c817
NK
282 (source
283 (origin
284 (method url-fetch)
285 (uri (string-append "http://www.netlib.org/lapack/lapack-"
286 version ".tgz"))
287 (sha256
288 (base32
566146ab 289 "0lk3f97i9imqascnlf6wr5mjpyxqcdj73pgj97dj2mgvyg9z1n4s"))))
da95c817
NK
290 (build-system cmake-build-system)
291 (home-page "http://www.netlib.org/lapack/")
19afbea1 292 (inputs `(("fortran" ,gfortran)
da95c817
NK
293 ("python" ,python-2)))
294 (arguments
06ed5982 295 `(#:configure-flags '("-DBUILD_SHARED_LIBS:BOOL=YES")
da95c817 296 #:phases (alist-cons-before
6a995754
LC
297 'check 'patch-python
298 (lambda* (#:key inputs #:allow-other-keys)
299 (let ((python (assoc-ref inputs "python")))
300 (substitute* "lapack_testing.py"
301 (("/usr/bin/env python") python))))
06ed5982 302 %standard-phases)))
da95c817
NK
303 (synopsis "Library for numerical linear algebra")
304 (description
305 "LAPACK is a Fortran 90 library for solving the most commonly occurring
306problems in numerical linear algebra.")
166191b3 307 (license (license:non-copyleft "file://LICENSE"
da95c817 308 "See LICENSE in the distribution."))))
73fed4f8 309
e1ff597a
EB
310(define-public scalapack
311 (package
312 (name "scalapack")
313 (version "2.0.2")
314 (source
315 (origin
316 (method url-fetch)
317 (uri (string-append "http://www.netlib.org/scalapack/scalapack-"
318 version ".tgz"))
319 (sha256
320 (base32
321 "0p1r61ss1fq0bs8ynnx7xq4wwsdvs32ljvwjnx6yxr8gd6pawx0c"))))
322 (build-system cmake-build-system)
323 (inputs
324 `(("mpi" ,openmpi)
325 ("fortran" ,gfortran)
326 ("lapack" ,lapack))) ;for testing only
327 (arguments
328 `(#:configure-flags `("-DBUILD_SHARED_LIBS:BOOL=YES")))
329 (home-page "http://www.netlib.org/scalapack/")
330 (synopsis "Library for scalable numerical linear algebra")
331 (description
332 "ScaLAPACK is a Fortran 90 library of high-performance linear algebra
333routines on parallel distributed memory machines. ScaLAPACK solves dense and
334banded linear systems, least squares problems, eigenvalue problems, and
335singular value problems.")
336 (license (license:bsd-style "file://LICENSE"
337 "See LICENSE in the distribution."))))
338
73fed4f8
JD
339(define-public gnuplot
340 (package
341 (name "gnuplot")
ec4130b7 342 (version "5.0.2")
73fed4f8
JD
343 (source
344 (origin
345 (method url-fetch)
346 (uri (string-append "mirror://sourceforge/gnuplot/gnuplot/"
97003b5c 347 version "/gnuplot-" version ".tar.gz"))
73fed4f8
JD
348 (sha256
349 (base32
ec4130b7 350 "146qn414z96c7cc42a1kb9a4kpjc2q2hfdwk44kjjvgmfp9k2ass"))))
73fed4f8
JD
351 (build-system gnu-build-system)
352 (inputs `(("readline" ,readline)
353 ("cairo" ,cairo)
354 ("pango" ,pango)
355 ("gd" ,gd)))
97003b5c 356 (native-inputs `(("pkg-config" ,pkg-config)
289adba7 357 ("texlive" ,texlive-minimal)))
73fed4f8
JD
358 (home-page "http://www.gnuplot.info")
359 (synopsis "Command-line driven graphing utility")
360 (description "Gnuplot is a portable command-line driven graphing
35b9e423 361utility. It was originally created to allow scientists and students to
73fed4f8 362visualize mathematical functions and data interactively, but has grown to
35b9e423 363support many non-interactive uses such as web scripting. It is also used as a
73fed4f8
JD
364plotting engine by third-party applications like Octave.")
365 ;; X11 Style with the additional restriction that derived works may only be
366 ;; distributed as patches to the original.
367 (license (license:fsf-free
a124bbd2 368 "http://gnuplot.cvs.sourceforge.net/gnuplot/gnuplot/Copyright"))))
668c06ac 369
7ee3f1a2
JD
370(define-public hdf5
371 (package
372 (name "hdf5")
373 (version "1.8.12")
374 (source
375 (origin
376 (method url-fetch)
93c3de92
AE
377 (uri (string-append "http://www.hdfgroup.org/ftp/HDF5/releases/hdf5-"
378 version "/src/hdf5-"
7ee3f1a2
JD
379 version ".tar.bz2"))
380 (sha256
381 (base32 "0f9n0v3p3lwc7564791a39c6cn1d3dbrn7d1j3ikqsi27a8hy23d"))))
382 (build-system gnu-build-system)
12ed1216
AE
383 (inputs
384 `(("zlib" ,zlib)))
7ee3f1a2
JD
385 (arguments
386 `(#:phases
d4bf49b1
EB
387 (alist-cons-before
388 'configure 'patch-configure
389 (lambda _
390 (substitute* "configure"
391 (("/bin/mv") "mv")))
7ee3f1a2 392 %standard-phases)))
7ee3f1a2 393 (home-page "http://www.hdfgroup.org")
516e93f8 394 (synopsis "Management suite for extremely large and complex data")
7ee3f1a2
JD
395 (description "HDF5 is a suite that makes possible the management of
396extremely large and complex data collections.")
d4bf49b1
EB
397 (license (license:x11-style
398 "http://www.hdfgroup.org/ftp/HDF5/current/src/unpacked/COPYING"))))
7ee3f1a2
JD
399
400
668c06ac
JD
401;; For a fully featured Octave, users are strongly recommended also to install
402;; the following packages: texinfo, less, ghostscript, gnuplot.
403(define-public octave
404 (package
405 (name "octave")
19659acc 406 (version "4.0.0")
668c06ac
JD
407 (source
408 (origin
409 (method url-fetch)
410 (uri (string-append "mirror://gnu/octave/octave-"
a124bbd2 411 version ".tar.gz"))
668c06ac
JD
412 (sha256
413 (base32
a124bbd2 414 "101jr9yck798586jz4vkjcgk36zksmxf1pxrzvipgn2xgyay0zjc"))))
668c06ac
JD
415 (build-system gnu-build-system)
416 (inputs
417 `(("lapack" ,lapack)
418 ("readline" ,readline)
419 ("glpk" ,glpk)
1ec78e9d
EB
420 ("fftw" ,fftw)
421 ("fftwf" ,fftwf)
422 ("arpack" ,arpack-ng)
668c06ac
JD
423 ("curl" ,curl)
424 ("pcre" ,pcre)
425 ("fltk" ,fltk)
426 ("fontconfig" ,fontconfig)
427 ("freetype" ,freetype)
40029cbe 428 ("hdf5" ,hdf5)
668c06ac
JD
429 ("libxft" ,libxft)
430 ("mesa" ,mesa)
1ec78e9d 431 ("glu" ,glu)
668c06ac
JD
432 ("zlib" ,zlib)))
433 (native-inputs
19afbea1 434 `(("gfortran" ,gfortran)
668c06ac
JD
435 ("pkg-config" ,pkg-config)
436 ("perl" ,perl)
1ec78e9d
EB
437 ;; The following inputs are not actually used in the build process.
438 ;; However, the ./configure gratuitously tests for their existence and
439 ;; assumes that programs not present at build time are also not, and
440 ;; can never be, available at run time! If these inputs are therefore
441 ;; not present, support for them will be built out. However, Octave
442 ;; will still run without them, albeit without the features they
668c06ac
JD
443 ;; provide.
444 ("less" ,less)
445 ("texinfo" ,texinfo)
446 ("ghostscript" ,ghostscript)
447 ("gnuplot" ,gnuplot)))
448 (arguments
449 `(#:configure-flags (list (string-append "--with-shell="
450 (assoc-ref %build-inputs "bash")
451 "/bin/sh"))))
452 (home-page "http://www.gnu.org/software/octave/")
453 (synopsis "High-level language for numerical computation")
1ec78e9d
EB
454 (description "GNU Octave is a high-level interpreted language that is
455specialized for numerical computations. It can be used for both linear and
456non-linear applications and it provides great support for visualizing results.
457Work may be performed both at the interactive command-line as well as via
458script files.")
668c06ac 459 (license license:gpl3+)))
3de01d3f
EB
460
461(define-public gmsh
462 (package
463 (name "gmsh")
c7b08410 464 (version "2.11.0")
3de01d3f
EB
465 (source
466 (origin
467 (method url-fetch)
468 (uri (string-append "http://www.geuz.org/gmsh/src/gmsh-"
469 version "-source.tgz"))
470 (sha256
c7b08410 471 (base32 "1ilplibvjgf7a905grpnclrvkmqy9fgrpl7xyp3w4yl1qc682v9b"))
3de01d3f
EB
472 (modules '((guix build utils)))
473 (snippet
474 ;; Remove non-free METIS code
475 '(delete-file-recursively "contrib/Metis"))))
476 (build-system cmake-build-system)
3de01d3f
EB
477 (propagated-inputs
478 `(("fltk" ,fltk)
19afbea1 479 ("gfortran" ,gfortran)
3de01d3f 480 ("gmp" ,gmp)
40029cbe 481 ("hdf5" ,hdf5)
3de01d3f
EB
482 ("lapack" ,lapack)
483 ("mesa" ,mesa)
85f41902 484 ("glu" ,glu)
3de01d3f
EB
485 ("libx11" ,libx11)
486 ("libxext" ,libxext)))
487 (arguments
488 `(#:configure-flags `("-DENABLE_METIS:BOOL=OFF"
489 "-DENABLE_BUILD_SHARED:BOOL=ON"
c7b08410
EB
490 "-DENABLE_BUILD_DYNAMIC:BOOL=ON")
491 #:phases (modify-phases %standard-phases
492 (replace
493 'check
494 (lambda _
495 (zero? (system* "make" "test"
496 ;; Disable this test. See
497 ;; https://geuz.org/trac/gmsh/ticket/271
498 "ARGS=-E component8_in_a_box")))))))
3de01d3f
EB
499 (home-page "http://www.geuz.org/gmsh/")
500 (synopsis "3D finite element grid generator")
edf684ef
EB
501 (description "Gmsh is a 3D finite element grid generator with a built-in
502CAD engine and post-processor. Its design goal is to provide a fast, light
503and user-friendly meshing tool with parametric input and advanced
504visualization capabilities. Gmsh is built around four modules: geometry,
505mesh, solver and post-processing. The specification of any input to these
506modules is done either interactively using the graphical user interface or in
507ASCII text files using Gmsh's own scripting language.")
3de01d3f 508 (license license:gpl2+)))
b9100e2f
EB
509
510(define-public petsc
511 (package
512 (name "petsc")
32187d99 513 (version "3.6.2")
b9100e2f
EB
514 (source
515 (origin
516 (method url-fetch)
517 ;; The *-lite-* tarball does not contain the *large* documentation
518 (uri (string-append "http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/"
519 "petsc-lite-" version ".tar.gz"))
520 (sha256
32187d99 521 (base32 "13h0m5f9xsdpps4lsp59iz2m7zkapwavq2zfkfvs3ab6sndla0l9"))))
b9100e2f
EB
522 (build-system gnu-build-system)
523 (native-inputs
524 `(("python" ,python-2)
525 ("perl" ,perl)))
526 (inputs
19afbea1 527 `(("gfortran" ,gfortran)
b9100e2f 528 ("lapack" ,lapack)
f258212d 529 ("superlu" ,superlu)
b9100e2f
EB
530 ;; leaving out hdf5 and fftw, as petsc expects them to be built with mpi
531 ;; leaving out opengl, as configuration seems to only be for mac
532 ))
533 (arguments
534 `(#:test-target "test"
9a899cce 535 #:parallel-build? #f ;build is parallel by default
b9100e2f
EB
536 #:configure-flags
537 `("--with-mpi=0"
f258212d
EB
538 "--with-openmp=1"
539 "--with-superlu=1"
540 ,(string-append "--with-superlu-include="
541 (assoc-ref %build-inputs "superlu") "/include")
542 ,(string-append "--with-superlu-lib="
543 (assoc-ref %build-inputs "superlu") "/lib/libsuperlu.a"))
b9100e2f
EB
544 #:phases
545 (alist-replace
546 'configure
547 ;; PETSc's configure script is actually a python script, so we can't
548 ;; run it with bash.
549 (lambda* (#:key outputs (configure-flags '())
550 #:allow-other-keys)
551 (let* ((prefix (assoc-ref outputs "out"))
552 (flags `(,(string-append "--prefix=" prefix)
553 ,@configure-flags)))
554 (format #t "build directory: ~s~%" (getcwd))
555 (format #t "configure flags: ~s~%" flags)
556 (zero? (apply system* "./configure" flags))))
557 (alist-cons-after
10b11968
EB
558 'configure 'clean-local-references
559 ;; Try to keep build directory names from leaking into compiled code
b9100e2f 560 (lambda* (#:key inputs outputs #:allow-other-keys)
10b11968
EB
561 (let ((out (assoc-ref outputs "out")))
562 (substitute* (find-files "." "^petsc(conf|machineinfo).h$")
563 (((getcwd)) out))))
564 (alist-cons-after
565 'install 'clean-install
566 ;; Try to keep installed files from leaking build directory names.
567 (lambda* (#:key inputs outputs #:allow-other-keys)
dfdf5716 568 (let ((out (assoc-ref outputs "out")))
10b11968 569 (substitute* (map (lambda (file)
9a899cce
EB
570 (string-append out "/lib/petsc/conf/" file))
571 '("petscvariables" "PETScConfig.cmake"))
10b11968
EB
572 (((getcwd)) out))
573 ;; Make compiler references point to the store
9a899cce 574 (substitute* (string-append out "/lib/petsc/conf/petscvariables")
dfdf5716
EB
575 (("= (gcc|g\\+\\+|gfortran)" _ compiler)
576 (string-append "= " (which compiler))))
10b11968
EB
577 ;; PETSc installs some build logs, which aren't necessary.
578 (for-each (lambda (file)
9a899cce 579 (let ((f (string-append out "/lib/petsc/conf/" file)))
10b11968
EB
580 (when (file-exists? f)
581 (delete-file f))))
9a899cce
EB
582 '("configure.log" "make.log" "gmake.log"
583 "test.log" "error.log" "RDict.db"
10b11968 584 ;; Once installed, should uninstall with Guix
9a899cce 585 "uninstall.py"))))
10b11968 586 %standard-phases)))))
b9100e2f 587 (home-page "http://www.mcs.anl.gov/petsc")
16ecf3ff 588 (synopsis "Library to solve PDEs")
b9100e2f
EB
589 (description "PETSc, pronounced PET-see (the S is silent), is a suite of
590data structures and routines for the scalable (parallel) solution of
591scientific applications modeled by partial differential equations.")
166191b3 592 (license (license:non-copyleft
b9100e2f
EB
593 "http://www.mcs.anl.gov/petsc/documentation/copyright.html"))))
594
595(define-public petsc-complex
596 (package (inherit petsc)
597 (name "petsc-complex")
598 (arguments
599 (substitute-keyword-arguments (package-arguments petsc)
600 ((#:configure-flags cf)
601 `(cons "--with-scalar-type=complex" ,cf))))
16ecf3ff 602 (synopsis "Library to solve PDEs (with complex scalars)")))
183e44ae 603
d8c7eeb9
EB
604(define-public petsc-openmpi
605 (package (inherit petsc)
606 (name "petsc-openmpi")
607 (inputs
608 `(("openmpi" ,openmpi)
609 ,@(package-inputs petsc)))
610 (arguments
611 (substitute-keyword-arguments (package-arguments petsc)
612 ((#:configure-flags cf)
613 ``("--with-mpiexec=mpirun"
614 ,(string-append "--with-mpi-dir="
615 (assoc-ref %build-inputs "openmpi"))
616 ,@(delete "--with-mpi=0" ,cf)))))
16ecf3ff 617 (synopsis "Library to solve PDEs (with MPI support)")))
d8c7eeb9
EB
618
619(define-public petsc-complex-openmpi
620 (package (inherit petsc-complex)
621 (name "petsc-complex-openmpi")
622 (inputs
623 `(("openmpi" ,openmpi)
624 ,@(package-inputs petsc-complex)))
625 (arguments
626 (substitute-keyword-arguments (package-arguments petsc-complex)
627 ((#:configure-flags cf)
628 ``("--with-mpiexec=mpirun"
629 ,(string-append "--with-mpi-dir="
630 (assoc-ref %build-inputs "openmpi"))
631 ,@(delete "--with-mpi=0" ,cf)))))
16ecf3ff 632 (synopsis "Library to solve PDEs (with complex scalars and MPI support)")))
d8c7eeb9 633
a7f01414
EB
634(define-public slepc
635 (package
636 (name "slepc")
9cf52454 637 (version "3.6.2")
a7f01414
EB
638 (source
639 (origin
640 (method url-fetch)
641 (uri (string-append "http://slepc.upv.es/download/download.php?"
642 "filename=slepc-" version ".tar.gz"))
d588422e 643 (file-name (string-append name "-" version ".tar.gz"))
a7f01414
EB
644 (sha256
645 (base32
9cf52454 646 "1pv5iqz2kc8sj49zsabyz4arnfpana8mjrhq31vzgk16xldk3d1a"))))
a7f01414
EB
647 (build-system gnu-build-system)
648 (native-inputs
649 `(("python" ,python-2)))
650 (inputs
651 `(("arpack" ,arpack-ng)
652 ("gfortran" ,gfortran)))
653 (propagated-inputs
654 `(("petsc" ,petsc)))
655 (arguments
656 `(#:parallel-build? #f ;build is parallel by default
657 #:configure-flags
658 `(,(string-append "--with-arpack-dir="
9cf52454 659 (assoc-ref %build-inputs "arpack") "/lib"))
a7f01414
EB
660 #:phases
661 (modify-phases %standard-phases
662 (replace
663 'configure
664 ;; configure is a python script, so we can't run it with bash.
665 (lambda* (#:key inputs outputs (configure-flags '())
666 #:allow-other-keys)
667 (let* ((prefix (assoc-ref outputs "out"))
668 (flags `(,(string-append "--prefix=" prefix)
669 ,@configure-flags)))
670 (format #t "build directory: ~s~%" (getcwd))
671 (format #t "configure flags: ~s~%" flags)
672 (setenv "SLEPC_DIR" (getcwd))
9cf52454 673 (setenv "PETSC_DIR" (assoc-ref inputs "petsc"))
a7f01414
EB
674 (zero? (apply system* "./configure" flags)))))
675 (add-after
676 'install 'delete-doc
677 ;; TODO: SLEPc installs HTML documentation alongside headers in
678 ;; $out/include. We'd like to move them to share/doc, but delete
679 ;; them for now, as they are incomplete and installing the complete
680 ;; documentation is difficult.
681 (lambda* (#:key outputs #:allow-other-keys)
682 (let* ((out (assoc-ref outputs "out")))
683 (for-each delete-file (find-files out "\\.html$")))))
684 (add-after
685 'install 'clean-install
686 ;; Clean up unnecessary build logs from installation.
687 (lambda* (#:key outputs #:allow-other-keys)
688 (let ((out (assoc-ref outputs "out")))
689 (for-each (lambda (file)
690 (let ((f (string-append out "/lib/slepc/conf/" file)))
691 (when (file-exists? f)
692 (delete-file f))))
693 '("configure.log" "make.log" "gmake.log"
694 "test.log" "error.log" "RDict.db"
695 "uninstall.py"))))))))
696 (home-page "http://slepc.upv.es")
697 (synopsis "Scalable library for eigenproblems")
698 (description "SLEPc is a software library for the solution of large sparse
699eigenproblems on parallel computers. It can be used for the solution of
700linear eigenvalue problems formulated in either standard or generalized form,
701as well as other related problems such as the singular value decomposition.
702The emphasis of the software is on methods and techniques appropriate for
703problems in which the associated matrices are sparse, for example, those
704arising after the discretization of partial differential equations.")
705 (license license:lgpl3)))
706
707(define-public slepc-complex
708 (package (inherit slepc)
709 (name "slepc-complex")
710 (propagated-inputs
711 `(("petsc" ,petsc-complex)
712 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
713 (synopsis "Scalable library for eigenproblems (with complex scalars)")))
714
715(define-public slepc-openmpi
716 (package (inherit slepc)
717 (name "slepc-openmpi")
718 (inputs
719 `(("mpi" ,openmpi)
720 ("arpack" ,arpack-ng-openmpi)
721 ,@(alist-delete "arpack" (package-inputs slepc))))
722 (propagated-inputs
723 `(("petsc" ,petsc-openmpi)
724 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
725 (synopsis "Scalable library for eigenproblems (with MPI support)")))
726
727(define-public slepc-complex-openmpi
728 (package (inherit slepc-openmpi)
729 (name "slepc-complex-openmpi")
730 (propagated-inputs
731 `(("petsc" ,petsc-complex-openmpi)
732 ,@(alist-delete "petsc" (package-propagated-inputs slepc-openmpi))))
733 (synopsis "Scalable library for eigenproblems (with complex scalars and MPI support)")))
734
cec86422
EB
735(define-public mumps
736 (package
737 (name "mumps")
c69fa438 738 (version "5.0.1")
cec86422
EB
739 (source
740 (origin
741 (method url-fetch)
742 (uri (string-append "http://mumps.enseeiht.fr/MUMPS_"
743 version ".tar.gz"))
744 (sha256
745 (base32
c69fa438 746 "1820jfp3mbl7n85765v5mp6p0gzqpgr4d2lrnhwj4gl7cwp5ndah"))
cec86422
EB
747 (patches (list (search-patch "mumps-build-parallelism.patch")))))
748 (build-system gnu-build-system)
749 (inputs
750 `(("fortran" ,gfortran)
751 ;; These are required for linking against mumps, but we let the user
752 ;; declare the dependency.
753 ("blas" ,openblas)
754 ("metis" ,metis)
755 ("scotch" ,scotch)))
756 (arguments
757 `(#:modules ((ice-9 match)
758 (ice-9 popen)
759 (srfi srfi-1)
760 ,@%gnu-build-system-modules)
761 #:phases
762 (modify-phases %standard-phases
763 (replace
764 'configure
765 (lambda* (#:key inputs #:allow-other-keys)
766 (call-with-output-file "Makefile.inc"
767 (lambda (port)
768 (format port "
769PLAT =
770LIBEXT = .a
771OUTC = -o
772OUTF = -o
773RM = rm -f~:[
774CC = gcc
775FC = gfortran
776FL = gfortran
777INCSEQ = -I$(topdir)/libseq
778LIBSEQ = -L$(topdir)/libseq -lmpiseq
779LIBSEQNEEDED = libseqneeded~;
780CC = mpicc
781FC = mpifort
782FL = mpifort~]
783AR = ar vr # rules require trailing space, ugh...
784RANLIB = ranlib
785LIBBLAS = -L~a -lopenblas~@[
786SCALAP = -L~a -lscalapack~]
787LIBOTHERS = -pthread
788CDEFS = -DAdd_
789PIC = -fPIC
790OPTF = -O2 -DALLOW_NON_INIT $(PIC)
791OPTL = -O2 $(PIC)
792OPTC = -O2 $(PIC)
793INCS = $(INCSEQ)
794LIBS = $(SCALAP) $(LIBSEQ)
795LPORDDIR = $(topdir)/PORD/lib
796IPORD = -I$(topdir)/PORD/include
797LPORD = -L$(LPORDDIR) -lpord
798ORDERINGSF = -Dpord~@[
799METISDIR = ~a
800IMETIS = -I$(METISDIR)/include
801LMETIS = -L$(METISDIR)/lib -lmetis
802ORDERINGSF += -Dmetis~]~@[~:{
803SCOTCHDIR = ~a
804ISCOTCH = -I$(SCOTCHDIR)/include
805LSCOTCH = -L$(SCOTCHDIR)/lib ~a-lesmumps -lscotch -lscotcherr
806ORDERINGSF += ~a~}~]
807ORDERINGSC = $(ORDERINGSF)
808LORDERINGS = $(LPORD) $(LMETIS) $(LSCOTCH)
809IORDERINGSF = $(ISCOTCH)
810IORDERINGSC = $(IPORD) $(IMETIS) $(ISCOTCH)"
811 (assoc-ref inputs "mpi")
812 (assoc-ref inputs "blas")
813 (assoc-ref inputs "scalapack")
814 (assoc-ref inputs "metis")
815 (match (list (assoc-ref inputs "pt-scotch")
816 (assoc-ref inputs "scotch"))
817 ((#f #f)
818 #f)
819 ((#f scotch)
820 `((,scotch "" "-Dscotch")))
821 ((ptscotch _)
822 `((,ptscotch
823 "-lptesmumps -lptscotch -lptscotcherr "
824 "-Dptscotch")))))))))
825 (replace
826 'build
827 ;; By default only the d-precision library is built. Make with "all"
828 ;; target so that all precision libraries and examples are built.
829 (lambda _
830 (zero? (system* "make" "all"
831 (format #f "-j~a" (parallel-job-count))))))
832 (replace
833 'check
834 ;; Run the simple test drivers, which read test input from stdin:
835 ;; from the "real" input for the single- and double-precision
836 ;; testers, and from the "cmplx" input for complex-precision
837 ;; testers. The EXEC-PREFIX key is used by the mumps-openmpi
838 ;; package to prefix execution with "mpirun".
839 (lambda* (#:key (exec-prefix '()) #:allow-other-keys)
840 (with-directory-excursion "examples"
841 (every
842 (lambda (prec type)
843 (let ((tester (apply open-pipe*
844 `(,OPEN_WRITE
845 ,@exec-prefix
846 ,(string-append "./" prec
847 "simpletest"))))
848 (input (open-input-file
849 (string-append "input_simpletest_" type))))
850 (begin
851 (dump-port input tester)
852 (close-port input)
853 (zero? (close-pipe tester)))))
854 '("s" "d" "c" "z")
855 '("real" "real" "cmplx" "cmplx")))))
856 (replace
857 'install
858 (lambda* (#:key outputs #:allow-other-keys)
859 (let ((out (assoc-ref outputs "out")))
860 (copy-recursively "lib" (string-append out "/lib"))
861 (copy-recursively "include" (string-append out "/include"))
862 (when (file-exists? "libseq/libmpiseq.a")
863 (copy-file "libseq/libmpiseq.a"
864 (string-append out "/lib/libmpiseq.a")))))))))
865 (home-page "http://mumps.enseeiht.fr")
866 (synopsis "Multifrontal sparse direct solver")
867 (description
868 "MUMPS (MUltifrontal Massively Parallel sparse direct Solver) solves a
869sparse system of linear equations A x = b using Guassian elimination.")
870 (license license:cecill-c)))
871
872(define-public mumps-metis
873 (package (inherit mumps)
874 (name "mumps-metis")
875 (inputs
876 (alist-delete "scotch" (package-inputs mumps)))))
877
878(define-public mumps-openmpi
879 (package (inherit mumps)
880 (name "mumps-openmpi")
881 (inputs
882 `(("mpi" ,openmpi)
883 ("scalapack" ,scalapack)
884 ("pt-scotch" ,pt-scotch)
885 ,@(alist-delete "scotch" (package-inputs mumps))))
886 (arguments
887 (substitute-keyword-arguments (package-arguments mumps)
888 ((#:phases phases)
889 `(modify-phases ,phases
890 (replace
891 'check
892 (lambda _
893 ((assoc-ref ,phases 'check)
894 #:exec-prefix '("mpirun" "-n" "2"))))))))
895 (synopsis "Multifrontal sparse direct solver (with MPI)")))
896
897(define-public mumps-metis-openmpi
898 (package (inherit mumps-openmpi)
899 (name "mumps-metis-openmpi")
900 (inputs
901 (alist-delete "pt-scotch" (package-inputs mumps-openmpi)))))
902
183e44ae
EB
903(define-public superlu
904 (package
905 (name "superlu")
906 (version "4.3")
907 (source
908 (origin
909 (method url-fetch)
910 (uri (string-append "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/"
911 "superlu_" version ".tar.gz"))
912 (sha256
913 (base32 "10b785s9s4x0m9q7ihap09275pq4km3k2hk76jiwdfdr5qr2168n"))))
914 (build-system gnu-build-system)
915 (native-inputs
916 `(("tcsh" ,tcsh)))
917 (inputs
918 `(("lapack" ,lapack)
19afbea1 919 ("gfortran" ,gfortran)))
183e44ae
EB
920 (arguments
921 `(#:parallel-build? #f
922 #:tests? #f ;tests are run as part of `make all`
923 #:phases
924 (alist-replace
925 'configure
926 (lambda* (#:key inputs outputs #:allow-other-keys)
927 (call-with-output-file "make.inc"
928 (lambda (port)
929 (format port "
930PLAT =
931SuperLUroot = ~a
932SUPERLULIB = ~a/lib/libsuperlu.a
933TMGLIB = libtmglib.a
934BLASDEF = -DUSE_VENDOR_BLAS
935BLASLIB = -L~a/lib -lblas
936LIBS = $(SUPERLULIB) $(BLASLIB)
937ARCH = ar
938ARCHFLAGS = cr
939RANLIB = ranlib
940CC = gcc
941PIC = -fPIC
942CFLAGS = -O3 -DPRNTlevel=0 $(PIC)
943NOOPTS = -O0 $(PIC)
944FORTRAN = gfortran
945FFLAGS = -O2 $(PIC)
946LOADER = $(CC)
947CDEFS = -DAdd_"
948 (getcwd)
949 (assoc-ref outputs "out")
950 (assoc-ref inputs "lapack")))))
951 (alist-cons-before
952 'build 'create-install-directories
953 (lambda* (#:key outputs #:allow-other-keys)
954 (for-each
955 (lambda (dir)
956 (mkdir-p (string-append (assoc-ref outputs "out")
957 "/" dir)))
958 '("lib" "include")))
959 (alist-replace
960 'install
961 (lambda* (#:key outputs #:allow-other-keys)
962 ;; Library is placed in lib during the build phase. Copy over
963 ;; headers to include.
964 (let* ((out (assoc-ref outputs "out"))
965 (incdir (string-append out "/include")))
966 (for-each (lambda (file)
967 (let ((base (basename file)))
968 (format #t "installing `~a' to `~a'~%"
969 base incdir)
970 (copy-file file
971 (string-append incdir "/" base))))
972 (find-files "SRC" ".*\\.h$"))))
973 %standard-phases)))))
974 (home-page "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/")
975 (synopsis "Supernodal direct solver for sparse linear systems")
976 (description
977 "SuperLU is a general purpose library for the direct solution of large,
978sparse, nonsymmetric systems of linear equations on high performance machines.
979The library is written in C and is callable from either C or Fortran. The
980library routines perform an LU decomposition with partial pivoting and
981triangular system solves through forward and back substitution. The library
982also provides threshold-based ILU factorization preconditioners.")
983 (license license:bsd-3)))
f8ed036a 984
a54aefea
EB
985(define-public superlu-dist
986 (package
987 (name "superlu-dist")
988 (version "3.3")
989 (source
990 (origin
991 (method url-fetch)
992 (uri (string-append "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/"
993 "superlu_dist_" version ".tar.gz"))
994 (sha256
995 (base32 "1hnak09yxxp026blq8zhrl7685yip16svwngh1wysqxf8z48vzfj"))
996 (patches (list (search-patch "superlu-dist-scotchmetis.patch")))))
997 (build-system gnu-build-system)
998 (native-inputs
999 `(("tcsh" ,tcsh)))
1000 (inputs
19afbea1 1001 `(("gfortran" ,gfortran)))
a54aefea
EB
1002 (propagated-inputs
1003 `(("openmpi" ,openmpi) ;headers include MPI heades
1004 ("lapack" ,lapack) ;required to link with output library
1005 ("pt-scotch" ,pt-scotch))) ;same
1006 (arguments
1007 `(#:parallel-build? #f ;race conditions using ar
1008 #:phases
1009 (alist-replace
1010 'configure
1011 (lambda* (#:key inputs outputs #:allow-other-keys)
1012 (call-with-output-file "make.inc"
1013 (lambda (port)
1014 (format port "
1015PLAT =
1016DSuperLUroot = ~a
1017DSUPERLULIB = ~a/lib/libsuperlu_dist.a
1018BLASDEF = -DUSE_VENDOR_BLAS
1019BLASLIB = -L~a/lib -lblas
1020PARMETISLIB = -L~a/lib \
1021 -lptscotchparmetis -lptscotch -lptscotcherr -lptscotcherrexit \
1022 -lscotch -lscotcherr -lscotcherrexit
1023METISLIB = -L~:*~a/lib \
1024 -lscotchmetis -lscotch -lscotcherr -lscotcherrexit
1025LIBS = $(DSUPERLULIB) $(PARMETISLIB) $(METISLIB) $(BLASLIB)
1026ARCH = ar
1027ARCHFLAGS = cr
1028RANLIB = ranlib
1029CC = mpicc
1030PIC = -fPIC
1031CFLAGS = -O3 -g -DPRNTlevel=0 $(PIC)
1032NOOPTS = -O0 -g $(PIC)
1033FORTRAN = mpifort
1034FFLAGS = -O2 -g $(PIC)
1035LOADER = $(CC)
1036CDEFS = -DAdd_"
1037 (getcwd)
1038 (assoc-ref outputs "out")
1039 (assoc-ref inputs "lapack")
1040 (assoc-ref inputs "pt-scotch")))))
1041 (alist-cons-after
1042 'unpack 'remove-broken-symlinks
1043 (lambda _
1044 (for-each delete-file
1045 (find-files "MAKE_INC" "\\.#make\\..*")))
1046 (alist-cons-before
1047 'build 'create-install-directories
1048 (lambda* (#:key outputs #:allow-other-keys)
1049 (for-each
1050 (lambda (dir)
1051 (mkdir-p (string-append (assoc-ref outputs "out")
1052 "/" dir)))
1053 '("lib" "include")))
1054 (alist-replace
1055 'check
1056 (lambda _
1057 (with-directory-excursion "EXAMPLE"
1058 (and
1059 (zero? (system* "mpirun" "-n" "2"
1060 "./pddrive" "-r" "1" "-c" "2" "g20.rua"))
1061 (zero? (system* "mpirun" "-n" "2"
1062 "./pzdrive" "-r" "1" "-c" "2" "cg20.cua")))))
1063 (alist-replace
1064 'install
1065 (lambda* (#:key outputs #:allow-other-keys)
1066 ;; Library is placed in lib during the build phase. Copy over
1067 ;; headers to include.
1068 (let* ((out (assoc-ref outputs "out"))
1069 (incdir (string-append out "/include")))
1070 (for-each (lambda (file)
1071 (let ((base (basename file)))
1072 (format #t "installing `~a' to `~a'~%"
1073 base incdir)
1074 (copy-file file
1075 (string-append incdir "/" base))))
1076 (find-files "SRC" ".*\\.h$"))))
1077 %standard-phases)))))))
1078 (home-page (package-home-page superlu))
1079 (synopsis "Parallel supernodal direct solver")
1080 (description
1081 "SuperLU_DIST is a parallel extension to the serial SuperLU library.
1082It is targeted for distributed memory parallel machines. SuperLU_DIST is
1083implemented in ANSI C, and MPI for communications.")
1084 (license license:bsd-3)))
1085
f8ed036a
EB
1086(define-public scotch
1087 (package
1088 (name "scotch")
6c798540 1089 (version "6.0.4")
f8ed036a
EB
1090 (source
1091 (origin
1092 (method url-fetch)
6c798540 1093 (uri (string-append "https://gforge.inria.fr/frs/download.php/34618/"
f8ed036a
EB
1094 "scotch_" version ".tar.gz"))
1095 (sha256
6c798540
EB
1096 (base32 "1ir088mvrqggyqdkx9qfynmiaffqbyih5qfl5mga2nrlm1qlsgzm"))
1097 (patches (list (search-patch "scotch-test-threading.patch")
1098 (search-patch "pt-scotch-build-parallelism.patch")))))
f8ed036a
EB
1099 (build-system gnu-build-system)
1100 (inputs
1101 `(("zlib" ,zlib)
1102 ("flex" ,flex)
1103 ("bison" ,bison)))
1104 (arguments
1105 `(#:phases
d6602ee9
EB
1106 (modify-phases %standard-phases
1107 (add-after
1108 'unpack 'chdir-to-src
1109 (lambda _ (chdir "src")))
1110 (replace
1111 'configure
1112 (lambda _
1113 (call-with-output-file "Makefile.inc"
1114 (lambda (port)
1115 (format port "
f8ed036a
EB
1116EXE =
1117LIB = .a
1118OBJ = .o
1119MAKE = make
1120AR = ar
1121ARFLAGS = -ruv
cf0ec6c4 1122CAT = cat
f8ed036a
EB
1123CCS = gcc
1124CCP = mpicc
1125CCD = gcc
1126CPPFLAGS =~{ -D~a~}
6c798540 1127CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
f8ed036a
EB
1128LDFLAGS = -lz -lm -lrt -lpthread
1129CP = cp
1130LEX = flex -Pscotchyy -olex.yy.c
1131LN = ln
1132MKDIR = mkdir
1133MV = mv
1134RANLIB = ranlib
1135YACC = bison -pscotchyy -y -b y
1136"
d6602ee9
EB
1137 '("COMMON_FILE_COMPRESS_GZ"
1138 "COMMON_PTHREAD"
1139 "COMMON_RANDOM_FIXED_SEED"
cf0ec6c4
EB
1140 ;; Prevents symbolc clashes with libesmumps
1141 "SCOTCH_RENAME"
d6602ee9
EB
1142 ;; XXX: Causes invalid frees in superlu-dist tests
1143 ;; "SCOTCH_PTHREAD"
1144 ;; "SCOTCH_PTHREAD_NUMBER=2"
1145 "restrict=__restrict"))))))
cf0ec6c4
EB
1146 (add-after
1147 'build 'build-esmumps
1148 (lambda _
1149 (zero? (system* "make"
1150 (format #f "-j~a" (parallel-job-count))
1151 "esmumps"))))
d6602ee9 1152 (replace
f8ed036a
EB
1153 'install
1154 (lambda* (#:key outputs #:allow-other-keys)
1155 (let ((out (assoc-ref outputs "out")))
1156 (mkdir out)
1157 (zero? (system* "make"
1158 (string-append "prefix=" out)
cf0ec6c4
EB
1159 "install"))
1160 ;; esmumps files are not installed with the above
1161 (for-each (lambda (f)
1162 (copy-file f (string-append out "/include/" f)))
1163 (find-files "../include" ".*esmumps.h$"))
1164 (for-each (lambda (f)
1165 (copy-file f (string-append out "/lib/" f)))
1166 (find-files "../lib" "^lib.*esmumps.*"))))))))
f8ed036a
EB
1167 (home-page "http://www.labri.fr/perso/pelegrin/scotch/")
1168 (synopsis "Programs and libraries for graph algorithms")
1169 (description "SCOTCH is a set of programs and libraries which implement
1170the static mapping and sparse matrix reordering algorithms developed within
1171the SCOTCH project. Its purpose is to apply graph theory, with a divide and
1172conquer approach, to scientific computing problems such as graph and mesh
1173partitioning, static mapping, and sparse matrix ordering, in application
1174domains ranging from structural mechanics to operating systems or
1175bio-chemistry.")
1176 ;; See LICENSE_en.txt
1177 (license license:cecill-c)))
6acb4adb
EB
1178
1179(define-public pt-scotch
1180 (package (inherit scotch)
1181 (name "pt-scotch")
1182 (propagated-inputs
1183 `(("openmpi" ,openmpi))) ;Headers include MPI headers
1184 (arguments
1185 (substitute-keyword-arguments (package-arguments scotch)
1186 ((#:phases scotch-phases)
d6602ee9
EB
1187 `(modify-phases ,scotch-phases
1188 (replace
1189 'build
d6602ee9
EB
1190 (lambda _
1191 (and
cf0ec6c4
EB
1192 (zero? (system* "make"
1193 (format #f "-j~a" (parallel-job-count))
1194 "ptscotch" "ptesmumps"))
d6602ee9
EB
1195 ;; Install the serial metis compatibility library
1196 (zero? (system* "make" "-C" "libscotchmetis" "install")))))
1197 (replace
1198 'check
1199 (lambda _ (zero? (system* "make" "ptcheck"))))))))
6acb4adb 1200 (synopsis "Programs and libraries for graph algorithms (with MPI)")))
5698b8b8 1201
aa75ad00
EB
1202(define-public metis
1203 (package
1204 (name "metis")
1205 (version "5.1.0")
1206 (source
1207 (origin
1208 (method url-fetch)
1209 (uri (string-append "http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/"
1210 "metis-" version ".tar.gz"))
1211 (sha256
1212 (base32
1213 "1cjxgh41r8k6j029yxs8msp3z6lcnpm16g5pvckk35kc7zhfpykn"))))
1214 (build-system cmake-build-system)
1215 (inputs
1216 `(("blas" ,openblas)))
1217 (arguments
1218 `(#:tests? #f ;no tests
1219 #:configure-flags `("-DSHARED=ON"
1220 ,(string-append "-DGKLIB_PATH=" (getcwd)
1221 "/metis-" ,version "/GKlib"))))
1222 (home-page "http://glaros.dtc.umn.edu/gkhome/metis/metis/overview")
1223 (synopsis "Graph partitioning and fill-reducing matrix ordering library")
1224 (description
1225 "METIS is a set of serial programs for partitioning graphs, partitioning
1226finite element meshes, and producing fill-reducing orderings for sparse
1227matrices. The algorithms implemented in METIS are based on the multilevel
1228recursive-bisection, multilevel k-way, and multi-constraint partitioning
1229schemes.")
1230 (license license:asl2.0))) ;As of version 5.0.3
1231
700ff222
EB
1232(define-public p4est
1233 (package
1234 (name "p4est")
1235 (version "1.1")
1236 (source
1237 (origin
1238 (method url-fetch)
1239 (uri (string-append "http://p4est.github.io/release/p4est-"
1240 version ".tar.gz"))
1241 (sha256
1242 (base32
1243 "0faina2h5qsx3m2izbzaj9bbakma1krbbjmq43wrp1hcbyijflqb"))))
1244 (build-system gnu-build-system)
1245 (inputs
1246 `(("fortran" ,gfortran)
1247 ("blas" ,openblas)
1248 ("lapack" ,lapack)
1249 ("zlib" ,zlib)))
1250 (arguments
1251 `(#:configure-flags `(,(string-append "BLAS_LIBS=-L"
1252 (assoc-ref %build-inputs "blas")
1253 " -lopenblas")
1254 ,(string-append "LAPACK_LIBS=-L"
1255 (assoc-ref %build-inputs "lapack")
1256 " -llapack"))))
1257 (home-page "http://www.p4est.org")
1258 (synopsis "Adaptive mesh refinement on forests of octrees")
1259 (description
1260 "The p4est software library enables the dynamic management of a
1261collection of adaptive octrees, conveniently called a forest of octrees.
1262p4est is designed to work in parallel and scales to hundreds of thousands of
1263processor cores.")
1264 (license license:gpl2+)))
1265
1266(define-public p4est-openmpi
1267 (package (inherit p4est)
1268 (name "p4est-openmpi")
1269 (inputs
1270 `(("mpi" ,openmpi)
1271 ,@(package-inputs p4est)))
1272 (arguments
1273 (substitute-keyword-arguments (package-arguments p4est)
1274 ((#:configure-flags cf)
1275 ``("--enable-mpi" ,@,cf))))
1276 (synopsis "Parallel adaptive mesh refinement on forests of octrees")))
1277
5698b8b8
JD
1278(define-public gsegrafix
1279 (package
1280 (name "gsegrafix")
1281 (version "1.0.6")
1282 (source
1283 (origin
1284 (method url-fetch)
1285 (uri (string-append "mirror://gnu/" name "/" name "-"
1286 version ".tar.gz"))
1287 (sha256
1288 (base32
1289 "1b13hvx063zv970y750bx41wpx6hwd5ngjhbdrna8w8yy5kmxcda"))))
1290 (build-system gnu-build-system)
1291 (arguments
1292 `(#:configure-flags '("LDFLAGS=-lm")))
1293 (inputs
1294 `(("libgnomecanvas" ,libgnomecanvas)
1295 ("libbonoboui" ,libbonoboui)
1296 ("libgnomeui" ,libgnomeui)
1297 ("libgnomeprintui" ,libgnomeprintui)
1298 ("popt" ,popt)))
1299 (native-inputs
1300 `(("pkg-config" ,pkg-config)))
1301 (home-page "http://www.gnu.org/software/gsegrafix/")
1302 (synopsis "GNOME application to create scientific and engineering plots")
1303 (description "GSEGrafix is an application which produces high-quality graphical
1304plots for science and engineering. Plots are specified via simple ASCII
1305parameter files and data files and are presented in an anti-aliased GNOME
1306canvas. The program supports rectangular two-dimensional plots, histograms,
1307polar-axis plots and three-dimensional plots. Plots can be printed or saved
1308to BMP, JPEG or PNG image formats.")
1309 (license license:gpl3+)))
8731e527
JD
1310
1311(define-public maxima
1312 (package
1313 (name "maxima")
77af7b24 1314 (version "5.36.1")
8731e527
JD
1315 (source
1316 (origin
1317 (method url-fetch)
1318 (uri (string-append "mirror://sourceforge/maxima/Maxima-source/"
1319 version "-source/" name "-" version ".tar.gz"))
1320 (sha256
1321 (base32
77af7b24
MW
1322 "0x1rk659sn3cq0n5c90848ilzr1gb1wf0072fl6jhkdq00qgh2s0"))
1323 (patches (list (search-patch "maxima-defsystem-mkdir.patch")))))
8731e527 1324 (build-system gnu-build-system)
df354a77
FB
1325 (inputs
1326 `(("gcl" ,gcl)
1327 ("gnuplot" ,gnuplot) ;for plots
f36afe4d 1328 ("tk" ,tk))) ;Tcl/Tk is used by 'xmaxima'
df354a77
FB
1329 (native-inputs
1330 `(("texinfo" ,texinfo)
1331 ("perl" ,perl)))
8731e527 1332 (arguments
df354a77
FB
1333 `(#:configure-flags
1334 (list "--enable-gcl"
1335 (string-append "--with-posix-shell="
1336 (assoc-ref %build-inputs "bash")
1337 "/bin/sh")
1338 (string-append "--with-wish="
1339 (assoc-ref %build-inputs "tk")
1340 "/bin/wish"
1341 (let ((v ,(package-version tk)))
1342 (string-take v (string-index-right v #\.)))))
df354a77 1343 ;; By default Maxima attempts to write temporary files to
77af7b24
MW
1344 ;; '/tmp/nix-build-maxima-*', which won't exist at run time.
1345 ;; Work around that.
df354a77 1346 #:make-flags (list "TMPDIR=/tmp")
df354a77 1347 #:phases (alist-cons-before
8731e527 1348 'check 'pre-check
df354a77 1349 (lambda _
8731e527 1350 (chmod "src/maxima" #o555))
f36afe4d
FB
1351 ;; Make sure the doc and emacs files are found in the
1352 ;; standard location. Also configure maxima to find gnuplot
1353 ;; without having it on the PATH.
1354 (alist-cons-after
1355 'install 'post-install
1356 (lambda* (#:key outputs inputs #:allow-other-keys)
1357 (let* ((gnuplot (assoc-ref inputs "gnuplot"))
1358 (out (assoc-ref outputs "out"))
1359 (datadir (string-append out "/share/maxima/" ,version)))
1360 (with-directory-excursion out
1361 (mkdir-p "share/emacs")
1362 (mkdir-p "share/doc")
1363 (symlink
1364 (string-append datadir "/emacs/")
1365 (string-append out "/share/emacs/site-lisp"))
1366 (symlink
1367 (string-append datadir "/doc/")
1368 (string-append out "/share/doc/maxima"))
1369 (with-atomic-file-replacement
1370 (string-append datadir "/share/maxima-init.lisp")
1371 (lambda (in out)
1372 (format out "~a ~s~a~%"
1373 "(setf $gnuplot_command "
1374 (string-append gnuplot "/bin/gnuplot") ")")
1375 (dump-port in out))))))
1376 %standard-phases))))
8731e527
JD
1377 (home-page "http://maxima.sourceforge.net")
1378 (synopsis "Numeric and symbolic expression manipulation")
1379 (description "Maxima is a system for the manipulation of symbolic and
1380numerical expressions. It yields high precision numeric results by using
1381exact fractions, arbitrary precision integers, and variable precision floating
e881752c 1382point numbers.")
8731e527
JD
1383 ;; Some files are lgpl2.1+. Some are gpl2+. Some explicitly state gpl1+.
1384 ;; Others simply say "GNU General Public License" without stating a
1385 ;; version (which implicitly means gpl1+).
1386 ;; At least one file (src/maxima.asd) says "version 2."
1387 ;; GPLv2 only is therefore the smallest subset.
f36afe4d 1388 (license license:gpl2)))
ec322be2 1389
9aafbc0c
MW
1390(define-public wxmaxima
1391 (package
1392 (name "wxmaxima")
1393 (version "15.04.0")
1394 (source
1395 (origin
1396 (method url-fetch)
1397 (uri (string-append "mirror://sourceforge/wxmaxima/wxMaxima/"
1398 version "/" name "-" version ".tar.gz"))
1399 (sha256
1400 (base32
1401 "1fm47ah4aw5qdjqhkz67w5fwhy8yfffa5z896crp0d3hk2bh4180"))))
1402 (build-system gnu-build-system)
1403 (inputs
1404 `(("wxwidgets" ,wxwidgets)
1405 ("maxima" ,maxima)))
1406 (arguments
1407 `(#:phases (modify-phases %standard-phases
1408 (add-after
1409 'install 'wrap-program
1410 (lambda* (#:key inputs outputs #:allow-other-keys)
1411 (wrap-program (string-append (assoc-ref outputs "out")
1412 "/bin/wxmaxima")
1413 `("PATH" ":" prefix
1414 (,(string-append (assoc-ref inputs "maxima")
1415 "/bin"))))
1416 #t)))))
1417 (home-page "https://andrejv.github.io/wxmaxima/")
1418 (synopsis "Graphical user interface for the Maxima computer algebra system")
1419 (description
1420 "wxMaxima is a graphical user interface for the Maxima computer algebra
1421system. It eases the use of Maxima by making most of its commands available
1422through a menu system and by providing input dialogs for commands that require
1423more than one argument. It also implements its own display engine that
1424outputs mathematical symbols directly instead of depicting them with ASCII
1425characters.
1426
1427wxMaxima also features 2D and 3D inline plots, simple animations, mixing of
1428text and mathematical calculations to create documents, exporting of input and
1429output to TeX, and a browser for Maxima's manual including command index and
1430full text searching.")
1431 (license license:gpl2+)))
1432
b15e47f9
RW
1433(define-public armadillo
1434 (package
1435 (name "armadillo")
1436 (version "6.400.3")
1437 (source (origin
1438 (method url-fetch)
1439 (uri (string-append "mirror://sourceforge/arma/armadillo-"
1440 version ".tar.gz"))
1441 (sha256
1442 (base32
1443 "0bsgrmldlx77w5x26n3axj1hg6iw6csyw0dwl1flrbdwl51f9701"))))
1444 (build-system cmake-build-system)
1445 (arguments `(#:tests? #f)) ;no test target
1446 (inputs
1447 `(("openblas" ,openblas)
1448 ("lapack" ,lapack)
1449 ("arpack" ,arpack-ng)))
1450 (home-page "http://arma.sourceforge.net/")
1451 (synopsis "C++ linear algebra library")
1452 (description
1453 "Armadillo is a C++ linear algebra library, aiming towards a good balance
1454between speed and ease of use. It is useful for algorithm development
1455directly in C++, or quick conversion of research code into production
1456environments. It can be used for machine learning, pattern recognition,
1457signal processing, bioinformatics, statistics, econometrics, etc. The library
1458provides efficient classes for vectors, matrices and cubes, as well as 150+
1459associated functions (eg. contiguous and non-contiguous submatrix views).")
1460 (license license:mpl2.0)))
1461
e22d4ca4
RW
1462(define-public armadillo-for-rcpparmadillo
1463 (package (inherit armadillo)
1464 (version "6.200.2")
1465 (source (origin
1466 (method url-fetch)
1467 (uri (string-append "mirror://sourceforge/arma/armadillo-"
1468 version ".tar.gz"))
1469 (sha256
1470 (base32
1471 "1f69rlqhnf2wv8khyn2a8vi6gx1i72qgfy8b9b760ssk85dcl763"))))))
1472
279663ef
RW
1473(define-public muparser
1474 (package
1475 (name "muparser")
1476 (version "2.2.5")
1477 (source
1478 (origin
1479 (method svn-fetch)
1480 (uri (svn-reference
1481 (url "http://muparser.googlecode.com/svn/trunk/")
1482 (revision 34)))
1483 (sha256
1484 (base32
1485 "1d6bdbhx9zj3srwj3m7c9hvr18gnx1fx43h6d25my7q85gicpcwn"))))
1486 (build-system gnu-build-system)
1487 (arguments
1488 `(#:configure-flags '("--enable-samples=no")
1489 #:tests? #f)) ;no "check" target
1490 (home-page "http://muparser.beltoforion.de/")
1491 (synopsis "Fast parser library for mathematical expressions")
1492 (description
1493 "muParser is an extensible high performance math parser library. It is
1494based on transforming an expression into a bytecode and precalculating
1495constant parts of it.")
1496 (license license:expat)))
1497
e73b49fb
RW
1498(define-public openblas
1499 (package
1500 (name "openblas")
69851c59 1501 (version "0.2.15")
e73b49fb
RW
1502 (source
1503 (origin
1504 (method url-fetch)
1505 (uri (string-append "https://github.com/xianyi/OpenBLAS/tarball/v"
1506 version))
1507 (file-name (string-append name "-" version ".tar.gz"))
1508 (sha256
1509 (base32
69851c59 1510 "1k5f6vjlk54qlplk5m7xkbaw6g2y7dl50lwwdv6xsbcsgsbxfcpy"))))
e73b49fb
RW
1511 (build-system gnu-build-system)
1512 (arguments
5b5ea159 1513 `(#:tests? #f ;no "check" target
bd0b4379
RW
1514 ;; DYNAMIC_ARCH is only supported on x86. When it is disabled and no
1515 ;; TARGET is specified, OpenBLAS will tune itself to the build host, so
1516 ;; we need to disable substitutions.
71923a91
AE
1517 #:substitutable?
1518 ,(let ((system (or (%current-target-system) (%current-system))))
1519 (or (string-prefix? "x86_64" system)
bd0b4379
RW
1520 (string-prefix? "i686" system)
1521 (string-prefix? "mips" system)))
e73b49fb
RW
1522 #:make-flags
1523 (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
1524 "SHELL=bash"
af5b817e
RW
1525 "NO_LAPACK=1"
1526 ;; Build the library for all supported CPUs. This allows
1527 ;; switching CPU targets at runtime with the environment variable
1528 ;; OPENBLAS_CORETYPE=<type>, where "type" is a supported CPU type.
71923a91
AE
1529 ;; Unfortunately, this is not supported on non-x86 architectures,
1530 ;; where it leads to failed builds.
1531 ,@(let ((system (or (%current-target-system) (%current-system))))
8a637e79
RW
1532 (cond
1533 ((or (string-prefix? "x86_64" system)
71923a91 1534 (string-prefix? "i686" system))
8a637e79
RW
1535 '("DYNAMIC_ARCH=1"))
1536 ;; On MIPS we force the "SICORTEX" TARGET, as for the other
1537 ;; two available MIPS targets special extended instructions
1538 ;; for Loongson cores are used.
1539 ((string-prefix? "mips" system)
1540 '("TARGET=SICORTEX"))
1541 (else '()))))
e73b49fb
RW
1542 ;; no configure script
1543 #:phases (alist-delete 'configure %standard-phases)))
1544 (inputs
19afbea1 1545 `(("fortran" ,gfortran)))
e73b49fb
RW
1546 (native-inputs
1547 `(("cunit" ,cunit)
1548 ("perl" ,perl)))
1549 (home-page "http://www.openblas.net/")
1550 (synopsis "Optimized BLAS library based on GotoBLAS")
1551 (description
1552 "OpenBLAS is a BLAS library forked from the GotoBLAS2-1.13 BSD version.")
1553 (license license:bsd-3)))
1554
e1605e36
RW
1555(define-public openlibm
1556 (package
1557 (name "openlibm")
1558 (version "0.4.1")
1559 (source
1560 (origin
1561 (method url-fetch)
1562 (uri (string-append "https://github.com/JuliaLang/openlibm/archive/v"
1563 version ".tar.gz"))
1564 (file-name (string-append name "-" version ".tar.gz"))
1565 (sha256
1566 (base32
1567 "0cwqqqlblj3kzp9aq1wnpfs1fl0qd1wp1xzm5shb09w06i4rh9nn"))))
1568 (build-system gnu-build-system)
1569 (arguments
1570 `(#:make-flags
1571 (list (string-append "prefix=" (assoc-ref %outputs "out")))
1572 #:phases
1573 ;; no configure script
1574 (alist-delete 'configure %standard-phases)
1575 #:tests? #f)) ;the tests are part of the default target
1576 (home-page "http://openlibm.org/")
1577 (synopsis "Portable C mathematical library (libm)")
1578 (description
1579 "OpenLibm is an effort to have a high quality, portable, standalone C
1580mathematical library (libm). It can be used standalone in applications and
1581programming language implementations. The project was born out of a need to
e881752c 1582have a good libm for the Julia programming language that worked consistently
e1605e36
RW
1583across compilers and operating systems, and in 32-bit and 64-bit
1584environments.")
1585 ;; See LICENSE.md for details.
1586 (license (list license:expat
1587 license:isc
1588 license:bsd-2
1589 license:public-domain
1590 license:lgpl2.1+))))
1591
e62be58f
RW
1592(define-public openspecfun
1593 (package
1594 (name "openspecfun")
1595 (version "0.4")
1596 (source
1597 (origin
1598 (method url-fetch)
1599 (uri (string-append "https://github.com/JuliaLang/openspecfun/archive/v"
1600 version ".tar.gz"))
1601 (file-name (string-append name "-" version ".tar.gz"))
1602 (sha256
1603 (base32
1604 "0nsa3jjmlhcqkw5ba5ypbn3n0c8b6lc22zzlxnmxkxi9shhdx65z"))))
1605 (build-system gnu-build-system)
1606 (arguments
1607 '(#:tests? #f ;no "check" target
1608 #:make-flags
1609 (list (string-append "prefix=" (assoc-ref %outputs "out")))
1610 ;; no configure script
1611 #:phases (alist-delete 'configure %standard-phases)))
1612 (inputs
19afbea1 1613 `(("fortran" ,gfortran)))
e62be58f
RW
1614 (home-page "https://github.com/JuliaLang/openspecfun")
1615 (synopsis "Collection of special mathematical functions")
1616 (description
1617 "Openspecfun provides AMOS and Faddeeva. AMOS (from Netlib) is a
1618portable package for Bessel Functions of a Complex Argument and Nonnegative
1619Order; it contains subroutines for computing Bessel functions and Airy
1620functions. Faddeeva allows computing the various error functions of arbitrary
1621complex arguments (Faddeeva function, error function, complementary error
1622function, scaled complementary error function, imaginary error function, and
1623Dawson function); given these, one can also easily compute Voigt functions,
1624Fresnel integrals, and similar related functions as well.")
1625 ;; Faddeeva is released under the Expat license; AMOS is included as
1626 ;; public domain software.
1627 (license (list license:expat license:public-domain))))
1628
2742f87e
RW
1629(define-public suitesparse
1630 (package
1631 (name "suitesparse")
1632 (version "4.4.3")
1633 (source
1634 (origin
1635 (method url-fetch)
1636 (uri (string-append
1637 "http://faculty.cse.tamu.edu/davis/SuiteSparse/SuiteSparse-"
1638 version ".tar.gz"))
1639 (sha256
1640 (base32
1641 "100hdzr0mf4mzlwnqpmwpfw4pymgsf9n3g0ywb1yps2nk1zbkdy5"))))
1642 (build-system gnu-build-system)
1643 (arguments
1644 '(#:parallel-build? #f ;cholmod build fails otherwise
1645 #:tests? #f ;no "check" target
1646 #:make-flags
1647 (list "CC=gcc"
1648 "BLAS=-lblas"
1649 "TBB=-ltbb"
1650 "CHOLMOD_CONFIG=-DNPARTITION" ;required when METIS is not used
1651 (string-append "INSTALL_LIB="
1652 (assoc-ref %outputs "out") "/lib")
1653 (string-append "INSTALL_INCLUDE="
1654 (assoc-ref %outputs "out") "/include"))
1655 #:phases
1656 (alist-cons-before
1657 'install 'prepare-out
1658 ;; README.txt states that the target directories must exist prior to
1659 ;; running "make install".
1660 (lambda _
1661 (mkdir-p (string-append (assoc-ref %outputs "out") "/lib"))
1662 (mkdir-p (string-append (assoc-ref %outputs "out") "/include")))
1663 ;; no configure script
1664 (alist-delete 'configure %standard-phases))))
1665 (inputs
1666 `(("tbb" ,tbb)
1667 ("lapack" ,lapack)))
1668 (home-page "http://faculty.cse.tamu.edu/davis/suitesparse.html")
1669 (synopsis "Suite of sparse matrix software")
1670 (description
1671 "SuiteSparse is a suite of sparse matrix algorithms, including: UMFPACK,
1672multifrontal LU factorization; CHOLMOD, supernodal Cholesky; SPQR,
1673multifrontal QR; KLU and BTF, sparse LU factorization, well-suited for circuit
1674simulation; ordering methods (AMD, CAMD, COLAMD, and CCOLAMD); CSparse and
1675CXSparse, a concise sparse Cholesky factorization package; and many other
1676packages.")
1677 ;; LGPLv2.1+:
1678 ;; AMD, CAMD, BTF, COLAMD, CCOLAMD, CSparse, CXSparse, KLU, LDL
1679 ;; GPLv2+:
1680 ;; GPUQREngine, RBio, SuiteSparse_GPURuntime, SuiteSparseQR, UMFPACK
1681 (license (list license:gpl2+ license:lgpl2.1+))))
1682
ec322be2
FB
1683(define-public atlas
1684 (package
1685 (name "atlas")
1686 (version "3.10.2")
1687 (source (origin
1688 (method url-fetch)
1689 (uri (string-append "mirror://sourceforge/math-atlas/atlas"
1690 version ".tar.bz2"))
1691 (sha256
1692 (base32
1693 "0bqh4bdnjdyww4mcpg6kn0x7338mfqbdgysn97dzrwwb26di7ars"))))
1694 (build-system gnu-build-system)
1695 (home-page "http://math-atlas.sourceforge.net/")
19afbea1 1696 (inputs `(("gfortran" ,gfortran)
ec322be2
FB
1697 ("lapack-tar" ,(package-source lapack))))
1698 (outputs '("out" "doc"))
01480b9e
FB
1699 ;; For the moment we drop support for MIPS at it fails to compile. See
1700 ;; https://lists.gnu.org/archive/html/guix-devel/2014-11/msg00516.html
1701 (supported-systems (delete "mips64el-linux" %supported-systems))
ec322be2
FB
1702 (arguments
1703 `(#:parallel-build? #f
1704 #:parallel-tests? #f
f15615b1
LC
1705
1706 ;; ATLAS tunes itself for the machine it is built on, as explained at
1707 ;; <http://lists.gnu.org/archive/html/guix-devel/2014-10/msg00305.html>.
1708 ;; For this reason, we want users to build it locally instead of using
1709 ;; substitutes.
1710 #:substitutable? #f
1711
ec322be2
FB
1712 #:modules ((srfi srfi-26)
1713 (srfi srfi-1)
1714 (guix build gnu-build-system)
1715 (guix build utils))
40029cbe 1716 #:configure-flags
ec322be2
FB
1717 `(;; Generate position independent code suitable for dynamic libraries
1718 ;; and use WALL timer to get more accurate timing.
1719 "-Fa" "alg" "-fPIC" "-D" "c" "-DWALL"
1720 ;; Set word width.
1721 "-b"
1722 ,,(if (string-match "64" (%current-system))
1723 "64"
1724 "32")
1725 ;; Disable parallel build as it gives errors: atlas_pthread.h is
1726 ;; needed to compile C files before it is generated.
1727 "-Ss" "pmake" "make -j 1"
af89a667
FB
1728 ;; Probe is failing for MIPS. We therefore define the system
1729 ;; architecture explicitly by setting (-A) MACHINETYPE = 49
1730 ;; 'MIPSR1xK' and (-V) ISA = 1 'none'.
1731 ,,@(if (string-prefix? "mips" (%current-system))
1732 (list "-A" "49" "-V" "1")
1733 (list))
ec322be2
FB
1734 ;; Generate shared libraries.
1735 "--shared"
1736 ;; Build a full LAPACK library.
1737 ,(string-append "--with-netlib-lapack-tarfile="
1738 (assoc-ref %build-inputs "lapack-tar")))
1739 #:phases
1740 (alist-cons-after
1741 'install 'install-doc
1742 (lambda* (#:key outputs inputs #:allow-other-keys)
40029cbe 1743 (let ((doc (string-append (assoc-ref outputs "doc")
ec322be2
FB
1744 "/share/doc/atlas")))
1745 (mkdir-p doc)
40029cbe 1746 (fold (lambda (file previous)
ec322be2
FB
1747 (and previous (zero? (system* "cp" file doc))))
1748 #t (find-files "../ATLAS/doc" ".*"))))
1749 (alist-cons-after
1750 'check 'check-pt
1751 (lambda _ (zero? (system* "make" "ptcheck")))
1752 ;; Fix files required to run configure.
1753 (alist-cons-before
1754 'configure 'fix-/bin/sh
1755 (lambda _
1756 ;; Use `sh', not `/bin/sh'.
1757 (substitute* (find-files "." "Makefile|configure|SpewMakeInc\\.c")
1758 (("/bin/sh")
1759 "sh")))
1760 ;; Fix /bin/sh in generated make files.
1761 (alist-cons-after
1762 'configure 'fix-/bin/sh-in-generated-files
1763 (lambda _
1764 (substitute* (find-files "." "^[Mm]ake\\.inc.*")
1765 (("/bin/sh")
1766 "sh")))
1767 ;; ATLAS configure program does not accepts the default flags
1768 ;; passed by the 'gnu-build-system'.
1769 (alist-replace
1770 'configure
1771 (lambda* (#:key native-inputs inputs outputs
1772 (configure-flags '())
1773 #:allow-other-keys #:rest args)
1774 (let* ((prefix (assoc-ref outputs "out"))
1775 (bash (or (and=> (assoc-ref
1776 (or native-inputs inputs) "bash")
1777 (cut string-append <> "/bin/bash"))
1778 "/bin/sh"))
1779 (flags `(,(string-append "--prefix=" prefix)
1780 ,@configure-flags))
1781 (abs-srcdir (getcwd))
1782 (srcdir (string-append "../" (basename abs-srcdir))))
1783 (format #t "source directory: ~s (relative from build: ~s)~%"
1784 abs-srcdir srcdir)
1785 (mkdir "../build")
1786 (chdir "../build")
1787 (format #t "build directory: ~s~%" (getcwd))
1788 (format #t "configure flags: ~s~%" flags)
1789 (zero? (apply system* bash
1790 (string-append srcdir "/configure")
1791 flags))))
1792 %standard-phases)))))))
1793 (synopsis "Automatically Tuned Linear Algebra Software")
1794 (description
1795 "ATLAS is an automatically tuned linear algebra software library
1796providing C and Fortran77 interfaces to a portably efficient BLAS
1797implementation, as well as a few routines from LAPACK.
1798
f15615b1
LC
1799Optimization occurs at build time. For this reason, the library is built on
1800the machine where it is installed, without resorting to pre-built substitutes.
ec322be2 1801
f15615b1
LC
1802Before building the library, CPU throttling should be disabled. This can be
1803done in the BIOS, or, on GNU/Linux, with the following commands:
ec322be2
FB
1804
1805cpufreq-selector -g performance -c 0
1806...
1807cpufreq-selector -g performance -c N-1
1808
1809where N is the number of cores of your CPU. Failure to do so will result in a
1810library with poor performance.")
1811 (license license:bsd-3)))
c12efc72
AE
1812
1813(define-public glm
1814 (package
1815 (name "glm")
1816 (version "0.9.6.3")
1817 (source
1818 (origin
1819 (method url-fetch)
1820 (uri (string-append "mirror://sourceforge/ogl-math/glm-"
1821 version ".zip"))
1822 (sha256
1823 (base32
1824 "1cnjmi033a16a95v6xfkr1bvfmkd26hzdjka8j1819hgn5b1nr8l"))))
1825 (build-system cmake-build-system)
1826 (native-inputs
1827 `(("unzip" ,unzip)))
1828 (home-page "http://glm.g-truc.net")
1829 (synopsis "OpenGL Mathematics library")
1830 (description "OpenGL Mathematics (GLM) is a header-only C++ mathematics
1831library for graphics software based on the OpenGL Shading Language (GLSL)
1832specifications.")
1833 (license license:expat)))
7f18257b
AE
1834
1835(define-public lpsolve
1836 (package
1837 (name "lpsolve")
1838 (version "5.5.2.0")
1839 (source
1840 (origin
1841 (method url-fetch)
1842 (uri (string-append "mirror://sourceforge/lpsolve/lpsolve/" version
1843 "/lp_solve_" version "_source.tar.gz"))
1844 (sha256
1845 (base32
1846 "176c7f023mb6b8bfmv4rfqnrlw88lsg422ca74zjh19i2h5s69sq"))
1847 (modules '((guix build utils)))
1848 (snippet
1849 '(substitute* (list "lp_solve/ccc" "lpsolve55/ccc")
1850 (("^c=cc") "c=gcc")
1851 ;; Pretend to be on a 64 bit platform to obtain a common directory
1852 ;; name for the build results on all architectures; nothing else
1853 ;; seems to depend on it.
1854 (("^PLATFORM=.*$") "PLATFORM=ux64\n")))))
1855 (build-system gnu-build-system)
1856 (arguments
1857 `(#:tests? #f ; no check target
1858 #:phases
1859 (modify-phases %standard-phases
1860 (delete 'configure)
1861 (replace 'build
1862 (lambda _
1863 (with-directory-excursion "lpsolve55"
1864 (system* "bash" "ccc"))
1865 (with-directory-excursion "lp_solve"
1866 (system* "bash" "ccc"))
1867 #t))
1868 (replace 'install
1869 (lambda* (#:key outputs #:allow-other-keys)
1870 (let* ((out (assoc-ref outputs "out"))
1871 (bin (string-append out "/bin"))
1872 (lib (string-append out "/lib"))
1873 ;; This is where LibreOffice expects to find the header
1874 ;; files, and where they are installed by Debian.
1875 (include (string-append out "/include/lpsolve")))
1876 (mkdir-p lib)
1877 (copy-file "lpsolve55/bin/ux64/liblpsolve55.a"
1878 (string-append lib "/liblpsolve55.a"))
1879 (copy-file "lpsolve55/bin/ux64/liblpsolve55.so"
1880 (string-append lib "/liblpsolve55.so"))
96c46210
LC
1881 (install-file "lp_solve/bin/ux64/lp_solve" bin)
1882
7f18257b
AE
1883 ;; Install a subset of the header files as on Debian
1884 ;; (plus lp_bit.h, which matches the regular expression).
96c46210
LC
1885 (for-each (lambda (name)
1886 (install-file name include))
1887 (find-files "." "lp_[HMSa-z].*\\.h$"))
7f18257b 1888 (with-directory-excursion "shared"
96c46210
LC
1889 (for-each (lambda (name)
1890 (install-file name include))
1891 (find-files "." "\\.h$")))
7f18257b
AE
1892 #t))))))
1893 (home-page "http://lpsolve.sourceforge.net/")
1894 (synopsis "Mixed integer linear programming (MILP) solver")
1895 (description
1896 "lp_solve is a mixed integer linear programming solver based on the
1897revised simplex and the branch-and-bound methods.")
1898 (license license:lgpl2.1+)))
a17d4564
EB
1899
1900(define-public dealii
1901 (package
1902 (name "dealii")
1903 (version "8.2.1")
1904 (source
1905 (origin
1906 (method url-fetch)
1907 (uri (string-append "https://github.com/dealii/dealii/releases/"
1908 "download/v" version "/dealii-" version ".tar.gz"))
1909 (sha256
1910 (base32
1911 "185jych0gdnpkjwxni7pd0dda149492zwq2457xdjg76bzj78mnp"))
1912 (patches (list (search-patch "dealii-p4est-interface.patch")))
1913 (modules '((guix build utils)))
1914 (snippet
1915 ;; Remove bundled sources: UMFPACK, TBB, muParser, and boost
1916 '(delete-file-recursively "bundled"))))
1917 (build-system cmake-build-system)
1918 (inputs
1919 `(("tbb" ,tbb)
1920 ("zlib" ,zlib)
1921 ("boost" ,boost)
1922 ("p4est" ,p4est)
1923 ("blas" ,openblas)
1924 ("lapack" ,lapack)
1925 ("arpack" ,arpack-ng)
1926 ("muparser" ,muparser)
1927 ("gfortran" ,gfortran)
1928 ("suitesparse" ,suitesparse))) ;for UMFPACK
1929 (arguments
1930 `(#:build-type "DebugRelease" ;only supports Release, Debug, or DebugRelease
1931 #:configure-flags '("-DCOMPAT_FILES=OFF") ;Follow new directory structure
1932 #:phases (modify-phases %standard-phases
1933 (add-after
1934 'install 'hint-example-prefix
1935 ;; Set Cmake hints in examples so that they can find this
1936 ;; deal.II when configuring.
1937 (lambda* (#:key outputs #:allow-other-keys)
1938 (let* ((out (assoc-ref %outputs "out"))
1939 (exmpl (string-append out "/share/doc"
1940 "/dealii/examples")))
1941 (substitute* (find-files exmpl "CMakeLists.txt")
1942 (("([[:space:]]*HINTS.*)\n" _ line)
1943 (string-append line " $ENV{HOME}/.guix-profile "
1944 out "\n")))
1945 #t))))))
1946 (home-page "https://www.dealii.org")
1947 (synopsis "Finite element library")
1948 (description
1949 "Deal.II is a C++ program library targeted at the computational solution
1950of partial differential equations using adaptive finite elements. The main
1951aim of deal.II is to enable rapid development of modern finite element codes,
1952using among other aspects adaptive meshes and a wide array of tools often used
1953in finite element programs.")
1954 (license license:lgpl2.1+)))
1955
1956(define-public dealii-openmpi
1957 (package (inherit dealii)
1958 (name "dealii-openmpi")
1959 (inputs
1960 `(("mpi" ,openmpi)
1961 ;;Supported only with MPI:
1962 ("p4est" ,p4est-openmpi)
1963 ("petsc" ,petsc-openmpi)
1964 ("slepc" ,slepc-openmpi)
1965 ("metis" ,metis) ;for MUMPS
1966 ("scalapack" ,scalapack) ;for MUMPS
1967 ("mumps" ,mumps-metis-openmpi) ;configure supports only metis orderings
1968 ("arpack" ,arpack-ng-openmpi)
1969 ,@(fold alist-delete (package-inputs dealii)
1970 '("p4est" "arpack"))))
1971 (arguments
1972 (substitute-keyword-arguments (package-arguments dealii)
1973 ((#:configure-flags cf)
1974 ``("-DMPI_C_COMPILER=mpicc"
1975 "-DMPI_CXX_COMPILER=mpicxx"
1976 "-DMPI_Fortran_COMPILER=mpifort"
1977 ,@,cf))))
1978 (synopsis "Finite element library (with MPI support)")))
194c7f95
AE
1979
1980(define-public flann
1981 (package
1982 (name "flann")
1983 (version "1.8.4")
1984 (source
1985 (origin
1986 (method url-fetch)
1987 (uri
1988 (string-append
1989 "http://www.cs.ubc.ca/research/flann/uploads/FLANN/flann-"
1990 version "-src.zip"))
1991 (sha256
1992 (base32
1993 "022w8hph7bli5zbpnk3z1qh1c2sl5hm8fw2ccim651ynn0hr7fyz"))))
1994 (build-system cmake-build-system)
1995 (native-inputs
1996 `(("unzip" ,unzip)))
1997 (inputs
1998 `(("hdf5" ,hdf5)
1999 ("octave" ,octave)
2000 ("python" ,python-2) ; print syntax
2001 ;; ("python2-numpy" ,python2-numpy) ; only required for the tests
2002 ("zlib" ,zlib)))
2003 (arguments
2004 `(#:tests? #f)) ; The test data are downloaded from the Internet.
2005 (home-page "http://www.cs.ubc.ca/research/flann/")
2006 (synopsis "Library for approximate nearest neighbors computation")
2007 (description "FLANN is a library for performing fast approximate
2008nearest neighbor searches in high dimensional spaces. It implements a
2009collection of algorithms and a system for automatically choosing the best
2010algorithm and optimum parameters depending on the dataset.
2011
2012FLANN is written in C++ and contains bindings for C, Octave and Python.")
2013 (license (license:non-copyleft "file://COPYING"
2014 "See COPYING in the distribution."))))
d8c97beb
EF
2015
2016(define-public wcalc
2017 (package
2018 (name "wcalc")
2019 (version "2.5")
2020 (source
2021 (origin
2022 (method url-fetch)
2023 (uri
2024 (string-append
2025 "mirror://sourceforge/w-calc/wcalc-" version ".tar.bz2"))
2026 (sha256
2027 (base32
2028 "1vi8dl6rccqiq1apmpwawyg2ywx6a1ic1d3cvkf2hlwk1z11fb0f"))))
2029 (build-system gnu-build-system)
2030 (inputs
2031 `(("mpfr" ,mpfr)
2032 ("readline" ,readline)))
2033 (home-page "http://w-calc.sourceforge.net/index.php")
2034 (synopsis "Flexible command-line scientific calculator")
2035 (description "Wcalc is a very capable calculator. It has standard functions
2036(sin, asin, and sinh for example, in either radians or degrees), many
2037pre-defined constants (pi, e, c, etc.), support for using variables, \"active\"
2038variables, a command history, hex/octal/binary input and output, unit
2039conversions, embedded comments, and an expandable expression entry field. It
2040evaluates expressions using the standard order of operations.")
2041 (license license:gpl2+)))
45147b0c
FH
2042
2043(define-public xaos
2044 (package
2045 (name "xaos")
2046 (version "3.6")
2047 (source (origin
2048 (method url-fetch)
2049 (uri (string-append "mirror://sourceforge/xaos/xaos-"
2050 version ".tar.gz"))
2051 (sha256
2052 (base32
2053 "15cd1cx1dyygw6g2nhjqq3bsfdj8sj8m4va9n75i0f3ryww3x7wq"))))
2054 (build-system gnu-build-system)
2055 (native-inputs `(("gettext" ,gnu-gettext)))
2056 (inputs `(("libx11" ,libx11)
2057 ("zlib" ,zlib)
2058 ("libpng" ,libpng)
2059 ("gsl" ,gsl)))
2060 (arguments
2061 `(#:tests? #f ;no "check" target
2062 #:make-flags '("LOCALEDIR=$DATAROOTDIR/locale")))
2063 (synopsis "Real-time fractal zoomer")
2064 (description "GNU XaoS is a graphical program that generates fractal
2065patterns and allows you to zoom in and out of them infinitely in a fluid,
2066continuous manner. It also includes tutorials that help to explain how fractals
2067are built. It can generate many different fractal types such as the Mandelbrot
2068set.")
2069 (home-page "http://www.gnu.org/software/xaos/")
2070 (license license:gpl2+)))