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