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