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, 2017, 2018 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, 2017, 2018 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, 2018 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, 2018 Kei Kebreau <kkebreau@posteo.net>
15 ;;; Copyright © 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
16 ;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
17 ;;; Copyright © 2016, 2017 Thomas Danckaert <post@thomasdanckaert.be>
18 ;;; Copyright © 2017 Paul Garlick <pgarlick@tourbillion-technology.com>
19 ;;; Copyright © 2017 Nils Gillmann <ng0@n0.is>
20 ;;; Copyright © 2017 Ben Woodcroft <donttrustben@gmail.com>
21 ;;; Copyright © 2017 Theodoros Foradis <theodoros@foradis.org>
22 ;;; Copyright © 2017 Arun Isaac <arunisaac@systemreboot.net>
23 ;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
24 ;;; Copyright © 2017 Dave Love <me@fx@gnu.org>
25 ;;; Copyright © 2018 Jan Nieuwenhuizen <janneke@gnu.org>
26 ;;; Copyright © 2018 Joshua Sierles, Nextjournal <joshua@nextjournal.com>
27 ;;; Copyright © 2018 Nadya Voronova <voronovank@gmail.com>
28 ;;; Copyright © 2018 Adam Massmann <massmannak@gmail.com>
29 ;;; Copyright © 2018 Marius Bakke <mbakke@fastmail.com>
31 ;;; This file is part of GNU Guix.
33 ;;; GNU Guix is free software; you can redistribute it and/or modify it
34 ;;; under the terms of the GNU General Public License as published by
35 ;;; the Free Software Foundation; either version 3 of the License, or (at
36 ;;; your option) any later version.
38 ;;; GNU Guix is distributed in the hope that it will be useful, but
39 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
40 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
41 ;;; GNU General Public License for more details.
43 ;;; You should have received a copy of the GNU General Public License
44 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
46 (define-module (gnu packages maths)
47 #:use-module (ice-9 regex)
48 #:use-module (gnu packages)
49 #:use-module ((guix licenses) #:prefix license:)
50 #:use-module (guix packages)
51 #:use-module (guix download)
52 #:use-module (guix git-download)
53 #:use-module (guix utils)
54 #:use-module (guix build utils)
55 #:use-module (guix build-system cmake)
56 #:use-module (guix build-system gnu)
57 #:use-module (guix build-system ocaml)
58 #:use-module (guix build-system python)
59 #:use-module (guix build-system r)
60 #:use-module (guix build-system ruby)
61 #:use-module (gnu packages algebra)
62 #:use-module (gnu packages audio)
63 #:use-module (gnu packages autotools)
64 #:use-module (gnu packages bison)
65 #:use-module (gnu packages boost)
66 #:use-module (gnu packages check)
67 #:use-module (gnu packages cmake)
68 #:use-module (gnu packages compression)
69 #:use-module (gnu packages curl)
70 #:use-module (gnu packages cyrus-sasl)
71 #:use-module (gnu packages documentation)
72 #:use-module (gnu packages elf)
73 #:use-module (gnu packages flex)
74 #:use-module (gnu packages fltk)
75 #:use-module (gnu packages fontutils)
76 #:use-module (gnu packages gettext)
77 #:use-module (gnu packages gcc)
78 #:use-module (gnu packages gd)
79 #:use-module (gnu packages ghostscript)
80 #:use-module (gnu packages graphviz)
81 #:use-module (gnu packages gtk)
82 #:use-module (gnu packages image)
83 #:use-module (gnu packages java)
84 #:use-module (gnu packages less)
85 #:use-module (gnu packages lisp)
86 #:use-module (gnu packages linux)
87 #:use-module (gnu packages logging)
88 #:use-module (gnu packages lua)
89 #:use-module (gnu packages gnome)
90 #:use-module (gnu packages guile)
91 #:use-module (gnu packages xorg)
92 #:use-module (gnu packages gl)
93 #:use-module (gnu packages imagemagick)
94 #:use-module (gnu packages m4)
95 #:use-module (gnu packages mpi)
96 #:use-module (gnu packages multiprecision)
97 #:use-module (gnu packages netpbm)
98 #:use-module (gnu packages ocaml)
99 #:use-module (gnu packages pcre)
100 #:use-module (gnu packages popt)
101 #:use-module (gnu packages perl)
102 #:use-module (gnu packages pkg-config)
103 #:use-module (gnu packages pulseaudio)
104 #:use-module (gnu packages python)
105 #:use-module (gnu packages python-web)
106 #:use-module (gnu packages qt)
107 #:use-module (gnu packages readline)
108 #:use-module (gnu packages ruby)
109 #:use-module (gnu packages tbb)
110 #:use-module (gnu packages scheme)
111 #:use-module (gnu packages shells)
112 #:use-module (gnu packages tcl)
113 #:use-module (gnu packages texinfo)
114 #:use-module (gnu packages tex)
115 #:use-module (gnu packages tls)
116 #:use-module (gnu packages version-control)
117 #:use-module (gnu packages wxwidgets)
118 #:use-module (gnu packages xml)
119 #:use-module (srfi srfi-1))
127 (uri (string-append "mirror://gnu/" name "/" name "-" version ".tar.gz"))
129 "1q1887ryqdr9sn0522hc7p16kqwlxxyz5dkmma8ar2nxplhgll7q"))))
130 (build-system gnu-build-system)
131 (inputs `(("gtk+" ,gtk+)
132 ("libxml2" ,libxml2)))
133 (native-inputs `(("pkg-config" ,pkg-config)))
134 (synopsis "Natural deduction first-order logic interface")
135 (description "Aris is a program for performing logical proofs. It supports
136 propositional and predicate logic, as well as Boolean algebra and
137 arithmetical logic. In addition to its predefined inference and equivalence
138 rules, Aris also supports references to older proofs. Its use of standard
139 logical symbols and its natural deduction interface make it easy to use for
141 (license license:gpl3+)
142 (home-page "https://www.gnu.org/software/aris/")))
144 (define-public c-graph
150 (uri (string-append "mirror://gnu/c-graph/c-graph-" version
153 "1hlvpzrh7hzzf533diyfiabzskddi8zx92av9hwkjw3l46z7qv01"))))
154 (build-system gnu-build-system)
156 `(("fortran" ,gfortran)))
157 (synopsis "Visualizing and demonstrating convolution")
159 "GNU C-Graph is a tool for demonstrating the theory of convolution.
160 Thus, it can serve as an excellent aid to students of signal and systems
161 theory in visualizing the convolution process. Rather than forcing the
162 student to write code, the program offers an intuitive interface with
163 interactive dialogs to guide them.")
164 (license license:gpl3+)
165 (home-page "https://www.gnu.org/software/c-graph/")))
174 (uri (string-append "https://github.com/stcorp/coda/releases/download/"
175 version "/coda-" version ".tar.gz"))
177 (base32 "1zlzgcvwmmjm8mw8w4rg2rqy0pjilz7kyyxm0y4p8cbljbbjxxz0"))
178 (patches (search-patches "coda-use-system-libs.patch"))
179 (modules '((guix build utils)))
181 ;; Make sure we don't use the bundled software.
183 (for-each (lambda (d)
184 (delete-file-recursively (string-append "libcoda/" d)))
185 '("zlib" "pcre" "expat"))
188 `(("fortran" ,gfortran)
190 ("python-numpy" ,python-numpy)))
197 (build-system gnu-build-system)
199 '(#:configure-flags '("--with-hdf4" "--with-hdf5" "--enable-python"
200 "LIBS= -lz -lpcre -lexpat")))
201 (synopsis "A common interface to various earth observation data formats")
203 "The Common Data Access toolbox (CODA) provides a set of interfaces for
204 reading remote sensing data from earth observation data files. It consists of
205 command line applications and interfaces to the C, Fortran, Python, and Java
206 programming languages.")
207 (home-page "https://stcorp.nl/coda")
208 (license license:gpl2+)))
216 (uri (string-append "mirror://gnu/units/units-" version
219 "11hnp3gcmcc5kci2caxw4hs6m08h2mhqs3xzqq7iafx1ha2ggwyw"))))
220 (build-system gnu-build-system)
222 `(("readline" ,readline)
223 ("python" ,python-wrapper) ;for 'units_cur' script
224 ("python-requests" ,python-requests)))
226 `(#:phases (modify-phases %standard-phases
227 (add-after 'install 'wrap-units_cur
228 (lambda* (#:key outputs #:allow-other-keys)
229 (let* ((out (assoc-ref outputs "out"))
230 (bin (string-append out "/bin")))
231 (wrap-program (string-append bin "/units_cur")
232 `("PYTHONPATH" ":" prefix
233 ,(search-path-as-string->list (getenv "PYTHONPATH"))))
235 (synopsis "Conversion between thousands of scales")
237 "GNU Units converts numeric quantities between units of measure. It
238 can handle scale changes through adaptive usage of standard scale
239 prefixes (micro-, kilo-, etc.). It can also handle nonlinear
240 conversions such as Fahrenheit to Celsius. Its interpreter is powerful
241 enough to be used effectively as a scientific calculator.")
242 (license license:gpl3+)
243 (home-page "https://www.gnu.org/software/units/")))
245 (define-public double-conversion
247 (name "double-conversion")
252 "https://github.com/floitsch/double-conversion/archive/v"
254 (file-name (string-append name "-" version ".tar.gz"))
257 "0cnr8xhyjfxijay8ymkqcph3672wp2lj23qhdmr3m4kia5kpdf83"))))
258 (build-system cmake-build-system)
260 '(#:test-target "test"
261 #:configure-flags '("-DBUILD_SHARED_LIBS=ON"
262 "-DBUILD_TESTING=ON")))
263 (home-page "https://github.com/floitsch/double-conversion")
264 (synopsis "Conversion routines for IEEE doubles")
266 "The double-conversion library provides binary-decimal and decimal-binary
267 routines for IEEE doubles. The library consists of efficient conversion
268 routines that have been extracted from the V8 JavaScript engine.")
269 (license license:bsd-3)))
271 (define-public dionysus
277 (uri (string-append "mirror://gnu/dionysus/dionysus-" version
281 "194pzs1mlsj4ww6v37qq3961h5hckm5h805cv0r14xj3g9wfx2sk"))))
282 (build-system gnu-build-system)
283 (inputs `(("tcl" ,tcl))) ;for 'tclsh'
284 (synopsis "Local search for universal constants and scientific values")
286 "GNU Dionysus is a convenient system for quickly retrieving the values of
287 mathematical constants used in science and engineering. Values can be
288 searched using a simple command-line tool, choosing from three databases:
289 universal constants, atomic numbers, and constants related to
291 (license license:gpl3+)
292 (home-page "https://www.gnu.org/software/dionysus/")))
300 (uri (string-append "mirror://gnu/gsl/gsl-"
304 "1395y9hlhqadn5g9j8q22224fds5sd92jxi9czfavjj24myasq04"))
305 (patches (search-patches "gsl-test-i686.patch"))))
306 (build-system gnu-build-system)
308 `(;; Currently there are numerous tests that fail on "exotic"
309 ;; architectures such as aarch64 and ppc64le.
310 ,@(if (string-prefix? "aarch64-linux"
311 (or (%current-target-system) (%current-system)))
314 (home-page "https://www.gnu.org/software/gsl/")
315 (synopsis "Numerical library for C and C++")
317 "The GNU Scientific Library is a library for numerical analysis in C
318 and C++. It includes a wide range of mathematical routines, with over 1000
319 functions in total. Subject areas covered by the library include:
320 differential equations, linear algebra, Fast Fourier Transforms and random
322 (license license:gpl3+)))
324 (define-public ocaml-gsl
333 "https://github.com/mmottl/gsl-ocaml/releases/download/v"
334 version"/gsl-ocaml-" version ".tar.gz"))
337 "0nzp43hp8pbjqkrxnwp5lgjrabxayf61h18fjaydi0s5faq6f3xh"))))
338 (build-system ocaml-build-system)
341 (home-page "https://mmottl.github.io/gsl-ocaml")
342 (synopsis "Bindings to the GNU Scientific Library")
344 "GSL-OCaml is an interface to the @dfn{GNU scientific library} (GSL) for
345 the OCaml language.")
346 (license license:gpl3+)))
348 (define-public ocaml4.01-gsl
349 (package-with-ocaml4.01 ocaml-gsl))
358 (uri (string-append "mirror://gnu/glpk/glpk-"
362 "040sfaa9jclg2nqdh83w71sv9rc1sznpnfiripjdyr48cady50a2"))))
363 (build-system gnu-build-system)
367 `(#:configure-flags '("--with-gmp")))
368 (home-page "https://www.gnu.org/software/glpk/")
369 (synopsis "GNU Linear Programming Kit, supporting the MathProg language")
371 "GLPK is a C library for solving large-scale linear programming (LP),
372 mixed integer programming (MIP), and other related problems. It supports the
373 GNU MathProg modeling language, a subset of the AMPL language, and features a
374 translator for the language. In addition to the C library, a stand-alone
375 LP/MIP solver is included in the package.")
376 (license license:gpl3+)))
385 (uri (string-append "http://www.4ti2.de/version_" version
386 "/4ti2-" version ".tar.gz"))
389 "1frix3rnm9ffr93alqzw4cavxbfpf524l8rfbmcpyhwd3n1km0yl"))))
390 (build-system gnu-build-system)
392 `(("which" ,(@ (gnu packages base) which)))) ; for the tests
396 (home-page "http://www.4ti2.de/")
397 (synopsis "Mathematical tool suite for problems on linear spaces")
399 "4ti2 implements algorithms for solving algebraic, geometric and
400 combinatorial problems on linear spaces. Among others, it solves systems
401 of linear equations, computes extreme rays of polyhedral cones, solves
402 integer programming problems and computes Markov bases for statistics.")
403 (license license:gpl2+)))
405 (define-public cddlib
412 (uri (string-append "ftp://ftp.math.ethz.ch/users/fukudak/cdd/cddlib-"
413 (string-delete #\. version) ".tar.gz"))
416 "1dasasscwfg793q8fwzgwf64xwj7w62yfvszpr8x8g38jka08vgy"))))
417 (build-system gnu-build-system)
420 (home-page "https://www.inf.ethz.ch/personal/fukudak/cdd_home/index.html")
421 (synopsis "Library for convex hulls and extreme rays of polyhedra")
423 "The C-library cddlib implements the Double Description Method of
424 Motzkin et al. for generating all vertices (i.e. extreme points) and extreme
425 rays of a general convex polyhedron given by a system of linear inequalities
426 in arbitrary dimension. It can also be used for the converse operation of
427 computing convex hulls.")
428 (license license:gpl2+)))
430 (define-public arpack-ng
434 (home-page "https://github.com/opencollab/arpack-ng")
438 (uri (string-append home-page "/archive/" version ".tar.gz"))
439 (file-name (string-append name "-" version ".tar.gz"))
442 "0f8jx3fifmj9qdp289zr7r651y1q48k1jya859rqxq62mvis7xsh"))))
443 (build-system gnu-build-system)
445 '(#:phases (modify-phases %standard-phases
446 (add-after 'unpack 'autoreconf
448 (invoke "autoreconf" "-vfi"))))))
450 `(("autoconf" ,autoconf)
451 ("automake" ,automake)
452 ("libtool" ,libtool)))
455 ("fortran" ,gfortran)))
456 (synopsis "Fortran subroutines for solving eigenvalue problems")
458 "ARPACK-NG is a collection of Fortran77 subroutines designed to solve
459 large scale eigenvalue problems.")
460 (license (license:non-copyleft "file://COPYING"
461 "See COPYING in the distribution."))))
463 (define-public arpack-ng-3.3.0
467 (name (package-name arpack-ng))
468 (home-page (package-home-page arpack-ng))
472 (uri (string-append home-page "/archive/" version ".tar.gz"))
473 (file-name (string-append name "-" version ".tar.gz"))
476 "1cz53wqzcf6czmcpfb3vb61xi0rn5bwhinczl65hpmbrglg82ndd"))))))
478 (define-public arpack-ng-openmpi
479 (package (inherit arpack-ng)
480 (name "arpack-ng-openmpi")
483 ,@(package-inputs arpack-ng)))
485 (substitute-keyword-arguments (package-arguments arpack-ng)
486 ((#:configure-flags _ '())
487 ''("--enable-mpi"))))
488 (synopsis "Fortran subroutines for solving eigenvalue problems with MPI")))
490 (define-public lapack
497 (uri (string-append "http://www.netlib.org/lapack/lapack-"
501 "1j51r7n5w4k7r3lrvy7710xrpkg40wf4rqnmngfz6ck9ypckzign"))))
502 (build-system cmake-build-system)
503 (home-page "http://www.netlib.org/lapack/")
504 (inputs `(("fortran" ,gfortran)
505 ("python" ,python-2)))
507 `(#:configure-flags (list
508 "-DBUILD_SHARED_LIBS:BOOL=YES"
511 ;; Build the 'LAPACKE_clatms' functions.
512 "-DLAPACKE_WITH_TMG=ON")
514 (modify-phases %standard-phases
515 (add-before 'check 'patch-python
516 (lambda* (#:key inputs #:allow-other-keys)
517 (let ((python (assoc-ref inputs "python")))
518 (substitute* "lapack_testing.py"
519 (("/usr/bin/env python") python)))
521 (synopsis "Library for numerical linear algebra")
523 "LAPACK is a Fortran 90 library for solving the most commonly occurring
524 problems in numerical linear algebra.")
525 (license (license:non-copyleft "file://LICENSE"
526 "See LICENSE in the distribution."))))
528 (define-public scalapack
535 (uri (string-append "http://www.netlib.org/scalapack/scalapack-"
539 "0p1r61ss1fq0bs8ynnx7xq4wwsdvs32ljvwjnx6yxr8gd6pawx0c"))))
540 (build-system cmake-build-system)
543 ("fortran" ,gfortran)
544 ("lapack" ,lapack))) ;for testing only
546 `(#:configure-flags `("-DBUILD_SHARED_LIBS:BOOL=YES")
547 #:phases (modify-phases %standard-phases
548 (add-before 'check 'set-test-environment
550 ;; By default, running the test suite would fail because
551 ;; 'ssh' could not be found in $PATH. Define this
552 ;; variable to placate Open MPI without adding a
553 ;; dependency on OpenSSH (the agent isn't used anyway.)
554 (setenv "OMPI_MCA_plm_rsh_agent" (which "cat"))
556 (home-page "http://www.netlib.org/scalapack/")
557 (synopsis "Library for scalable numerical linear algebra")
559 "ScaLAPACK is a Fortran 90 library of high-performance linear algebra
560 routines on parallel distributed memory machines. ScaLAPACK solves dense and
561 banded linear systems, least squares problems, eigenvalue problems, and
562 singular value problems.")
563 (license (license:bsd-style "file://LICENSE"
564 "See LICENSE in the distribution."))))
566 (define-public gnuplot
572 (uri (string-append "mirror://sourceforge/gnuplot/gnuplot/"
577 "18diyy7aib9mn098x07g25c7jij1x7wbfpicz0z8gwxx08px45m4"))))
578 (build-system gnu-build-system)
579 (inputs `(("readline" ,readline)
585 `(("pkg-config" ,pkg-config)
586 ("texlive" ,texlive-tiny)))
587 (arguments `(#:configure-flags (list (string-append
588 "--with-texdir=" %output
589 "/texmf-local/tex/latex/gnuplot"))))
590 (home-page "http://www.gnuplot.info")
591 (synopsis "Command-line driven graphing utility")
592 (description "Gnuplot is a portable command-line driven graphing
593 utility. It was originally created to allow scientists and students to
594 visualize mathematical functions and data interactively, but has grown to
595 support many non-interactive uses such as web scripting. It is also used as a
596 plotting engine by third-party applications like Octave.")
597 ;; X11 Style with the additional restriction that derived works may only be
598 ;; distributed as patches to the original.
599 (license (license:fsf-free
600 "http://gnuplot.cvs.sourceforge.net/gnuplot/gnuplot/Copyright"))))
609 (uri (string-append "https://github.com/OkoSanto/GCTP/archive/v"
611 (file-name (string-append name "-" version ".tar.gz"))
614 "0l9aqnqynh9laicn5dxf3rsb1n14xiks79wbyqccirzmjqd1c1x4"))))
616 `(("fortran" ,gfortran)))
617 (build-system gnu-build-system)
618 (synopsis "General Cartographic Transformation Package (GCTP)")
620 "The General Cartographic Transformation Package (GCTP) is a system of
621 software routines designed to permit the transformation of coordinate pairs
622 from one map projection to another. The GCTP is the standard computer
623 software used by the National Mapping Division for map projection
625 (home-page "https://github.com/OkoSanto/GCTP")
626 (license license:public-domain))) ;https://www2.usgs.gov/laws/info_policies.html
635 (uri (string-append "https://support.hdfgroup.org/ftp/HDF/releases/HDF"
636 version "/src/hdf-" version ".tar.bz2"))
638 (base32 "1wz0586zh91pqb95wvr0pbh71a8rz358fdj6n2ksp85x2cis9lsm"))
639 (patches (search-patches "hdf4-architectures.patch"
640 "hdf4-reproducibility.patch"
641 "hdf4-shared-fortran.patch"))))
642 (build-system gnu-build-system)
644 `(("gfortran" ,gfortran)
649 ("libjpeg" ,libjpeg)))
651 `(#:parallel-tests? #f
652 #:configure-flags '("--enable-shared")
654 (modify-phases %standard-phases
655 ;; This is inspired by two of Debian's patches.
656 (add-before 'configure 'add-more-aarch64-support
658 (substitute* '("mfhdf/ncgen/ncgen.l"
659 "mfhdf/ncgen/ncgenyy.c"
660 "mfhdf/libsrc/netcdf.h.in")
661 (("AIX5L64") "__aarch64__"))
663 (add-before 'configure 'patchbuild
666 '("mfhdf/hdfimport/testutil.sh.in" "hdf/util/testutil.sh.in")
668 (("/bin/mkdir") "mkdir"))
669 (substitute* (find-files "." "^Makefile\\.in$")
670 (("@HDF_BUILD_XDR_TRUE@XDR_ADD = \
671 -R\\$\\(abs_top_builddir\\)/mfhdf/xdr/\\.libs") "")
672 (("@HDF_BUILD_SHARED_TRUE@AM_LDFLAGS = \
673 -R\\$\\(abs_top_builddir\\)/mfhdf/libsrc/\\.libs \
674 -R\\$\\(abs_top_builddir\\)/hdf/src/\\.libs \\$\\(XDR_ADD\\)") ""))
676 (add-after 'configure 'patch-settings
678 ;; libhdf4.settings contains the full path of the
679 ;; compilers used, and its contents are included in
680 ;; .so-files. We truncate the hashes to avoid
681 ;; unnecessary store references to those compilers:
682 (substitute* "libhdf4.settings"
683 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
684 (string-append prefix (string-take hash 10) "...")))
687 (home-page "https://www.hdfgroup.org/products/hdf4/")
689 "Library and multi-object file format for storing and managing data")
690 (description "HDF4 is a library and multi-object file format for storing
691 and managing data between machines. HDF4 is an older hierarchical data format,
692 incompatible with HDF5.")
694 (license:non-copyleft
695 "https://www.hdfgroup.org/ftp/HDF/HDF_Current/src/unpacked/COPYING"))))
697 (define-public hdf4-alt
702 (substitute-keyword-arguments (package-arguments hdf4)
703 ((#:configure-flags flags) `(cons* "--disable-netcdf" ,flags))))
705 "HDF4 without netCDF API, can be combined with the regular netCDF library")))
714 (uri (list (string-append "https://support.hdfgroup.org/ftp/HDF5/releases/"
715 "hdf5-" (version-major+minor version)
716 "/hdf5-" version "/src/hdf5-"
718 (string-append "https://support.hdfgroup.org/ftp/HDF5/"
721 (take (string-split version #\.) 2))
722 "/src/hdf5-" version ".tar.bz2")))
724 (base32 "0f3jfbqpaaq21ighi40qzs52nb52kc2d2yjk541rjmsx20b3ih2r"))
725 (patches (list (search-patch "hdf5-config-date.patch")))))
726 (build-system gnu-build-system)
730 `(("gfortran" ,gfortran)))
731 (outputs '("out" ; core library
732 "fortran")) ; fortran interface
734 `(;; Some of the users, notably Flann, need the C++ interface.
735 #:configure-flags '("--enable-cxx"
737 "--enable-fortran2003")
738 ;; Use -fPIC to allow the R bindings to link with the static libraries
739 #:make-flags (list "CFLAGS=-fPIC"
742 (modify-phases %standard-phases
743 (add-before 'configure 'patch-configure
744 (lambda* (#:key outputs #:allow-other-keys)
745 (substitute* "configure"
747 (substitute* "fortran/src/Makefile.in"
748 (("libhdf5_fortran_la_LDFLAGS =")
749 (string-append "libhdf5_fortran_la_LDFLAGS = -Wl-rpath="
750 (assoc-ref outputs "fortran") "/lib")))
751 (substitute* "hl/fortran/src/Makefile.in"
752 (("libhdf5hl_fortran_la_LDFLAGS =")
753 (string-append "libhdf5hl_fortran_la_LDFLAGS = -Wl,-rpath="
754 (assoc-ref outputs "fortran") "/lib")))
756 (add-after 'configure 'patch-settings
758 ;; libhdf5.settings contains the full path of the
759 ;; compilers used, and its contents are included in
760 ;; libhdf5.so. We truncate the hashes to avoid
761 ;; unnecessary store references to those compilers:
762 (substitute* "src/libhdf5.settings"
763 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
764 (string-append prefix (string-take hash 10) "..."))
765 ;; Don't record the build-time kernel version to make the
766 ;; settings file reproducible.
767 (("Uname information:.*")
768 "Uname information: Linux\n"))
770 (add-after 'install 'patch-references
771 (lambda* (#:key inputs outputs #:allow-other-keys)
772 (let ((bin (string-append (assoc-ref outputs "out") "/bin"))
773 (zlib (assoc-ref inputs "zlib")))
774 (substitute* (find-files bin "h5p?cc")
776 (string-append "-L" zlib "/lib " lib)))
778 (add-after 'install 'split
779 (lambda* (#:key inputs outputs #:allow-other-keys)
780 ;; Move all fortran-related files
781 (let* ((out (assoc-ref outputs "out"))
782 (bin (string-append out "/bin"))
783 (lib (string-append out "/lib"))
784 (inc (string-append out "/include"))
785 (ex (string-append out "/share/hdf5_examples/fortran"))
786 (fort (assoc-ref outputs "fortran"))
787 (fbin (string-append fort "/bin"))
788 (flib (string-append fort "/lib"))
789 (finc (string-append fort "/include"))
790 (fex (string-append fort "/share/hdf5_examples/fortran")))
795 (rename-file (string-append bin "/h5fc")
796 (string-append fbin "/h5fc"))
797 (for-each (lambda (file)
799 (string-append flib "/" (basename file))))
800 (find-files lib ".*fortran.*"))
801 (for-each (lambda (file)
803 (string-append finc "/" (basename file))))
804 (find-files inc ".*mod"))
805 (for-each (lambda (file)
807 (string-append fex "/" (basename file))))
808 (find-files ex ".*"))
809 (delete-file-recursively ex))
811 (home-page "http://www.hdfgroup.org")
812 (synopsis "Management suite for extremely large and complex data")
813 (description "HDF5 is a suite that makes possible the management of
814 extremely large and complex data collections.")
815 (license (license:x11-style
816 "http://www.hdfgroup.org/ftp/HDF5/current/src/unpacked/COPYING"))))
818 (define-public hdf-java
826 "http://www.hdfgroup.org/ftp/HDF5/releases/HDF-JAVA/hdfjni-"
827 version "/src/CMake-hdfjava-" version ".tar.gz"))
829 (base32 "0m1gp2aspcblqzmpqbdpfp6giskws85ds6p5gz8sx7asyp7wznpr"))
830 (modules '((guix build utils)))
831 (snippet ; Make sure we don't use the bundled sources and binaries.
833 (for-each delete-file
834 (list "SZip.tar.gz" "ZLib.tar.gz" "JPEG8d.tar.gz"
835 "HDF4.tar.gz" "HDF5.tar.gz"))
836 (delete-file-recursively ,(string-append "hdfjava-" version "/lib"))
838 (build-system gnu-build-system)
840 `(("jdk" ,icedtea "jdk")
841 ("automake" ,automake) ; For up to date 'config.guess' and 'config.sub'.
843 ("hamcrest-core" ,java-hamcrest-core)
844 ("junit" ,java-junit)
845 ("slf4j-simple" ,java-slf4j-simple)))
851 ("slf4j-api" ,java-slf4j-api)))
854 (list (string-append "--target=" ,(or (%current-target-system) (%current-system)))
855 (string-append "--with-jdk=" (assoc-ref %build-inputs "jdk") "/include,"
856 (assoc-ref %build-inputs "jdk") "/lib" )
857 (string-append "--with-hdf4=" (assoc-ref %build-inputs "hdf4") "/lib")
858 (string-append "--with-hdf5=" (assoc-ref %build-inputs "hdf5") "/lib"))
861 (list (string-append "HDFLIB=" (assoc-ref %build-inputs "hdf4") "/lib")
862 (string-append "HDF5LIB=" (assoc-ref %build-inputs "hdf5") "/lib")
863 (string-append "ZLIB=" (assoc-ref %build-inputs "zlib") "/lib/libz.so")
864 (string-append "JPEGLIB="
865 (assoc-ref %build-inputs "libjpeg") "/lib/libjpeg.so")
869 (modify-phases %standard-phases
870 (add-before 'configure 'chdir-to-source
871 (lambda _ (chdir ,(string-append "hdfjava-" version))))
872 (add-before 'configure 'patch-build
873 (lambda* (#:key inputs outputs #:allow-other-keys)
874 (substitute* "configure"
875 (("COPT=\"") "COPT=\"-O2 ") ; CFLAGS is ignored in Makefiles
876 (("/bin/cat") (which "cat")))
877 ;; Set classpath for compilation
878 (substitute* '("hdf/hdf5lib/Makefile.in"
879 "hdf/hdf5lib/exceptions/Makefile.in"
880 "hdf/hdflib/Makefile.in")
881 (("\\$\\(TOP\\)/lib/slf4j-api-1\\.7\\.5\\.jar")
882 (string-append (assoc-ref inputs "slf4j-api")
883 "/share/java/slf4j-api.jar")))
884 ;; Replace outdated config.sub and config.guess:
885 (with-directory-excursion "config"
886 (for-each (lambda (file)
888 (string-append (assoc-ref inputs "automake")
889 "/share/automake-1.15/" file) file))
890 '("config.sub" "config.guess")))
891 (mkdir-p (string-append (assoc-ref outputs "out")))
892 ;; Set classpath for tests
893 (let* ((build-dir (getcwd))
894 (lib (string-append build-dir "/lib"))
895 (jhdf (string-append lib "/jhdf.jar"))
896 (jhdf5 (string-append lib "/jhdf5.jar"))
899 (string-append (assoc-ref inputs i)
900 "/share/java/" i ".jar"))
901 '("junit" "hamcrest-core" "slf4j-api" "slf4j-simple")))
903 (string-join `("." ,build-dir ,jhdf ,jhdf5 ,@testjars) ":")))
905 (substitute* '("test/hdf5lib/Makefile.in"
906 "test/hdf5lib/junit.sh.in"
907 "examples/runExample.sh.in")
909 (string-append (assoc-ref inputs "coreutils")
912 (string-append (assoc-ref inputs "coreutils")
914 (("CLASSPATH=[^\n]*")
915 (string-append "CLASSPATH=" class-path)))
916 (setenv "CLASSPATH" class-path))
918 (add-before 'check 'build-examples
920 (zero? (apply system* `("javac"
921 ,@(find-files "examples" ".*\\.java")))))))
925 #:parallel-tests? #f ))
926 (home-page "https://support.hdfgroup.org/products/java")
927 (synopsis "Java interface for the HDF4 and HDF5 libraries")
928 (description "Java HDF Interface (JHI) and Java HDF5 Interface (JHI5) use
929 the Java Native Interface to wrap the HDF4 and HDF5 libraries, which are
932 ;; BSD-style license:
933 (license (license:x11-style
934 "https://support.hdfgroup.org/ftp/HDF5/hdf-java\
935 /current/src/unpacked/COPYING"))))
937 (define-public hdf-eos2
944 (uri "ftp://edhs1.gsfc.nasa.gov\
945 /edhs/hdfeos/latest_release/HDF-EOS2.19v1.00.tar.Z")
947 (base32 "0c9fcz25s292ldap12wxmlrvnyz99z24p63d8fwx51bf8s0s1zrz"))
948 (patches (search-patches "hdf-eos2-remove-gctp.patch"
949 "hdf-eos2-build-shared.patch"
950 "hdf-eos2-fortrantests.patch"))))
951 (build-system gnu-build-system)
953 `(("gfortran" ,gfortran)))
955 `(("hdf4" ,hdf4-alt) ; assume most HDF-EOS2 users won't use the HDF4 netCDF API
960 `( #:configure-flags '("--enable-install-include" "--enable-shared"
961 "CC=h4cc -Df2cFortran" "LIBS=-lgctp")
962 #:parallel-tests? #f))
963 (home-page "http://hdfeos.org/software/library.php#HDF-EOS2")
964 (synopsis "HDF4-based data format for NASA's Earth Observing System")
965 (description "HDF-EOS2 is a software library built on HDF4 which supports
966 the construction of data structures used in NASA's Earth Observing
967 System (Grid, Point and Swath).")
969 ;; Source files carry a permissive license header.
970 (license (license:non-copyleft home-page))))
972 (define-public hdf-eos5
978 (uri (string-append "ftp://edhs1.gsfc.nasa.gov\
979 /edhs/hdfeos5/latest_release/HDF-EOS5." version ".tar.Z"))
982 "1p83333nzzy8rn5chxlm0hrkjjnhh2w1ji8ac0f9q4xzg838i58i"))
983 (patches (search-patches "hdf-eos5-build-shared.patch"
984 "hdf-eos5-remove-gctp.patch"
985 "hdf-eos5-fix-szip.patch"
986 "hdf-eos5-fortrantests.patch"))))
988 `(("gfortran" ,gfortran)))
989 (build-system gnu-build-system)
995 `(#:configure-flags '("--enable-install-include" "--enable-shared"
996 "CC=h5cc -Df2cFortran" "LIBS=-lgctp")
997 #:parallel-tests? #f))
998 (synopsis "HDF5-based data format for NASA's Earth Observing System")
1000 "HDF-EOS5 is a software library built on HDF5 to support the construction
1001 of data structures used in NASA's Earth Observing System (Grid, Point and
1003 (home-page "http://www.hdfeos.org/software/library.php#HDF-EOS5")
1005 ;; Source files carry a permissive license header.
1006 (license (license:non-copyleft home-page))))
1008 (define-public hdf5-parallel-openmpi
1009 (package (inherit hdf5)
1010 (name "hdf5-parallel-openmpi")
1013 ,@(package-inputs hdf5)))
1015 (substitute-keyword-arguments `(#:configure-flags '("--enable-parallel")
1016 ,@(package-arguments hdf5))
1018 `(modify-phases ,phases
1019 (add-before 'check 'patch-tests
1021 ;; OpenMPI's mpirun will exit with non-zero status if it
1022 ;; detects an "abnormal termination", i.e. any process not
1023 ;; calling MPI_Finalize(). Since the test is explicitely
1024 ;; avoiding MPI_Finalize so as not to have at_exit and thus
1025 ;; H5C_flush_cache from being called, mpirun will always
1026 ;; complain, so turn this test off.
1027 (substitute* "testpar/Makefile"
1028 (("(^TEST_PROG_PARA.*)t_pflush1(.*)" front back)
1029 (string-append front back "\n")))
1030 (substitute* "tools/h5diff/testph5diff.sh"
1031 (("/bin/sh") (which "sh")))
1033 (synopsis "Management suite for data with parallel IO support")))
1035 (define-public h5check
1042 (uri (string-append "http://www.hdfgroup.org/ftp/HDF5/tools/"
1043 "h5check/src/h5check-" version ".tar.gz"))
1046 "1gm76jbwhz9adbxgn14zx8cj33dmjdr2g5xcy0m9c2gakp8w59kj"))))
1047 (build-system gnu-build-system)
1048 (inputs `(("hdf5" ,hdf5))) ;h5cc for tests
1049 (home-page "https://www.hdfgroup.org/products/hdf5_tools/h5check.html")
1050 (synopsis "HDF5 format checker")
1051 (description "@code{h5check} is a validation tool for verifying that an
1052 HDF5 file is encoded according to the HDF File Format Specification.")
1053 (license (license:x11-style "file://COPYING"))))
1061 (uri (string-append "mirror://sourceforge/itpp/itpp/"
1066 "14ddy2xnb6sgp4hiax9v5sv4pr4l4dd4ps76nfha3nrpr1ikhcqm"))))
1067 (build-system cmake-build-system)
1068 (arguments `(#:tests? #f)) ; Tests require googletest *sources*
1069 (inputs `(("lapack" ,lapack)
1071 ;; FIXME: Even though the fonts are available dvips complains:
1072 ;; "Font cmmi10 not found; characters will be left blank."
1074 `(("texlive" ,texlive-tiny)
1075 ("ghostscript" ,ghostscript)
1076 ("doxygen" ,doxygen)))
1077 (home-page "http://itpp.sourceforge.net")
1078 (synopsis "C++ library of maths, signal processing and communication classes")
1079 (description "IT++ is a C++ library of mathematical, signal processing and
1080 communication classes and functions. Its main use is in simulation of
1081 communication systems and for performing research in the area of
1082 communications. The kernel of the library consists of generic vector and
1083 matrix classes, and a set of accompanying routines. Such a kernel makes IT++
1084 similar to MATLAB, GNU Octave or SciPy.")
1085 (license license:gpl3+)))
1087 (define-public netcdf
1094 (uri (string-append "ftp://ftp.unidata.ucar.edu/pub/netcdf/"
1095 "netcdf-" version ".tar.gz"))
1098 "1blc7ik5yin7i0ls2kag0a9xjk12m0dzx6v1x88az3ras3scci2d"))
1099 (patches (search-patches "netcdf-date-time.patch"
1100 "netcdf-tst_h_par.patch"))))
1101 (build-system gnu-build-system)
1104 ("doxygen" ,doxygen)
1105 ("graphviz" ,graphviz)))
1107 `(("hdf4" ,hdf4-alt)
1110 ("libjpeg" ,libjpeg)))
1112 `(#:configure-flags '("--enable-doxygen" "--enable-dot" "--enable-hdf4")
1114 #:phases (modify-phases %standard-phases
1115 (add-before 'configure 'fix-source-date
1117 ;; As we ${SOURCE_DATE_EPOCH} evaluates to "1" in the build
1118 ;; environment, `date -u -d ${SOURCE_DATE_EPOCH}` will evaluate
1119 ;; to '1st hour of the current day', and therefore makes the
1120 ;; package not reproducible.
1121 (substitute* "./configure"
1122 (("date -u -d \"\\$\\{SOURCE_DATE_EPOCH\\}\"")
1123 "date --date='@0'"))
1125 (add-after 'configure 'patch-settings
1127 ;; libnetcdf.settings contains the full filename of the compilers
1128 ;; used to build the library. We truncate the hashes of those
1129 ;; filenames to avoid unnecessary references to the corresponding
1131 (substitute* "libnetcdf.settings"
1132 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
1133 (string-append prefix (string-take hash 10) "...")))
1136 #:parallel-tests? #f)) ;various race conditions
1137 (home-page "http://www.unidata.ucar.edu/software/netcdf/")
1138 (synopsis "Library for scientific data")
1139 (description "NetCDF is an interface for scientific data access and a
1140 software library that provides an implementation of the interface. The netCDF
1141 library defines a machine-independent format for representing scientific data.
1142 Together, the interface, library, and format support the creation, access, and
1143 sharing of scientific data.")
1144 (license (license:x11-style "file://COPYRIGHT"))))
1146 (define-public netcdf-parallel-openmpi
1147 (package (inherit netcdf)
1148 (name "netcdf-parallel-openmpi")
1151 ,@(alist-replace "hdf5" (list hdf5-parallel-openmpi)
1152 (package-inputs netcdf))))
1153 ;; TODO: Replace pkg-config references in nc-config with absolute references
1155 (substitute-keyword-arguments (package-arguments netcdf)
1156 ((#:configure-flags flags)
1157 `(cons* "CC=mpicc" "CXX=mpicxx"
1158 "--enable-parallel-tests"
1159 ;; Shared libraries not supported with parallel IO.
1160 "--disable-shared" "--with-pic"
1163 (define-public netcdf-fortran
1165 (name "netcdf-fortran")
1170 "ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-fortran-"
1174 "0xaxdcg1p83zmypwml3swsnr3ccn38inwldyr1l3wa4dbwbrblxj"))))
1175 (build-system gnu-build-system)
1177 `(#:parallel-tests? #f))
1179 `(("netcdf" ,netcdf)))
1181 `(("gfortran" ,gfortran)))
1182 (synopsis "Fortran interface for the netCDF library")
1183 (description (package-description netcdf))
1184 (home-page (package-home-page netcdf))
1185 (license (package-license netcdf))))
1187 (define-public nlopt
1193 (uri (string-append "http://ab-initio.mit.edu/nlopt/nlopt-"
1196 (base32 "12cfkkhcdf4zmb6h7y6qvvdvqjs2xf9sjpa3rl3bq76px4yn76c0"))))
1197 (build-system gnu-build-system)
1199 `(;; Shared libraries are not built by default. They are required to
1200 ;; build the Guile, Octave, and Python bindings.
1201 #:configure-flags '("--enable-shared")
1204 (modify-phases %standard-phases
1205 (add-before 'configure 'set-libnlopt-file-name
1206 (lambda* (#:key outputs #:allow-other-keys)
1207 ;; Make sure the Scheme module refers to the library by its
1208 ;; absolute file name (we cannot do that from a snippet
1209 ;; because the expansion of @libdir@ contains
1211 (let ((out (assoc-ref outputs "out")))
1212 (substitute* "swig/nlopt.scm.in"
1214 (string-append out "/lib/libnlopt")))
1216 (inputs `(("guile" ,guile-2.0)))
1217 (native-inputs `(("pkg-config" ,pkg-config)))
1218 (home-page "http://ab-initio.mit.edu/wiki/")
1219 (synopsis "Library for nonlinear optimization")
1220 (description "NLopt is a library for nonlinear optimization, providing a
1221 common interface for a number of different free optimization routines available
1222 online as well as original implementations of various other algorithms.")
1223 (license license:lgpl2.1+)))
1225 (define-public ipopt
1232 "http://www.coin-or.org/download/source/Ipopt/Ipopt-"
1236 "09bk2hqy2vgi4yi76xng9zxakddwqy3wij9nx7wf2vfbxxpazrsk"))
1237 (modules '((guix build utils)))
1239 ;; Make sure we don't use the bundled software.
1241 (delete-file-recursively "ThirdParty")
1243 (build-system gnu-build-system)
1245 '(#:phases (modify-phases %standard-phases
1246 (add-after 'install 'add--L-flags-in-ipopt.pc
1247 (lambda* (#:key inputs outputs #:allow-other-keys)
1248 ;; The '.pc' file lists '-llapack -lblas' in "Libs";
1249 ;; move it to "Libs.private" where it belongs, and add a
1250 ;; '-L' flag for LAPACK.
1251 (let ((out (assoc-ref outputs "out"))
1252 (lapack (assoc-ref inputs "lapack")))
1253 (substitute* (string-append out "/lib/pkgconfig/"
1255 (("Libs: (.*)-llapack -lblas(.*)$" _ before after)
1256 (string-append "Libs: " before " " after "\n"
1257 "Libs.private: " before
1258 "-L" lapack "/lib -llapack -lblas "
1262 `(("gfortran" ,gfortran)))
1264 ;; TODO: Maybe add dependency on COIN-MUMPS, ASL, and HSL.
1265 `(("lapack" ,lapack))) ;for both libblas and liblapack
1266 (home-page "http://www.coin-or.org")
1267 (synopsis "Large-scale nonlinear optimizer")
1269 "The Interior Point Optimizer (IPOPT) is a software package for
1270 large-scale nonlinear optimization. It provides C++, C, and Fortran
1272 (license license:epl1.0)))
1274 (define-public ceres
1276 (name "ceres-solver")
1278 (home-page "http://ceres-solver.org/")
1281 (uri (string-append home-page "ceres-solver-"
1285 "13lfxy8x58w8vprr0nkbzziaijlh0vvqshgahvcgw0mrqdgh0i27"))))
1286 (build-system cmake-build-system)
1288 ;; TODO: Build HTML user documentation and install separately.
1289 '(#:configure-flags '("-DBUILD_EXAMPLES=OFF"
1290 "-DBUILD_SHARED_LIBS=ON")
1292 #:phases (modify-phases %standard-phases
1293 (add-before 'configure 'set-library-directory
1295 ;; Install libraries to lib/, not lib64/.
1296 (substitute* "internal/ceres/CMakeLists.txt"
1297 (("set\\(LIB_SUFFIX \"64\"\\)")
1298 "set(LIB_SUFFIX \"\")"))
1301 `(("pkg-config" ,pkg-config)))
1303 `(("glog" ,glog))) ;for #include <glog/glog.h>
1308 ("suitesparse" ,suitesparse)
1309 ("gflags" ,gflags)))
1310 (synopsis "C++ library for solving large optimization problems")
1312 "Ceres Solver is a C++ library for modeling and solving large,
1313 complicated optimization problems. It is a feature rich, mature and
1314 performant library which has been used in production since 2010. Ceres Solver
1315 can solve two kinds of problems:
1317 @item non-linear least squares problems with bounds constraints;
1318 @item general unconstrained optimization problems.
1320 (license license:bsd-3)))
1322 ;; For a fully featured Octave, users are strongly recommended also to install
1323 ;; the following packages: less, ghostscript, gnuplot.
1324 (define-public octave
1331 (uri (string-append "mirror://gnu/octave/octave-"
1335 "0nm766737gbkq9wqry54a026k3dg7rb1065kngfpwgjz8b544xbp"))))
1336 (build-system gnu-build-system)
1338 `(("lapack" ,lapack)
1339 ("readline" ,readline)
1344 ("arpack" ,arpack-ng)
1347 ("fontconfig" ,fontconfig)
1348 ("freetype" ,freetype)
1355 ("texinfo" ,texinfo)
1356 ("graphicsmagick" ,graphicsmagick)
1357 ("suitesparse" ,suitesparse)
1358 ("libsndfile" ,libsndfile)
1359 ("portaudio" ,portaudio)
1360 ("alsa-lib" ,alsa-lib)))
1363 ("gfortran" ,gfortran)
1364 ("pkg-config" ,pkg-config)
1366 ;; The following inputs are not actually used in the build process.
1367 ;; However, the ./configure gratuitously tests for their existence and
1368 ;; assumes that programs not present at build time are also not, and
1369 ;; can never be, available at run time! If these inputs are therefore
1370 ;; not present, support for them will be built out. However, Octave
1371 ;; will still run without them, albeit without the features they
1374 ("ghostscript" ,ghostscript)
1375 ("gnuplot" ,gnuplot)))
1378 (list (string-append "--with-shell="
1379 (assoc-ref %build-inputs "bash")
1382 (modify-phases %standard-phases
1383 (add-after 'configure 'configure-makeinfo
1384 (lambda* (#:key inputs #:allow-other-keys)
1385 (substitute* "libinterp/corefcn/help.cc"
1386 (("Vmakeinfo_program = \"makeinfo\"")
1387 (string-append "Vmakeinfo_program = \""
1388 (assoc-ref inputs "texinfo")
1389 "/bin/makeinfo\"")))
1391 (home-page "https://www.gnu.org/software/octave/")
1392 (synopsis "High-level language for numerical computation")
1393 (description "GNU Octave is a high-level interpreted language that is
1394 specialized for numerical computations. It can be used for both linear and
1395 non-linear applications and it provides great support for visualizing results.
1396 Work may be performed both at the interactive command-line as well as via
1398 (license license:gpl3+)))
1400 (define-public qtoctave
1401 (package (inherit octave)
1404 `(("qscintilla" ,qscintilla)
1406 ,@(package-inputs octave)))
1408 `(("qttools" , qttools) ;for lrelease
1409 ,@(package-native-inputs octave)))
1411 (substitute-keyword-arguments (package-arguments octave)
1413 `(modify-phases ,phases
1414 (add-before 'configure 'patch-qscintilla-library-name
1415 (lambda* (#:key inputs #:allow-other-keys)
1416 ;; The QScintilla library that the Octave configure script tries
1417 ;; to link with should be named libqscintilla-qt5.so, but the
1418 ;; QScintilla input provides the shared library as
1419 ;; libqscintilla2_qt5.so.
1420 (substitute* "configure"
1421 (("qscintilla2-qt5")
1425 (define-public opencascade-oce
1427 (name "opencascade-oce")
1433 "https://github.com/tpaviot/oce/archive/OCE-"
1436 (patches (search-patches "opencascade-oce-glibc-2.26.patch"))
1439 "0vpmnb0k5y2f7lpmwx9pg9yfq24zjvnsak5alzacncfm1hv9b6cd"))))
1440 (build-system cmake-build-system)
1443 (list "-DOCE_TESTING:BOOL=ON"
1444 "-DOCE_USE_TCL_TEST_FRAMEWORK:BOOL=ON"
1445 "-DOCE_DRAW:BOOL=ON"
1446 (string-append "-DOCE_INSTALL_PREFIX:PATH="
1447 (assoc-ref %outputs "out"))
1448 "-UCMAKE_INSTALL_RPATH")))
1450 `(("freetype" ,freetype)
1457 `(("python" ,python-wrapper)))
1458 (home-page "https://github.com/tpaviot/oce")
1459 (synopsis "Libraries for 3D modeling and numerical simulation")
1461 "Open CASCADE is a set of libraries for the development of applications
1462 dealing with 3D CAD data or requiring industrial 3D capabilities. It includes
1463 C++ class libraries providing services for 3D surface and solid modeling, CAD
1464 data exchange, and visualization. It is used for development of specialized
1465 software dealing with 3D models in design (CAD), manufacturing (CAM),
1466 numerical simulation (CAE), measurement equipment (CMM), and quality
1467 control (CAQ) domains.
1469 This is the ``Community Edition'' (OCE) of Open CASCADE, which gathers
1470 patches, improvements, and experiments contributed by users over the official
1471 Open CASCADE library.")
1472 (license (list license:lgpl2.1; OCE libraries, with an exception for the
1473 ; use of header files; see
1474 ; OCCT_LGPL_EXCEPTION.txt
1475 license:public-domain; files
1476 ; src/Standard/Standard_StdAllocator.hxx and
1477 ; src/NCollection/NCollection_StdAllocator.hxx
1478 license:expat; file src/OpenGl/OpenGl_glext.h
1479 license:bsd-3)))); test framework gtest
1488 (uri (string-append "http://gmsh.info/src/gmsh-"
1489 version "-source.tgz"))
1491 (base32 "1slf0bfkwrcgn6296wb4qhbk4ahz6i4wfb10hnim08x05vrylag8"))
1492 (modules '((guix build utils)))
1494 ;; Remove non-free METIS code
1496 (delete-file-recursively "contrib/Metis")
1498 (build-system cmake-build-system)
1501 ("gfortran" ,gfortran)
1507 ("opencascade-oce" ,opencascade-oce)
1509 ("libxext" ,libxext)))
1511 `(("fontconfig" ,fontconfig)
1512 ("libxft" ,libxft)))
1514 `(#:configure-flags `("-DENABLE_METIS:BOOL=OFF"
1515 "-DENABLE_BUILD_SHARED:BOOL=ON"
1516 "-DENABLE_BUILD_DYNAMIC:BOOL=ON")))
1517 (home-page "http://www.geuz.org/gmsh/")
1518 (synopsis "3D finite element grid generator")
1519 (description "Gmsh is a 3D finite element grid generator with a built-in
1520 CAD engine and post-processor. Its design goal is to provide a fast, light
1521 and user-friendly meshing tool with parametric input and advanced
1522 visualization capabilities. Gmsh is built around four modules: geometry,
1523 mesh, solver and post-processing. The specification of any input to these
1524 modules is done either interactively using the graphical user interface or in
1525 ASCII text files using Gmsh's own scripting language.")
1526 (license license:gpl2+)))
1528 (define-public maxflow
1535 (url "https://github.com/gerddie/maxflow.git")
1536 (commit "42401fa54823d16b9da47716f04e5d9ef1605875")))
1537 (file-name (string-append name "-" version "-checkout"))
1540 "0rll38whw55h0vcjrrwdnh9ascvxby0ph7n1l0d12z17cg215kkb"))))
1541 (build-system cmake-build-system)
1542 (home-page "http://pub.ist.ac.at/~vnk/software.html")
1543 (synopsis "Library implementing Maxflow algorithm")
1544 (description "An implementation of the maxflow algorithm described in
1545 @cite{An Experimental Comparison of Min-Cut/Max-Flow Algorithms for
1546 Energy Minimization in Computer Vision.\n
1547 Yuri Boykov and Vladimir Kolmogorov.\n
1548 In IEEE Transactions on Pattern Analysis and Machine Intelligence,\n
1550 (license license:gpl3+)))
1552 (define-public petsc
1559 ;; The *-lite-* tarball does not contain the *large* documentation
1560 (uri (string-append "http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/"
1561 "petsc-lite-" version ".tar.gz"))
1563 (base32 "1lajbk3c29hnh83v6cbmm3a8wv6bdykh0p70kwrr4vrnizalk88s"))))
1564 (build-system gnu-build-system)
1566 `(("python" ,python-2)))
1568 `(("gfortran" ,gfortran)
1570 ("superlu" ,superlu)
1571 ;; leaving out hdf5 and fftw, as petsc expects them to be built with mpi
1572 ;; leaving out opengl, as configuration seems to only be for mac
1575 `(#:test-target "test"
1576 #:parallel-build? #f ;build is parallel by default
1581 ,(string-append "--with-superlu-include="
1582 (assoc-ref %build-inputs "superlu") "/include")
1583 ,(string-append "--with-superlu-lib="
1584 (assoc-ref %build-inputs "superlu") "/lib/libsuperlu.a"))
1586 ;; Honor (parallel-job-count) for build. Do not use --with-make-np,
1587 ;; whose value is dumped to $out/lib/petsc/conf/petscvariables.
1588 (list (format #f "MAKE_NP=~a" (parallel-job-count)))
1590 (modify-phases %standard-phases
1592 ;; PETSc's configure script is actually a python script, so we can't
1593 ;; run it with bash.
1594 (lambda* (#:key outputs (configure-flags '())
1596 (let* ((prefix (assoc-ref outputs "out"))
1597 (flags `(,(string-append "--prefix=" prefix)
1598 ,@configure-flags)))
1599 (format #t "build directory: ~s~%" (getcwd))
1600 (format #t "configure flags: ~s~%" flags)
1601 (apply invoke "./configure" flags))))
1602 (add-after 'configure 'clean-local-references
1603 (lambda* (#:key outputs #:allow-other-keys)
1604 (let ((out (assoc-ref outputs "out")))
1605 (substitute* (find-files "." "^petsc(conf|machineinfo).h$")
1606 ;; Prevent build directory from leaking into compiled code
1608 ;; Scrub timestamp for reproducibility
1609 ((".*Libraries compiled on.*") ""))
1610 (substitute* (find-files "." "petscvariables")
1611 ;; Do not expose build machine characteristics, set to defaults.
1612 (("MAKE_NP = [:digit:]+") "MAKE_NP = 2")
1613 (("NPMAX = [:digit:]+") "NPMAX = 2"))
1615 (add-after 'install 'clean-install
1616 ;; Try to keep installed files from leaking build directory names.
1617 (lambda* (#:key inputs outputs #:allow-other-keys)
1618 (let ((out (assoc-ref outputs "out")))
1619 (substitute* (map (lambda (file)
1620 (string-append out "/lib/petsc/conf/" file))
1621 '("petscvariables"))
1623 ;; Make compiler references point to the store
1624 (substitute* (string-append out "/lib/petsc/conf/petscvariables")
1625 (("= (gcc|g\\+\\+|gfortran)" _ compiler)
1626 (string-append "= " (which compiler))))
1627 ;; PETSc installs some build logs, which aren't necessary.
1628 (for-each (lambda (file)
1629 (let ((f (string-append out "/lib/petsc/conf/" file)))
1630 (when (file-exists? f)
1632 '("configure.log" "make.log" "gmake.log"
1633 "test.log" "error.log" "RDict.db"
1634 "PETScBuildInternal.cmake"
1635 ;; Once installed, should uninstall with Guix
1638 (home-page "http://www.mcs.anl.gov/petsc")
1639 (synopsis "Library to solve PDEs")
1640 (description "PETSc, pronounced PET-see (the S is silent), is a suite of
1641 data structures and routines for the scalable (parallel) solution of
1642 scientific applications modeled by partial differential equations.")
1643 (license (license:non-copyleft
1644 "http://www.mcs.anl.gov/petsc/documentation/copyright.html"))))
1646 (define-public petsc-complex
1647 (package (inherit petsc)
1648 (name "petsc-complex")
1650 (substitute-keyword-arguments (package-arguments petsc)
1651 ((#:configure-flags cf)
1652 `(cons "--with-scalar-type=complex" ,cf))))
1653 (synopsis "Library to solve PDEs (with complex scalars)")))
1655 (define-public petsc-openmpi
1656 (package (inherit petsc)
1657 (name "petsc-openmpi")
1659 `(("openmpi" ,openmpi)
1660 ,@(package-inputs petsc)))
1662 (substitute-keyword-arguments (package-arguments petsc)
1663 ((#:configure-flags cf)
1664 ``("--with-mpiexec=mpirun"
1665 ,(string-append "--with-mpi-dir="
1666 (assoc-ref %build-inputs "openmpi"))
1667 ,@(delete "--with-mpi=0" ,cf)))))
1668 (synopsis "Library to solve PDEs (with MPI support)")))
1670 (define-public petsc-complex-openmpi
1671 (package (inherit petsc-complex)
1672 (name "petsc-complex-openmpi")
1674 `(("openmpi" ,openmpi)
1675 ,@(package-inputs petsc-complex)))
1677 (substitute-keyword-arguments (package-arguments petsc-complex)
1678 ((#:configure-flags cf)
1679 ``("--with-mpiexec=mpirun"
1680 ,(string-append "--with-mpi-dir="
1681 (assoc-ref %build-inputs "openmpi"))
1682 ,@(delete "--with-mpi=0" ,cf)))))
1683 (synopsis "Library to solve PDEs (with complex scalars and MPI support)")))
1686 (define-public python-kiwisolver
1688 (name "python-kiwisolver")
1692 (uri (pypi-uri "kiwisolver" version))
1695 "0y22ci86znwwwfhbmvbgdfnbi6lv5gv2xkdlxvjw7lml43ayafyf"))))
1696 (build-system python-build-system)
1697 (home-page "https://github.com/nucleic/kiwi")
1698 (synopsis "Fast implementation of the Cassowary constraint solver")
1700 "Kiwi is an efficient C++ implementation of the Cassowary constraint
1701 solving algorithm. Kiwi has been designed from the ground up to be
1702 lightweight and fast. Kiwi ranges from 10x to 500x faster than the original
1703 Cassowary solver with typical use cases gaining a 40x improvement. Memory
1704 savings are consistently > 5x.")
1705 (license license:bsd-3)))
1707 (define-public python2-kiwisolver
1708 (package-with-python2 python-kiwisolver))
1710 (define-public slepc
1717 (uri (string-append "http://slepc.upv.es/download/distrib/slepc-"
1721 "04zd48p43rnvg68p6cp28zll0px5whglc5v0sc3s6vdj1v920z8y"))))
1722 (build-system gnu-build-system)
1724 `(("python" ,python-2)))
1726 `(("arpack" ,arpack-ng)
1727 ("gfortran" ,gfortran)))
1729 `(("petsc" ,petsc)))
1731 `(#:parallel-build? #f ;build is parallel by default
1733 `(,(string-append "--with-arpack-dir="
1734 (assoc-ref %build-inputs "arpack") "/lib"))
1735 #:make-flags ;honor (parallel-job-count)
1736 `(,(format #f "MAKE_NP=~a" (parallel-job-count)))
1738 (modify-phases %standard-phases
1740 ;; configure is a python script, so we can't run it with bash.
1741 (lambda* (#:key inputs outputs (configure-flags '())
1743 (let* ((prefix (assoc-ref outputs "out"))
1744 (flags `(,(string-append "--prefix=" prefix)
1745 ,@configure-flags)))
1746 (format #t "build directory: ~s~%" (getcwd))
1747 (format #t "configure flags: ~s~%" flags)
1748 (setenv "SLEPC_DIR" (getcwd))
1749 (setenv "PETSC_DIR" (assoc-ref inputs "petsc"))
1750 (apply invoke "./configure" flags))))
1751 (add-after 'install 'delete-doc
1752 ;; TODO: SLEPc installs HTML documentation alongside headers in
1753 ;; $out/include. We'd like to move them to share/doc, but delete
1754 ;; them for now, as they are incomplete and installing the complete
1755 ;; documentation is difficult.
1756 (lambda* (#:key outputs #:allow-other-keys)
1757 (let* ((out (assoc-ref outputs "out")))
1758 (for-each delete-file (find-files out "\\.html$")))))
1759 (add-after 'install 'clean-install
1760 ;; Clean up unnecessary build logs from installation.
1761 (lambda* (#:key outputs #:allow-other-keys)
1762 (let ((out (assoc-ref outputs "out")))
1763 (for-each (lambda (file)
1764 (let ((f (string-append out "/lib/slepc/conf/" file)))
1765 (when (file-exists? f)
1767 '("configure.log" "make.log" "gmake.log"
1768 "test.log" "error.log" "RDict.db"
1769 "uninstall.py"))))))))
1770 (home-page "http://slepc.upv.es")
1771 (synopsis "Scalable library for eigenproblems")
1772 (description "SLEPc is a software library for the solution of large sparse
1773 eigenproblems on parallel computers. It can be used for the solution of
1774 linear eigenvalue problems formulated in either standard or generalized form,
1775 as well as other related problems such as the singular value decomposition.
1776 The emphasis of the software is on methods and techniques appropriate for
1777 problems in which the associated matrices are sparse, for example, those
1778 arising after the discretization of partial differential equations.")
1779 (license license:bsd-2)))
1781 (define-public slepc-complex
1782 (package (inherit slepc)
1783 (name "slepc-complex")
1785 `(("petsc" ,petsc-complex)
1786 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
1787 (synopsis "Scalable library for eigenproblems (with complex scalars)")))
1789 (define-public slepc-openmpi
1790 (package (inherit slepc)
1791 (name "slepc-openmpi")
1793 (substitute-keyword-arguments (package-arguments slepc)
1794 ((#:phases phases '%standard-phases)
1795 `(modify-phases ,phases
1796 (add-before 'check 'set-test-environment
1798 ;; By default, running the test suite would fail because 'ssh'
1799 ;; could not be found in $PATH. Define this variable to
1800 ;; placate Open MPI without adding a dependency on OpenSSH (the
1801 ;; agent isn't used anyway.)
1802 (setenv "OMPI_MCA_plm_rsh_agent" (which "cat"))
1806 ("arpack" ,arpack-ng-openmpi)
1807 ,@(alist-delete "arpack" (package-inputs slepc))))
1809 `(("petsc" ,petsc-openmpi)
1810 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
1811 (synopsis "Scalable library for eigenproblems (with MPI support)")))
1813 (define-public slepc-complex-openmpi
1814 (package (inherit slepc-openmpi)
1815 (name "slepc-complex-openmpi")
1817 `(("petsc" ,petsc-complex-openmpi)
1818 ,@(alist-delete "petsc" (package-propagated-inputs slepc-openmpi))))
1819 (synopsis "Scalable library for eigenproblems (with complex scalars and MPI support)")))
1821 (define-public mumps
1828 (uri (string-append "http://mumps.enseeiht.fr/MUMPS_"
1832 "1s9asin08zqzmh08257sdghhivvy9vjif7c53fhaxaax2kd5qd7b"))
1833 (patches (search-patches "mumps-build-parallelism.patch"))))
1834 (build-system gnu-build-system)
1836 `(("fortran" ,gfortran)
1837 ;; These are required for linking against mumps, but we let the user
1838 ;; declare the dependency.
1841 ("scotch" ,scotch)))
1843 `(#:modules ((ice-9 match)
1846 ,@%gnu-build-system-modules)
1848 (modify-phases %standard-phases
1850 (lambda* (#:key inputs #:allow-other-keys)
1851 (call-with-output-file "Makefile.inc"
1862 INCSEQ = -I$(topdir)/libseq
1863 LIBSEQ = -L$(topdir)/libseq -lmpiseq
1864 LIBSEQNEEDED = libseqneeded~;
1868 AR = ar vr # rules require trailing space, ugh...
1870 LIBBLAS = -L~a -lopenblas~@[
1871 SCALAP = -L~a -lscalapack~]
1872 LIBOTHERS = -pthread
1875 OPTF = -O2 -DALLOW_NON_INIT $(PIC)
1879 LIBS = $(SCALAP) $(LIBSEQ)
1880 LPORDDIR = $(topdir)/PORD/lib
1881 IPORD = -I$(topdir)/PORD/include
1882 LPORD = -L$(LPORDDIR) -lpord
1883 ORDERINGSF = -Dpord~@[
1885 IMETIS = -I$(METISDIR)/include
1886 LMETIS = -L$(METISDIR)/lib -lmetis
1887 ORDERINGSF += -Dmetis~]~@[~:{
1889 ISCOTCH = -I$(SCOTCHDIR)/include
1890 LSCOTCH = -L$(SCOTCHDIR)/lib ~a-lesmumps -lscotch -lscotcherr
1891 ORDERINGSF += ~a~}~]
1892 ORDERINGSC = $(ORDERINGSF)
1893 LORDERINGS = $(LPORD) $(LMETIS) $(LSCOTCH)
1894 IORDERINGSF = $(ISCOTCH)
1895 IORDERINGSC = $(IPORD) $(IMETIS) $(ISCOTCH)"
1896 (assoc-ref inputs "mpi")
1897 (assoc-ref inputs "blas")
1898 (assoc-ref inputs "scalapack")
1899 (assoc-ref inputs "metis")
1900 (match (list (assoc-ref inputs "pt-scotch")
1901 (assoc-ref inputs "scotch"))
1905 `((,scotch "" "-Dscotch")))
1908 "-lptesmumps -lptscotch -lptscotcherr "
1909 "-Dptscotch")))))))))
1911 ;; By default only the d-precision library is built. Make with "all"
1912 ;; target so that all precision libraries and examples are built.
1914 (zero? (system* "make" "all"
1915 (format #f "-j~a" (parallel-job-count))))))
1917 ;; Run the simple test drivers, which read test input from stdin:
1918 ;; from the "real" input for the single- and double-precision
1919 ;; testers, and from the "cmplx" input for complex-precision
1920 ;; testers. The EXEC-PREFIX key is used by the mumps-openmpi
1921 ;; package to prefix execution with "mpirun".
1922 (lambda* (#:key (exec-prefix '()) #:allow-other-keys)
1923 (with-directory-excursion "examples"
1926 (let ((tester (apply open-pipe*
1929 ,(string-append "./" prec
1931 (input (open-input-file
1932 (string-append "input_simpletest_" type))))
1934 (dump-port input tester)
1936 (zero? (close-pipe tester)))))
1938 '("real" "real" "cmplx" "cmplx")))))
1940 (lambda* (#:key outputs #:allow-other-keys)
1941 (let* ((out (assoc-ref outputs "out"))
1942 (libdir (string-append out "/lib")))
1943 (copy-recursively "lib" libdir)
1944 (copy-recursively "include" (string-append out "/include"))
1945 (when (file-exists? "libseq/libmpiseq.a")
1946 (install-file "libseq/libmpiseq.a" libdir))
1948 (home-page "http://mumps.enseeiht.fr")
1949 (synopsis "Multifrontal sparse direct solver")
1951 "MUMPS (MUltifrontal Massively Parallel sparse direct Solver) solves a
1952 sparse system of linear equations A x = b using Guassian elimination.")
1953 (license license:cecill-c)))
1955 (define-public mumps-metis
1956 (package (inherit mumps)
1957 (name "mumps-metis")
1959 (alist-delete "scotch" (package-inputs mumps)))))
1961 (define-public mumps-openmpi
1962 (package (inherit mumps)
1963 (name "mumps-openmpi")
1966 ("scalapack" ,scalapack)
1967 ("pt-scotch" ,pt-scotch)
1968 ,@(alist-delete "scotch" (package-inputs mumps))))
1970 (substitute-keyword-arguments (package-arguments mumps)
1972 `(modify-phases ,phases
1973 (add-before 'check 'set-test-environment
1975 ;; By default, running the test suite would fail because 'ssh'
1976 ;; could not be found in $PATH. Define this variable to
1977 ;; placate Open MPI without adding a dependency on OpenSSH (the
1978 ;; agent isn't used anyway.)
1979 (setenv "OMPI_MCA_plm_rsh_agent" (which "cat"))
1983 ((assoc-ref ,phases 'check)
1984 #:exec-prefix '("mpirun" "-n" "2"))))))))
1985 (synopsis "Multifrontal sparse direct solver (with MPI)")))
1987 (define-public mumps-metis-openmpi
1988 (package (inherit mumps-openmpi)
1989 (name "mumps-metis-openmpi")
1991 (alist-delete "pt-scotch" (package-inputs mumps-openmpi)))))
1993 (define-public r-quadprog
2000 (uri (cran-uri "quadprog" version))
2003 "0jg3r6abmhp8r9vkbhpx9ldjfw6vyl1m4c5vwlyjhk1mi03656fr"))))
2004 (build-system r-build-system)
2006 `(("gfortran" ,gfortran)))
2007 (home-page "https://cran.r-project.org/web/packages/quadprog")
2008 (synopsis "Functions to solve quadratic programming problems")
2010 "This package contains routines and documentation for solving quadratic
2011 programming problems.")
2012 (license license:gpl3+)))
2014 (define-public r-pracma
2020 (uri (cran-uri "pracma" version))
2022 (base32 "1ygm81i7mqvh229dp9935djjyb120p3bqvaf4k572sa4q63fzjhc"))))
2023 (build-system r-build-system)
2025 `(("r-quadprog" ,r-quadprog)))
2026 (home-page "https://cran.r-project.org/web/packages/pracma")
2027 (synopsis "Practical numerical math functions")
2028 (description "This package provides functions for numerical analysis and
2029 linear algebra, numerical optimization, differential equations, plus some
2030 special functions. It uses Matlab function names where appropriate to simplify
2032 (license license:gpl3+)))
2034 (define-public ruby-asciimath
2036 (name "ruby-asciimath")
2041 (uri (rubygems-uri "asciimath" version))
2044 "1d80kiph5mc78zps7si1hv48kv4k12mzaq8jk5kb3pqpjdr72qmc"))))
2045 (build-system ruby-build-system)
2048 (modify-phases %standard-phases
2050 ;; https://github.com/asciidoctor/asciimath/commit/1c06fdc8086077f4785479f78b0823a4a72d7948
2051 (add-after 'unpack 'patch-remove-spurious-backslashes
2053 (substitute* "spec/parser_spec.rb"
2057 `(("bundler" ,bundler)
2058 ("ruby-rspec" ,ruby-rspec)))
2059 (synopsis "AsciiMath parsing and conversion library")
2061 "A pure Ruby AsciiMath parsing and conversion library. AsciiMath is an
2062 easy-to-write markup language for mathematics.")
2063 (home-page "https://github.com/asciidoctor/asciimath")
2064 (license license:expat)))
2066 (define-public superlu
2073 (uri (string-append "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/"
2074 "superlu_" version ".tar.gz"))
2076 (base32 "0qzlb7cd608q62kyppd0a8c65l03vrwqql6gsm465rky23b6dyr8"))
2077 (modules '((guix build utils)))
2079 ;; Replace the non-free implementation of MC64 with a stub adapted
2082 (use-modules (ice-9 regex)
2084 (call-with-output-file "SRC/mc64ad.c"
2089 void mc64id_(int *a) {
2090 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
2093 void mc64ad_ (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
2094 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
2095 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
2098 ;; Remove the corresponding license verbiage. MC64 license follows
2099 ;; a "------" line separator.
2100 (with-atomic-file-replacement "License.txt"
2101 (let ((rx (make-regexp "-{8}")))
2104 (let ((line (read-line in 'concat)))
2105 (unless (regexp-exec rx line)
2109 (build-system cmake-build-system)
2113 `(("blas" ,openblas)
2114 ("gfortran" ,gfortran)))
2116 `(#:configure-flags '("-Denable_blaslib:BOOL=NO" ;do not use internal cblas
2117 "-DTPL_BLAS_LIBRARIES=openblas"
2118 "-DBUILD_SHARED_LIBS:BOOL=YES")))
2119 (home-page "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/")
2120 (synopsis "Supernodal direct solver for sparse linear systems")
2122 "SuperLU is a general purpose library for the direct solution of large,
2123 sparse, nonsymmetric systems of linear equations on high performance machines.
2124 The library is written in C and is callable from either C or Fortran. The
2125 library routines perform an LU decomposition with partial pivoting and
2126 triangular system solves through forward and back substitution. The library
2127 also provides threshold-based ILU factorization preconditioners.")
2128 (license (list license:bsd-3
2129 license:gpl2+ ;EXAMPLE/*fgmr.c
2130 (license:fsf-free "file://SRC/colamd.h")))))
2132 (define-public superlu-dist
2134 (name "superlu-dist")
2139 (uri (string-append "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/"
2140 "superlu_dist_" version ".tar.gz"))
2142 (base32 "0ja5ihqivkda1wd58y4lmzvmwssm9g91f70c5q0fzwhng6580h6y"))
2143 (modules '((guix build utils)))
2145 ;; Replace the non-free implementation of MC64 with a stub
2147 (use-modules (ice-9 regex)
2149 (call-with-output-file "SRC/mc64ad_dist.c"
2154 void mc64id_dist(int *a) {
2155 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
2158 void mc64ad_dist (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
2159 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
2160 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
2163 (substitute* "SRC/util.c" ;adjust default algorithm
2164 (("RowPerm[[:blank:]]*=[[:blank:]]*LargeDiag")
2165 "RowPerm = NOROWPERM"))
2167 (patches (search-patches "superlu-dist-scotchmetis.patch"))))
2168 (build-system gnu-build-system)
2172 `(("gfortran" ,gfortran)))
2174 `(("openmpi" ,openmpi) ;headers include MPI heades
2175 ("lapack" ,lapack) ;required to link with output library
2176 ("pt-scotch" ,pt-scotch))) ;same
2178 `(#:parallel-build? #f ;race conditions using ar
2180 (modify-phases %standard-phases
2182 (lambda* (#:key inputs outputs #:allow-other-keys)
2183 (call-with-output-file "make.inc"
2188 DSUPERLULIB = ~a/lib/libsuperlu_dist.a
2189 BLASDEF = -DUSE_VENDOR_BLAS
2190 BLASLIB = -L~a/lib -lblas
2191 PARMETISLIB = -L~a/lib \
2192 -lptscotchparmetis -lptscotch -lptscotcherr -lptscotcherrexit \
2193 -lscotch -lscotcherr -lscotcherrexit
2194 METISLIB = -L~:*~a/lib \
2195 -lscotchmetis -lscotch -lscotcherr -lscotcherrexit
2196 LIBS = $(DSUPERLULIB) $(PARMETISLIB) $(METISLIB) $(BLASLIB)
2202 CFLAGS = -O3 -g -DPRNTlevel=0 $(PIC)
2203 NOOPTS = -O0 -g $(PIC)
2205 FFLAGS = -O2 -g $(PIC)
2209 (assoc-ref outputs "out")
2210 (assoc-ref inputs "lapack")
2211 (assoc-ref inputs "pt-scotch"))))
2213 (add-after 'unpack 'remove-broken-symlinks
2215 (for-each delete-file
2216 (find-files "MAKE_INC" "\\.#make\\..*"))
2218 (add-before 'build 'create-install-directories
2219 (lambda* (#:key outputs #:allow-other-keys)
2222 (mkdir-p (string-append (assoc-ref outputs "out")
2228 ;; By default, running the test suite would fail because 'ssh'
2229 ;; could not be found in $PATH. Define this variable to placate
2230 ;; Open MPI without adding a dependency on OpenSSH (the agent
2231 ;; isn't used anyway.)
2232 (setenv "OMPI_MCA_plm_rsh_agent" (which "cat"))
2233 (with-directory-excursion "EXAMPLE"
2234 (invoke "mpirun" "-n" "2"
2235 "./pddrive" "-r" "1" "-c" "2" "g20.rua")
2236 (invoke "mpirun" "-n" "2"
2237 "./pzdrive" "-r" "1" "-c" "2" "cg20.cua"))
2240 (lambda* (#:key outputs #:allow-other-keys)
2241 ;; Library is placed in lib during the build phase. Copy over
2242 ;; headers to include.
2243 (let* ((out (assoc-ref outputs "out"))
2244 (incdir (string-append out "/include")))
2245 (for-each (lambda (file)
2246 (let ((base (basename file)))
2247 (format #t "installing `~a' to `~a'~%"
2250 (string-append incdir "/" base))))
2251 (find-files "SRC" ".*\\.h$")))
2253 (home-page (package-home-page superlu))
2254 (synopsis "Parallel supernodal direct solver")
2256 "SuperLU_DIST is a parallel extension to the serial SuperLU library.
2257 It is targeted for distributed memory parallel machines. SuperLU_DIST is
2258 implemented in ANSI C, and MPI for communications.")
2259 (license license:bsd-3)))
2261 (define-public scotch
2268 (uri (string-append "https://gforge.inria.fr/frs/download.php/"
2269 "latestfile/298/scotch_" version ".tar.gz"))
2271 (base32 "0vsmgjz8qv80di3ljmc7hbdsizxxxwy2b9rgd2fl1mdc6dgbj8av"))
2272 (patches (search-patches "scotch-test-threading.patch"
2273 "scotch-build-parallelism.patch"
2274 "scotch-graph-induce-type-64.patch"
2275 "scotch-graph-diam-64.patch"))))
2276 (build-system gnu-build-system)
2283 (modify-phases %standard-phases
2285 'unpack 'chdir-to-src
2286 (lambda _ (chdir "src") #t))
2290 (call-with-output-file "Makefile.inc"
2304 CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
2305 LDFLAGS = -lz -lm -lrt -lpthread
2307 LEX = flex -Pscotchyy -olex.yy.c
2312 YACC = bison -pscotchyy -y -b y
2314 '("COMMON_FILE_COMPRESS_GZ"
2316 "COMMON_RANDOM_FIXED_SEED"
2317 "INTSIZE64" ;use 'long' instead of 'int'
2318 ;; Prevents symbolc clashes with libesmumps
2320 ;; XXX: Causes invalid frees in superlu-dist tests
2322 ;; "SCOTCH_PTHREAD_NUMBER=2"
2323 "restrict=__restrict"))))
2326 'build 'build-esmumps
2328 ;; By default, running the test suite would fail because 'ssh'
2329 ;; could not be found in $PATH. Define this variable to placate
2330 ;; Open MPI without adding a dependency on OpenSSH (the agent
2331 ;; isn't used anyway.)
2332 (setenv "OMPI_MCA_plm_rsh_agent" (which "cat"))
2335 (format #f "-j~a" (parallel-job-count))
2339 (lambda* (#:key outputs #:allow-other-keys)
2340 (let ((out (assoc-ref outputs "out")))
2343 (string-append "prefix=" out)
2345 ;; esmumps files are not installed with the above
2346 (for-each (lambda (f)
2347 (copy-file f (string-append out "/include/" f)))
2348 (find-files "../include" ".*esmumps.h$"))
2349 (for-each (lambda (f)
2350 (copy-file f (string-append out "/lib/" f)))
2351 (find-files "../lib" "^lib.*esmumps.*"))
2353 (home-page "http://www.labri.fr/perso/pelegrin/scotch/")
2354 (synopsis "Programs and libraries for graph algorithms")
2355 (description "SCOTCH is a set of programs and libraries which implement
2356 the static mapping and sparse matrix reordering algorithms developed within
2357 the SCOTCH project. Its purpose is to apply graph theory, with a divide and
2358 conquer approach, to scientific computing problems such as graph and mesh
2359 partitioning, static mapping, and sparse matrix ordering, in application
2360 domains ranging from structural mechanics to operating systems or
2362 ;; See LICENSE_en.txt
2363 (license license:cecill-c)))
2365 (define-public scotch32
2366 ;; This is the 'INTSIZE32' variant, which uses 32-bit integers, as needed by
2367 ;; some applications.
2368 (package (inherit scotch)
2371 (substitute-keyword-arguments (package-arguments scotch)
2372 ((#:phases scotch-phases)
2373 `(modify-phases ,scotch-phases
2377 (call-with-output-file "Makefile.inc"
2391 CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
2392 LDFLAGS = -lz -lm -lrt -lpthread
2394 LEX = flex -Pscotchyy -olex.yy.c
2399 YACC = bison -pscotchyy -y -b y
2401 '("COMMON_FILE_COMPRESS_GZ"
2403 "COMMON_RANDOM_FIXED_SEED"
2404 "INTSIZE32" ;use 32-bit integers. See INSTALL.txt
2405 ;; Prevents symbolc clashes with libesmumps
2407 ;; XXX: Causes invalid frees in superlu-dist tests
2409 ;; "SCOTCH_PTHREAD_NUMBER=2"
2410 "restrict=__restrict"))))))))))
2412 "Programs and libraries for graph algorithms (32-bit integers)")))
2414 (define-public pt-scotch
2415 (package (inherit scotch)
2418 `(("openmpi" ,openmpi))) ;Headers include MPI headers
2420 (substitute-keyword-arguments (package-arguments scotch)
2421 ((#:phases scotch-phases)
2422 `(modify-phases ,scotch-phases
2427 (zero? (system* "make"
2428 (format #f "-j~a" (parallel-job-count))
2429 "ptscotch" "ptesmumps"))
2430 ;; Install the serial metis compatibility library
2431 (zero? (system* "make" "-C" "libscotchmetis" "install")))))
2434 (lambda _ (zero? (system* "make" "ptcheck"))))))))
2435 (synopsis "Programs and libraries for graph algorithms (with MPI)")))
2437 (define-public pt-scotch32
2438 (package (inherit scotch32)
2439 (name "pt-scotch32")
2441 `(("openmpi" ,openmpi))) ;headers include MPI headers
2443 (substitute-keyword-arguments (package-arguments scotch32)
2444 ((#:phases scotch32-phases)
2445 `(modify-phases ,scotch32-phases
2449 (zero? (system* "make"
2450 (format #f "-j~a" (parallel-job-count))
2451 "ptscotch" "ptesmumps"))
2452 ;; Install the serial metis compatibility library
2453 (zero? (system* "make" "-C" "libscotchmetis" "install")))))
2456 (zero? (system* "make" "ptcheck"))))))))
2458 "Programs and libraries for graph algorithms (with MPI and 32-bit integers)")))
2460 (define-public metis
2467 (uri (string-append "http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/"
2468 "metis-" version ".tar.gz"))
2471 "1cjxgh41r8k6j029yxs8msp3z6lcnpm16g5pvckk35kc7zhfpykn"))))
2472 (build-system cmake-build-system)
2474 `(("blas" ,openblas)))
2476 `(#:tests? #f ;no tests
2477 #:configure-flags `("-DSHARED=ON"
2478 ,(string-append "-DGKLIB_PATH=" (getcwd)
2479 "/metis-" ,version "/GKlib"))))
2480 (home-page "http://glaros.dtc.umn.edu/gkhome/metis/metis/overview")
2481 (synopsis "Graph partitioning and fill-reducing matrix ordering library")
2483 "METIS is a set of serial programs for partitioning graphs, partitioning
2484 finite element meshes, and producing fill-reducing orderings for sparse
2485 matrices. The algorithms implemented in METIS are based on the multilevel
2486 recursive-bisection, multilevel k-way, and multi-constraint partitioning
2488 (license license:asl2.0))) ;As of version 5.0.3
2490 (define-public p4est
2497 (uri (string-append "http://p4est.github.io/release/p4est-"
2501 "16h267z256kxcxfjs390qqzv19hr58vrj4x8lndb7alnk2vca8n5"))))
2502 (build-system gnu-build-system)
2504 `(("fortran" ,gfortran)
2509 `(#:configure-flags `(,(string-append "BLAS_LIBS=-L"
2510 (assoc-ref %build-inputs "blas")
2512 ,(string-append "LAPACK_LIBS=-L"
2513 (assoc-ref %build-inputs "lapack")
2515 #:phases (modify-phases %standard-phases
2516 (add-before 'check 'set-test-environment
2518 ;; By default, running the test suite would fail because
2519 ;; 'ssh' could not be found in $PATH. Define this
2520 ;; variable to placate Open MPI without adding a
2521 ;; dependency on OpenSSH (the agent isn't used anyway.)
2522 (setenv "OMPI_MCA_plm_rsh_agent" (which "cat"))
2524 (home-page "http://www.p4est.org")
2525 (synopsis "Adaptive mesh refinement on forests of octrees")
2527 "The p4est software library enables the dynamic management of a
2528 collection of adaptive octrees, conveniently called a forest of octrees.
2529 p4est is designed to work in parallel and scales to hundreds of thousands of
2531 (license license:gpl2+)))
2533 (define-public p4est-openmpi
2534 (package (inherit p4est)
2535 (name "p4est-openmpi")
2538 ,@(package-inputs p4est)))
2540 (substitute-keyword-arguments (package-arguments p4est)
2541 ((#:configure-flags cf)
2542 ``("--enable-mpi" ,@,cf))))
2543 (synopsis "Parallel adaptive mesh refinement on forests of octrees")))
2545 (define-public gsegrafix
2552 (uri (string-append "mirror://gnu/" name "/" name "-"
2556 "1b13hvx063zv970y750bx41wpx6hwd5ngjhbdrna8w8yy5kmxcda"))))
2557 (build-system gnu-build-system)
2559 `(#:configure-flags '("LDFLAGS=-lm")))
2561 `(("libgnomecanvas" ,libgnomecanvas)
2562 ("libbonoboui" ,libbonoboui)
2563 ("libgnomeui" ,libgnomeui)
2564 ("libgnomeprintui" ,libgnomeprintui)
2567 `(("pkg-config" ,pkg-config)))
2568 (home-page "https://www.gnu.org/software/gsegrafix/")
2569 (synopsis "GNOME application to create scientific and engineering plots")
2570 (description "GSEGrafix is an application which produces high-quality graphical
2571 plots for science and engineering. Plots are specified via simple ASCII
2572 parameter files and data files and are presented in an anti-aliased GNOME
2573 canvas. The program supports rectangular two-dimensional plots, histograms,
2574 polar-axis plots and three-dimensional plots. Plots can be printed or saved
2575 to BMP, JPEG or PNG image formats.")
2576 (license license:gpl3+)))
2578 (define-public maxima
2585 (uri (string-append "mirror://sourceforge/maxima/Maxima-source/"
2586 version "-source/" name "-" version ".tar.gz"))
2589 "0x0n81z0s4pl8nwpf7ivlsbvsdphm9w42250g7qdkizl0132by6s"))
2590 (patches (search-patches "maxima-defsystem-mkdir.patch"))))
2591 (build-system gnu-build-system)
2594 ("gnuplot" ,gnuplot) ;for plots
2595 ("tk" ,tk))) ;Tcl/Tk is used by 'xmaxima'
2597 `(("texinfo" ,texinfo)
2599 ("python" ,python)))
2602 (list "--enable-gcl"
2603 (string-append "--with-posix-shell="
2604 (assoc-ref %build-inputs "bash")
2606 (string-append "--with-wish="
2607 (assoc-ref %build-inputs "tk")
2609 (let ((v ,(package-version tk)))
2610 (string-take v (string-index-right v #\.)))))
2611 ;; By default Maxima attempts to write temporary files to
2612 ;; '/tmp/nix-build-maxima-*', which won't exist at run time.
2613 ;; Work around that.
2614 #:make-flags (list "TMPDIR=/tmp")
2616 (modify-phases %standard-phases
2617 (add-before 'check 'pre-check
2619 (chmod "src/maxima" #o555)
2621 ;; Make sure the doc and emacs files are found in the
2622 ;; standard location. Also configure maxima to find gnuplot
2623 ;; without having it on the PATH.
2624 (add-after 'install 'post-install
2625 (lambda* (#:key outputs inputs #:allow-other-keys)
2626 (let* ((gnuplot (assoc-ref inputs "gnuplot"))
2627 (out (assoc-ref outputs "out"))
2628 (datadir (string-append out "/share/maxima/" ,version))
2629 (binutils (string-append (assoc-ref inputs "binutils")
2631 (with-directory-excursion out
2632 (mkdir-p "share/emacs")
2633 (mkdir-p "share/doc")
2635 (string-append datadir "/emacs/")
2636 (string-append out "/share/emacs/site-lisp"))
2638 (string-append datadir "/doc/")
2639 (string-append out "/share/doc/maxima"))
2640 (with-atomic-file-replacement
2641 (string-append datadir "/share/maxima-init.lisp")
2643 (format out "~a ~s~a~%"
2644 "(setf $gnuplot_command "
2645 (string-append gnuplot "/bin/gnuplot") ")")
2646 (dump-port in out))))
2647 ;; Ensure that Maxima will have access to the GNU binutils
2648 ;; components at runtime.
2649 (wrap-program (string-append out "/bin/maxima")
2650 `("PATH" prefix (,binutils))))
2652 (home-page "http://maxima.sourceforge.net")
2653 (synopsis "Numeric and symbolic expression manipulation")
2654 (description "Maxima is a system for the manipulation of symbolic and
2655 numerical expressions. It yields high precision numeric results by using
2656 exact fractions, arbitrary precision integers, and variable precision floating
2658 ;; Some files are lgpl2.1+. Some are gpl2+. Some explicitly state gpl1+.
2659 ;; Others simply say "GNU General Public License" without stating a
2660 ;; version (which implicitly means gpl1+).
2661 ;; At least one file (src/maxima.asd) says "version 2."
2662 ;; GPLv2 only is therefore the smallest subset.
2663 (license license:gpl2)))
2665 (define-public wxmaxima
2672 (uri (string-append "https://github.com/andrejv/" name "/archive"
2673 "/Version-" version ".tar.gz"))
2674 (file-name (string-append name "-" version ".tar.gz"))
2677 "03kr2rgfp4hcf3is8m8d8f9hj660c3xgrc50vrrfpixx4syh6wvj"))
2679 (search-patches "wxmaxima-do-not-use-old-gnuplot-parameters.patch"))))
2680 (build-system cmake-build-system)
2682 `(("gettext" ,gettext-minimal)))
2684 `(("wxwidgets" ,wxwidgets)
2687 ("adwaita-icon-theme" ,adwaita-icon-theme)
2689 ("shared-mime-info" ,shared-mime-info)))
2691 `(#:tests? #f ; no check target
2693 (modify-phases %standard-phases
2694 (add-after 'install 'wrap-program
2695 (lambda* (#:key inputs outputs #:allow-other-keys)
2696 (wrap-program (string-append (assoc-ref outputs "out")
2699 (,(string-append (assoc-ref inputs "maxima")
2701 ;; For GtkFileChooserDialog.
2702 `("GSETTINGS_SCHEMA_DIR" =
2703 (,(string-append (assoc-ref inputs "gtk+")
2704 "/share/glib-2.0/schemas")))
2705 `("XDG_DATA_DIRS" ":" prefix
2706 (;; Needed by gdk-pixbuf to know supported icon formats.
2708 (assoc-ref inputs "shared-mime-info") "/share")
2709 ;; The default icon theme of GTK+.
2711 (assoc-ref inputs "adwaita-icon-theme") "/share"))))
2713 (home-page "https://andrejv.github.io/wxmaxima/")
2714 (synopsis "Graphical user interface for the Maxima computer algebra system")
2716 "wxMaxima is a graphical user interface for the Maxima computer algebra
2717 system. It eases the use of Maxima by making most of its commands available
2718 through a menu system and by providing input dialogs for commands that require
2719 more than one argument. It also implements its own display engine that
2720 outputs mathematical symbols directly instead of depicting them with ASCII
2723 wxMaxima also features 2D and 3D inline plots, simple animations, mixing of
2724 text and mathematical calculations to create documents, exporting of input and
2725 output to TeX, and a browser for Maxima's manual including command index and
2726 full text searching.")
2727 (license license:gpl2+)))
2729 (define-public armadillo
2735 (uri (string-append "mirror://sourceforge/arma/armadillo-"
2739 "1qqzy7dp891j9v7062mv1599hdwr97vqzrd3j2fl8c3gmc00dmzg"))))
2740 (build-system cmake-build-system)
2741 (arguments `(#:tests? #f)) ;no test target
2743 `(("openblas" ,openblas)
2745 ("arpack" ,arpack-ng)))
2746 (home-page "http://arma.sourceforge.net/")
2747 (synopsis "C++ linear algebra library")
2749 "Armadillo is a C++ linear algebra library, aiming towards a good balance
2750 between speed and ease of use. It is useful for algorithm development
2751 directly in C++, or quick conversion of research code into production
2752 environments. It can be used for machine learning, pattern recognition,
2753 signal processing, bioinformatics, statistics, econometrics, etc. The library
2754 provides efficient classes for vectors, matrices and cubes, as well as 150+
2755 associated functions (eg. contiguous and non-contiguous submatrix views).")
2756 (license license:asl2.0)))
2758 (define-public muparser
2759 ;; When switching download sites, muparser re-issued a 2.2.5 release with a
2760 ;; different hash. In order to make `guix package --upgrade` work correctly,
2761 ;; we set a Guix packaging revision.
2762 ;; When the next version of muparser is released, we can remove
2763 ;; UPSTREAM-VERSION and REVISION and use the plain VERSION.
2764 (let ((upstream-version "2.2.5")
2768 (version (string-append upstream-version "-" revision))
2772 (uri (string-append "https://github.com/beltoforion/muparser/archive/v"
2773 upstream-version ".tar.gz"))
2774 (file-name (string-append name "-" version ".tar.gz"))
2777 "0277qsi5l23jsck1vhn383bmvc2n9l4a1dl5r9bf7hvjv9ayyrh6"))))
2778 (build-system gnu-build-system)
2780 `(#:configure-flags '("--enable-samples=no")
2781 #:tests? #f)) ;no "check" target
2782 (home-page "http://muparser.beltoforion.de/")
2783 (synopsis "Fast parser library for mathematical expressions")
2785 "muParser is an extensible high performance math parser library. It is
2786 based on transforming an expression into a bytecode and precalculating constant
2788 (license license:expat))))
2790 (define-public openblas
2797 (uri (string-append "https://github.com/xianyi/OpenBLAS/tarball/v"
2799 (file-name (string-append name "-" version ".tar.gz"))
2802 "1bd03c5xni0bla0wg1wba841b36b0sg13sjja955kn5xzvy4i61a"))))
2803 (build-system gnu-build-system)
2805 `(#:test-target "test"
2806 ;; DYNAMIC_ARCH is only supported on x86. When it is disabled and no
2807 ;; TARGET is specified, OpenBLAS will tune itself to the build host, so
2808 ;; we need to disable substitutions.
2810 ,(let ((system (or (%current-target-system) (%current-system))))
2811 (or (string-prefix? "x86_64" system)
2812 (string-prefix? "i686" system)
2813 (string-prefix? "mips" system)
2814 (string-prefix? "aarch64" system)))
2816 (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
2818 ;; Build the library for all supported CPUs. This allows
2819 ;; switching CPU targets at runtime with the environment variable
2820 ;; OPENBLAS_CORETYPE=<type>, where "type" is a supported CPU type.
2821 ;; Unfortunately, this is not supported on non-x86 architectures,
2822 ;; where it leads to failed builds.
2823 ,@(let ((system (or (%current-target-system) (%current-system))))
2825 ((or (string-prefix? "x86_64" system)
2826 (string-prefix? "i686" system))
2827 '("DYNAMIC_ARCH=1"))
2828 ;; On MIPS we force the "SICORTEX" TARGET, as for the other
2829 ;; two available MIPS targets special extended instructions
2830 ;; for Loongson cores are used.
2831 ((string-prefix? "mips" system)
2832 '("TARGET=SICORTEX"))
2833 ;; On aarch64 force the generic 'armv8-a' target
2834 ((string-prefix? "aarch64" system)
2837 ;; no configure script
2839 (modify-phases %standard-phases
2841 (add-before 'build 'set-extralib
2842 (lambda* (#:key inputs #:allow-other-keys)
2843 ;; Get libgfortran found when building in utest.
2845 (string-append "-L" (assoc-ref inputs "fortran-lib")
2849 `(("fortran-lib" ,gfortran "lib")))
2852 ("fortran" ,gfortran)
2854 (home-page "http://www.openblas.net/")
2855 (synopsis "Optimized BLAS library based on GotoBLAS")
2857 "OpenBLAS is a BLAS library forked from the GotoBLAS2-1.13 BSD version.")
2858 (license license:bsd-3)))
2860 (define* (make-blis implementation #:optional substitutable?)
2861 "Return a BLIS package with the given IMPLEMENTATION (see config/ in the
2862 source tree for a list of implementations.)
2864 SUBSTITUTABLE? determines whether the package is made available as a
2867 Currently the specialization must be selected at configure-time, but work is
2868 underway to allow BLIS to select the right optimized kernels at run time:
2869 <https://github.com/flame/blis/issues/129>."
2871 (name (if (string=? implementation "reference")
2873 (string-append "blis-" implementation)))
2875 (home-page "https://github.com/flame/blis")
2878 (uri (git-reference (url home-page) (commit version)))
2881 "1wr79a50nm4abhw8w3sn96nmwp5mrzifcigk7khw9qcgyyyqayfh"))
2882 (file-name (git-file-name "blis" version))))
2883 (build-system gnu-build-system)
2885 `(#:test-target "test"
2887 #:substitutable? ,substitutable?
2889 #:phases (modify-phases %standard-phases
2891 (lambda* (#:key outputs #:allow-other-keys)
2892 ;; This is a home-made 'configure' script.
2893 (let ((out (assoc-ref outputs "out")))
2894 (zero? (system* "./configure" "-p" out
2898 "--enable-threading=openmp"
2900 ,implementation)))))
2901 (add-before 'check 'show-test-output
2903 ;; By default "make check" is silent. Make it verbose.
2904 (system "tail -F output.testsuite &")
2906 (synopsis "High-performance basic linear algebra (BLAS) routines")
2908 "BLIS is a portable software framework for instantiating high-performance
2909 BLAS-like dense linear algebra libraries. The framework was designed to
2910 isolate essential kernels of computation that, when optimized, immediately
2911 enable optimized implementations of most of its commonly used and
2912 computationally intensive operations. While BLIS exports a new BLAS-like API,
2913 it also includes a BLAS compatibility layer which gives application developers
2914 access to BLIS implementations via traditional BLAS routine calls.")
2915 (license license:bsd-3)))
2918 ;; This is the "reference" implementation, which is the non-optimized but
2919 ;; portable variant (no assembly).
2920 (make-blis "reference" #t))
2922 (define ignorance blis)
2924 (define-syntax-rule (blis/x86_64 processor)
2925 "Expand to a package specialized for PROCESSOR."
2927 (inherit (make-blis processor))
2928 (supported-systems '("x86_64-linux"))))
2930 (define-public blis-sandybridge
2931 ;; BLIS specialized for Sandy Bridge processors (launched 2011):
2932 ;; <http://ark.intel.com/products/codename/29900/Sandy-Bridge>.
2933 (blis/x86_64 "sandybridge"))
2935 (define-public blis-haswell
2936 ;; BLIS specialized for Haswell processors (launched 2013):
2937 ;; <http://ark.intel.com/products/codename/42174/Haswell>.
2938 (blis/x86_64 "haswell"))
2940 (define-public blis-knl
2941 ;; BLIS specialized for Knights Landing processor (launched 2016):
2942 ;; <http://ark.intel.com/products/series/92650/Intel-Xeon-Phi-x200-Product-Family>.
2943 (blis/x86_64 "knl"))
2946 (define-public openlibm
2953 (uri (string-append "https://github.com/JuliaLang/openlibm/archive/v"
2955 (file-name (string-append name "-" version ".tar.gz"))
2958 "1z8cj5q8ca8kmrakwkpjxf8svi81waw0c568cx8v8pv9kvswbp07"))))
2959 (build-system gnu-build-system)
2962 (list (string-append "prefix=" (assoc-ref %outputs "out")))
2964 ;; no configure script
2965 (modify-phases %standard-phases (delete 'configure))
2966 #:tests? #f)) ;the tests are part of the default target
2967 (home-page "http://openlibm.org/")
2968 (synopsis "Portable C mathematical library (libm)")
2970 "OpenLibm is an effort to have a high quality, portable, standalone C
2971 mathematical library (libm). It can be used standalone in applications and
2972 programming language implementations. The project was born out of a need to
2973 have a good libm for the Julia programming language that worked consistently
2974 across compilers and operating systems, and in 32-bit and 64-bit
2976 ;; Each architecture has its own make target, and there is none for mips.
2977 (supported-systems (delete "mips64el-linux" %supported-systems))
2978 ;; See LICENSE.md for details.
2979 (license (list license:expat
2982 license:public-domain
2983 license:lgpl2.1+))))
2985 (define-public openspecfun
2987 (name "openspecfun")
2992 (uri (string-append "https://github.com/JuliaLang/openspecfun/archive/v"
2994 (file-name (string-append name "-" version ".tar.gz"))
2997 "1rs1bv8jq751fv9vq79890wqf9xlbjc7lvz3ighzyfczbyjcf18m"))))
2998 (build-system gnu-build-system)
3000 '(#:tests? #f ; no "check" target
3002 (list (string-append "prefix=" (assoc-ref %outputs "out")))
3004 (modify-phases %standard-phases
3005 (delete 'configure)))) ; no configure script
3007 `(("fortran" ,gfortran)))
3008 (home-page "https://github.com/JuliaLang/openspecfun")
3009 (synopsis "Collection of special mathematical functions")
3011 "Openspecfun provides AMOS and Faddeeva. AMOS (from Netlib) is a
3012 portable package for Bessel Functions of a Complex Argument and Nonnegative
3013 Order; it contains subroutines for computing Bessel functions and Airy
3014 functions. Faddeeva allows computing the various error functions of arbitrary
3015 complex arguments (Faddeeva function, error function, complementary error
3016 function, scaled complementary error function, imaginary error function, and
3017 Dawson function); given these, one can also easily compute Voigt functions,
3018 Fresnel integrals, and similar related functions as well.")
3019 ;; Faddeeva is released under the Expat license; AMOS is included as
3020 ;; public domain software.
3021 (license (list license:expat license:public-domain))))
3023 (define-public suitesparse
3025 (name "suitesparse")
3031 "http://faculty.cse.tamu.edu/davis/SuiteSparse/SuiteSparse-"
3035 "1dnr6pmjzc2qmbkmb4shigx1l74ilf6abn7svyd6brxgvph8vadr"))
3036 (modules '((guix build utils)))
3038 ;; Remove bundled metis source
3040 (delete-file-recursively "metis-5.1.0")
3042 (build-system gnu-build-system)
3044 '(#:tests? #f ;no "check" target
3049 "MY_METIS_LIB=-lmetis"
3050 (string-append "INSTALL_LIB="
3051 (assoc-ref %outputs "out") "/lib")
3052 (string-append "INSTALL_INCLUDE="
3053 (assoc-ref %outputs "out") "/include")
3056 (modify-phases %standard-phases
3057 (delete 'configure)))) ;no configure script
3062 (home-page "http://faculty.cse.tamu.edu/davis/suitesparse.html")
3063 (synopsis "Suite of sparse matrix software")
3065 "SuiteSparse is a suite of sparse matrix algorithms, including: UMFPACK,
3066 multifrontal LU factorization; CHOLMOD, supernodal Cholesky; SPQR,
3067 multifrontal QR; KLU and BTF, sparse LU factorization, well-suited for circuit
3068 simulation; ordering methods (AMD, CAMD, COLAMD, and CCOLAMD); CSparse and
3069 CXSparse, a concise sparse Cholesky factorization package; and many other
3072 ;; AMD, CAMD, BTF, COLAMD, CCOLAMD, CSparse, CXSparse, KLU, LDL
3074 ;; GPUQREngine, RBio, SuiteSparse_GPURuntime, SuiteSparseQR, UMFPACK
3075 (license (list license:gpl2+ license:lgpl2.1+))))
3077 (define-public atlas
3083 (uri (string-append "mirror://sourceforge/math-atlas/Stable/"
3084 version "/atlas" version ".tar.bz2"))
3087 "1dyjlq3fiparvm8ypwk6rsmjzmnwk81l88gkishphpvc79ryp216"))))
3088 (build-system gnu-build-system)
3089 (home-page "http://math-atlas.sourceforge.net/")
3090 (inputs `(("gfortran" ,gfortran)
3091 ("lapack-tar" ,(package-source lapack))))
3092 (outputs '("out" "doc"))
3093 ;; For the moment we drop support for MIPS at it fails to compile. See
3094 ;; https://lists.gnu.org/archive/html/guix-devel/2014-11/msg00516.html
3095 (supported-systems (delete "mips64el-linux" %supported-systems))
3097 `(#:parallel-build? #f
3098 #:parallel-tests? #f
3100 ;; ATLAS tunes itself for the machine it is built on, as explained at
3101 ;; <http://lists.gnu.org/archive/html/guix-devel/2014-10/msg00305.html>.
3102 ;; For this reason, we want users to build it locally instead of using
3106 #:modules ((srfi srfi-26)
3108 (guix build gnu-build-system)
3111 `(;; Generate position independent code suitable for dynamic libraries
3112 ;; and use WALL timer to get more accurate timing.
3113 "-Fa" "alg" "-fPIC" "-D" "c" "-DWALL"
3116 ,,(if (string-match "64" (%current-system))
3119 ;; Disable parallel build as it gives errors: atlas_pthread.h is
3120 ;; needed to compile C files before it is generated.
3121 "-Ss" "pmake" "make -j 1"
3122 ;; Probe is failing for MIPS. We therefore define the system
3123 ;; architecture explicitly by setting (-A) MACHINETYPE = 49
3124 ;; 'MIPSR1xK' and (-V) ISA = 1 'none'.
3125 ,,@(if (string-prefix? "mips" (%current-system))
3126 (list "-A" "49" "-V" "1")
3128 ;; Generate shared libraries.
3130 ;; Build a full LAPACK library.
3131 ,(string-append "--with-netlib-lapack-tarfile="
3132 (assoc-ref %build-inputs "lapack-tar")))
3134 (modify-phases %standard-phases
3135 (add-after 'install 'install-doc
3136 (lambda* (#:key outputs inputs #:allow-other-keys)
3137 (let ((doc (string-append (assoc-ref outputs "doc")
3138 "/share/doc/atlas")))
3140 (fold (lambda (file previous)
3141 (and previous (zero? (system* "cp" file doc))))
3142 #t (find-files "../ATLAS/doc" ".*")))))
3143 (add-after 'check 'check-pt
3144 (lambda _ (zero? (system* "make" "ptcheck"))))
3145 ;; Fix files required to run configure.
3146 (add-before 'configure 'fix-/bin/sh
3148 ;; Use `sh', not `/bin/sh'.
3149 (substitute* (find-files "." "Makefile|configure|SpewMakeInc\\.c")
3152 ;; Fix /bin/sh in generated make files.
3153 (add-after 'configure 'fix-/bin/sh-in-generated-files
3155 (substitute* (find-files "." "^[Mm]ake\\.inc.*")
3158 ;; ATLAS configure program does not accepts the default flags
3159 ;; passed by the 'gnu-build-system'.
3161 (lambda* (#:key native-inputs inputs outputs
3162 (configure-flags '())
3163 #:allow-other-keys #:rest args)
3164 (let* ((prefix (assoc-ref outputs "out"))
3165 (bash (or (and=> (assoc-ref
3166 (or native-inputs inputs) "bash")
3167 (cut string-append <> "/bin/bash"))
3169 (flags `(,(string-append "--prefix=" prefix)
3171 (abs-srcdir (getcwd))
3172 (srcdir (string-append "../" (basename abs-srcdir))))
3173 (format #t "source directory: ~s (relative from build: ~s)~%"
3177 (format #t "build directory: ~s~%" (getcwd))
3178 (format #t "configure flags: ~s~%" flags)
3179 (zero? (apply system* bash
3180 (string-append srcdir "/configure")
3182 (synopsis "Automatically Tuned Linear Algebra Software")
3184 "ATLAS is an automatically tuned linear algebra software library
3185 providing C and Fortran77 interfaces to a portably efficient BLAS
3186 implementation, as well as a few routines from LAPACK.
3188 Optimization occurs at build time. For this reason, the library is built on
3189 the machine where it is installed, without resorting to pre-built substitutes.
3191 Before building the library, CPU throttling should be disabled. This can be
3192 done in the BIOS, or, on GNU/Linux, with the following command:
3195 # cpupower --governor performance
3198 Failure to do so will result in a library with poor performance.")
3199 (license license:bsd-3)))
3208 (uri (string-append "mirror://sourceforge/ogl-math/glm-" version
3209 "/glm-" version ".zip"))
3212 "1cnjmi033a16a95v6xfkr1bvfmkd26hzdjka8j1819hgn5b1nr8l"))))
3213 (build-system cmake-build-system)
3215 `(("unzip" ,unzip)))
3216 (home-page "http://glm.g-truc.net")
3217 (synopsis "OpenGL Mathematics library")
3218 (description "OpenGL Mathematics (GLM) is a header-only C++ mathematics
3219 library for graphics software based on the OpenGL Shading Language (GLSL)
3221 (license license:expat)))
3223 (define-public lpsolve
3230 (uri (string-append "mirror://sourceforge/lpsolve/lpsolve/" version
3231 "/lp_solve_" version "_source.tar.gz"))
3234 "12pj1idjz31r7c2mb5w03vy1cmvycvbkx9z29s40qdmkp1i7q6i0"))
3235 (modules '((guix build utils)))
3238 (substitute* (list "lp_solve/ccc" "lpsolve55/ccc")
3240 ;; Pretend to be on a 64 bit platform to obtain a common directory
3241 ;; name for the build results on all architectures; nothing else
3242 ;; seems to depend on it.
3243 (("^PLATFORM=.*$") "PLATFORM=ux64\n")
3245 ;; The check for 'isnan' as it is written fails with
3246 ;; "non-floating-point argument in call to function
3247 ;; ‘__builtin_isnan’", which leads to the 'NOISNAN' cpp macro
3248 ;; definition, which in turn leads to bad things. Fix the feature
3250 (("isnan\\(0\\)") "isnan(0.)"))
3252 (build-system gnu-build-system)
3254 `(#:tests? #f ; no check target
3256 (modify-phases %standard-phases
3257 (delete 'configure) ; no configure script
3260 (with-directory-excursion "lpsolve55"
3261 (invoke "bash" "ccc"))
3262 (with-directory-excursion "lp_solve"
3263 (invoke "bash" "ccc"))
3266 (lambda* (#:key outputs #:allow-other-keys)
3267 (let* ((out (assoc-ref outputs "out"))
3268 (bin (string-append out "/bin"))
3269 (lib (string-append out "/lib"))
3270 ;; This is where LibreOffice expects to find the header
3271 ;; files, and where they are installed by Debian.
3272 (include (string-append out "/include/lpsolve")))
3273 (install-file "lpsolve55/bin/ux64/liblpsolve55.a" lib)
3274 (install-file "lpsolve55/bin/ux64/liblpsolve55.so" lib)
3275 (install-file "lp_solve/bin/ux64/lp_solve" bin)
3277 ;; Install a subset of the header files as on Debian
3278 ;; (plus lp_bit.h, which matches the regular expression).
3279 (for-each (lambda (name)
3280 (install-file name include))
3281 (find-files "." "lp_[HMSa-z].*\\.h$"))
3282 (with-directory-excursion "shared"
3283 (for-each (lambda (name)
3284 (install-file name include))
3285 (find-files "." "\\.h$")))
3287 (home-page "http://lpsolve.sourceforge.net/")
3288 (synopsis "Mixed integer linear programming (MILP) solver")
3290 "lp_solve is a mixed integer linear programming solver based on the
3291 revised simplex and the branch-and-bound methods.")
3292 (license license:lgpl2.1+)))
3294 (define-public dealii
3301 (uri (string-append "https://github.com/dealii/dealii/releases/"
3302 "download/v" version "/dealii-" version ".tar.gz"))
3305 "1bh9rsmkrg0zi70n27b11djmac9lximghsiy7mg7w7x544n82gnk"))
3306 (modules '((guix build utils)))
3308 ;; Remove bundled sources: UMFPACK, TBB, muParser, and boost
3310 (delete-file-recursively "bundled")
3312 (build-system cmake-build-system)
3320 ("arpack" ,arpack-ng)
3321 ("muparser" ,muparser)
3322 ("gfortran" ,gfortran)
3323 ("suitesparse" ,suitesparse))) ;for UMFPACK
3325 `(#:build-type "DebugRelease" ;only supports Release, Debug, or DebugRelease
3327 ;; Work around a bug in libsuitesparseconfig linking
3328 ;; see https://github.com/dealii/dealii/issues/4745
3329 '("-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON")))
3330 (home-page "https://www.dealii.org")
3331 (synopsis "Finite element library")
3333 "Deal.II is a C++ program library targeted at the computational solution
3334 of partial differential equations using adaptive finite elements. The main
3335 aim of deal.II is to enable rapid development of modern finite element codes,
3336 using among other aspects adaptive meshes and a wide array of tools often used
3337 in finite element programs.")
3338 (license license:lgpl2.1+)))
3340 (define-public dealii-openmpi
3341 (package (inherit dealii)
3342 (name "dealii-openmpi")
3345 ;;Supported only with MPI:
3346 ("p4est" ,p4est-openmpi)
3347 ("petsc" ,petsc-openmpi)
3348 ("slepc" ,slepc-openmpi)
3349 ("metis" ,metis) ;for MUMPS
3350 ("scalapack" ,scalapack) ;for MUMPS
3351 ("mumps" ,mumps-metis-openmpi) ;configure supports only metis orderings
3352 ("arpack" ,arpack-ng-openmpi)
3353 ,@(fold alist-delete (package-inputs dealii)
3354 '("p4est" "arpack"))))
3356 (substitute-keyword-arguments (package-arguments dealii)
3357 ((#:configure-flags cf)
3358 ``("-DMPI_C_COMPILER=mpicc"
3359 "-DMPI_CXX_COMPILER=mpicxx"
3360 "-DMPI_Fortran_COMPILER=mpifort"
3362 (synopsis "Finite element library (with MPI support)")))
3364 (define-public flann
3373 "http://www.cs.ubc.ca/research/flann/uploads/FLANN/flann-"
3374 version "-src.zip"))
3377 "022w8hph7bli5zbpnk3z1qh1c2sl5hm8fw2ccim651ynn0hr7fyz"))
3378 (patches (search-patches "flann-cmake-3.11.patch"))))
3379 (build-system cmake-build-system)
3381 "octave")) ;46 MiB .mex file that pulls Octave
3383 `(("unzip" ,unzip)))
3387 ("python" ,python-2) ; print syntax
3388 ;; ("python2-numpy" ,python2-numpy) ; only required for the tests
3391 `(;; The 'share/flann/octave' contains a .mex file, which is an ELF file
3392 ;; taken 46 MiB unstripped, and 6 MiB stripped.
3393 #:strip-directories '("lib" "lib64" "libexec"
3394 "bin" "sbin" "share/flann/octave")
3396 ;; Save 12 MiB by not installing .a files. Passing
3397 ;; '-DBUILD_STATIC_LIBS=OFF' has no effect.
3398 #:phases (modify-phases %standard-phases
3399 (add-before 'configure 'set-octave-directory
3400 (lambda* (#:key outputs #:allow-other-keys)
3401 ;; Install the .mex file in the "octave" output.
3402 (let ((out (assoc-ref outputs "octave")))
3403 (substitute* "src/matlab/CMakeLists.txt"
3404 (("share/flann/octave")
3405 (string-append out "/share/flann/octave")))
3407 (add-after 'install 'remove-static-libraries
3408 (lambda* (#:key outputs #:allow-other-keys)
3409 (let* ((out (assoc-ref outputs "out"))
3410 (lib (string-append out "/lib")))
3411 (for-each delete-file
3412 (find-files lib "\\.a$"))
3415 #:tests? #f)) ; The test data are downloaded from the Internet.
3416 (home-page "http://www.cs.ubc.ca/research/flann/")
3417 (synopsis "Library for approximate nearest neighbors computation")
3418 (description "FLANN is a library for performing fast approximate
3419 nearest neighbor searches in high dimensional spaces. It implements a
3420 collection of algorithms and a system for automatically choosing the best
3421 algorithm and optimum parameters depending on the dataset.
3423 FLANN is written in C++ and contains bindings for C, Octave and Python.")
3424 (license (license:non-copyleft "file://COPYING"
3425 "See COPYING in the distribution."))))
3427 (define-public wcalc
3434 (uri (string-append "mirror://sourceforge/w-calc/Wcalc/" version "/"
3435 "wcalc-" version ".tar.bz2"))
3438 "1vi8dl6rccqiq1apmpwawyg2ywx6a1ic1d3cvkf2hlwk1z11fb0f"))))
3439 (build-system gnu-build-system)
3442 ("readline" ,readline)))
3443 (home-page "http://w-calc.sourceforge.net/index.php")
3444 (synopsis "Flexible command-line scientific calculator")
3445 (description "Wcalc is a very capable calculator. It has standard functions
3446 (sin, asin, and sinh for example, in either radians or degrees), many
3447 pre-defined constants (pi, e, c, etc.), support for using variables, \"active\"
3448 variables, a command history, hex/octal/binary input and output, unit
3449 conversions, embedded comments, and an expandable expression entry field. It
3450 evaluates expressions using the standard order of operations.")
3451 (license license:gpl2+)))
3459 (uri (string-append "mirror://sourceforge/xaos/XaoS/" version
3460 "/xaos-" version ".tar.gz"))
3463 "15cd1cx1dyygw6g2nhjqq3bsfdj8sj8m4va9n75i0f3ryww3x7wq"))))
3464 (build-system gnu-build-system)
3465 (native-inputs `(("gettext" ,gettext-minimal)))
3466 (inputs `(("libx11" ,libx11)
3471 `(#:tests? #f ;no "check" target
3472 #:make-flags '("LOCALEDIR=$DATAROOTDIR/locale")))
3473 (synopsis "Real-time fractal zoomer")
3474 (description "GNU XaoS is a graphical program that generates fractal
3475 patterns and allows you to zoom in and out of them infinitely in a fluid,
3476 continuous manner. It also includes tutorials that help to explain how fractals
3477 are built. It can generate many different fractal types such as the Mandelbrot
3479 (home-page "https://www.gnu.org/software/xaos/")
3480 (license license:gpl2+)))
3482 (define-public hypre
3488 (uri (string-append "https://github.com/LLNL/hypre/archive/"
3489 "v" version ".tar.gz"))
3490 (file-name (string-append name "-" version ".tar.gz"))
3493 "0q69ia0jivzcr8p049dn3mg8yjpn6nwq4sw9iqac8vr63vi54l6m"))
3494 (modules '((guix build utils)))
3497 ;; Remove use of __DATE__ and __TIME__ for reproducibility;
3498 ;; substitute the tarball creation time.
3499 (substitute* "src/utilities/HYPRE_utilities.h"
3500 (("Date Compiled: .*$")
3501 "Date Compiled: Mar 28 2016 20:19:59 +0000\"\n"))
3503 (build-system gnu-build-system)
3504 (outputs '("out" ;6.1 MiB of headers and libraries
3505 "doc")) ;4.8 MiB of documentation
3509 ("perl" ,perl) ;needed to run 'ppmquant' during tests
3510 ("texlive" ,texlive) ;full package required for fonts
3511 ("ghostscript" ,ghostscript)))
3513 `(("blas" ,openblas)
3514 ("lapack" ,lapack)))
3516 `(#:modules ((srfi srfi-1)
3517 ,@%gnu-build-system-modules)
3518 #:configure-flags '("--enable-shared"
3526 (modify-phases %standard-phases
3527 (add-before 'configure 'chdir-src
3528 (lambda _ (chdir "src")))
3530 (lambda* (#:key build target configure-flags
3531 #:allow-other-keys #:rest args)
3532 (let* ((configure (assoc-ref %standard-phases 'configure)))
3535 (list #:configure-flags
3536 (cons (string-append
3537 "--host=" (or target build))
3538 configure-flags)))))))
3539 (add-after 'build 'build-docs
3541 (zero? (system* "make" "-Cdocs" "pdf" "html"))))
3544 (setenv "LD_LIBRARY_PATH" (string-append (getcwd) "/hypre/lib"))
3545 (setenv "PATH" (string-append "." ":" (getenv "PATH")))
3546 (and (system* "make" "check" "CHECKRUN=")
3547 (fold (lambda (filename result)
3549 (let ((size (stat:size (stat filename))))
3550 (when (not (zero? size))
3551 (format #t "~a size ~d; error indication~%"
3555 (find-files "test" ".*\\.err$")))))
3556 (add-after 'install 'install-docs
3557 (lambda* (#:key outputs #:allow-other-keys)
3558 ;; Custom install because docs/Makefile doesn't honor ${docdir}.
3559 (let* ((doc (assoc-ref outputs "doc"))
3560 (docdir (string-append doc "/share/doc/hypre-" ,version)))
3561 (with-directory-excursion "docs"
3562 (for-each (lambda (base)
3563 (install-file (string-append base ".pdf") docdir)
3564 (copy-recursively base docdir)) ;html docs
3565 '("HYPRE_usr_manual"
3566 "HYPRE_ref_manual")))
3568 (home-page "http://www.llnl.gov/casc/hypre/")
3569 (synopsis "Library of solvers and preconditioners for linear equations")
3571 "HYPRE is a software library of high performance preconditioners and
3572 solvers for the solution of large, sparse linear systems of equations. It
3573 features multigrid solvers for both structured and unstructured grid
3575 (license license:lgpl2.1)))
3577 (define-public hypre-openmpi
3578 (package (inherit hypre)
3579 (name "hypre-openmpi")
3582 ,@(package-inputs hypre)))
3584 (substitute-keyword-arguments (package-arguments hypre)
3585 ((#:configure-flags flags)
3587 ,@(delete "--without-MPI" ,flags)))
3589 `(modify-phases ,phases
3590 (add-before 'check 'set-test-environment
3592 ;; By default, running the test suite would fail because 'ssh'
3593 ;; could not be found in $PATH. Define this variable to
3594 ;; placate Open MPI without adding a dependency on OpenSSH (the
3595 ;; agent isn't used anyway.)
3596 (setenv "OMPI_MCA_plm_rsh_agent" (which "cat"))
3598 (synopsis "Parallel solvers and preconditioners for linear equations")
3600 "HYPRE is a software library of high performance preconditioners and
3601 solvers for the solution of large, sparse linear systems of equations on
3602 parallel computers. It features parallel multigrid solvers for both
3603 structured and unstructured grid problems.")))
3605 (define-public matio
3612 (uri (string-append "mirror://sourceforge/matio/matio/" version "/"
3613 "matio-" version ".tar.gz"))
3616 "0y2qymgxank8wdiwc68ap8bxdzrhvyw86i29yh3xgn4z1njfd9ir"))))
3617 (build-system gnu-build-system)
3621 (home-page "http://matio.sourceforge.net/")
3622 (synopsis "Library for reading and writing MAT files")
3623 (description "Matio is a library for reading and writing MAT files. It
3624 supports compressed MAT files, as well as newer (version 7.3) MAT files.")
3625 (license license:bsd-2)))
3632 (origin (method url-fetch)
3633 (uri (string-append "https://github.com/VcDevel/Vc/releases/"
3634 "download/" version "/Vc-" version ".tar.gz"))
3637 "1zmlpn32jzb38smp3j834llmbix3whsrbw0h397qxysbw792kih8"))))
3638 (build-system cmake-build-system)
3641 '("-DBUILD_TESTING=ON"
3642 ;; By default, Vc will optimize for the CPU of the build machine.
3643 ;; Setting this to "none" makes it create portable binaries. See
3644 ;; "cmake/OptimizeForArchitecture.cmake".
3645 "-DTARGET_ARCHITECTURE=none")))
3646 (synopsis "SIMD vector classes for C++")
3647 (description "Vc provides portable, zero-overhead C++ types for explicitly
3648 data-parallel programming. It is a library designed to ease explicit
3649 vectorization of C++ code. Its types enable explicitly stating data-parallel
3650 operations on multiple values. The parallelism is therefore added via the type
3651 system. Vc has an intuitive API and provides portability between different
3652 compilers and compiler versions as well as portability between different vector
3653 instruction sets. Thus, an application written with Vc can be compiled for:
3656 @item SSE2 up to SSE4.2 or SSE4a
3659 @item NEON (in development)
3660 @item NVIDIA GPUs / CUDA (in development)
3662 (home-page "https://github.com/VcDevel/Vc")
3663 ;; "No support_???.cpp file exists for this architecture."
3664 (supported-systems '("x86_64-linux" "i686-linux"))
3665 (license license:bsd-3)))
3667 (define-public reducelcs
3668 ;; This is the last commit which is available upstream, no
3669 ;; release happened since 2010.
3670 (let ((commit "474f88deb968061abe8cf11c959e02319b8ae5c0")
3674 (version (string-append "1.0-" revision "." (string-take commit 7)))
3679 (url "https://github.com/gdv/Reduce-Expand-for-LCS")
3681 (file-name (string-append name "-" version "-checkout"))
3684 "1rllzcfwc042c336mhq262a8ha90x6afq30kvk60r7i4761j4yjm"))))
3685 (build-system gnu-build-system)
3687 `(("openlibm" ,openlibm)))
3689 `(#:tests? #f ; no tests
3691 (modify-phases %standard-phases
3692 (delete 'configure) ; No configure script exists.
3693 (replace 'install ; No install phase exists.
3694 (lambda* (#:key outputs #:allow-other-keys)
3695 (let* ((out (assoc-ref outputs "out"))
3696 (bin (string-append out "/bin")))
3697 (install-file "Approximation" bin)
3698 (install-file "CollectResults" bin)
3699 (install-file "GenerateInstances" bin)
3701 (synopsis "Approximate Longest Commons Subsequence computation tool")
3703 "@code{reduceLCS} is an implementation of the Reduce-Expand
3704 algorithm for LCS. It is a fast program to compute the approximate
3705 Longest Commons Subsequence of a set of strings.")
3706 (home-page "https://github.com/gdv/Reduce-Expand-for-LCS")
3707 (license license:gpl3+))))
3709 (define-public jacal
3716 "http://groups.csail.mit.edu/mac/ftpdir/scm/jacal-"
3719 "055zrn12a1dmy0dqkwrkq3fklbhg3yir6vn0lacp4mvbg8573a3q"))
3720 (patches (search-patches "jacal-fix-texinfo.patch"))))
3721 (build-system gnu-build-system)
3724 (modify-phases %standard-phases
3725 (add-before 'build 'pre-build
3726 ;; Don't use upstream's script - it really doesn't fit into
3727 ;; Guix's functional paradigm.
3728 (lambda* (#:key inputs outputs #:allow-other-keys)
3729 (substitute* "Makefile"
3730 (("^install: install-script") "install: "))))
3731 (add-after 'install 'post-install
3732 ;; Instead, we provide our own simplified script.
3733 (lambda* (#:key inputs outputs #:allow-other-keys)
3734 (let ((wrapper (string-append (assoc-ref outputs "out")
3736 (format (open wrapper (logior O_WRONLY O_CREAT))
3737 (string-append "#!~a\nexec ~a/bin/scm -ip1 "
3738 "-e '(slib:load \"~a/lib/jacal/math\") "
3741 (assoc-ref inputs "scm")
3742 (assoc-ref outputs "out"))
3743 (chmod wrapper #o555))))
3745 (lambda* (#:key inputs outputs #:allow-other-keys)
3746 (zero? (system* "./configure"
3747 (string-append "--prefix="
3748 (assoc-ref outputs "out")))))))))
3749 (inputs `(("scm" ,scm)))
3750 (native-inputs `(("unzip" ,unzip)
3751 ("texinfo" ,texinfo)))
3752 (synopsis "Symbolic mathematics system")
3753 (description "GNU JACAL is an interactive symbolic mathematics program based on
3754 Scheme. It manipulate and simplify a range of mathematical expressions such
3755 as equations, scalars, vectors, and matrices.")
3756 (home-page "https://www.gnu.org/software/jacal/")
3757 (license license:gpl3+)))
3766 "https://github.com/Z3Prover/z3/archive/z3-"
3770 "032a5lvji2liwmc25jv52bdrhimqflvqbpg77ccaq1jykhiivbmf"))))
3771 (build-system cmake-build-system)
3774 (list "-DBUILD_PYTHON_BINDINGS=true"
3775 "-DINSTALL_PYTHON_BINDINGS=true"
3776 (string-append "-DCMAKE_INSTALL_PYTHON_PKG_DIR="
3778 "/lib/python2.7/site-packages"))
3780 (modify-phases %standard-phases
3781 (add-before 'configure 'bootstrap
3784 (system* "python" "contrib/cmake/bootstrap.py" "create"))))
3785 (add-before 'check 'make-test-z3
3787 ;; Build the test suite executable.
3788 (zero? (system* "make" "test-z3" "-j"
3789 (number->string (parallel-job-count))))))
3792 ;; Run all the tests that don't require arguments.
3793 (zero? (system* "./test-z3" "/a")))))))
3795 `(("python" ,python-2)))
3796 (synopsis "Theorem prover")
3797 (description "Z3 is a theorem prover and @dfn{satisfiability modulo
3798 theories} (SMT) solver. It provides a C/C++ API, as well as Python bindings.")
3799 (home-page "https://github.com/Z3Prover/z3")
3800 (license license:expat)))
3802 (define-public cubicle
3808 (uri (string-append "http://cubicle.lri.fr/cubicle-"
3812 "1sny9c4fm14k014pk62ibpwbrjjirkx8xmhs9jg7q1hk7y7x3q2h"))))
3813 (build-system gnu-build-system)
3816 ("which" ,(@@ (gnu packages base) which))))
3820 `(#:configure-flags (list "--with-z3")
3823 (modify-phases %standard-phases
3824 (add-before 'configure 'configure-for-release
3826 (substitute* "Makefile.in"
3827 (("SVNREV=") "#SVNREV="))))
3828 (add-before 'configure 'fix-/bin/sh
3830 (substitute* "configure"
3831 (("/bin/sh") (which "sh")))))
3832 (add-before 'configure 'fix-smt-z3wrapper.ml
3834 (substitute* "Makefile.in"
3835 (("\\\\n") "")))))))
3836 (home-page "http://cubicle.lri.fr/")
3837 (synopsis "Model checker for array-based systems")
3838 (description "Cubicle is a model checker for verifying safety properties
3839 of array-based systems. This is a syntactically restricted class of
3840 parametrized transition systems with states represented as arrays indexed by
3841 an arbitrary number of processes. Cache coherence protocols and mutual
3842 exclusion algorithms are typical examples of such systems.")
3843 (license license:asl2.0)))
3845 (define-public elemental
3851 (uri (string-append "https://github.com/elemental/Elemental/"
3852 "archive/v" version ".tar.gz"))
3853 (file-name (string-append name "-" version ".tar.gz"))
3856 "1nfp82w22pi8x8fg9sc37z8kf84dqi1dhxp8bbk7571y4aygvv3v"))))
3857 (build-system cmake-build-system)
3858 (home-page "http://libelemental.org")
3860 `(("gfortran" ,gfortran)))
3862 `(("blas" ,openblas)
3863 ("gfortran:lib" ,gfortran "lib")
3872 `(#:build-type "Release" ;default RelWithDebInfo not supported
3873 #:configure-flags `("-DEL_DISABLE_PARMETIS:BOOL=YES"
3874 "-DEL_AVOID_COMPLEX_MPI:BOOL=NO"
3875 "-DEL_CACHE_WARNINGS:BOOL=YES"
3876 "-DEL_TESTS:BOOL=YES"
3877 "-DCMAKE_INSTALL_LIBDIR=lib"
3878 "-DGFORTRAN_LIB=gfortran")
3879 #:phases (modify-phases %standard-phases
3880 (add-before 'check 'setup-tests
3882 ;; Parallelism is done at the MPI layer.
3883 (setenv "OMP_NUM_THREADS" "1")
3885 (add-after 'install 'remove-tests
3886 (lambda* (#:key outputs #:allow-other-keys)
3887 ;; Tests are installed, with no easy configuration
3888 ;; switch to prevent this, so delete them.
3889 (delete-file-recursively
3890 (string-append (assoc-ref outputs "out") "/bin"))
3892 (synopsis "Dense and sparse-direct linear algebra and optimization")
3893 (description "Elemental is a modern C++ library for distributed-memory
3894 dense and sparse-direct linear algebra, conic optimization, and lattice
3896 (license license:bsd-2)))
3898 (define-public mcrl2
3901 (version "201707.1.15162")
3904 (uri (string-append "http://www.mcrl2.org/download/devel/mcrl2-"
3909 "1ziww2fchsklm25hl9p2mngssxfh9w07nc114cncqaxfibqp2p8f"))))
3911 `(("subversion" ,subversion)))
3917 (build-system cmake-build-system)
3918 (synopsis "Toolset for the mCRL2 formal specification language")
3920 "@dfn{mCRL2} (micro Common Representation Language 2) is a formal
3921 specification language for describing concurrent discrete event systems. Its
3922 toolset supports analysis and automatic verification, linearisation, simulation,
3923 state-space exploration and generation, and tools to optimise and analyse
3924 specifications. Also, state spaces can be manipulated, visualised and
3926 (home-page "http://mcrl2.org")
3927 (license license:boost1.0)))
3929 (define-public r-subplex
3936 (uri (cran-uri "subplex" version))
3939 "10cbgbx1bgsax5z7gz6716g360xpq4mvq19cf4qqrxv02mmwz57z"))))
3940 (build-system r-build-system)
3942 `(("gfortran" ,gfortran)))
3943 (home-page "https://cran.r-project.org/web/packages/subplex")
3944 (synopsis "Unconstrained optimization using the subplex algorithm")
3945 (description "This package implements the Subplex optimization algorithm.
3946 It solves unconstrained optimization problems using a simplex method on
3947 subspaces. The method is well suited for optimizing objective functions that
3948 are noisy or are discontinuous at the solution.")
3949 (license license:gpl3+)))
3951 (define-public r-desolve
3958 (uri (cran-uri "deSolve" version))
3961 "0qqc4mknw1jblzcmph1dg3k1p6w42yal0k1xjh8pqk7yb3a75hs5"))))
3962 (properties `((upstream-name . "deSolve")))
3963 (build-system r-build-system)
3965 `(("gfortran" ,gfortran)))
3966 (home-page "https://desolve.r-forge.r-project.org/")
3967 (synopsis "Solvers for initial value problems of differential equations")
3968 (description "This package provides functions that solve initial
3969 value problems of a system of first-order ordinary differential equations (ODE),
3970 of partial differential equations (PDE), of differential algebraic equations
3971 (DAE), and of delay differential equations. The functions provide an interface
3972 to the FORTRAN functions lsoda, lsodar, lsode, lsodes of the ODEPACK collection,
3973 to the FORTRAN functions dvode and daspk and a C-implementation of solvers of
3974 the Runge-Kutta family with fixed or variable time steps. The package contains
3975 routines designed for solving ODEs resulting from 1-D, 2-D and 3-D partial
3976 differential equations (PDE) that have been converted to ODEs by numerical
3978 (license license:gpl2+)))
3980 (define-public tcalc
3987 (uri (string-append "https://sites.google.com/site/mohammedisam2000/tcalc/tcalc-"
3991 "0jq806m4dqfia85nppfm75mml9w57g0cgv4cdw9bp3zymda83s0m"))))
3992 (build-system gnu-build-system)
3993 (synopsis "The terminal calculator")
3995 "The terminal calculator is a small program to help users of the GNU/Linux
3996 terminal do calculations simply and quickly. The formula to be calculated can
3997 be fed to @command{tcalc} through the command line.")
3998 (home-page "https://sites.google.com/site/mohammedisam2000/tcalc")
3999 (license license:gpl3+)))