gnu: Add petsc-openmpi.
[jackhill/guix/guix.git] / gnu / packages / maths.scm
CommitLineData
8f8b2451 1;;; GNU Guix --- Functional package management for GNU
06ed5982 2;;; Copyright © 2013, 2014 Andreas Enge <andreas@enge.fr>
da95c817 3;;; Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org>
668c06ac 4;;; Copyright © 2014 John Darrington <jmd@gnu.org>
f5d5a346 5;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org>
8f8b2451
AE
6;;;
7;;; This file is part of GNU Guix.
8;;;
9;;; GNU Guix is free software; you can redistribute it and/or modify it
10;;; under the terms of the GNU General Public License as published by
11;;; the Free Software Foundation; either version 3 of the License, or (at
12;;; your option) any later version.
13;;;
14;;; GNU Guix is distributed in the hope that it will be useful, but
15;;; WITHOUT ANY WARRANTY; without even the implied warranty of
16;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17;;; GNU General Public License for more details.
18;;;
19;;; You should have received a copy of the GNU General Public License
20;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
21
22(define-module (gnu packages maths)
23 #:use-module (gnu packages)
24 #:use-module ((guix licenses)
25 #:renamer (symbol-prefix-proc 'license:))
26 #:use-module (guix packages)
27 #:use-module (guix download)
0e2672ae 28 #:use-module (guix utils)
da95c817 29 #:use-module (guix build-system cmake)
c9dfa3c7 30 #:use-module (guix build-system gnu)
3de01d3f
EB
31 #:use-module (gnu packages algebra)
32 #:use-module (gnu packages bison)
33 #:use-module (gnu packages cmake)
c9dfa3c7 34 #:use-module (gnu packages compression)
668c06ac 35 #:use-module (gnu packages curl)
57e544e8 36 #:use-module (gnu packages elf)
3de01d3f 37 #:use-module (gnu packages flex)
668c06ac 38 #:use-module (gnu packages fltk)
f3929800 39 #:use-module (gnu packages fontutils)
1dba6407 40 #:use-module (gnu packages gettext)
da95c817 41 #:use-module (gnu packages gcc)
73fed4f8 42 #:use-module (gnu packages gd)
668c06ac 43 #:use-module (gnu packages ghostscript)
f3929800 44 #:use-module (gnu packages gtk)
668c06ac
JD
45 #:use-module (gnu packages less)
46 #:use-module (gnu packages xorg)
47 #:use-module (gnu packages gl)
d8c7eeb9 48 #:use-module (gnu packages mpi)
b92eee75 49 #:use-module (gnu packages multiprecision)
668c06ac 50 #:use-module (gnu packages pcre)
c9dfa3c7
AE
51 #:use-module (gnu packages perl)
52 #:use-module (gnu packages pkg-config)
da95c817 53 #:use-module (gnu packages python)
c9dfa3c7 54 #:use-module (gnu packages readline)
183e44ae 55 #:use-module (gnu packages tcsh)
668c06ac 56 #:use-module (gnu packages texinfo)
73fed4f8 57 #:use-module (gnu packages texlive)
c9dfa3c7 58 #:use-module (gnu packages xml))
8f8b2451
AE
59
60(define-public units
61 (package
62 (name "units")
983815c8 63 (version "2.11")
8f8b2451
AE
64 (source (origin
65 (method url-fetch)
66 (uri (string-append "mirror://gnu/units/units-" version
67 ".tar.gz"))
68 (sha256 (base32
983815c8 69 "1gjs3wc212aaiq4r76hx9nl1h3fa39n0ljwl9420d6ixl3rdmdjk"))))
8f8b2451
AE
70 (build-system gnu-build-system)
71 (synopsis "Conversion between thousands of scales")
72 (description
574e86f9
LC
73 "GNU Units converts numeric quantities between units of measure. It
74can handle scale changes through adaptive usage of standard scale prefixes
75(micro-, kilo-, etc.). It can also handle nonlinear conversions such as
76Fahrenheit to Celsius. Its interpreter is powerful enough to be used
77effectively as a scientific calculator.")
8f8b2451
AE
78 (license license:gpl3+)
79 (home-page "http://www.gnu.org/software/units/")))
c9dfa3c7 80
88bd1804
AE
81(define-public gsl
82 (package
83 (name "gsl")
487da565 84 (version "1.16")
88bd1804
AE
85 (source
86 (origin
87 (method url-fetch)
88 (uri (string-append "mirror://gnu/gsl/gsl-"
89 version ".tar.gz"))
90 (sha256
91 (base32
487da565 92 "0lrgipi0z6559jqh82yx8n4xgnxkhzj46v96dl77hahdp58jzg3k"))))
88bd1804 93 (build-system gnu-build-system)
71e0f288 94 (arguments
487da565
AE
95 `(#:parallel-tests? #f
96 #:phases
71e0f288
AE
97 (alist-replace
98 'configure
99 (lambda* (#:key target system outputs #:allow-other-keys #:rest args)
100 (let ((configure (assoc-ref %standard-phases 'configure)))
101 ;; disable numerically unstable test on i686, see thread at
102 ;; http://lists.gnu.org/archive/html/bug-gsl/2011-11/msg00019.html
103 (if (string=? (or target system) "i686-linux")
104 (substitute* "ode-initval2/Makefile.in"
105 (("TESTS = \\$\\(check_PROGRAMS\\)") "TESTS =")))
106 (apply configure args)))
107 %standard-phases)))
88bd1804
AE
108 (home-page "http://www.gnu.org/software/gsl/")
109 (synopsis "Numerical library for C and C++")
110 (description
a22dc0c4
LC
111 "The GNU Scientific Library is a library for numerical analysis in C
112and C++. It includes a wide range of mathematical routines, with over 1000
113functions in total. Subject areas covered by the library include:
114differential equations, linear algebra, Fast Fourier Transforms and random
115numbers.")
88bd1804
AE
116 (license license:gpl3+)))
117
b92eee75
AE
118(define-public glpk
119 (package
120 (name "glpk")
1f1c0aff 121 (version "4.54")
b92eee75
AE
122 (source
123 (origin
124 (method url-fetch)
125 (uri (string-append "mirror://gnu/glpk/glpk-"
126 version ".tar.gz"))
127 (sha256
128 (base32
1f1c0aff 129 "18gr2anv8gyps6j9f22k7li6w07glvww666sdqblvlq2hh3whwmb"))))
b92eee75
AE
130 (build-system gnu-build-system)
131 (inputs
132 `(("gmp" ,gmp)))
133 (arguments
134 `(#:configure-flags '("--with-gmp")))
135 (home-page "http://www.gnu.org/software/glpk/")
79c311b8 136 (synopsis "GNU Linear Programming Kit, supporting the MathProg language")
b92eee75
AE
137 (description
138 "GLPK is a C library for solving large-scale linear programming (LP),
139mixed integer programming (MIP), and other related problems. It supports the
140GNU MathProg modeling language, a subset of the AMPL language, and features a
141translator for the language. In addition to the C library, a stand-alone
142LP/MIP solver is included in the package.")
143 (license license:gpl3+)))
144
c9dfa3c7
AE
145(define-public pspp
146 (package
147 (name "pspp")
e7d6f7bf 148 (version "0.8.2")
c9dfa3c7
AE
149 (source
150 (origin
151 (method url-fetch)
152 (uri (string-append "mirror://gnu/pspp/pspp-"
153 version ".tar.gz"))
154 (sha256
155 (base32
e7d6f7bf 156 "1w7h3dglgx0jlq1wb605b8pgfsk2vr1q2q2rj7bsajh9ihbcsixr"))))
c9dfa3c7
AE
157 (build-system gnu-build-system)
158 (inputs
f3929800
AE
159 `(("cairo" ,cairo)
160 ("fontconfig" ,fontconfig)
1dba6407 161 ("gettext" ,gnu-gettext)
c9dfa3c7
AE
162 ("gsl" ,gsl)
163 ("libxml2" ,libxml2)
f3929800 164 ("pango" ,pango)
c9dfa3c7 165 ("readline" ,readline)
e6a5ce8e
JD
166 ("gtk" ,gtk+-2)
167 ("gtksourceview" ,gtksourceview)
c9dfa3c7
AE
168 ("zlib" ,zlib)))
169 (native-inputs
170 `(("perl" ,perl)
171 ("pkg-config" ,pkg-config)))
c9dfa3c7
AE
172 (home-page "http://www.gnu.org/software/pspp/")
173 (synopsis "Statistical analysis")
174 (description
79c311b8
LC
175 "GNU PSPP is a statistical analysis program. It can perform
176descriptive statistics, T-tests, linear regression and non-parametric tests.
177It features both a graphical interface as well as command-line input. PSPP is
178designed to interoperate with Gnumeric, LibreOffice and OpenOffice. Data can
179be imported from spreadsheets, text files and database sources and it can be
180output in text, PostScript, PDF or HTML.")
c9dfa3c7 181 (license license:gpl3+)))
da95c817
NK
182
183(define-public lapack
184 (package
185 (name "lapack")
566146ab 186 (version "3.5.0")
da95c817
NK
187 (source
188 (origin
189 (method url-fetch)
190 (uri (string-append "http://www.netlib.org/lapack/lapack-"
191 version ".tgz"))
192 (sha256
193 (base32
566146ab 194 "0lk3f97i9imqascnlf6wr5mjpyxqcdj73pgj97dj2mgvyg9z1n4s"))))
da95c817
NK
195 (build-system cmake-build-system)
196 (home-page "http://www.netlib.org/lapack/")
57e544e8 197 (native-inputs `(("patchelf" ,patchelf))) ;for augment-rpath
da95c817
NK
198 (inputs `(("fortran" ,gfortran-4.8)
199 ("python" ,python-2)))
200 (arguments
06ed5982 201 `(#:configure-flags '("-DBUILD_SHARED_LIBS:BOOL=YES")
da95c817 202 #:phases (alist-cons-before
6a995754
LC
203 'check 'patch-python
204 (lambda* (#:key inputs #:allow-other-keys)
205 (let ((python (assoc-ref inputs "python")))
206 (substitute* "lapack_testing.py"
207 (("/usr/bin/env python") python))))
06ed5982 208 %standard-phases)))
da95c817
NK
209 (synopsis "Library for numerical linear algebra")
210 (description
211 "LAPACK is a Fortran 90 library for solving the most commonly occurring
212problems in numerical linear algebra.")
213 (license (license:bsd-style "file://LICENSE"
214 "See LICENSE in the distribution."))))
73fed4f8
JD
215
216(define-public gnuplot
217 (package
218 (name "gnuplot")
219 (version "4.6.3")
220 (source
221 (origin
222 (method url-fetch)
223 (uri (string-append "mirror://sourceforge/gnuplot/gnuplot/"
224 version "/gnuplot-" version ".tar.gz"))
225 (sha256
226 (base32
227 "1xd7gqdhlk7k1p9yyqf9vkk811nadc7m4si0q3nb6cpv4pxglpyz"))))
228 (build-system gnu-build-system)
229 (inputs `(("readline" ,readline)
230 ("cairo" ,cairo)
231 ("pango" ,pango)
232 ("gd" ,gd)))
233 (native-inputs `(("texlive" ,texlive)
234 ("pkg-config" ,pkg-config)))
235 (home-page "http://www.gnuplot.info")
236 (synopsis "Command-line driven graphing utility")
237 (description "Gnuplot is a portable command-line driven graphing
238utility. It was originally created to allow scientists and students to
239visualize mathematical functions and data interactively, but has grown to
240support many non-interactive uses such as web scripting. It is also used as a
241plotting engine by third-party applications like Octave.")
242 ;; X11 Style with the additional restriction that derived works may only be
243 ;; distributed as patches to the original.
244 (license (license:fsf-free
668c06ac
JD
245 "http://gnuplot.cvs.sourceforge.net/gnuplot/gnuplot/Copyright"))))
246
7ee3f1a2
JD
247(define-public hdf5
248 (package
249 (name "hdf5")
250 (version "1.8.12")
251 (source
252 (origin
253 (method url-fetch)
254 (uri (string-append "http://www.hdfgroup.org/ftp/HDF5/current/src/hdf5-"
255 version ".tar.bz2"))
256 (sha256
257 (base32 "0f9n0v3p3lwc7564791a39c6cn1d3dbrn7d1j3ikqsi27a8hy23d"))))
258 (build-system gnu-build-system)
259 (arguments
260 `(#:phases
d4bf49b1
EB
261 (alist-cons-before
262 'configure 'patch-configure
263 (lambda _
264 (substitute* "configure"
265 (("/bin/mv") "mv")))
7ee3f1a2
JD
266 %standard-phases)))
267 (outputs '("out" "bin" "lib" "include"))
268 (home-page "http://www.hdfgroup.org")
269 (synopsis "Management suite for extremely large and complex data")
270 (description "HDF5 is a suite that makes possible the management of
271extremely large and complex data collections.")
d4bf49b1
EB
272 (license (license:x11-style
273 "http://www.hdfgroup.org/ftp/HDF5/current/src/unpacked/COPYING"))))
7ee3f1a2
JD
274
275
668c06ac
JD
276;; For a fully featured Octave, users are strongly recommended also to install
277;; the following packages: texinfo, less, ghostscript, gnuplot.
278(define-public octave
279 (package
280 (name "octave")
281 (version "3.8.0")
282 (source
283 (origin
284 (method url-fetch)
285 (uri (string-append "mirror://gnu/octave/octave-"
286 version ".tar.gz"))
287 (sha256
288 (base32
289 "0ks9pr154syw0vb3jn6xsnrkkrbvf9y7i7gaxa28rz6ngxbxvq9l"))))
290 (build-system gnu-build-system)
291 (inputs
292 `(("lapack" ,lapack)
293 ("readline" ,readline)
294 ("glpk" ,glpk)
295 ("curl" ,curl)
296 ("pcre" ,pcre)
297 ("fltk" ,fltk)
298 ("fontconfig" ,fontconfig)
299 ("freetype" ,freetype)
7ee3f1a2
JD
300 ("hdf5-lib" ,hdf5 "lib")
301 ("hdf5-include" ,hdf5 "include")
668c06ac
JD
302 ("libxft" ,libxft)
303 ("mesa" ,mesa)
304 ("zlib" ,zlib)))
305 (native-inputs
306 `(("gfortran" ,gfortran-4.8)
307 ("pkg-config" ,pkg-config)
308 ("perl" ,perl)
309 ;; The following inputs are not actually used in the build process. However, the
310 ;; ./configure gratuitously tests for their existence and assumes that programs not
311 ;; present at build time are also not, and can never be, available at run time!
312 ;; If these inputs are therefore not present, support for them will be built out.
313 ;; However, Octave will still run without them, albeit without the features they
314 ;; provide.
315 ("less" ,less)
316 ("texinfo" ,texinfo)
317 ("ghostscript" ,ghostscript)
318 ("gnuplot" ,gnuplot)))
319 (arguments
320 `(#:configure-flags (list (string-append "--with-shell="
321 (assoc-ref %build-inputs "bash")
322 "/bin/sh"))))
323 (home-page "http://www.gnu.org/software/octave/")
324 (synopsis "High-level language for numerical computation")
325 (description "GNU Octave is a high-level interpreted language that is specialized
326for numerical computations. It can be used for both linear and non-linear
327applications and it provides great support for visualizing results. Work may
328be performed both at the interactive command-line as well as via script
329files.")
330 (license license:gpl3+)))
3de01d3f
EB
331
332(define-public gmsh
333 (package
334 (name "gmsh")
335 (version "2.8.4")
336 (source
337 (origin
338 (method url-fetch)
339 (uri (string-append "http://www.geuz.org/gmsh/src/gmsh-"
340 version "-source.tgz"))
341 (sha256
342 (base32 "0jv2yvk28w86rx5mvjkb0w12ff2jxih7axnpvznpd295lg5jg7hr"))
343 (modules '((guix build utils)))
344 (snippet
345 ;; Remove non-free METIS code
346 '(delete-file-recursively "contrib/Metis"))))
347 (build-system cmake-build-system)
348 (native-inputs `(("patchelf" ,patchelf))) ;for augment-rpath
349 (propagated-inputs
350 `(("fltk" ,fltk)
351 ("gfortran" ,gfortran-4.8)
352 ("gmp" ,gmp)
353 ("hdf5-lib" ,hdf5 "lib")
354 ("hdf5-include" ,hdf5 "include")
355 ("lapack" ,lapack)
356 ("mesa" ,mesa)
357 ("libx11" ,libx11)
358 ("libxext" ,libxext)))
359 (arguments
360 `(#:configure-flags `("-DENABLE_METIS:BOOL=OFF"
361 "-DENABLE_BUILD_SHARED:BOOL=ON"
362 "-DENABLE_BUILD_DYNAMIC:BOOL=ON")))
363 (home-page "http://www.geuz.org/gmsh/")
364 (synopsis "3D finite element grid generator")
edf684ef
EB
365 (description "Gmsh is a 3D finite element grid generator with a built-in
366CAD engine and post-processor. Its design goal is to provide a fast, light
367and user-friendly meshing tool with parametric input and advanced
368visualization capabilities. Gmsh is built around four modules: geometry,
369mesh, solver and post-processing. The specification of any input to these
370modules is done either interactively using the graphical user interface or in
371ASCII text files using Gmsh's own scripting language.")
3de01d3f 372 (license license:gpl2+)))
b9100e2f
EB
373
374(define-public petsc
375 (package
376 (name "petsc")
377 (version "3.4.4")
378 (source
379 (origin
380 (method url-fetch)
381 ;; The *-lite-* tarball does not contain the *large* documentation
382 (uri (string-append "http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/"
383 "petsc-lite-" version ".tar.gz"))
384 (sha256
385 (base32 "0v5dg6dhdjpi5ianvd4mm6hsvxzv1bsxwnh9f9myag0a0d9xk9iv"))
386 (patches
387 (list (search-patch "petsc-fix-threadcomm.patch")))))
388 (build-system gnu-build-system)
389 (native-inputs
390 `(("python" ,python-2)
391 ("perl" ,perl)))
392 (inputs
393 `(("gfortran" ,gfortran-4.8)
394 ("lapack" ,lapack)
f258212d 395 ("superlu" ,superlu)
b9100e2f
EB
396 ;; leaving out hdf5 and fftw, as petsc expects them to be built with mpi
397 ;; leaving out opengl, as configuration seems to only be for mac
398 ))
399 (arguments
400 `(#:test-target "test"
401 #:parallel-build? #f
402 #:configure-flags
403 `("--with-mpi=0"
f258212d
EB
404 "--with-openmp=1"
405 "--with-superlu=1"
406 ,(string-append "--with-superlu-include="
407 (assoc-ref %build-inputs "superlu") "/include")
408 ,(string-append "--with-superlu-lib="
409 (assoc-ref %build-inputs "superlu") "/lib/libsuperlu.a"))
b9100e2f
EB
410 #:phases
411 (alist-replace
412 'configure
413 ;; PETSc's configure script is actually a python script, so we can't
414 ;; run it with bash.
415 (lambda* (#:key outputs (configure-flags '())
416 #:allow-other-keys)
417 (let* ((prefix (assoc-ref outputs "out"))
418 (flags `(,(string-append "--prefix=" prefix)
419 ,@configure-flags)))
420 (format #t "build directory: ~s~%" (getcwd))
421 (format #t "configure flags: ~s~%" flags)
422 (zero? (apply system* "./configure" flags))))
423 (alist-cons-after
10b11968
EB
424 'configure 'clean-local-references
425 ;; Try to keep build directory names from leaking into compiled code
b9100e2f 426 (lambda* (#:key inputs outputs #:allow-other-keys)
10b11968
EB
427 (let ((out (assoc-ref outputs "out")))
428 (substitute* (find-files "." "^petsc(conf|machineinfo).h$")
429 (((getcwd)) out))))
430 (alist-cons-after
431 'install 'clean-install
432 ;; Try to keep installed files from leaking build directory names.
433 (lambda* (#:key inputs outputs #:allow-other-keys)
434 (let ((out (assoc-ref outputs "out"))
435 (fortran (assoc-ref inputs "gfortran")))
436 (substitute* (map (lambda (file)
437 (string-append out "/" file))
438 '("conf/petscvariables"
439 "conf/PETScConfig.cmake"))
440 (((getcwd)) out))
441 ;; Make compiler references point to the store
442 (substitute* (string-append out "/conf/petscvariables")
443 (("= g(cc|\\+\\+|fortran)" _ suffix)
444 (string-append "= " fortran "/bin/g" suffix)))
445 ;; PETSc installs some build logs, which aren't necessary.
446 (for-each (lambda (file)
447 (let ((f (string-append out "/" file)))
448 (when (file-exists? f)
449 (delete-file f))))
450 '("conf/configure.log"
451 "conf/make.log"
452 "conf/test.log"
453 "conf/error.log"
454 "conf/RDict.db"
455 ;; Once installed, should uninstall with Guix
456 "conf/uninstall.py"))))
457 %standard-phases)))))
b9100e2f
EB
458 (home-page "http://www.mcs.anl.gov/petsc")
459 (synopsis "Library to solve ODEs and algebraic equations")
460 (description "PETSc, pronounced PET-see (the S is silent), is a suite of
461data structures and routines for the scalable (parallel) solution of
462scientific applications modeled by partial differential equations.")
463 (license (license:bsd-style
464 "http://www.mcs.anl.gov/petsc/documentation/copyright.html"))))
465
466(define-public petsc-complex
467 (package (inherit petsc)
468 (name "petsc-complex")
469 (arguments
470 (substitute-keyword-arguments (package-arguments petsc)
471 ((#:configure-flags cf)
472 `(cons "--with-scalar-type=complex" ,cf))))
473 (description
474 (string-append (package-description petsc)
475 " Complex scalar type version."))))
183e44ae 476
d8c7eeb9
EB
477(define-public petsc-openmpi
478 (package (inherit petsc)
479 (name "petsc-openmpi")
480 (inputs
481 `(("openmpi" ,openmpi)
482 ,@(package-inputs petsc)))
483 (arguments
484 (substitute-keyword-arguments (package-arguments petsc)
485 ((#:configure-flags cf)
486 ``("--with-mpiexec=mpirun"
487 ,(string-append "--with-mpi-dir="
488 (assoc-ref %build-inputs "openmpi"))
489 ,@(delete "--with-mpi=0" ,cf)))))
490 (description
491 (string-append (package-description petsc)
492 " With OpenMPI parallelism support."))))
493
494(define-public petsc-complex-openmpi
495 (package (inherit petsc-complex)
496 (name "petsc-complex-openmpi")
497 (inputs
498 `(("openmpi" ,openmpi)
499 ,@(package-inputs petsc-complex)))
500 (arguments
501 (substitute-keyword-arguments (package-arguments petsc-complex)
502 ((#:configure-flags cf)
503 ``("--with-mpiexec=mpirun"
504 ,(string-append "--with-mpi-dir="
505 (assoc-ref %build-inputs "openmpi"))
506 ,@(delete "--with-mpi=0" ,cf)))))
507 (description
508 (string-append (package-description petsc-complex)
509 " With OpenMPI parallelism support."))))
510
183e44ae
EB
511(define-public superlu
512 (package
513 (name "superlu")
514 (version "4.3")
515 (source
516 (origin
517 (method url-fetch)
518 (uri (string-append "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/"
519 "superlu_" version ".tar.gz"))
520 (sha256
521 (base32 "10b785s9s4x0m9q7ihap09275pq4km3k2hk76jiwdfdr5qr2168n"))))
522 (build-system gnu-build-system)
523 (native-inputs
524 `(("tcsh" ,tcsh)))
525 (inputs
526 `(("lapack" ,lapack)
527 ("gfortran" ,gfortran-4.8)))
528 (arguments
529 `(#:parallel-build? #f
530 #:tests? #f ;tests are run as part of `make all`
531 #:phases
532 (alist-replace
533 'configure
534 (lambda* (#:key inputs outputs #:allow-other-keys)
535 (call-with-output-file "make.inc"
536 (lambda (port)
537 (format port "
538PLAT =
539SuperLUroot = ~a
540SUPERLULIB = ~a/lib/libsuperlu.a
541TMGLIB = libtmglib.a
542BLASDEF = -DUSE_VENDOR_BLAS
543BLASLIB = -L~a/lib -lblas
544LIBS = $(SUPERLULIB) $(BLASLIB)
545ARCH = ar
546ARCHFLAGS = cr
547RANLIB = ranlib
548CC = gcc
549PIC = -fPIC
550CFLAGS = -O3 -DPRNTlevel=0 $(PIC)
551NOOPTS = -O0 $(PIC)
552FORTRAN = gfortran
553FFLAGS = -O2 $(PIC)
554LOADER = $(CC)
555CDEFS = -DAdd_"
556 (getcwd)
557 (assoc-ref outputs "out")
558 (assoc-ref inputs "lapack")))))
559 (alist-cons-before
560 'build 'create-install-directories
561 (lambda* (#:key outputs #:allow-other-keys)
562 (for-each
563 (lambda (dir)
564 (mkdir-p (string-append (assoc-ref outputs "out")
565 "/" dir)))
566 '("lib" "include")))
567 (alist-replace
568 'install
569 (lambda* (#:key outputs #:allow-other-keys)
570 ;; Library is placed in lib during the build phase. Copy over
571 ;; headers to include.
572 (let* ((out (assoc-ref outputs "out"))
573 (incdir (string-append out "/include")))
574 (for-each (lambda (file)
575 (let ((base (basename file)))
576 (format #t "installing `~a' to `~a'~%"
577 base incdir)
578 (copy-file file
579 (string-append incdir "/" base))))
580 (find-files "SRC" ".*\\.h$"))))
581 %standard-phases)))))
582 (home-page "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/")
583 (synopsis "Supernodal direct solver for sparse linear systems")
584 (description
585 "SuperLU is a general purpose library for the direct solution of large,
586sparse, nonsymmetric systems of linear equations on high performance machines.
587The library is written in C and is callable from either C or Fortran. The
588library routines perform an LU decomposition with partial pivoting and
589triangular system solves through forward and back substitution. The library
590also provides threshold-based ILU factorization preconditioners.")
591 (license license:bsd-3)))