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