1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2014, 2015, 2016, 2019 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, 2019 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, 2019 Ricardo Wurmus <rekado@elephly.net>
9 ;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com>
10 ;;; Copyright © 2015, 2018 Mark H Weaver <mhw@netris.org>
11 ;;; Copyright © 2015, 2016, 2017, 2018, 2019 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, 2019 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, 2018, 2019 Paul Garlick <pgarlick@tourbillion-technology.com>
19 ;;; Copyright © 2017 ng0 <ng0@n0.is>
20 ;;; Copyright © 2017 Ben Woodcroft <donttrustben@gmail.com>
21 ;;; Copyright © 2017 Theodoros Foradis <theodoros@foradis.org>
22 ;;; Copyright © 2017, 2019 Arun Isaac <arunisaac@systemreboot.net>
23 ;;; Copyright © 2017, 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
24 ;;; Copyright © 2017 Dave Love <me@fx@gnu.org>
25 ;;; Copyright © 2018, 2019 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>
30 ;;; Copyright © 2018 Eric Brown <brown@fastmail.com>
31 ;;; Copyright © 2018 Julien Lepiller <julien@lepiller.eu>
32 ;;; Copyright © 2018 Amin Bandali <bandali@gnu.org>
33 ;;; Copyright © 2019 Nicolas Goaziou <mail@nicolasgoaziou.fr>
34 ;;; Copyright © 2019 Steve Sprang <scs@stevesprang.com>
36 ;;; This file is part of GNU Guix.
38 ;;; GNU Guix is free software; you can redistribute it and/or modify it
39 ;;; under the terms of the GNU General Public License as published by
40 ;;; the Free Software Foundation; either version 3 of the License, or (at
41 ;;; your option) any later version.
43 ;;; GNU Guix is distributed in the hope that it will be useful, but
44 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
45 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
46 ;;; GNU General Public License for more details.
48 ;;; You should have received a copy of the GNU General Public License
49 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
51 (define-module (gnu packages maths)
52 #:use-module (ice-9 regex)
53 #:use-module (ice-9 match)
54 #:use-module (gnu packages)
55 #:use-module ((guix licenses) #:prefix license:)
56 #:use-module (guix packages)
57 #:use-module (guix download)
58 #:use-module (guix git-download)
59 #:use-module (guix utils)
60 #:use-module ((guix build utils) #:select (alist-replace))
61 #:use-module (guix build-system cmake)
62 #:use-module (guix build-system gnu)
63 #:use-module (guix build-system python)
64 #:use-module (guix build-system r)
65 #:use-module (guix build-system ruby)
66 #:use-module (gnu packages algebra)
67 #:use-module (gnu packages audio)
68 #:use-module (gnu packages autotools)
69 #:use-module (gnu packages base)
70 #:use-module (gnu packages bison)
71 #:use-module (gnu packages boost)
72 #:use-module (gnu packages check)
73 #:use-module (gnu packages cmake)
74 #:use-module (gnu packages compression)
75 #:use-module (gnu packages curl)
76 #:use-module (gnu packages cyrus-sasl)
77 #:use-module (gnu packages documentation)
78 #:use-module (gnu packages elf)
79 #:use-module (gnu packages flex)
80 #:use-module (gnu packages fltk)
81 #:use-module (gnu packages fontutils)
82 #:use-module (gnu packages gettext)
83 #:use-module (gnu packages gcc)
84 #:use-module (gnu packages gd)
85 #:use-module (gnu packages ghostscript)
86 #:use-module (gnu packages graphviz)
87 #:use-module (gnu packages gtk)
88 #:use-module (gnu packages image)
89 #:use-module (gnu packages java)
90 #:use-module (gnu packages less)
91 #:use-module (gnu packages lisp)
92 #:use-module (gnu packages linux)
93 #:use-module (gnu packages logging)
94 #:use-module (gnu packages lua)
95 #:use-module (gnu packages gnome)
96 #:use-module (gnu packages guile)
97 #:use-module (gnu packages xorg)
98 #:use-module (gnu packages gl)
99 #:use-module (gnu packages imagemagick)
100 #:use-module (gnu packages m4)
101 #:use-module (gnu packages mpi)
102 #:use-module (gnu packages multiprecision)
103 #:use-module (gnu packages netpbm)
104 #:use-module (gnu packages onc-rpc)
105 #:use-module (gnu packages pcre)
106 #:use-module (gnu packages popt)
107 #:use-module (gnu packages perl)
108 #:use-module (gnu packages pkg-config)
109 #:use-module (gnu packages pulseaudio)
110 #:use-module (gnu packages python)
111 #:use-module (gnu packages python-web)
112 #:use-module (gnu packages python-xyz)
113 #:use-module (gnu packages qt)
114 #:use-module (gnu packages readline)
115 #:use-module (gnu packages ruby)
116 #:use-module (gnu packages tbb)
117 #:use-module (gnu packages scheme)
118 #:use-module (gnu packages shells)
119 #:use-module (gnu packages tcl)
120 #:use-module (gnu packages texinfo)
121 #:use-module (gnu packages tex)
122 #:use-module (gnu packages tls)
123 #:use-module (gnu packages version-control)
124 #:use-module (gnu packages wxwidgets)
125 #:use-module (gnu packages xml)
126 #:use-module (srfi srfi-1))
134 (uri (string-append "mirror://gnu/" name "/" name "-" version ".tar.gz"))
136 "1q1887ryqdr9sn0522hc7p16kqwlxxyz5dkmma8ar2nxplhgll7q"))))
137 (build-system gnu-build-system)
138 (inputs `(("gtk+" ,gtk+)
139 ("libxml2" ,libxml2)))
140 (native-inputs `(("pkg-config" ,pkg-config)))
141 (synopsis "Natural deduction first-order logic interface")
142 (description "Aris is a program for performing logical proofs. It supports
143 propositional and predicate logic, as well as Boolean algebra and
144 arithmetical logic. In addition to its predefined inference and equivalence
145 rules, Aris also supports references to older proofs. Its use of standard
146 logical symbols and its natural deduction interface make it easy to use for
148 (license license:gpl3+)
149 (home-page "https://www.gnu.org/software/aris/")))
151 (define-public c-graph
157 (uri (string-append "mirror://gnu/c-graph/c-graph-" version
160 "092412jzxy6wdvpk96pfj499hpmaww8xllavbvlqspfpr7ips9id"))))
161 (build-system gnu-build-system)
163 `(("fortran" ,gfortran)))
164 (synopsis "Visualizing and demonstrating convolution")
166 "GNU C-Graph is a tool for demonstrating the theory of convolution.
167 Thus, it can serve as an excellent aid to students of signal and systems
168 theory in visualizing the convolution process. Rather than forcing the
169 student to write code, the program offers an intuitive interface with
170 interactive dialogs to guide them.")
171 (license license:gpl3+)
172 (home-page "https://www.gnu.org/software/c-graph/")))
181 (uri (string-append "https://github.com/stcorp/coda/releases/download/"
182 version "/coda-" version ".tar.gz"))
184 (base32 "1fbxd2afm7dshd92p10yy8dwbr9gc1h1fmnnnmr7d0c5lnw80245"))
185 (patches (search-patches "coda-use-system-libs.patch"))
186 (modules '((guix build utils)))
188 ;; Make sure we don't use the bundled software.
190 (for-each (lambda (d)
191 (delete-file-recursively (string-append "libcoda/" d)))
192 '("zlib" "pcre" "expat"))
195 `(("fortran" ,gfortran)
197 ("python-numpy" ,python-numpy)))
204 (build-system gnu-build-system)
206 '(#:configure-flags '("--with-hdf4" "--with-hdf5" "--enable-python"
207 "LIBS= -lz -lpcre -lexpat")))
208 (synopsis "A common interface to various earth observation data formats")
210 "The Common Data Access toolbox (CODA) provides a set of interfaces for
211 reading remote sensing data from earth observation data files. It consists of
212 command line applications and interfaces to the C, Fortran, Python, and Java
213 programming languages.")
214 (home-page "https://stcorp.nl/coda")
215 (license license:gpl2+)))
223 (uri (string-append "http://www.qhull.org/download/qhull-"
224 (car (string-split version #\.))
228 "0dm4b2xr3asy6w74khq2zg4gf26zsy3qf9sq7pf7lmrvbj911c3q"))))
229 (build-system cmake-build-system)
230 (synopsis "Calculate convex hulls and related structures")
232 "@code{Qhull} computes the convex hull, Delaunay triangulation, Voronoi
233 diagram, halfspace intersection about a point, furthest-site Delaunay
234 triangulation, and furthest-site Voronoi diagram. The source code runs in 2-d,
235 3-d, 4-d, and higher dimensions. @code{Qhull} implements the Quickhull
236 algorithm for computing the convex hull. It handles roundoff errors from
237 floating point arithmetic. It computes volumes, surface areas, and
238 approximations to the convex hull.
240 @code{Qhull} does not support triangulation of non-convex surfaces, mesh
241 generation of non-convex objects, medium-sized inputs in 9-D and higher, alpha
242 shapes, weighted Voronoi diagrams, Voronoi volumes, or constrained Delaunay
244 (home-page "http://qhull.org")
245 (license (license:non-copyleft "file://COPYING.txt"
246 "See COPYING in the distribution."))))
248 (define-public python-cvxopt
250 (name "python-cvxopt")
255 (url "https://github.com/cvxopt/cvxopt.git")
257 (file-name (git-file-name name version))
260 "1kiy2m62xgs2d5id6dnnwy4vap85cd70p7pgkb9nh23qf9xnak7b"))))
261 (build-system python-build-system)
264 (modify-phases %standard-phases
265 (add-after 'unpack 'find-libraries
266 (lambda* (#:key inputs #:allow-other-keys)
267 (setenv "CVXOPT_BLAS_LIB" "openblas")
268 (setenv "CVXOPT_BUILD_FFTW" "1")
269 (setenv "CVXOPT_BUILD_GLPK" "1")
270 (setenv "CVXOPT_BUILD_GSL" "1")
277 ("openblas" ,openblas)
278 ("suitesparse" ,suitesparse)))
279 (home-page "https://www.cvxopt.org")
280 (synopsis "Python library for convex optimization")
282 "CVXOPT is a package for convex optimization based on the Python
283 programming language. Its main purpose is to make the development of software
284 for convex optimization applications straightforward by building on Python’s
285 extensive standard library and on the strengths of Python as a high-level
286 programming language.")
287 (license license:gpl3+)))
289 (define-public python2-cvxopt
290 (package-with-python2 python-cvxopt))
298 (uri (string-append "mirror://gnu/units/units-" version
301 "0mk562g7dnidjgfgvkxxpvlba66fh1ykmfd9ylzvcln1vxmi6qj2"))))
302 (build-system gnu-build-system)
304 `(("readline" ,readline)
305 ("python" ,python-wrapper) ;for 'units_cur' script
306 ("python-requests" ,python-requests)))
308 `(#:phases (modify-phases %standard-phases
309 (add-after 'install 'wrap-units_cur
310 (lambda* (#:key outputs #:allow-other-keys)
311 (let* ((out (assoc-ref outputs "out"))
312 (bin (string-append out "/bin")))
313 (wrap-program (string-append bin "/units_cur")
314 `("PYTHONPATH" ":" prefix
315 ,(search-path-as-string->list (getenv "PYTHONPATH"))))
317 (synopsis "Conversion between thousands of scales")
319 "GNU Units converts numeric quantities between units of measure. It
320 can handle scale changes through adaptive usage of standard scale
321 prefixes (micro-, kilo-, etc.). It can also handle nonlinear
322 conversions such as Fahrenheit to Celsius. Its interpreter is powerful
323 enough to be used effectively as a scientific calculator.")
324 (license license:gpl3+)
325 (home-page "https://www.gnu.org/software/units/")))
327 (define-public double-conversion
329 (name "double-conversion")
331 (home-page "https://github.com/google/double-conversion")
334 (uri (git-reference (url home-page)
335 (commit (string-append "v" version))))
336 (file-name (git-file-name name version))
339 "0csy4pjw1p8rp6g5qxi2h0ychhhp1fldv7gb761627fs2mclw9gv"))))
340 (build-system cmake-build-system)
342 '(#:test-target "test"
343 #:configure-flags '("-DBUILD_SHARED_LIBS=ON"
344 "-DBUILD_TESTING=ON")))
345 (synopsis "Conversion routines for IEEE doubles")
347 "The double-conversion library provides binary-decimal and decimal-binary
348 routines for IEEE doubles. The library consists of efficient conversion
349 routines that have been extracted from the V8 JavaScript engine.")
350 (license license:bsd-3)))
352 (define-public dionysus
358 (uri (string-append "mirror://gnu/dionysus/dionysus-" version
362 "194pzs1mlsj4ww6v37qq3961h5hckm5h805cv0r14xj3g9wfx2sk"))))
363 (build-system gnu-build-system)
364 (inputs `(("tcl" ,tcl))) ;for 'tclsh'
365 (synopsis "Local search for universal constants and scientific values")
367 "GNU Dionysus is a convenient system for quickly retrieving the values of
368 mathematical constants used in science and engineering. Values can be
369 searched using a simple command-line tool, choosing from three databases:
370 universal constants, atomic numbers, and constants related to
372 (license license:gpl3+)
373 (home-page "https://www.gnu.org/software/dionysus/")))
381 (uri (string-append "mirror://gnu/gsl/gsl-"
385 "1395y9hlhqadn5g9j8q22224fds5sd92jxi9czfavjj24myasq04"))
386 (patches (search-patches "gsl-test-i686.patch"))))
387 (build-system gnu-build-system)
389 `(;; Currently there are numerous tests that fail on "exotic"
390 ;; architectures such as aarch64 and ppc64le.
391 ,@(if (string-prefix? "aarch64-linux"
392 (or (%current-target-system) (%current-system)))
395 (home-page "https://www.gnu.org/software/gsl/")
396 (synopsis "Numerical library for C and C++")
398 "The GNU Scientific Library is a library for numerical analysis in C
399 and C++. It includes a wide range of mathematical routines, with over 1000
400 functions in total. Subject areas covered by the library include:
401 differential equations, linear algebra, Fast Fourier Transforms and random
403 (license license:gpl3+)))
412 (uri (string-append "mirror://gnu/glpk/glpk-"
416 "040sfaa9jclg2nqdh83w71sv9rc1sznpnfiripjdyr48cady50a2"))))
417 (build-system gnu-build-system)
421 `(#:configure-flags '("--with-gmp")))
422 (home-page "https://www.gnu.org/software/glpk/")
423 (synopsis "GNU Linear Programming Kit, supporting the MathProg language")
425 "GLPK is a C library for solving large-scale linear programming (LP),
426 mixed integer programming (MIP), and other related problems. It supports the
427 GNU MathProg modeling language, a subset of the AMPL language, and features a
428 translator for the language. In addition to the C library, a stand-alone
429 LP/MIP solver is included in the package.")
430 (license license:gpl3+)))
439 (uri (string-append "https://github.com/4ti2/4ti2/releases/download/"
441 (string-map (lambda (c) (if (char=? c #\.) #\_ c))
443 "/4ti2-" version ".tar.gz"))
445 (base32 "0rj92x6p9m3la5gasjbj7sa569im527ffmka5y2sv1amgd3fflrh"))))
446 (build-system gnu-build-system)
448 `(("which" ,(@ (gnu packages base) which)))) ; for the tests
452 (home-page "http://www.4ti2.de/")
453 (synopsis "Mathematical tool suite for problems on linear spaces")
455 "4ti2 implements algorithms for solving algebraic, geometric and
456 combinatorial problems on linear spaces. Among others, it solves systems
457 of linear equations, computes extreme rays of polyhedral cones, solves
458 integer programming problems and computes Markov bases for statistics.")
459 (license license:gpl2+)))
461 (define-public cddlib
468 (uri (string-append "ftp://ftp.math.ethz.ch/users/fukudak/cdd/cddlib-"
469 (string-delete #\. version) ".tar.gz"))
472 "00zdgiqb91vx6gd2103h3ijij0llspsxc6zz3iw2bll39fvkl4xq"))))
473 (build-system gnu-build-system)
476 (home-page "https://www.inf.ethz.ch/personal/fukudak/cdd_home/index.html")
477 (synopsis "Library for convex hulls and extreme rays of polyhedra")
479 "The C-library cddlib implements the Double Description Method of
480 Motzkin et al. for generating all vertices (i.e. extreme points) and extreme
481 rays of a general convex polyhedron given by a system of linear inequalities
482 in arbitrary dimension. It can also be used for the converse operation of
483 computing convex hulls.")
484 (license license:gpl2+)))
486 (define-public arpack-ng
490 (home-page "https://github.com/opencollab/arpack-ng")
493 (uri (git-reference (url home-page) (commit version)))
494 (file-name (git-file-name name version))
497 "1wljl96yqxc9v8r49c37lscwkdp58kaacfb9p6s6nvpm31haax4y"))))
498 (build-system gnu-build-system)
500 `(("autoconf" ,autoconf)
501 ("automake" ,automake)
502 ("libtool" ,libtool)))
505 ("fortran" ,gfortran)))
506 (synopsis "Fortran subroutines for solving eigenvalue problems")
508 "ARPACK-NG is a collection of Fortran77 subroutines designed to solve
509 large scale eigenvalue problems.")
510 (license (license:non-copyleft "file://COPYING"
511 "See COPYING in the distribution."))))
513 (define-public arpack-ng-3.3.0
517 (name (package-name arpack-ng))
518 (home-page (package-home-page arpack-ng))
522 (uri (string-append home-page "/archive/" version ".tar.gz"))
523 (file-name (string-append name "-" version ".tar.gz"))
526 "1cz53wqzcf6czmcpfb3vb61xi0rn5bwhinczl65hpmbrglg82ndd"))))))
528 (define-public arpack-ng-openmpi
529 (package (inherit arpack-ng)
530 (name "arpack-ng-openmpi")
533 ,@(package-inputs arpack-ng)))
535 (substitute-keyword-arguments (package-arguments arpack-ng)
536 ((#:configure-flags _ '())
538 ((#:phases phases '%standard-phases)
539 `(modify-phases ,phases
540 (add-before 'check 'mpi-setup
542 (synopsis "Fortran subroutines for solving eigenvalue problems with MPI")))
544 (define-public lapack
551 (uri (string-append "http://www.netlib.org/lapack/lapack-"
555 "1j51r7n5w4k7r3lrvy7710xrpkg40wf4rqnmngfz6ck9ypckzign"))))
556 (build-system cmake-build-system)
557 (home-page "http://www.netlib.org/lapack/")
558 (inputs `(("fortran" ,gfortran)
559 ("python" ,python-2)))
561 `(#:configure-flags (list
562 "-DBUILD_SHARED_LIBS:BOOL=YES"
565 ;; Build the 'LAPACKE_clatms' functions.
566 "-DLAPACKE_WITH_TMG=ON")
568 (modify-phases %standard-phases
569 (add-before 'check 'patch-python
570 (lambda* (#:key inputs #:allow-other-keys)
571 (let ((python (assoc-ref inputs "python")))
572 (substitute* "lapack_testing.py"
573 (("/usr/bin/env python") python)))
575 (synopsis "Library for numerical linear algebra")
577 "LAPACK is a Fortran 90 library for solving the most commonly occurring
578 problems in numerical linear algebra.")
579 (license (license:non-copyleft "file://LICENSE"
580 "See LICENSE in the distribution."))))
582 (define-public scalapack
589 (uri (string-append "http://www.netlib.org/scalapack/scalapack-"
593 "0p1r61ss1fq0bs8ynnx7xq4wwsdvs32ljvwjnx6yxr8gd6pawx0c"))
594 (patches (search-patches "scalapack-blacs-mpi-deprecations.patch"))))
595 (build-system cmake-build-system)
598 ("fortran" ,gfortran)
599 ("lapack" ,lapack))) ;for testing only
601 `(#:configure-flags `("-DBUILD_SHARED_LIBS:BOOL=YES")
602 #:phases (modify-phases %standard-phases
603 (add-before 'check 'mpi-setup
605 (home-page "http://www.netlib.org/scalapack/")
606 (synopsis "Library for scalable numerical linear algebra")
608 "ScaLAPACK is a Fortran 90 library of high-performance linear algebra
609 routines on parallel distributed memory machines. ScaLAPACK solves dense and
610 banded linear systems, least squares problems, eigenvalue problems, and
611 singular value problems.")
612 (license (license:non-copyleft "file://LICENSE"
613 "See LICENSE in the distribution."))))
615 (define-public gnuplot
621 (uri (string-append "mirror://sourceforge/gnuplot/gnuplot/"
625 (base32 "1vglp4la40f5dpj0zdj63zprrkyjgzy068p35bz5dqxjyczm1zlp"))))
626 (build-system gnu-build-system)
627 (inputs `(("readline" ,readline)
633 `(("pkg-config" ,pkg-config)
634 ("texlive" ,texlive-tiny)))
635 (arguments `(#:configure-flags (list (string-append
636 "--with-texdir=" %output
637 "/texmf-local/tex/latex/gnuplot"))))
638 (home-page "http://www.gnuplot.info")
639 (synopsis "Command-line driven graphing utility")
640 (description "Gnuplot is a portable command-line driven graphing
641 utility. It was originally created to allow scientists and students to
642 visualize mathematical functions and data interactively, but has grown to
643 support many non-interactive uses such as web scripting. It is also used as a
644 plotting engine by third-party applications like Octave.")
645 ;; X11 Style with the additional restriction that derived works may only be
646 ;; distributed as patches to the original.
647 (license (license:fsf-free
648 "http://gnuplot.cvs.sourceforge.net/gnuplot/gnuplot/Copyright"))))
658 (url "https://github.com/OkoSanto/GCTP.git")
659 (commit (string-append "v" version))))
660 (file-name (git-file-name name version))
662 (base32 "11wqmd443b4nksdbzp1msdws3av948nmwq1xz80w6hka3ss2aigd"))))
664 `(("fortran" ,gfortran)))
665 (build-system gnu-build-system)
666 (synopsis "General Cartographic Transformation Package (GCTP)")
668 "The General Cartographic Transformation Package (GCTP) is a system of
669 software routines designed to permit the transformation of coordinate pairs
670 from one map projection to another. The GCTP is the standard computer
671 software used by the National Mapping Division for map projection
673 (home-page "https://github.com/OkoSanto/GCTP")
674 (license license:public-domain))) ;https://www2.usgs.gov/laws/info_policies.html
683 (uri (string-append "https://support.hdfgroup.org/ftp/HDF/releases/HDF"
684 version "/src/hdf-" version ".tar.bz2"))
686 (base32 "0n29klrrbwan9307np0d9hr128dlpc4nnlf57a140080ll3jmp8l"))
687 (patches (search-patches "hdf4-architectures.patch"
688 "hdf4-reproducibility.patch"
689 "hdf4-shared-fortran.patch"
690 "hdf4-tirpc.patch"))))
691 (build-system gnu-build-system)
693 `(("gfortran" ,gfortran)
699 ("libtirpc" ,libtirpc)))
701 `(#:parallel-tests? #f
702 #:configure-flags (list "--enable-shared"
703 (string-append "CPPFLAGS=-I"
704 (assoc-ref %build-inputs "libtirpc")
707 (modify-phases %standard-phases
708 ;; This is inspired by two of Debian's patches.
709 (add-before 'configure 'add-more-aarch64-support
711 (substitute* '("mfhdf/ncgen/ncgen.l"
712 "mfhdf/ncgen/ncgenyy.c"
713 "mfhdf/libsrc/netcdf.h.in")
714 (("AIX5L64") "__aarch64__"))
716 (add-before 'configure 'patchbuild
719 '("mfhdf/hdfimport/testutil.sh.in" "hdf/util/testutil.sh.in")
721 (("/bin/mkdir") "mkdir"))
722 (substitute* (find-files "." "^Makefile\\.in$")
723 (("@HDF_BUILD_XDR_TRUE@XDR_ADD = \
724 -R\\$\\(abs_top_builddir\\)/mfhdf/xdr/\\.libs") "")
725 (("@HDF_BUILD_SHARED_TRUE@AM_LDFLAGS = \
726 -R\\$\\(abs_top_builddir\\)/mfhdf/libsrc/\\.libs \
727 -R\\$\\(abs_top_builddir\\)/hdf/src/\\.libs \\$\\(XDR_ADD\\)") ""))
729 (add-after 'configure 'patch-settings
731 ;; libhdf4.settings contains the full path of the
732 ;; compilers used, and its contents are included in
733 ;; .so-files. We truncate the hashes to avoid
734 ;; unnecessary store references to those compilers:
735 (substitute* "libhdf4.settings"
736 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
737 (string-append prefix (string-take hash 10) "...")))
740 (home-page "https://www.hdfgroup.org/products/hdf4/")
742 "Library and multi-object file format for storing and managing data")
743 (description "HDF4 is a library and multi-object file format for storing
744 and managing data between machines. HDF4 is an older hierarchical data format,
745 incompatible with HDF5.")
747 (license:non-copyleft
748 "https://www.hdfgroup.org/ftp/HDF/HDF_Current/src/unpacked/COPYING"))))
750 (define-public hdf4-alt
755 (substitute-keyword-arguments (package-arguments hdf4)
756 ((#:configure-flags flags) `(cons* "--disable-netcdf" ,flags))))
758 "HDF4 without netCDF API, can be combined with the regular netCDF library")))
767 (uri (list (string-append "https://support.hdfgroup.org/ftp/HDF5/releases/"
768 "hdf5-" (version-major+minor version)
769 "/hdf5-" version "/src/hdf5-"
771 (string-append "https://support.hdfgroup.org/ftp/HDF5/"
773 (match (string-split version #\.)
775 (string-append major minor)))
776 "/src/hdf5-" version ".tar.bz2")))
778 (base32 "03glk4w4wyb1jyb443g53y3y1ncnf6mj2cqwm6avfr2awkgb3cg5"))
779 (patches (search-patches "hdf5-config-date.patch"
780 "hdf5-1.8-mpi-deprecations.patch"))))
781 (build-system gnu-build-system)
785 `(("gfortran" ,gfortran)
786 ("perl" ,perl))) ;part of the test machinery needs Perl
787 (outputs '("out" ; core library
788 "fortran")) ; fortran interface
790 `(;; Some of the users, notably Flann, need the C++ interface.
791 #:configure-flags '("--enable-cxx"
793 "--enable-fortran2003"
795 ;; Build a thread-safe library. Unfortunately,
796 ;; 'configure' invites you to either turn off C++,
797 ;; Fortran, and the high-level interface (HL), or
798 ;; to pass '--enable-unsupported'. Debian
799 ;; packagers chose to pass '--enable-unsupported'
800 ;; and we follow their lead here.
801 "--enable-threadsafe"
803 "--enable-unsupported")
804 ;; Use -fPIC to allow the R bindings to link with the static libraries
805 #:make-flags (list "CFLAGS=-fPIC"
808 (modify-phases %standard-phases
809 (add-before 'configure 'patch-configure
810 (lambda* (#:key outputs #:allow-other-keys)
811 (substitute* "configure"
813 (substitute* "fortran/src/Makefile.in"
814 (("libhdf5_fortran_la_LDFLAGS =")
815 (string-append "libhdf5_fortran_la_LDFLAGS = -Wl-rpath="
816 (assoc-ref outputs "fortran") "/lib")))
817 (substitute* "hl/fortran/src/Makefile.in"
818 (("libhdf5hl_fortran_la_LDFLAGS =")
819 (string-append "libhdf5hl_fortran_la_LDFLAGS = -Wl,-rpath="
820 (assoc-ref outputs "fortran") "/lib")))
822 (add-after 'configure 'patch-settings
824 ;; libhdf5.settings contains the full path of the
825 ;; compilers used, and its contents are included in
826 ;; libhdf5.so. We truncate the hashes to avoid
827 ;; unnecessary store references to those compilers:
828 (substitute* "src/libhdf5.settings"
829 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
830 (string-append prefix (string-take hash 10) "..."))
831 ;; Don't record the build-time kernel version to make the
832 ;; settings file reproducible.
833 (("Uname information:.*")
834 "Uname information: Linux\n"))
836 (add-after 'install 'patch-references
837 (lambda* (#:key inputs outputs #:allow-other-keys)
838 (let ((bin (string-append (assoc-ref outputs "out") "/bin"))
839 (zlib (assoc-ref inputs "zlib")))
840 (substitute* (find-files bin "h5p?cc")
842 (string-append "-L" zlib "/lib " lib)))
844 (add-after 'install 'split
845 (lambda* (#:key inputs outputs #:allow-other-keys)
846 ;; Move all fortran-related files
847 (let* ((out (assoc-ref outputs "out"))
848 (bin (string-append out "/bin"))
849 (lib (string-append out "/lib"))
850 (inc (string-append out "/include"))
851 (ex (string-append out "/share/hdf5_examples/fortran"))
852 (fort (assoc-ref outputs "fortran"))
853 (fbin (string-append fort "/bin"))
854 (flib (string-append fort "/lib"))
855 (finc (string-append fort "/include"))
856 (fex (string-append fort "/share/hdf5_examples/fortran")))
861 ;; Note: When built with --enable-parallel, the 'h5fc' file
862 ;; doesn't exist, hence this condition.
863 (when (file-exists? (string-append bin "/h5fc"))
864 (rename-file (string-append bin "/h5fc")
865 (string-append fbin "/h5fc")))
866 (for-each (lambda (file)
868 (string-append flib "/" (basename file))))
869 (find-files lib ".*fortran.*"))
870 (for-each (lambda (file)
872 (string-append finc "/" (basename file))))
873 (find-files inc ".*mod"))
874 (for-each (lambda (file)
876 (string-append fex "/" (basename file))))
877 (find-files ex ".*"))
878 (delete-file-recursively ex))
880 (home-page "http://www.hdfgroup.org")
881 (synopsis "Management suite for extremely large and complex data")
882 (description "HDF5 is a suite that makes possible the management of
883 extremely large and complex data collections.")
884 (license (license:x11-style
885 "http://www.hdfgroup.org/ftp/HDF5/current/src/unpacked/COPYING"))))
887 (define-public hdf5-1.10
888 (package (inherit hdf5)
893 (uri (list (string-append "https://support.hdfgroup.org/ftp/HDF5/releases/"
894 "hdf5-" (version-major+minor version)
895 "/hdf5-" version "/src/hdf5-"
897 (string-append "https://support.hdfgroup.org/ftp/HDF5/"
900 (take (string-split version #\.) 2))
901 "/src/hdf5-" version ".tar.bz2")))
903 (base32 "1pr85fa1sh2ky6ai2hs3f21lp252grl2cq3wbyi4rh7dm83gyrqj"))
904 (patches (search-patches "hdf5-config-date.patch"
905 "hdf5-mpi-deprecations.patch"))))))
907 (define-public hdf-java
915 "http://www.hdfgroup.org/ftp/HDF5/releases/HDF-JAVA/hdfjni-"
916 version "/src/CMake-hdfjava-" version ".tar.gz"))
918 (base32 "0m1gp2aspcblqzmpqbdpfp6giskws85ds6p5gz8sx7asyp7wznpr"))
919 (modules '((guix build utils)))
920 (snippet ; Make sure we don't use the bundled sources and binaries.
922 (for-each delete-file
923 (list "SZip.tar.gz" "ZLib.tar.gz" "JPEG8d.tar.gz"
924 "HDF4.tar.gz" "HDF5.tar.gz"))
925 (delete-file-recursively ,(string-append "hdfjava-" version "/lib"))
927 (build-system gnu-build-system)
929 `(("jdk" ,icedtea "jdk")
930 ("automake" ,automake) ; For up to date 'config.guess' and 'config.sub'.
932 ("hamcrest-core" ,java-hamcrest-core)
933 ("junit" ,java-junit)
934 ("slf4j-simple" ,java-slf4j-simple)))
940 ("slf4j-api" ,java-slf4j-api)))
943 (list (string-append "--target=" ,(or (%current-target-system) (%current-system)))
944 (string-append "--with-jdk=" (assoc-ref %build-inputs "jdk") "/include,"
945 (assoc-ref %build-inputs "jdk") "/lib" )
946 (string-append "--with-hdf4=" (assoc-ref %build-inputs "hdf4") "/lib")
947 (string-append "--with-hdf5=" (assoc-ref %build-inputs "hdf5") "/lib"))
950 (list (string-append "HDFLIB=" (assoc-ref %build-inputs "hdf4") "/lib")
951 (string-append "HDF5LIB=" (assoc-ref %build-inputs "hdf5") "/lib")
952 (string-append "ZLIB=" (assoc-ref %build-inputs "zlib") "/lib/libz.so")
953 (string-append "JPEGLIB="
954 (assoc-ref %build-inputs "libjpeg") "/lib/libjpeg.so")
958 (modify-phases %standard-phases
959 (add-before 'configure 'chdir-to-source
960 (lambda _ (chdir ,(string-append "hdfjava-" version)) #t))
961 (add-before 'configure 'patch-build
962 (lambda* (#:key inputs outputs #:allow-other-keys)
963 (substitute* "configure"
964 (("COPT=\"") "COPT=\"-O2 ") ; CFLAGS is ignored in Makefiles
965 (("/bin/cat") (which "cat")))
966 ;; Set classpath for compilation
967 (substitute* '("hdf/hdf5lib/Makefile.in"
968 "hdf/hdf5lib/exceptions/Makefile.in"
969 "hdf/hdflib/Makefile.in")
970 (("\\$\\(TOP\\)/lib/slf4j-api-1\\.7\\.5\\.jar")
971 (string-append (assoc-ref inputs "slf4j-api")
972 "/share/java/slf4j-api.jar")))
973 ;; Replace outdated config.sub and config.guess:
974 (with-directory-excursion "config"
975 (for-each (lambda (file)
977 (string-append (assoc-ref inputs "automake")
979 ,(version-major+minor (package-version automake))
981 '("config.sub" "config.guess")))
983 ;; Fix embedded version number
984 (let ((hdf5version (list ,@(string-split (package-version hdf5) #\.))))
985 (substitute* "hdf/hdf5lib/H5.java"
987 (string-join hdf5version ", "))))
989 (mkdir-p (string-append (assoc-ref outputs "out")))
990 ;; Set classpath for tests
991 (let* ((build-dir (getcwd))
992 (lib (string-append build-dir "/lib"))
993 (jhdf (string-append lib "/jhdf.jar"))
994 (jhdf5 (string-append lib "/jhdf5.jar"))
997 (string-append (assoc-ref inputs i)
998 "/share/java/" i ".jar"))
999 '("junit" "hamcrest-core" "slf4j-api" "slf4j-simple")))
1001 (string-join `("." ,build-dir ,jhdf ,jhdf5 ,@testjars) ":")))
1003 (substitute* '("test/hdf5lib/Makefile.in"
1004 "test/hdf5lib/junit.sh.in"
1005 "examples/runExample.sh.in")
1007 (string-append (assoc-ref inputs "coreutils")
1010 (string-append (assoc-ref inputs "coreutils")
1012 (("CLASSPATH=[^\n]*")
1013 (string-append "CLASSPATH=" class-path)))
1014 (setenv "CLASSPATH" class-path))
1016 (add-before 'check 'build-examples
1018 (apply invoke `("javac"
1019 ,@(find-files "examples" ".*\\.java"))))))
1021 #:parallel-build? #f
1023 #:parallel-tests? #f ))
1024 (home-page "https://support.hdfgroup.org/products/java")
1025 (synopsis "Java interface for the HDF4 and HDF5 libraries")
1026 (description "Java HDF Interface (JHI) and Java HDF5 Interface (JHI5) use
1027 the Java Native Interface to wrap the HDF4 and HDF5 libraries, which are
1030 ;; BSD-style license:
1031 (license (license:x11-style
1032 "https://support.hdfgroup.org/ftp/HDF5/hdf-java\
1033 /current/src/unpacked/COPYING"))))
1035 (define-public hdf-eos2
1042 (uri "ftp://edhs1.gsfc.nasa.gov\
1043 /edhs/hdfeos/latest_release/HDF-EOS2.19v1.00.tar.Z")
1045 (base32 "0c9fcz25s292ldap12wxmlrvnyz99z24p63d8fwx51bf8s0s1zrz"))
1046 (patches (search-patches "hdf-eos2-remove-gctp.patch"
1047 "hdf-eos2-build-shared.patch"
1048 "hdf-eos2-fortrantests.patch"))))
1049 (build-system gnu-build-system)
1051 `(("gfortran" ,gfortran)))
1053 `(("hdf4" ,hdf4-alt) ; assume most HDF-EOS2 users won't use the HDF4 netCDF API
1054 ;; XXX: These inputs are really dependencies of hdf4.
1056 ("libjpeg" ,libjpeg)
1057 ("libtirpc" ,libtirpc)
1061 `( #:configure-flags '("--enable-install-include" "--enable-shared"
1062 "CC=h4cc -Df2cFortran" "LIBS=-lgctp")
1063 #:parallel-tests? #f))
1064 (home-page "http://hdfeos.org/software/library.php#HDF-EOS2")
1065 (synopsis "HDF4-based data format for NASA's Earth Observing System")
1066 (description "HDF-EOS2 is a software library built on HDF4 which supports
1067 the construction of data structures used in NASA's Earth Observing
1068 System (Grid, Point and Swath).")
1070 ;; Source files carry a permissive license header.
1071 (license (license:non-copyleft home-page))))
1073 (define-public hdf-eos5
1079 (uri (string-append "ftp://edhs1.gsfc.nasa.gov\
1080 /edhs/hdfeos5/latest_release/HDF-EOS5." version ".tar.Z"))
1083 "1p83333nzzy8rn5chxlm0hrkjjnhh2w1ji8ac0f9q4xzg838i58i"))
1084 (patches (search-patches "hdf-eos5-build-shared.patch"
1085 "hdf-eos5-remove-gctp.patch"
1086 "hdf-eos5-fix-szip.patch"
1087 "hdf-eos5-fortrantests.patch"))))
1089 `(("gfortran" ,gfortran)))
1090 (build-system gnu-build-system)
1096 `(#:configure-flags '("--enable-install-include" "--enable-shared"
1097 "CC=h5cc -Df2cFortran" "LIBS=-lgctp")
1098 #:parallel-tests? #f))
1099 (synopsis "HDF5-based data format for NASA's Earth Observing System")
1101 "HDF-EOS5 is a software library built on HDF5 to support the construction
1102 of data structures used in NASA's Earth Observing System (Grid, Point and
1104 (home-page "http://www.hdfeos.org/software/library.php#HDF-EOS5")
1106 ;; Source files carry a permissive license header.
1107 (license (license:non-copyleft home-page))))
1109 (define-public hdf5-parallel-openmpi
1110 (package (inherit hdf5)
1111 (name "hdf5-parallel-openmpi")
1114 ,@(package-inputs hdf5)))
1116 (substitute-keyword-arguments (package-arguments hdf5)
1117 ((#:configure-flags flags)
1118 ``("--enable-parallel"
1119 ,@(delete "--enable-cxx"
1120 (delete "--enable-threadsafe" ,flags))))
1122 `(modify-phases ,phases
1123 (add-after 'build 'mpi-setup
1125 (add-before 'check 'patch-tests
1127 ;; OpenMPI's mpirun will exit with non-zero status if it
1128 ;; detects an "abnormal termination", i.e. any process not
1129 ;; calling MPI_Finalize(). Since the test is explicitly
1130 ;; avoiding MPI_Finalize so as not to have at_exit and thus
1131 ;; H5C_flush_cache from being called, mpirun will always
1132 ;; complain, so turn this test off.
1133 (substitute* "testpar/Makefile"
1134 (("(^TEST_PROG_PARA.*)t_pflush1(.*)" front back)
1135 (string-append front back "\n")))
1136 (substitute* "tools/h5diff/testph5diff.sh"
1137 (("/bin/sh") (which "sh")))
1139 (synopsis "Management suite for data with parallel IO support")))
1141 (define-public h5check
1148 (uri (string-append "http://www.hdfgroup.org/ftp/HDF5/tools/"
1149 "h5check/src/h5check-" version ".tar.gz"))
1152 "1gm76jbwhz9adbxgn14zx8cj33dmjdr2g5xcy0m9c2gakp8w59kj"))))
1153 (build-system gnu-build-system)
1154 (inputs `(("hdf5" ,hdf5))) ;h5cc for tests
1155 (home-page "https://www.hdfgroup.org/products/hdf5_tools/h5check.html")
1156 (synopsis "HDF5 format checker")
1157 (description "@code{h5check} is a validation tool for verifying that an
1158 HDF5 file is encoded according to the HDF File Format Specification.")
1159 (license (license:x11-style "file://COPYING"))))
1167 (uri (string-append "mirror://sourceforge/itpp/itpp/"
1172 "14ddy2xnb6sgp4hiax9v5sv4pr4l4dd4ps76nfha3nrpr1ikhcqm"))))
1173 (build-system cmake-build-system)
1174 (arguments `(#:tests? #f)) ; Tests require googletest *sources*
1175 (inputs `(("lapack" ,lapack)
1177 ;; FIXME: Even though the fonts are available dvips complains:
1178 ;; "Font cmmi10 not found; characters will be left blank."
1180 `(("texlive" ,texlive-tiny)
1181 ("ghostscript" ,ghostscript)
1182 ("doxygen" ,doxygen)))
1183 (home-page "http://itpp.sourceforge.net")
1184 (synopsis "C++ library of maths, signal processing and communication classes")
1185 (description "IT++ is a C++ library of mathematical, signal processing and
1186 communication classes and functions. Its main use is in simulation of
1187 communication systems and for performing research in the area of
1188 communications. The kernel of the library consists of generic vector and
1189 matrix classes, and a set of accompanying routines. Such a kernel makes IT++
1190 similar to MATLAB, GNU Octave or SciPy.")
1191 (license license:gpl3+)))
1193 (define-public netcdf
1200 (uri (string-append "ftp://ftp.unidata.ucar.edu/pub/netcdf/"
1201 "netcdf-" version ".tar.gz"))
1204 "1blc7ik5yin7i0ls2kag0a9xjk12m0dzx6v1x88az3ras3scci2d"))
1205 (patches (search-patches "netcdf-date-time.patch"
1206 "netcdf-tst_h_par.patch"))))
1207 (build-system gnu-build-system)
1210 ("doxygen" ,doxygen)
1211 ("graphviz" ,graphviz)))
1213 `(("hdf4" ,hdf4-alt)
1216 ("libjpeg" ,libjpeg)))
1218 `(#:configure-flags '("--enable-doxygen" "--enable-dot" "--enable-hdf4")
1220 #:phases (modify-phases %standard-phases
1221 (add-before 'configure 'fix-source-date
1223 ;; As we ${SOURCE_DATE_EPOCH} evaluates to "1" in the build
1224 ;; environment, `date -u -d ${SOURCE_DATE_EPOCH}` will evaluate
1225 ;; to '1st hour of the current day', and therefore makes the
1226 ;; package not reproducible.
1227 (substitute* "./configure"
1228 (("date -u -d \"\\$\\{SOURCE_DATE_EPOCH\\}\"")
1229 "date --date='@0'"))
1231 (add-after 'configure 'patch-settings
1233 ;; libnetcdf.settings contains the full filename of the compilers
1234 ;; used to build the library. We truncate the hashes of those
1235 ;; filenames to avoid unnecessary references to the corresponding
1237 (substitute* "libnetcdf.settings"
1238 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
1239 (string-append prefix (string-take hash 10) "...")))
1242 #:parallel-tests? #f)) ;various race conditions
1243 (home-page "http://www.unidata.ucar.edu/software/netcdf/")
1244 (synopsis "Library for scientific data")
1245 (description "NetCDF is an interface for scientific data access and a
1246 software library that provides an implementation of the interface. The netCDF
1247 library defines a machine-independent format for representing scientific data.
1248 Together, the interface, library, and format support the creation, access, and
1249 sharing of scientific data.")
1250 (license (license:x11-style "file://COPYRIGHT"))))
1252 (define-public netcdf-parallel-openmpi
1253 (package (inherit netcdf)
1254 (name "netcdf-parallel-openmpi")
1257 ,@(alist-replace "hdf5" (list hdf5-parallel-openmpi)
1258 (package-inputs netcdf))))
1259 ;; TODO: Replace pkg-config references in nc-config with absolute references
1261 (substitute-keyword-arguments (package-arguments netcdf)
1262 ((#:configure-flags flags)
1263 `(cons* "CC=mpicc" "CXX=mpicxx"
1264 "--enable-parallel-tests"
1265 ;; Shared libraries not supported with parallel IO.
1266 "--disable-shared" "--with-pic"
1269 (define-public netcdf-fortran
1271 (name "netcdf-fortran")
1276 "ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-fortran-"
1280 "0xaxdcg1p83zmypwml3swsnr3ccn38inwldyr1l3wa4dbwbrblxj"))))
1281 (build-system gnu-build-system)
1283 `(#:parallel-tests? #f))
1285 `(("netcdf" ,netcdf)))
1287 `(("gfortran" ,gfortran)))
1288 (synopsis "Fortran interface for the netCDF library")
1289 (description (package-description netcdf))
1290 (home-page (package-home-page netcdf))
1291 (license (package-license netcdf))))
1293 (define-public nlopt
1299 (uri (string-append "http://ab-initio.mit.edu/nlopt/nlopt-"
1302 (base32 "12cfkkhcdf4zmb6h7y6qvvdvqjs2xf9sjpa3rl3bq76px4yn76c0"))))
1303 (build-system gnu-build-system)
1305 `(;; Shared libraries are not built by default. They are required to
1306 ;; build the Guile, Octave, and Python bindings.
1307 #:configure-flags '("--enable-shared")
1310 (modify-phases %standard-phases
1311 (add-before 'configure 'set-libnlopt-file-name
1312 (lambda* (#:key outputs #:allow-other-keys)
1313 ;; Make sure the Scheme module refers to the library by its
1314 ;; absolute file name (we cannot do that from a snippet
1315 ;; because the expansion of @libdir@ contains
1317 (let ((out (assoc-ref outputs "out")))
1318 (substitute* "swig/nlopt.scm.in"
1320 (string-append out "/lib/libnlopt")))
1322 (inputs `(("guile" ,guile-2.0)))
1323 (native-inputs `(("pkg-config" ,pkg-config)))
1324 (home-page "http://ab-initio.mit.edu/wiki/")
1325 (synopsis "Library for nonlinear optimization")
1326 (description "NLopt is a library for nonlinear optimization, providing a
1327 common interface for a number of different free optimization routines available
1328 online as well as original implementations of various other algorithms.")
1329 (license license:lgpl2.1+)))
1331 (define-public ipopt
1338 "http://www.coin-or.org/download/source/Ipopt/Ipopt-"
1342 "07yn9rzdswjk8n246qq6ci9ssf2bcplkifcpsfz9j6cdxw9vgbkv"))
1343 (modules '((guix build utils)))
1345 ;; Make sure we don't use the bundled software.
1347 (delete-file-recursively "ThirdParty")
1349 (build-system gnu-build-system)
1351 '(#:phases (modify-phases %standard-phases
1352 (add-after 'install 'add--L-flags-in-ipopt.pc
1353 (lambda* (#:key inputs outputs #:allow-other-keys)
1354 ;; The '.pc' file lists '-llapack -lblas' in "Libs";
1355 ;; move it to "Libs.private" where it belongs, and add a
1356 ;; '-L' flag for LAPACK.
1357 (let ((out (assoc-ref outputs "out"))
1358 (lapack (assoc-ref inputs "lapack")))
1359 (substitute* (string-append out "/lib/pkgconfig/"
1361 (("Libs: (.*)-llapack -lblas(.*)$" _ before after)
1362 (string-append "Libs: " before " " after "\n"
1363 "Libs.private: " before
1364 "-L" lapack "/lib -llapack -lblas "
1368 `(("gfortran" ,gfortran)))
1370 ;; TODO: Maybe add dependency on COIN-MUMPS, ASL, and HSL.
1371 `(("lapack" ,lapack))) ;for both libblas and liblapack
1372 (home-page "http://www.coin-or.org")
1373 (synopsis "Large-scale nonlinear optimizer")
1375 "The Interior Point Optimizer (IPOPT) is a software package for
1376 large-scale nonlinear optimization. It provides C++, C, and Fortran
1378 (license license:epl1.0)))
1386 (uri (string-append "https://www.coin-or.org/download/source/"
1387 "Clp/Clp-" version ".tgz"))
1390 "1wdg820g3iikf9344ijwsc8sy6c0m6im42bzzizm6rlmkvnmxhk9"))
1391 (modules '((guix build utils)))
1393 ;; Make sure we don't use the bundled software.
1395 (delete-file-recursively "ThirdParty")
1397 (build-system gnu-build-system)
1399 `(("gfortran" ,gfortran)
1400 ("pkg-config" ,pkg-config)))
1402 `(("openblas" ,openblas)))
1403 (home-page "https://www.coin-or.org")
1404 (synopsis "Linear programming solver")
1406 "CLP is a high quality linear programming solver. Its main strengths are
1407 its dual and primal Simplex algorithms. It also has a barrier algorithm for
1408 linear and quadratic objectives. There are limited facilities for nonlinear
1409 and quadratic objectives using the Simplex algorithm.")
1410 (license license:epl1.0)))
1412 (define-public ceres
1414 (name "ceres-solver")
1416 (home-page "http://ceres-solver.org/")
1419 (uri (string-append home-page "ceres-solver-"
1423 "13lfxy8x58w8vprr0nkbzziaijlh0vvqshgahvcgw0mrqdgh0i27"))))
1424 (build-system cmake-build-system)
1426 ;; TODO: Build HTML user documentation and install separately.
1427 '(#:configure-flags '("-DBUILD_EXAMPLES=OFF"
1428 "-DBUILD_SHARED_LIBS=ON")
1430 #:phases (modify-phases %standard-phases
1431 (add-before 'configure 'set-library-directory
1433 ;; Install libraries to lib/, not lib64/.
1434 (substitute* "internal/ceres/CMakeLists.txt"
1435 (("set\\(LIB_SUFFIX \"64\"\\)")
1436 "set(LIB_SUFFIX \"\")"))
1439 `(("pkg-config" ,pkg-config)))
1441 `(("glog" ,glog))) ;for #include <glog/glog.h>
1446 ("suitesparse" ,suitesparse)
1447 ("gflags" ,gflags)))
1448 (synopsis "C++ library for solving large optimization problems")
1450 "Ceres Solver is a C++ library for modeling and solving large,
1451 complicated optimization problems. It is a feature rich, mature and
1452 performant library which has been used in production since 2010. Ceres Solver
1453 can solve two kinds of problems:
1455 @item non-linear least squares problems with bounds constraints;
1456 @item general unconstrained optimization problems.
1458 (license license:bsd-3)))
1460 ;; For a fully featured Octave, users are strongly recommended also to install
1461 ;; the following packages: less, ghostscript, gnuplot.
1462 (define-public octave-cli
1469 (uri (string-append "mirror://gnu/octave/octave-"
1473 "11wwxpy2q1bhxs2v41bqn05i2sb0905cj1xil6mg8l4k2kka4cq6"))))
1474 (build-system gnu-build-system)
1476 `(("alsa-lib" ,alsa-lib)
1477 ("arpack" ,arpack-ng)
1482 ("fontconfig" ,fontconfig)
1483 ("freetype" ,freetype)
1487 ("graphicsmagick" ,graphicsmagick)
1490 ("libsndfile" ,libsndfile)
1494 ("portaudio" ,portaudio)
1496 ("readline" ,readline)
1497 ("suitesparse" ,suitesparse)
1498 ("texinfo" ,texinfo)
1502 ("gfortran" ,gfortran)
1503 ("pkg-config" ,pkg-config)
1505 ;; The following inputs are not actually used in the build process.
1506 ;; However, the ./configure gratuitously tests for their existence and
1507 ;; assumes that programs not present at build time are also not, and
1508 ;; can never be, available at run time! If these inputs are therefore
1509 ;; not present, support for them will be built out. However, Octave
1510 ;; will still run without them, albeit without the features they
1513 ("ghostscript" ,ghostscript)
1514 ("gnuplot" ,gnuplot)))
1515 ;; Octave code uses this variable to detect directories holding multiple CA
1516 ;; certificates to verify peers with. This is required for the networking
1517 ;; functions that require encryption to work properly.
1518 (native-search-paths
1519 (list (search-path-specification
1520 (variable "CURLOPT_CAPATH")
1521 (files '("etc/ssl/certs")))))
1524 (list (string-append "--with-shell="
1525 (assoc-ref %build-inputs "bash")
1528 (modify-phases %standard-phases
1529 (add-after 'configure 'configure-makeinfo
1530 (lambda* (#:key inputs #:allow-other-keys)
1531 (substitute* "libinterp/corefcn/help.h"
1534 "\"" (assoc-ref inputs "texinfo") "/bin/makeinfo\"")))
1536 (home-page "https://www.gnu.org/software/octave/")
1537 (synopsis "High-level language for numerical computation")
1538 (description "GNU Octave is a high-level interpreted language that is
1539 specialized for numerical computations. It can be used for both linear and
1540 non-linear applications and it provides great support for visualizing results.
1541 Work may be performed both at the interactive command-line as well as via
1543 (license license:gpl3+)))
1545 (define-public octave
1546 (package (inherit octave-cli)
1549 (inherit (package-source octave-cli))))
1551 `(("qscintilla" ,qscintilla)
1553 ,@(package-inputs octave-cli)))
1555 `(("qttools" , qttools) ;for lrelease
1556 ("texlive" ,(texlive-union (list texlive-epsf))) ; for texi2dvi
1557 ,@(package-native-inputs octave-cli)))
1559 (substitute-keyword-arguments (package-arguments octave-cli)
1561 `(modify-phases ,phases
1562 (add-before 'configure 'patch-qscintilla-library-name
1563 (lambda* (#:key inputs #:allow-other-keys)
1564 ;; The QScintilla library that the Octave configure script tries
1565 ;; to link with should be named libqscintilla-qt5.so, but the
1566 ;; QScintilla input provides the shared library as
1567 ;; libqscintilla2_qt5.so.
1568 (substitute* "configure"
1569 (("qscintilla2-qt5")
1573 (define-public qtoctave
1574 (deprecated-package "qtoctave" octave))
1576 (define-public opencascade-oce
1578 (name "opencascade-oce")
1584 (url "https://github.com/tpaviot/oce.git")
1585 (commit (string-append "OCE-" version))))
1586 (file-name (git-file-name name version))
1587 (patches (search-patches "opencascade-oce-glibc-2.26.patch"))
1589 (base32 "0rg5wzkvfmzfl6v2amyryb8dnjad0nn9kyr607wy2gch6rciah69"))))
1590 (build-system cmake-build-system)
1593 (list "-DOCE_TESTING:BOOL=ON"
1594 "-DOCE_USE_TCL_TEST_FRAMEWORK:BOOL=ON"
1595 "-DOCE_DRAW:BOOL=ON"
1596 (string-append "-DOCE_INSTALL_PREFIX:PATH="
1597 (assoc-ref %outputs "out"))
1598 "-UCMAKE_INSTALL_RPATH")))
1600 `(("freetype" ,freetype)
1607 `(("python" ,python-wrapper)))
1608 (home-page "https://github.com/tpaviot/oce")
1609 (synopsis "Libraries for 3D modeling and numerical simulation")
1611 "Open CASCADE is a set of libraries for the development of applications
1612 dealing with 3D CAD data or requiring industrial 3D capabilities. It includes
1613 C++ class libraries providing services for 3D surface and solid modeling, CAD
1614 data exchange, and visualization. It is used for development of specialized
1615 software dealing with 3D models in design (CAD), manufacturing (CAM),
1616 numerical simulation (CAE), measurement equipment (CMM), and quality
1617 control (CAQ) domains.
1619 This is the ``Community Edition'' (OCE) of Open CASCADE, which gathers
1620 patches, improvements, and experiments contributed by users over the official
1621 Open CASCADE library.")
1622 (license (list license:lgpl2.1; OCE libraries, with an exception for the
1623 ; use of header files; see
1624 ; OCCT_LGPL_EXCEPTION.txt
1625 license:public-domain; files
1626 ; src/Standard/Standard_StdAllocator.hxx and
1627 ; src/NCollection/NCollection_StdAllocator.hxx
1628 license:expat; file src/OpenGl/OpenGl_glext.h
1629 license:bsd-3)))); test framework gtest
1631 (define-public opencascade-occt
1633 (name "opencascade-occt")
1639 (url "https://git.dev.opencascade.org/repos/occt.git")
1642 (string-map (lambda (x) (if (eq? x #\.) #\_ x))
1644 (file-name (git-file-name name version))
1646 (base32 "0bdywwxb6mk0ykbiajlvsb37295akqjp0a60y672qjfa67k0ljv4"))
1647 (modules '((guix build utils)))
1650 ;; Remove files specific to non-free operating systems.
1651 (delete-file-recursively "samples/ios")
1652 (delete-file-recursively "samples/mfc")
1653 (delete-file-recursively "samples/qt/FuncDemo")
1654 (delete-file "genconf.bat")
1655 (delete-file "gendoc.bat")
1656 (delete-file "genproj.bat")
1657 (delete-file "upgrade.bat")
1658 ;; Remove references to deleted files.
1659 (substitute* "dox/FILES_HTML.txt"
1660 ((".*standard.*") "" )
1661 ((".*UIKitSample.*") ""))
1663 (build-system cmake-build-system)
1665 '(;; There is no test target for make. OCCT provides an
1666 ;; 'Automated Testing System', which may be accessed after
1667 ;; installation via the draw.sh script. draw.sh is located in
1668 ;; the bin directory. For details see:
1669 ;; https://www.opencascade.com/doc/occt-7.3.0/overview/html/\
1670 ;; occt_dev_guides__tests.html
1672 ;; Configure without freeimage: attempting to link against the
1673 ;; freeimage version 3.17 library leads to 'undefined
1674 ;; reference' errors.
1676 (list "-DUSE_FREEIMAGE:BOOL=OFF"
1678 "-DUSE_VTK:BOOL=OFF"
1679 "-DBUILD_DOC_Overview:BOOL=OFF"
1680 "-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON"
1681 "-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON"
1682 "-UCMAKE_INSTALL_LIBDIR")))
1684 `(("doxygen" ,doxygen)
1685 ;("freeimage" ,freeimage)
1686 ("freetype" ,freetype)
1688 ("libxext" ,libxext)
1695 ;; TODO: build Overview documentation and add 'doc' output.
1696 (home-page "https://www.opencascade.com")
1697 (synopsis "Libraries for 3D modeling and numerical simulation")
1699 "Open CASCADE is a set of libraries for the development of applications
1700 dealing with 3D CAD data or requiring industrial 3D capabilities. It includes
1701 C++ class libraries providing services for 3D surface and solid modeling, CAD
1702 data exchange, and visualization. It is used for development of specialized
1703 software dealing with 3D models in design (CAD), manufacturing (CAM),
1704 numerical simulation (CAE), measurement equipment (CMM), and quality
1705 control (CAQ) domains.
1707 This is the certified version of the Open Cascade Technology (OCCT) library.")
1708 (license (list ;; OCCT library:
1709 license:lgpl2.1; with an exception for the use of header
1710 ; files, see OCCT_LGPL_EXCEPTION.txt.
1711 ;; Files src/OpenGl/glext.h, adm/cmake/cotire.cmake and
1712 ;; src/OpenGl/OpenGl_HaltonSampler.hxx:
1714 ;; Files src/ExprIntrp/ExprIntrp.tab.* and
1715 ;; src/StepFile/step.tab.*:
1716 license:gpl3+ ; with Bison 2.2 exception.
1717 ;; File src/NCollection/NCollection_UtfIterator.lxx:
1718 (license:non-copyleft
1719 "https://www.unicode.org/license.html")
1720 ;; File src/NCollection/NCollection_StdAllocator.hxx:
1721 license:public-domain))))
1731 (url "https://gitlab.onelab.info/gmsh/gmsh.git")
1733 (string-append "gmsh_"
1734 (string-map (lambda (x) (if (eq? x #\.) #\_ x))
1736 (file-name (git-file-name name version))
1738 (base32 "08rq4jajwmlpivnm9yifz2jhaivnz065lnk0h2zv773nwl9wf162"))
1739 (modules '((guix build utils)))
1741 ;; Remove non-free METIS code
1743 (delete-file-recursively "contrib/Metis")
1745 (build-system cmake-build-system)
1748 ("gfortran" ,gfortran)
1754 ("opencascade-oce" ,opencascade-oce)
1756 ("libxext" ,libxext)))
1758 `(("fontconfig" ,fontconfig)
1759 ("libxft" ,libxft)))
1761 `(#:configure-flags `("-DENABLE_METIS:BOOL=OFF"
1762 "-DENABLE_BUILD_SHARED:BOOL=ON"
1763 "-DENABLE_BUILD_DYNAMIC:BOOL=ON")))
1764 (home-page "http://gmsh.info/")
1765 (synopsis "3D finite element grid generator")
1766 (description "Gmsh is a 3D finite element grid generator with a built-in
1767 CAD engine and post-processor. Its design goal is to provide a fast, light
1768 and user-friendly meshing tool with parametric input and advanced
1769 visualization capabilities. Gmsh is built around four modules: geometry,
1770 mesh, solver and post-processing. The specification of any input to these
1771 modules is done either interactively using the graphical user interface or in
1772 ASCII text files using Gmsh's own scripting language.")
1773 (license license:gpl2+)))
1775 (define-public maxflow
1778 ;; Versioning is ambiguous: the git tag matching this commit is ‘3.0.5’,
1779 ;; which matches CMakeLists.txt, but README.md and CHANGES say ‘3.04’.
1784 (url "https://github.com/gerddie/maxflow.git")
1786 (file-name (git-file-name name version))
1789 "0rll38whw55h0vcjrrwdnh9ascvxby0ph7n1l0d12z17cg215kkb"))))
1790 (build-system cmake-build-system)
1791 (home-page "https://pub.ist.ac.at/~vnk/software.html")
1792 (synopsis "Library implementing Maxflow algorithm")
1793 (description "An implementation of the maxflow algorithm described in
1794 @cite{An Experimental Comparison of Min-Cut/Max-Flow Algorithms for
1795 Energy Minimization in Computer Vision.\n
1796 Yuri Boykov and Vladimir Kolmogorov.\n
1797 In IEEE Transactions on Pattern Analysis and Machine Intelligence,\n
1799 (license license:gpl3+)))
1801 (define-public petsc
1808 ;; The *-lite-* tarball does not contain the *large* documentation
1809 (uri (string-append "http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/"
1810 "petsc-lite-" version ".tar.gz"))
1812 (base32 "1645nwwcp9bcnfnxikk480mhbbacdvhsay2c401818hk97dqj5nx"))))
1813 (outputs '("out" ; libraries and headers
1814 "examples")) ; ~30MiB of examples
1815 (build-system gnu-build-system)
1817 `(("python" ,python-2)))
1819 `(("gfortran" ,gfortran)
1821 ("superlu" ,superlu)
1822 ;; leaving out hdf5 and fftw, as petsc expects them to be built with mpi
1823 ;; leaving out opengl, as configuration seems to only be for mac
1826 `(#:test-target "test"
1827 #:parallel-build? #f ; build is parallel by default
1833 ;; Honor (parallel-job-count) for build. Do not use --with-make-np,
1834 ;; whose value is dumped to $out/lib/petsc/conf/petscvariables.
1835 (list (format #f "MAKE_NP=~a" (parallel-job-count)))
1837 (modify-phases %standard-phases
1839 ;; PETSc's configure script is actually a python script, so we can't
1840 ;; run it with bash.
1841 (lambda* (#:key outputs (configure-flags '())
1843 (let* ((prefix (assoc-ref outputs "out"))
1844 (flags `(,(string-append "--prefix=" prefix)
1845 ,@configure-flags)))
1846 (format #t "build directory: ~s~%" (getcwd))
1847 (format #t "configure flags: ~s~%" flags)
1848 (apply invoke "./configure" flags))))
1849 (add-after 'configure 'clean-local-references
1850 (lambda* (#:key outputs #:allow-other-keys)
1851 (let ((out (assoc-ref outputs "out")))
1852 (substitute* (find-files "." "^petsc(conf|machineinfo).h$")
1853 ;; Prevent build directory from leaking into compiled code
1855 ;; Scrub timestamp for reproducibility
1856 ((".*Libraries compiled on.*") ""))
1857 (substitute* (find-files "." "petscvariables")
1858 ;; Do not expose build machine characteristics, set to defaults.
1859 (("MAKE_NP = [:digit:]+") "MAKE_NP = 2")
1860 (("NPMAX = [:digit:]+") "NPMAX = 2"))
1862 (add-after 'install 'clean-install
1863 ;; Try to keep installed files from leaking build directory names.
1864 (lambda* (#:key inputs outputs #:allow-other-keys)
1865 (let ((out (assoc-ref outputs "out")))
1866 (substitute* (map (lambda (file)
1867 (string-append out "/lib/petsc/conf/" file))
1868 '("petscvariables"))
1870 ;; Make compiler references point to the store
1871 (substitute* (string-append out "/lib/petsc/conf/petscvariables")
1872 (("= (gcc|g\\+\\+|gfortran)" _ compiler)
1873 (string-append "= " (which compiler))))
1874 ;; PETSc installs some build logs, which aren't necessary.
1875 (for-each (lambda (file)
1876 (let ((f (string-append out "/lib/petsc/conf/" file)))
1877 (when (file-exists? f)
1879 '("configure.log" "make.log" "gmake.log"
1880 "test.log" "error.log" "RDict.db"
1881 "PETScBuildInternal.cmake"
1882 ;; Once installed, should uninstall with Guix
1885 (add-after 'install 'move-examples
1886 (lambda* (#:key outputs #:allow-other-keys)
1887 (let* ((out (assoc-ref outputs "out"))
1888 (examples (assoc-ref outputs "examples"))
1889 (exdir (string-append out "/share/petsc/examples"))
1890 (exdir' (string-append examples "/share/petsc/examples")))
1891 (copy-recursively exdir exdir')
1892 (delete-file-recursively exdir)
1894 (home-page "http://www.mcs.anl.gov/petsc")
1895 (synopsis "Library to solve PDEs")
1896 (description "PETSc, pronounced PET-see (the S is silent), is a suite of
1897 data structures and routines for the scalable (parallel) solution of
1898 scientific applications modeled by partial differential equations.")
1899 (license (license:non-copyleft
1900 "http://www.mcs.anl.gov/petsc/documentation/copyright.html"))))
1902 (define-public petsc-complex
1903 (package (inherit petsc)
1904 (name "petsc-complex")
1906 (substitute-keyword-arguments (package-arguments petsc)
1907 ((#:configure-flags cf)
1908 `(cons "--with-scalar-type=complex" ,cf))))
1909 (synopsis "Library to solve PDEs (with complex scalars)")))
1911 (define-public petsc-openmpi
1912 (package (inherit petsc)
1913 (name "petsc-openmpi")
1915 `(("hdf5" ,hdf5-parallel-openmpi)
1916 ("hypre" ,hypre-openmpi)
1918 ("mumps" ,mumps-openmpi)
1919 ("openmpi" ,openmpi)
1920 ("scalapack" ,scalapack)
1921 ("scotch" ,pt-scotch32)
1922 ,@(package-inputs petsc)))
1924 (substitute-keyword-arguments (package-arguments petsc)
1925 ((#:configure-flags cf)
1927 "--with-mpiexec=mpirun"
1930 "--with-scalapack=1"
1932 ,(string-append "--with-mpi-dir="
1933 (assoc-ref %build-inputs "openmpi"))
1934 ,(string-append "--with-hdf5-include="
1935 (assoc-ref %build-inputs "hdf5") "/include")
1936 ,(string-append "--with-hdf5-lib="
1937 (assoc-ref %build-inputs "hdf5") "/lib/libhdf5.a")
1938 ,@(delete "--with-mpi=0" ,cf)))
1940 `(modify-phases ,phases
1941 (add-before 'configure 'mpi-setup
1942 ,%openmpi-setup)))))
1943 (synopsis "Library to solve PDEs (with MUMPS and MPI support)")))
1945 (define-public petsc-complex-openmpi
1946 (package (inherit petsc-complex)
1947 (name "petsc-complex-openmpi")
1949 `(("openmpi" ,openmpi)
1950 ,@(package-inputs petsc-complex)))
1952 (substitute-keyword-arguments (package-arguments petsc-complex)
1953 ((#:configure-flags cf)
1954 ``("--with-mpiexec=mpirun"
1955 ,(string-append "--with-mpi-dir="
1956 (assoc-ref %build-inputs "openmpi"))
1957 ,@(delete "--with-mpi=0" ,cf)))
1959 `(modify-phases ,phases
1960 (add-before 'configure 'mpi-setup
1961 ,%openmpi-setup)))))
1962 (synopsis "Library to solve PDEs (with complex scalars and MPI support)")))
1964 (define-public python-petsc4py
1966 (name "python-petsc4py")
1971 (uri (pypi-uri "petsc4py" version))
1974 "094hcnran0r2z1wlvmjswsz3ski1m9kqrl5l0ax8jjhnk55x0flh"))))
1975 (build-system python-build-system)
1978 (modify-phases %standard-phases
1979 (add-before 'build 'pre-build
1981 ;; Define path to PETSc installation.
1982 (setenv "PETSC_DIR" (assoc-ref %build-inputs "petsc"))
1984 (add-before 'check 'mpi-setup
1987 `(("petsc" ,petsc-openmpi)
1988 ("python-numpy" ,python-numpy)))
1989 (home-page "https://bitbucket.org/petsc/petsc4py/")
1990 (synopsis "Python bindings for PETSc")
1991 (description "PETSc, the Portable, Extensible Toolkit for
1992 Scientific Computation, is a suite of data structures and routines for
1993 the scalable (parallel) solution of scientific applications modeled by
1994 partial differential equations. It employs the MPI standard for all
1995 message-passing communication. @code{petsc4py} provides Python
1996 bindings to almost all functions of PETSc.")
1997 (license license:bsd-3)))
1999 (define-public python-kiwisolver
2001 (name "python-kiwisolver")
2005 (uri (pypi-uri "kiwisolver" version))
2008 "0y22ci86znwwwfhbmvbgdfnbi6lv5gv2xkdlxvjw7lml43ayafyf"))))
2009 (build-system python-build-system)
2010 (home-page "https://github.com/nucleic/kiwi")
2011 (synopsis "Fast implementation of the Cassowary constraint solver")
2013 "Kiwi is an efficient C++ implementation of the Cassowary constraint
2014 solving algorithm. Kiwi has been designed from the ground up to be
2015 lightweight and fast. Kiwi ranges from 10x to 500x faster than the original
2016 Cassowary solver with typical use cases gaining a 40x improvement. Memory
2017 savings are consistently > 5x.")
2018 (license license:bsd-3)))
2020 (define-public python2-kiwisolver
2021 (package-with-python2 python-kiwisolver))
2023 (define-public slepc
2030 (uri (string-append "http://slepc.upv.es/download/distrib/slepc-"
2034 "1yq84q9wannc8xwapxpay4ypdd675picwi395hhsdvng9q6hf5j8"))))
2035 (build-system gnu-build-system)
2037 `(("python" ,python-2)
2038 ("petsc:examples" ,petsc "examples"))) ;for gmakegen.py script
2040 `(("arpack" ,arpack-ng)
2041 ("gfortran" ,gfortran)))
2043 `(("petsc" ,petsc)))
2045 `(#:parallel-build? #f ;build is parallel by default
2047 `(,(string-append "--with-arpack-dir="
2048 (assoc-ref %build-inputs "arpack") "/lib"))
2049 #:make-flags ;honor (parallel-job-count)
2050 `(,(format #f "MAKE_NP=~a" (parallel-job-count))
2051 ,(string-append "PETSCCONFIGDIR="
2052 (assoc-ref %build-inputs "petsc:examples")
2053 "/share/petsc/examples/config"))
2055 (modify-phases %standard-phases
2057 ;; configure is a python script, so we can't run it with bash.
2058 (lambda* (#:key inputs outputs (configure-flags '())
2060 (let* ((prefix (assoc-ref outputs "out"))
2061 (flags `(,(string-append "--prefix=" prefix)
2062 ,@configure-flags)))
2063 (format #t "build directory: ~s~%" (getcwd))
2064 (format #t "configure flags: ~s~%" flags)
2065 (setenv "SLEPC_DIR" (getcwd))
2066 (setenv "PETSC_DIR" (assoc-ref inputs "petsc"))
2067 (apply invoke "./configure" flags))))
2068 (add-after 'install 'delete-doc
2069 ;; TODO: SLEPc installs HTML documentation alongside headers in
2070 ;; $out/include. We'd like to move them to share/doc, but delete
2071 ;; them for now, as they are incomplete and installing the complete
2072 ;; documentation is difficult.
2073 (lambda* (#:key outputs #:allow-other-keys)
2074 (let* ((out (assoc-ref outputs "out")))
2075 (for-each delete-file (find-files out "\\.html$"))
2077 (add-after 'install 'clean-install
2078 ;; Clean up unnecessary build logs from installation.
2079 (lambda* (#:key outputs #:allow-other-keys)
2080 (let ((out (assoc-ref outputs "out")))
2081 (for-each (lambda (file)
2082 (let ((f (string-append out "/lib/slepc/conf/" file)))
2083 (when (file-exists? f)
2085 '("configure.log" "make.log" "gmake.log"
2086 "test.log" "error.log" "RDict.db"
2089 (home-page "http://slepc.upv.es")
2090 (synopsis "Scalable library for eigenproblems")
2091 (description "SLEPc is a software library for the solution of large sparse
2092 eigenproblems on parallel computers. It can be used for the solution of
2093 linear eigenvalue problems formulated in either standard or generalized form,
2094 as well as other related problems such as the singular value decomposition.
2095 The emphasis of the software is on methods and techniques appropriate for
2096 problems in which the associated matrices are sparse, for example, those
2097 arising after the discretization of partial differential equations.")
2098 (license license:bsd-2)))
2100 (define-public slepc-complex
2101 (package (inherit slepc)
2102 (name "slepc-complex")
2104 `(("petsc" ,petsc-complex)
2105 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
2106 (synopsis "Scalable library for eigenproblems (with complex scalars)")))
2108 (define-public slepc-openmpi
2109 (package (inherit slepc)
2110 (name "slepc-openmpi")
2112 (substitute-keyword-arguments (package-arguments slepc)
2113 ((#:phases phases '%standard-phases)
2114 `(modify-phases ,phases
2115 (add-before 'check 'mpi-setup
2116 ,%openmpi-setup)))))
2119 ("arpack" ,arpack-ng-openmpi)
2120 ,@(alist-delete "arpack" (package-inputs slepc))))
2122 `(("petsc" ,petsc-openmpi)
2123 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
2124 (synopsis "Scalable library for eigenproblems (with MPI support)")))
2126 (define-public slepc-complex-openmpi
2127 (package (inherit slepc-openmpi)
2128 (name "slepc-complex-openmpi")
2130 `(("petsc" ,petsc-complex-openmpi)
2131 ,@(alist-delete "petsc" (package-propagated-inputs slepc-openmpi))))
2132 (synopsis "Scalable library for eigenproblems (with complex scalars and MPI support)")))
2134 (define-public python-slepc4py
2136 (name "python-slepc4py")
2141 (uri (pypi-uri "slepc4py" version))
2144 "0x049dyc8frgh79fvvavf4vlbqp4mgm61nsaivzdav4316vvlv1j"))))
2145 (build-system python-build-system)
2148 (modify-phases %standard-phases
2149 (add-before 'build 'pre-build
2151 ;; Define path to PETSc installation.
2152 (setenv "PETSC_DIR" (assoc-ref %build-inputs "petsc"))
2153 ;; Define path to SLEPc installation.
2154 (setenv "SLEPC_DIR" (assoc-ref %build-inputs "slepc"))
2156 (add-before 'check 'mpi-setup
2159 `(("python-numpy" ,python-numpy)
2160 ("python-petsc4py" ,python-petsc4py)
2161 ("slepc" ,slepc-openmpi)))
2162 (home-page "https://bitbucket.org/slepc/slepc4py/")
2163 (synopsis "Python bindings for SLEPc")
2164 (description "SLEPc, the Scalable Library for Eigenvalue Problem
2165 Computations, is based on PETSc, the Portable, Extensible Toolkit for
2166 Scientific Computation. It employs the MPI standard for all
2167 message-passing communication. @code{slepc4py} provides Python
2168 bindings to almost all functions of SLEPc.")
2169 (license license:bsd-3)))
2171 (define-public mumps
2178 (uri (string-append "http://mumps.enseeiht.fr/MUMPS_"
2182 "1s9asin08zqzmh08257sdghhivvy9vjif7c53fhaxaax2kd5qd7b"))
2183 (patches (search-patches "mumps-build-parallelism.patch"))))
2184 (build-system gnu-build-system)
2186 `(("fortran" ,gfortran)
2187 ;; These are required for linking against mumps, but we let the user
2188 ;; declare the dependency.
2191 ("scotch" ,scotch)))
2193 `(#:modules ((ice-9 match)
2196 ,@%gnu-build-system-modules)
2198 (modify-phases %standard-phases
2200 (lambda* (#:key inputs #:allow-other-keys)
2201 (call-with-output-file "Makefile.inc"
2212 INCSEQ = -I$(topdir)/libseq
2213 LIBSEQ = -L$(topdir)/libseq -lmpiseq
2214 LIBSEQNEEDED = libseqneeded~;
2218 AR = ar vr # rules require trailing space, ugh...
2220 LIBBLAS = -L~a -lopenblas~@[
2221 SCALAP = -L~a -lscalapack~]
2222 LIBOTHERS = -pthread
2225 OPTF = -O2 -DALLOW_NON_INIT $(PIC)
2229 LIBS = $(SCALAP) $(LIBSEQ)
2230 LPORDDIR = $(topdir)/PORD/lib
2231 IPORD = -I$(topdir)/PORD/include
2232 LPORD = -L$(LPORDDIR) -lpord
2233 ORDERINGSF = -Dpord~@[
2235 IMETIS = -I$(METISDIR)/include
2236 LMETIS = -L$(METISDIR)/lib -lmetis
2237 ORDERINGSF += -Dmetis~]~@[~:{
2239 ISCOTCH = -I$(SCOTCHDIR)/include
2240 LSCOTCH = -L$(SCOTCHDIR)/lib ~a-lesmumps -lscotch -lscotcherr
2241 ORDERINGSF += ~a~}~]
2242 ORDERINGSC = $(ORDERINGSF)
2243 LORDERINGS = $(LPORD) $(LMETIS) $(LSCOTCH)
2244 IORDERINGSF = $(ISCOTCH)
2245 IORDERINGSC = $(IPORD) $(IMETIS) $(ISCOTCH)"
2246 (assoc-ref inputs "mpi")
2247 (assoc-ref inputs "blas")
2248 (assoc-ref inputs "scalapack")
2249 (assoc-ref inputs "metis")
2250 (match (list (assoc-ref inputs "pt-scotch")
2251 (assoc-ref inputs "scotch"))
2255 `((,scotch "" "-Dscotch")))
2258 "-lptesmumps -lptscotch -lptscotcherr "
2259 "-Dptscotch")))))))))
2261 ;; By default only the d-precision library is built. Make with "all"
2262 ;; target so that all precision libraries and examples are built.
2264 (invoke "make" "all"
2265 (format #f "-j~a" (parallel-job-count)))))
2267 ;; Run the simple test drivers, which read test input from stdin:
2268 ;; from the "real" input for the single- and double-precision
2269 ;; testers, and from the "cmplx" input for complex-precision
2270 ;; testers. The EXEC-PREFIX key is used by the mumps-openmpi
2271 ;; package to prefix execution with "mpirun".
2272 (lambda* (#:key (exec-prefix '()) #:allow-other-keys)
2273 (with-directory-excursion "examples"
2276 (let ((tester (apply open-pipe*
2279 ,(string-append "./" prec
2281 (input (open-input-file
2282 (string-append "input_simpletest_" type))))
2284 (dump-port input tester)
2286 (zero? (close-pipe tester)))))
2288 '("real" "real" "cmplx" "cmplx")))))
2290 (lambda* (#:key outputs #:allow-other-keys)
2291 (let* ((out (assoc-ref outputs "out"))
2292 (libdir (string-append out "/lib")))
2293 (copy-recursively "lib" libdir)
2294 (copy-recursively "include" (string-append out "/include"))
2295 (when (file-exists? "libseq/libmpiseq.a")
2296 (install-file "libseq/libmpiseq.a" libdir))
2298 (home-page "http://mumps.enseeiht.fr")
2299 (synopsis "Multifrontal sparse direct solver")
2301 "MUMPS (MUltifrontal Massively Parallel sparse direct Solver) solves a
2302 sparse system of linear equations A x = b using Gaussian elimination.")
2303 (license license:cecill-c)))
2305 (define-public mumps-metis
2306 (package (inherit mumps)
2307 (name "mumps-metis")
2309 (alist-delete "scotch" (package-inputs mumps)))))
2311 (define-public mumps-openmpi
2312 (package (inherit mumps)
2313 (name "mumps-openmpi")
2316 ("scalapack" ,scalapack)
2317 ("pt-scotch" ,pt-scotch)
2318 ,@(alist-delete "scotch" (package-inputs mumps))))
2320 (substitute-keyword-arguments (package-arguments mumps)
2322 `(modify-phases ,phases
2323 (add-before 'check 'mpi-setup
2327 ((assoc-ref ,phases 'check)
2328 #:exec-prefix '("mpirun" "-n" "2"))))))))
2329 (synopsis "Multifrontal sparse direct solver (with MPI)")))
2331 (define-public mumps-metis-openmpi
2332 (package (inherit mumps-openmpi)
2333 (name "mumps-metis-openmpi")
2335 (alist-delete "pt-scotch" (package-inputs mumps-openmpi)))))
2337 (define-public r-quadprog
2344 (uri (cran-uri "quadprog" version))
2347 "0vg7i9p241bwvfdspjbydjrsvgipl6nsb8bjigp0hbbgvxbixx0s"))))
2348 (build-system r-build-system)
2350 `(("gfortran" ,gfortran)))
2351 (home-page "https://cran.r-project.org/web/packages/quadprog")
2352 (synopsis "Functions to solve quadratic programming problems")
2354 "This package contains routines and documentation for solving quadratic
2355 programming problems.")
2356 (license license:gpl3+)))
2358 (define-public r-pracma
2364 (uri (cran-uri "pracma" version))
2366 (base32 "0isd3s0i4mzmva8lkh0j76hwjy1w50q7d1n9lhxsnnkgalx3xs1g"))))
2367 (build-system r-build-system)
2368 (home-page "https://cran.r-project.org/web/packages/pracma/")
2369 (synopsis "Practical numerical math functions")
2370 (description "This package provides functions for numerical analysis and
2371 linear algebra, numerical optimization, differential equations, plus some
2372 special functions. It uses Matlab function names where appropriate to simplify
2374 (license license:gpl3+)))
2376 (define-public ruby-asciimath
2378 (name "ruby-asciimath")
2383 (uri (rubygems-uri "asciimath" version))
2386 "1d80kiph5mc78zps7si1hv48kv4k12mzaq8jk5kb3pqpjdr72qmc"))))
2387 (build-system ruby-build-system)
2390 (modify-phases %standard-phases
2392 ;; https://github.com/asciidoctor/asciimath/commit/1c06fdc8086077f4785479f78b0823a4a72d7948
2393 (add-after 'unpack 'patch-remove-spurious-backslashes
2395 (substitute* "spec/parser_spec.rb"
2400 `(("bundler" ,bundler)
2401 ("ruby-rspec" ,ruby-rspec)))
2402 (synopsis "AsciiMath parsing and conversion library")
2404 "A pure Ruby AsciiMath parsing and conversion library. AsciiMath is an
2405 easy-to-write markup language for mathematics.")
2406 (home-page "https://github.com/asciidoctor/asciimath")
2407 (license license:expat)))
2409 (define-public superlu
2416 (uri (string-append "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/"
2417 "superlu_" version ".tar.gz"))
2419 (base32 "0qzlb7cd608q62kyppd0a8c65l03vrwqql6gsm465rky23b6dyr8"))
2420 (modules '((guix build utils)))
2422 ;; Replace the non-free implementation of MC64 with a stub adapted
2425 (use-modules (ice-9 regex)
2427 (call-with-output-file "SRC/mc64ad.c"
2432 void mc64id_(int *a) {
2433 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
2436 void mc64ad_ (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
2437 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
2438 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
2441 ;; Remove the corresponding license verbiage. MC64 license follows
2442 ;; a "------" line separator.
2443 (with-atomic-file-replacement "License.txt"
2444 (let ((rx (make-regexp "-{8}")))
2447 (let ((line (read-line in 'concat)))
2448 (unless (regexp-exec rx line)
2452 (build-system cmake-build-system)
2456 `(("blas" ,openblas)
2457 ("gfortran" ,gfortran)))
2459 `(#:configure-flags '("-Denable_blaslib:BOOL=NO" ;do not use internal cblas
2460 "-DTPL_BLAS_LIBRARIES=openblas"
2461 "-DBUILD_SHARED_LIBS:BOOL=YES")))
2462 (home-page "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/")
2463 (synopsis "Supernodal direct solver for sparse linear systems")
2465 "SuperLU is a general purpose library for the direct solution of large,
2466 sparse, nonsymmetric systems of linear equations on high performance machines.
2467 The library is written in C and is callable from either C or Fortran. The
2468 library routines perform an LU decomposition with partial pivoting and
2469 triangular system solves through forward and back substitution. The library
2470 also provides threshold-based ILU factorization preconditioners.")
2471 (license (list license:bsd-3
2472 license:gpl2+ ;EXAMPLE/*fgmr.c
2473 (license:fsf-free "file://SRC/colamd.h")))))
2475 (define-public superlu-dist
2477 (name "superlu-dist")
2482 (uri (string-append "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/"
2483 "superlu_dist_" version ".tar.gz"))
2485 (base32 "0pqgcgh1yxhfzs99fas3mggajzd5wca3nbyp878rziy74gfk03dl"))
2486 (modules '((guix build utils)))
2488 ;; Replace the non-free implementation of MC64 with a stub
2490 (call-with-output-file "SRC/mc64ad_dist.c"
2495 void mc64id_dist(int *a) {
2496 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
2499 void mc64ad_dist (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
2500 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
2501 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
2504 (substitute* "SRC/util.c" ;adjust default algorithm
2505 (("RowPerm[[:blank:]]*=[[:blank:]]*LargeDiag_MC64;")
2506 ;; TODO: set to "LargeDiag_AWPM" once combinatorial-blas has
2507 ;; general (i.e. non-square) processor-grid support.
2508 "RowPerm = NOROWPERM;"))
2510 (patches (search-patches "superlu-dist-scotchmetis.patch"
2511 "superlu-dist-awpm-grid.patch"
2512 "superlu-dist-fix-mpi-deprecations.patch"))))
2513 (build-system cmake-build-system)
2517 `(("gfortran" ,gfortran)
2520 ("combblas" ,combinatorial-blas)))
2522 `(("mpi" ,openmpi) ;headers include MPI heades
2523 ("parmetis" ,pt-scotch32 "metis")
2524 ("pt-scotch" ,pt-scotch32)))
2526 `(#:parallel-tests? #f ;tests use MPI and OpenMP
2527 #:configure-flags (list "-DBUILD_SHARED_LIBS:BOOL=YES"
2528 "-DTPL_ENABLE_COMBBLASLIB=YES"
2529 "-DTPL_BLAS_LIBRARIES=-lopenblas"
2530 "-DTPL_LAPACK_LIBRARIES=-llapack"
2531 (string-append "-DTPL_PARMETIS_LIBRARIES="
2533 '("ptscotchparmetis" "ptscotch" "ptscotcherr"
2534 "scotchmetis" "scotch" "scotcherr")
2536 (string-append "-DTPL_PARMETIS_INCLUDE_DIRS="
2537 (assoc-ref %build-inputs "parmetis")
2539 "-DTPL_ENABLE_COMBBLASLIB=ON"
2540 (string-append "-DTPL_COMBBLAS_INCLUDE_DIRS="
2541 (assoc-ref %build-inputs "combblas")
2542 "/include/CombBLAS;"
2543 (assoc-ref %build-inputs "combblas")
2544 "/include/BipartiteMatchings")
2545 "-DTPL_COMBBLAS_LIBRARIES=CombBLAS")
2547 (modify-phases %standard-phases
2548 (add-before 'configure 'set-c++-standard
2550 (substitute* "CMakeLists.txt"
2551 ;; AWPM headers require C++14
2552 (("CMAKE_CXX_STANDARD 11") "CMAKE_CXX_STANDARD 14"))))
2553 (add-before 'check 'mpi-setup
2555 (add-before 'check 'omp-setup
2556 (lambda _ (setenv "OMP_NUM_THREADS" "1") #t)))))
2557 (home-page (package-home-page superlu))
2558 (synopsis "Parallel supernodal direct solver")
2560 "SuperLU_DIST is a parallel extension to the serial SuperLU library.
2561 It is targeted for distributed memory parallel machines. SuperLU_DIST is
2562 implemented in ANSI C, and MPI for communications.")
2563 (license license:bsd-3)))
2565 (define-public scotch
2572 (uri (string-append "https://gforge.inria.fr/frs/download.php/"
2573 "latestfile/298/scotch_" version ".tar.gz"))
2575 (base32 "1ky4k9r6jvajhqaqnnx6h8fkmds2yxgp70dpr1qzwcyhi2nhqvv8"))
2576 (patches (search-patches "scotch-build-parallelism.patch"
2577 "scotch-integer-declarations.patch"))))
2578 (build-system gnu-build-system)
2583 (outputs '("out" "metis"))
2585 `(#:make-flags (list (string-append "prefix=" %output))
2587 (modify-phases %standard-phases
2589 'unpack 'chdir-to-src
2590 (lambda _ (chdir "src") #t))
2594 (call-with-output-file "Makefile.inc"
2608 CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
2609 LDFLAGS = -lz -lm -lrt -lpthread
2611 LEX = flex -Pscotchyy -olex.yy.c
2616 YACC = bison -pscotchyy -y -b y
2618 '("COMMON_FILE_COMPRESS_GZ"
2620 "COMMON_RANDOM_FIXED_SEED"
2621 "INTSIZE64" ;use 'int64_t'
2622 ;; Prevents symbolc clashes with libesmumps
2624 ;; XXX: Causes invalid frees in superlu-dist tests
2626 ;; "SCOTCH_PTHREAD_NUMBER=2"
2627 "restrict=__restrict"))))
2629 (add-after 'build 'build-esmumps
2632 (format #f "-j~a" (parallel-job-count))
2634 (add-before 'install 'make-install-dirs
2635 (lambda* (#:key outputs #:allow-other-keys)
2636 (mkdir (assoc-ref outputs "out"))))
2637 (add-after 'install 'install-metis
2638 (lambda* (#:key outputs #:allow-other-keys)
2639 (let ((out (assoc-ref outputs "metis")))
2641 ;; metis files are not installed with 'make install'
2642 (for-each (lambda (f)
2643 (install-file f (string-append out "/include")))
2644 (find-files "../include/" ".*metis\\.h"))
2645 (for-each (lambda (f)
2646 (install-file f (string-append out "/lib")))
2647 (find-files "../lib/" ".*metis\\..*"))
2649 (home-page "http://www.labri.fr/perso/pelegrin/scotch/")
2650 (synopsis "Programs and libraries for graph algorithms")
2651 (description "SCOTCH is a set of programs and libraries which implement
2652 the static mapping and sparse matrix reordering algorithms developed within
2653 the SCOTCH project. Its purpose is to apply graph theory, with a divide and
2654 conquer approach, to scientific computing problems such as graph and mesh
2655 partitioning, static mapping, and sparse matrix ordering, in application
2656 domains ranging from structural mechanics to operating systems or
2658 ;; See LICENSE_en.txt
2659 (license license:cecill-c)))
2661 (define-public scotch32
2662 ;; This is the 'INTSIZE32' variant, which uses 32-bit integers, as needed by
2663 ;; some applications.
2664 (package (inherit scotch)
2667 (substitute-keyword-arguments (package-arguments scotch)
2668 ((#:phases scotch-phases)
2669 `(modify-phases ,scotch-phases
2673 (call-with-output-file "Makefile.inc"
2687 CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
2688 LDFLAGS = -lz -lm -lrt -lpthread
2690 LEX = flex -Pscotchyy -olex.yy.c
2695 YACC = bison -pscotchyy -y -b y
2697 '("COMMON_FILE_COMPRESS_GZ"
2699 "COMMON_RANDOM_FIXED_SEED"
2700 "INTSIZE32" ;use 32-bit integers. See INSTALL.txt
2701 ;; Prevents symbolc clashes with libesmumps
2703 ;; XXX: Causes invalid frees in superlu-dist tests
2705 ;; "SCOTCH_PTHREAD_NUMBER=2"
2706 "restrict=__restrict"))))))))))
2708 "Programs and libraries for graph algorithms (32-bit integers)")))
2710 (define-public pt-scotch
2711 (package (inherit scotch)
2714 `(("openmpi" ,openmpi))) ;Headers include MPI headers
2716 (substitute-keyword-arguments (package-arguments scotch)
2717 ((#:phases scotch-phases)
2718 `(modify-phases ,scotch-phases
2722 (invoke "make" (format #f "-j~a" (parallel-job-count))
2723 "ptscotch" "ptesmumps")
2725 ;; Install the serial metis compatibility library
2726 (invoke "make" "-C" "libscotchmetis" "install")))
2727 (add-before 'check 'mpi-setup
2731 (invoke "make" "ptcheck")))))))
2732 (synopsis "Programs and libraries for graph algorithms (with MPI)")))
2734 (define-public pt-scotch32
2735 (package (inherit scotch32)
2736 (name "pt-scotch32")
2738 `(("openmpi" ,openmpi))) ;headers include MPI headers
2740 (substitute-keyword-arguments (package-arguments scotch32)
2741 ((#:phases scotch32-phases)
2742 `(modify-phases ,scotch32-phases
2745 (invoke "make" (format #f "-j~a" (parallel-job-count))
2746 "ptscotch" "ptesmumps")
2747 ;; Install the serial metis compatibility library
2748 (invoke "make" "-C" "libscotchmetis" "install")))
2749 (add-before 'check 'mpi-setup
2753 (invoke "make" "ptcheck")))))))
2755 "Programs and libraries for graph algorithms (with MPI and 32-bit integers)")))
2757 (define-public metis
2764 (uri (string-append "http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/"
2765 "metis-" version ".tar.gz"))
2768 "1cjxgh41r8k6j029yxs8msp3z6lcnpm16g5pvckk35kc7zhfpykn"))))
2769 (build-system cmake-build-system)
2771 `(("blas" ,openblas)))
2773 `(#:tests? #f ;no tests
2774 #:configure-flags `("-DSHARED=ON"
2775 ,(string-append "-DGKLIB_PATH=" (getcwd)
2776 "/metis-" ,version "/GKlib"))))
2777 (home-page "http://glaros.dtc.umn.edu/gkhome/metis/metis/overview")
2778 (synopsis "Graph partitioning and fill-reducing matrix ordering library")
2780 "METIS is a set of serial programs for partitioning graphs, partitioning
2781 finite element meshes, and producing fill-reducing orderings for sparse
2782 matrices. The algorithms implemented in METIS are based on the multilevel
2783 recursive-bisection, multilevel k-way, and multi-constraint partitioning
2785 (license license:asl2.0))) ;As of version 5.0.3
2787 (define-public p4est
2794 (uri (string-append "http://p4est.github.io/release/p4est-"
2798 "16h267z256kxcxfjs390qqzv19hr58vrj4x8lndb7alnk2vca8n5"))))
2799 (build-system gnu-build-system)
2801 `(("fortran" ,gfortran)
2806 `(#:configure-flags `(,(string-append "BLAS_LIBS=-L"
2807 (assoc-ref %build-inputs "blas")
2809 ,(string-append "LAPACK_LIBS=-L"
2810 (assoc-ref %build-inputs "lapack")
2812 #:phases (modify-phases %standard-phases
2813 (add-before 'check 'mpi-setup
2815 (home-page "http://www.p4est.org")
2816 (synopsis "Adaptive mesh refinement on forests of octrees")
2818 "The p4est software library enables the dynamic management of a
2819 collection of adaptive octrees, conveniently called a forest of octrees.
2820 p4est is designed to work in parallel and scales to hundreds of thousands of
2822 (license license:gpl2+)))
2824 (define-public p4est-openmpi
2825 (package (inherit p4est)
2826 (name "p4est-openmpi")
2829 ,@(package-inputs p4est)))
2831 (substitute-keyword-arguments (package-arguments p4est)
2832 ((#:configure-flags cf)
2833 ``("--enable-mpi" ,@,cf))))
2834 (synopsis "Parallel adaptive mesh refinement on forests of octrees")))
2836 (define-public gsegrafix
2843 (uri (string-append "mirror://gnu/" name "/" name "-"
2847 "1b13hvx063zv970y750bx41wpx6hwd5ngjhbdrna8w8yy5kmxcda"))))
2848 (build-system gnu-build-system)
2850 `(#:configure-flags '("LDFLAGS=-lm")))
2852 `(("libgnomecanvas" ,libgnomecanvas)
2853 ("libbonoboui" ,libbonoboui)
2854 ("libgnomeui" ,libgnomeui)
2855 ("libgnomeprintui" ,libgnomeprintui)
2858 `(("pkg-config" ,pkg-config)))
2859 (home-page "https://www.gnu.org/software/gsegrafix/")
2860 (synopsis "GNOME application to create scientific and engineering plots")
2861 (description "GSEGrafix is an application which produces high-quality graphical
2862 plots for science and engineering. Plots are specified via simple ASCII
2863 parameter files and data files and are presented in an anti-aliased GNOME
2864 canvas. The program supports rectangular two-dimensional plots, histograms,
2865 polar-axis plots and three-dimensional plots. Plots can be printed or saved
2866 to BMP, JPEG or PNG image formats.")
2867 (license license:gpl3+)))
2869 (define-public maxima
2876 (uri (string-append "mirror://sourceforge/maxima/Maxima-source/"
2877 version "-source/" name "-" version ".tar.gz"))
2880 "0xyahp4c6509haxh4n1swiqm3421gplkdisa0zypclh3252sbzfw"))
2881 (patches (search-patches "maxima-defsystem-mkdir.patch"))))
2882 (build-system gnu-build-system)
2885 ("gnuplot" ,gnuplot) ;for plots
2887 ("tk" ,tk))) ;Tcl/Tk is used by 'xmaxima'
2889 `(("texinfo" ,texinfo)
2891 ("python" ,python)))
2894 (list "--enable-gcl"
2895 (string-append "--with-posix-shell="
2896 (assoc-ref %build-inputs "bash")
2898 (string-append "--with-wish="
2899 (assoc-ref %build-inputs "tk")
2901 (let ((v ,(package-version tk)))
2902 (string-take v (string-index-right v #\.)))))
2903 ;; By default Maxima attempts to write temporary files to
2904 ;; '/tmp/nix-build-maxima-*', which won't exist at run time.
2905 ;; Work around that.
2906 #:make-flags (list "TMPDIR=/tmp")
2908 (modify-phases %standard-phases
2909 (add-after 'unpack 'patch-paths
2910 (lambda* (#:key inputs #:allow-other-keys)
2911 (let* ((sed (string-append (assoc-ref inputs "sed") "/bin/sed"))
2912 (coreutils (assoc-ref inputs "coreutils"))
2913 (dirname (string-append coreutils "/bin/dirname"))
2914 (head (string-append coreutils "/bin/head"))
2915 (perl (string-append (assoc-ref inputs "perl") "/bin/perl"))
2916 (python (string-append (assoc-ref inputs "python")
2918 (substitute* "src/maxima.in"
2919 (("sed ") (string-append sed " "))
2920 (("dirname") dirname)
2922 (substitute* "doc/info/Makefile.in"
2923 (("/usr/bin/env perl") perl))
2924 (substitute* "doc/info/build_html.sh.in"
2925 (("python") python))
2927 (add-before 'check 'pre-check
2929 (chmod "src/maxima" #o555)
2933 ;; This is derived from the testing code in the "debian/rules" file
2934 ;; of Debian's Maxima package.
2935 ;; If Maxima can successfully run this, the binary to be installed
2941 "--batch-string=\"run_testsuite();\" "
2942 "| grep -q \"No unexpected errors found\""))))
2943 ;; Make sure the doc and emacs files are found in the
2944 ;; standard location. Also configure maxima to find gnuplot
2945 ;; without having it on the PATH.
2946 (add-after 'install 'post-install
2947 (lambda* (#:key outputs inputs #:allow-other-keys)
2948 (let* ((gnuplot (assoc-ref inputs "gnuplot"))
2949 (out (assoc-ref outputs "out"))
2950 (datadir (string-append out "/share/maxima/" ,version))
2951 (binutils (string-append (assoc-ref inputs "binutils")
2953 (with-directory-excursion out
2954 (mkdir-p "share/emacs")
2955 (mkdir-p "share/doc")
2957 (string-append datadir "/doc/")
2958 (string-append out "/share/doc/maxima"))
2959 (with-atomic-file-replacement
2960 (string-append datadir "/share/maxima-init.lisp")
2962 (format out "~a ~s~a~%"
2963 "(setf $gnuplot_command "
2964 (string-append gnuplot "/bin/gnuplot") ")")
2965 (dump-port in out))))
2966 ;; Ensure that Maxima will have access to the GNU binutils
2967 ;; components at runtime.
2968 (wrap-program (string-append out "/bin/maxima")
2969 `("PATH" prefix (,binutils))))
2971 (home-page "http://maxima.sourceforge.net")
2972 (synopsis "Numeric and symbolic expression manipulation")
2973 (description "Maxima is a system for the manipulation of symbolic and
2974 numerical expressions. It yields high precision numeric results by using
2975 exact fractions, arbitrary precision integers, and variable precision floating
2977 ;; Some files are lgpl2.1+. Some are gpl2+. Some explicitly state gpl1+.
2978 ;; Others simply say "GNU General Public License" without stating a
2979 ;; version (which implicitly means gpl1+).
2980 ;; At least one file (src/maxima.asd) says "version 2."
2981 ;; GPLv2 only is therefore the smallest subset.
2982 (license license:gpl2)))
2984 (define-public wxmaxima
2992 (url "https://github.com/wxMaxima-developers/wxmaxima.git")
2993 (commit (string-append "Version-" version))))
2994 (file-name (git-file-name name version))
2996 (base32 "195j6j8z0jd6xg3a63ywbrbsc6dany795m3fb95nbx1vq0bqqvvn"))))
2997 (build-system cmake-build-system)
2999 `(("gettext" ,gettext-minimal)))
3001 `(("wxwidgets" ,wxwidgets)
3004 ("adwaita-icon-theme" ,adwaita-icon-theme)
3006 ("shared-mime-info" ,shared-mime-info)))
3008 `(#:tests? #f ; no check target
3010 (modify-phases %standard-phases
3011 (add-after 'install 'wrap-program
3012 (lambda* (#:key inputs outputs #:allow-other-keys)
3013 (wrap-program (string-append (assoc-ref outputs "out")
3016 (,(string-append (assoc-ref inputs "maxima")
3018 ;; For GtkFileChooserDialog.
3019 `("GSETTINGS_SCHEMA_DIR" =
3020 (,(string-append (assoc-ref inputs "gtk+")
3021 "/share/glib-2.0/schemas")))
3022 `("XDG_DATA_DIRS" ":" prefix
3023 (;; Needed by gdk-pixbuf to know supported icon formats.
3025 (assoc-ref inputs "shared-mime-info") "/share")
3026 ;; The default icon theme of GTK+.
3028 (assoc-ref inputs "adwaita-icon-theme") "/share"))))
3030 (home-page "https://andrejv.github.io/wxmaxima/")
3031 (synopsis "Graphical user interface for the Maxima computer algebra system")
3033 "wxMaxima is a graphical user interface for the Maxima computer algebra
3034 system. It eases the use of Maxima by making most of its commands available
3035 through a menu system and by providing input dialogs for commands that require
3036 more than one argument. It also implements its own display engine that
3037 outputs mathematical symbols directly instead of depicting them with ASCII
3040 wxMaxima also features 2D and 3D inline plots, simple animations, mixing of
3041 text and mathematical calculations to create documents, exporting of input and
3042 output to TeX, and a browser for Maxima's manual including command index and
3043 full text searching.")
3044 (license license:gpl2+)))
3046 (define-public armadillo
3052 (uri (string-append "mirror://sourceforge/arma/armadillo-"
3056 "1ka1vd9fcmvp12qkcm4888dkfqwnalvv00x04wy29f3nx3qwczby"))))
3057 (build-system cmake-build-system)
3058 (arguments `(#:tests? #f)) ; no test target
3060 `(("openblas" ,openblas)
3062 ("arpack" ,arpack-ng)))
3063 (home-page "http://arma.sourceforge.net/")
3064 (synopsis "C++ linear algebra library")
3066 "Armadillo is a C++ linear algebra library, aiming towards a good balance
3067 between speed and ease of use. It is useful for algorithm development
3068 directly in C++, or quick conversion of research code into production
3069 environments. It can be used for machine learning, pattern recognition,
3070 signal processing, bioinformatics, statistics, econometrics, etc. The library
3071 provides efficient classes for vectors, matrices and cubes, as well as 150+
3072 associated functions (eg. contiguous and non-contiguous submatrix views).")
3073 (license license:asl2.0)))
3075 (define-public muparser
3076 ;; When switching download sites, muparser re-issued a 2.2.5 release with a
3077 ;; different hash. In order to make `guix package --upgrade` work correctly,
3078 ;; we set a Guix packaging revision.
3079 ;; When the next version of muparser is released, we can remove
3080 ;; UPSTREAM-VERSION and REVISION and use the plain VERSION.
3081 (let ((upstream-version "2.2.5")
3085 (version (string-append upstream-version "-" revision))
3090 (url "https://github.com/beltoforion/muparser.git")
3091 (commit (string-append "v" upstream-version))))
3092 (file-name (git-file-name name version))
3094 (base32 "0f0g4995xngf1pp3zr4p6ai2f8v6f8bxwa0k8ayjjiv1l8h44m24"))))
3095 (build-system gnu-build-system)
3097 `(#:configure-flags '("--enable-samples=no")
3098 #:tests? #f)) ;no "check" target
3099 (home-page "http://muparser.beltoforion.de/")
3100 (synopsis "Fast parser library for mathematical expressions")
3102 "muParser is an extensible high performance math parser library. It is
3103 based on transforming an expression into a bytecode and precalculating constant
3105 (license license:expat))))
3107 (define-public openblas
3109 ;; TODO: Incorporate 'openblas/fixed-num-threads' changes on the next
3111 (replacement openblas/fixed-num-threads)
3118 (uri (string-append "mirror://sourceforge/openblas/v" version "/OpenBLAS%20"
3119 version "%20version.tar.gz"))
3120 (file-name (string-append name "-" version ".tar.gz"))
3123 "1r2g9zzwq5dm8vjd19pxwggfvfzy56cvkmpmp5d014qr3svgmsap"))))
3124 (build-system gnu-build-system)
3126 `(#:test-target "test"
3127 ;; DYNAMIC_ARCH is only supported on x86. When it is disabled and no
3128 ;; TARGET is specified, OpenBLAS will tune itself to the build host, so
3129 ;; we need to disable substitutions.
3131 ,(let ((system (or (%current-target-system) (%current-system))))
3132 (or (string-prefix? "x86_64" system)
3133 (string-prefix? "i686" system)
3134 (string-prefix? "mips" system)
3135 (string-prefix? "aarch64" system)))
3137 (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
3139 "MAKE_NB_JOBS=0" ;use jobserver for submakes
3140 ;; Build the library for all supported CPUs. This allows
3141 ;; switching CPU targets at runtime with the environment variable
3142 ;; OPENBLAS_CORETYPE=<type>, where "type" is a supported CPU type.
3143 ;; Unfortunately, this is not supported on non-x86 architectures,
3144 ;; where it leads to failed builds.
3145 ,@(let ((system (or (%current-target-system) (%current-system))))
3147 ((or (string-prefix? "x86_64" system)
3148 (string-prefix? "i686" system))
3149 '("DYNAMIC_ARCH=1"))
3150 ;; On MIPS we force the "SICORTEX" TARGET, as for the other
3151 ;; two available MIPS targets special extended instructions
3152 ;; for Loongson cores are used.
3153 ((string-prefix? "mips" system)
3154 '("TARGET=SICORTEX"))
3155 ;; On aarch64 force the generic 'armv8-a' target
3156 ((string-prefix? "aarch64" system)
3159 ;; no configure script
3161 (modify-phases %standard-phases
3163 (add-before 'build 'set-extralib
3164 (lambda* (#:key inputs #:allow-other-keys)
3165 ;; Get libgfortran found when building in utest.
3167 (string-append "-L" (assoc-ref inputs "fortran-lib")
3171 `(("fortran-lib" ,gfortran "lib")))
3174 ("fortran" ,gfortran)
3176 (home-page "http://www.openblas.net/")
3177 (synopsis "Optimized BLAS library based on GotoBLAS")
3179 "OpenBLAS is a BLAS library forked from the GotoBLAS2-1.13 BSD version.")
3180 (license license:bsd-3)))
3182 (define-public openblas-ilp64
3183 (package/inherit openblas
3184 (name "openblas-ilp64")
3185 (supported-systems '("x86_64-linux" "aarch64-linux" "mips64el-linux"))
3187 (substitute-keyword-arguments (package-arguments openblas)
3188 ((#:make-flags flags '())
3189 `(append (list "INTERFACE64=1" "LIBNAMESUFFIX=ilp64")
3191 (synopsis "Optimized BLAS library based on GotoBLAS (ILP64 version)")
3192 (license license:bsd-3)))
3194 (define openblas/fixed-num-threads
3195 ;; TODO: Move that to 'openblas' proper on the next rebuild cycle.
3198 (version (match (string-split (package-version openblas) #\.)
3199 ((numbers ... (= string-length len))
3200 (string-join (append numbers
3201 (list (make-string len #\a)))
3204 (substitute-keyword-arguments (package-arguments openblas)
3205 ((#:make-flags flags ''())
3206 ;; This is the maximum number of threads OpenBLAS will ever use (that
3207 ;; is, if $OPENBLAS_NUM_THREADS is greater than that, then NUM_THREADS
3208 ;; is used.) If we don't set it, the makefile sets it to the number
3209 ;; of cores of the build machine, which is obviously wrong.
3210 `(cons "NUM_THREADS=128" ,flags))))))
3212 (define* (make-blis implementation #:optional substitutable?)
3213 "Return a BLIS package with the given IMPLEMENTATION (see config/ in the
3214 source tree for a list of implementations.)
3216 SUBSTITUTABLE? determines whether the package is made available as a
3219 Currently the specialization must be selected at configure-time, but work is
3220 underway to allow BLIS to select the right optimized kernels at run time:
3221 <https://github.com/flame/blis/issues/129>."
3223 (name (if (string=? implementation "reference")
3225 (string-append "blis-" implementation)))
3227 (home-page "https://github.com/flame/blis")
3230 (uri (git-reference (url home-page) (commit version)))
3233 "1wr79a50nm4abhw8w3sn96nmwp5mrzifcigk7khw9qcgyyyqayfh"))
3234 (file-name (git-file-name "blis" version))))
3235 (build-system gnu-build-system)
3237 `(#:test-target "test"
3239 #:substitutable? ,substitutable?
3241 #:phases (modify-phases %standard-phases
3243 (lambda* (#:key outputs #:allow-other-keys)
3244 ;; This is a home-made 'configure' script.
3245 (let ((out (assoc-ref outputs "out")))
3246 (invoke "./configure" "-p" out
3250 "--enable-threading=openmp"
3253 (add-before 'check 'show-test-output
3255 ;; By default "make check" is silent. Make it verbose.
3256 (system "tail -F output.testsuite &")
3258 (synopsis "High-performance basic linear algebra (BLAS) routines")
3260 "BLIS is a portable software framework for instantiating high-performance
3261 BLAS-like dense linear algebra libraries. The framework was designed to
3262 isolate essential kernels of computation that, when optimized, immediately
3263 enable optimized implementations of most of its commonly used and
3264 computationally intensive operations. While BLIS exports a new BLAS-like API,
3265 it also includes a BLAS compatibility layer which gives application developers
3266 access to BLIS implementations via traditional BLAS routine calls.")
3267 (license license:bsd-3)))
3270 ;; This is the "reference" implementation, which is the non-optimized but
3271 ;; portable variant (no assembly).
3272 (make-blis "reference" #t))
3274 (define ignorance blis)
3276 (define-syntax-rule (blis/x86_64 processor)
3277 "Expand to a package specialized for PROCESSOR."
3279 (inherit (make-blis processor))
3280 (supported-systems '("x86_64-linux"))))
3282 (define-public blis-sandybridge
3283 ;; BLIS specialized for Sandy Bridge processors (launched 2011):
3284 ;; <http://ark.intel.com/products/codename/29900/Sandy-Bridge>.
3285 (blis/x86_64 "sandybridge"))
3287 (define-public blis-haswell
3288 ;; BLIS specialized for Haswell processors (launched 2013):
3289 ;; <http://ark.intel.com/products/codename/42174/Haswell>.
3290 (blis/x86_64 "haswell"))
3292 (define-public blis-knl
3293 ;; BLIS specialized for Knights Landing processor (launched 2016):
3294 ;; <http://ark.intel.com/products/series/92650/Intel-Xeon-Phi-x200-Product-Family>.
3295 (blis/x86_64 "knl"))
3298 (define-public openlibm
3306 (url "https://github.com/JuliaLang/openlibm.git")
3307 (commit (string-append "v" version))))
3308 (file-name (git-file-name name version))
3310 (base32 "08wfchmmr5200fvmn1kwq9byc1fhsq46hn0y5k8scdl74771c7gh"))))
3311 (build-system gnu-build-system)
3314 (list (string-append "prefix=" (assoc-ref %outputs "out")))
3316 ;; no configure script
3317 (modify-phases %standard-phases (delete 'configure))
3318 #:tests? #f)) ;the tests are part of the default target
3319 (home-page "http://openlibm.org/")
3320 (synopsis "Portable C mathematical library (libm)")
3322 "OpenLibm is an effort to have a high quality, portable, standalone C
3323 mathematical library (libm). It can be used standalone in applications and
3324 programming language implementations. The project was born out of a need to
3325 have a good libm for the Julia programming language that worked consistently
3326 across compilers and operating systems, and in 32-bit and 64-bit
3328 ;; Each architecture has its own make target, and there is none for mips.
3329 (supported-systems (delete "mips64el-linux" %supported-systems))
3330 ;; See LICENSE.md for details.
3331 (license (list license:expat
3334 license:public-domain
3335 license:lgpl2.1+))))
3337 (define-public openspecfun
3339 (name "openspecfun")
3345 (url "https://github.com/JuliaLang/openspecfun.git")
3346 (commit (string-append "v" version))))
3347 (file-name (git-file-name name version))
3349 (base32 "0pfw6l3ch7isz403llx7inxlvavqh01jh1hb9dpidi86sjjx9kfh"))))
3350 (build-system gnu-build-system)
3352 '(#:tests? #f ; no "check" target
3354 (list (string-append "prefix=" (assoc-ref %outputs "out")))
3356 (modify-phases %standard-phases
3357 (delete 'configure)))) ; no configure script
3359 `(("fortran" ,gfortran)))
3360 (home-page "https://github.com/JuliaLang/openspecfun")
3361 (synopsis "Collection of special mathematical functions")
3363 "Openspecfun provides AMOS and Faddeeva. AMOS (from Netlib) is a
3364 portable package for Bessel Functions of a Complex Argument and Nonnegative
3365 Order; it contains subroutines for computing Bessel functions and Airy
3366 functions. Faddeeva allows computing the various error functions of arbitrary
3367 complex arguments (Faddeeva function, error function, complementary error
3368 function, scaled complementary error function, imaginary error function, and
3369 Dawson function); given these, one can also easily compute Voigt functions,
3370 Fresnel integrals, and similar related functions as well.")
3371 ;; Faddeeva is released under the Expat license; AMOS is included as
3372 ;; public domain software.
3373 (license (list license:expat license:public-domain))))
3375 (define-public suitesparse
3377 (name "suitesparse")
3383 "http://faculty.cse.tamu.edu/davis/SuiteSparse/SuiteSparse-"
3387 "1dnr6pmjzc2qmbkmb4shigx1l74ilf6abn7svyd6brxgvph8vadr"))
3388 (modules '((guix build utils)))
3390 ;; Remove bundled metis source
3392 (delete-file-recursively "metis-5.1.0")
3394 (build-system gnu-build-system)
3396 '(#:tests? #f ;no "check" target
3401 "MY_METIS_LIB=-lmetis"
3402 (string-append "INSTALL_LIB="
3403 (assoc-ref %outputs "out") "/lib")
3404 (string-append "INSTALL_INCLUDE="
3405 (assoc-ref %outputs "out") "/include")
3408 (modify-phases %standard-phases
3409 (delete 'configure)))) ;no configure script
3414 (home-page "http://faculty.cse.tamu.edu/davis/suitesparse.html")
3415 (synopsis "Suite of sparse matrix software")
3417 "SuiteSparse is a suite of sparse matrix algorithms, including: UMFPACK,
3418 multifrontal LU factorization; CHOLMOD, supernodal Cholesky; SPQR,
3419 multifrontal QR; KLU and BTF, sparse LU factorization, well-suited for circuit
3420 simulation; ordering methods (AMD, CAMD, COLAMD, and CCOLAMD); CSparse and
3421 CXSparse, a concise sparse Cholesky factorization package; and many other
3424 ;; AMD, CAMD, BTF, COLAMD, CCOLAMD, CSparse, CXSparse, KLU, LDL
3426 ;; GPUQREngine, RBio, SuiteSparse_GPURuntime, SuiteSparseQR, UMFPACK
3427 (license (list license:gpl2+ license:lgpl2.1+))))
3429 (define-public atlas
3435 (uri (string-append "mirror://sourceforge/math-atlas/Stable/"
3436 version "/atlas" version ".tar.bz2"))
3439 "1dyjlq3fiparvm8ypwk6rsmjzmnwk81l88gkishphpvc79ryp216"))))
3440 (build-system gnu-build-system)
3441 (home-page "http://math-atlas.sourceforge.net/")
3442 (inputs `(("gfortran" ,gfortran)
3443 ("lapack-tar" ,(package-source lapack))))
3444 (outputs '("out" "doc"))
3445 ;; For the moment we drop support for MIPS at it fails to compile. See
3446 ;; https://lists.gnu.org/archive/html/guix-devel/2014-11/msg00516.html
3447 (supported-systems (delete "mips64el-linux" %supported-systems))
3449 `(#:parallel-build? #f
3450 #:parallel-tests? #f
3452 ;; ATLAS tunes itself for the machine it is built on, as explained at
3453 ;; <http://lists.gnu.org/archive/html/guix-devel/2014-10/msg00305.html>.
3454 ;; For this reason, we want users to build it locally instead of using
3458 #:modules ((srfi srfi-26)
3459 (guix build gnu-build-system)
3462 `(;; Generate position independent code suitable for dynamic libraries
3463 ;; and use WALL timer to get more accurate timing.
3464 "-Fa" "alg" "-fPIC" "-D" "c" "-DWALL"
3467 ,,(if (string-match "64" (%current-system))
3470 ;; Disable parallel build as it gives errors: atlas_pthread.h is
3471 ;; needed to compile C files before it is generated.
3472 "-Ss" "pmake" "make -j 1"
3473 ;; Probe is failing for MIPS. We therefore define the system
3474 ;; architecture explicitly by setting (-A) MACHINETYPE = 49
3475 ;; 'MIPSR1xK' and (-V) ISA = 1 'none'.
3476 ,,@(if (string-prefix? "mips" (%current-system))
3477 (list "-A" "49" "-V" "1")
3479 ;; Generate shared libraries.
3481 ;; Build a full LAPACK library.
3482 ,(string-append "--with-netlib-lapack-tarfile="
3483 (assoc-ref %build-inputs "lapack-tar")))
3485 (modify-phases %standard-phases
3486 (add-after 'install 'install-doc
3487 (lambda* (#:key outputs inputs #:allow-other-keys)
3488 (let ((doc (string-append (assoc-ref outputs "doc")
3489 "/share/doc/atlas")))
3491 (for-each (cut install-file <> doc)
3492 (find-files "../ATLAS/doc" ".*"))
3494 (add-after 'check 'check-pt
3495 (lambda _ (invoke "make" "ptcheck")))
3496 ;; Fix files required to run configure.
3497 (add-before 'configure 'fix-/bin/sh
3499 ;; Use `sh', not `/bin/sh'.
3500 (substitute* (find-files "." "Makefile|configure|SpewMakeInc\\.c")
3504 ;; Fix /bin/sh in generated make files.
3505 (add-after 'configure 'fix-/bin/sh-in-generated-files
3507 (substitute* (find-files "." "^[Mm]ake\\.inc.*")
3511 ;; ATLAS configure program does not accepts the default flags
3512 ;; passed by the 'gnu-build-system'.
3514 (lambda* (#:key native-inputs inputs outputs
3515 (configure-flags '())
3516 #:allow-other-keys #:rest args)
3517 (let* ((prefix (assoc-ref outputs "out"))
3518 (bash (or (and=> (assoc-ref
3519 (or native-inputs inputs) "bash")
3520 (cut string-append <> "/bin/bash"))
3522 (flags `(,(string-append "--prefix=" prefix)
3524 (abs-srcdir (getcwd))
3525 (srcdir (string-append "../" (basename abs-srcdir))))
3526 (format #t "source directory: ~s (relative from build: ~s)~%"
3530 (format #t "build directory: ~s~%" (getcwd))
3531 (format #t "configure flags: ~s~%" flags)
3533 (string-append srcdir "/configure")
3535 (synopsis "Automatically Tuned Linear Algebra Software")
3537 "ATLAS is an automatically tuned linear algebra software library
3538 providing C and Fortran77 interfaces to a portably efficient BLAS
3539 implementation, as well as a few routines from LAPACK.
3541 Optimization occurs at build time. For this reason, the library is built on
3542 the machine where it is installed, without resorting to pre-built substitutes.
3544 Before building the library, CPU throttling should be disabled. This can be
3545 done in the BIOS, or, on GNU/Linux, with the following command:
3548 # cpupower --governor performance
3551 Failure to do so will result in a library with poor performance.")
3552 (license license:bsd-3)))
3561 (uri (string-append "https://github.com/g-truc/glm/releases/download/"
3562 version "/glm-" version ".zip"))
3564 (base32 "1l0pi1qi37mk6s0yrkrw07lspv4gcqnr9ryg3521hrl77ff37dwx"))
3565 (patches (search-patches "glm-restore-install-target.patch"))))
3566 (build-system cmake-build-system)
3568 `(("unzip" ,unzip)))
3569 (home-page "https://glm.g-truc.net/")
3570 (synopsis "OpenGL Mathematics library")
3571 (description "OpenGL Mathematics (GLM) is a header-only C++ mathematics
3572 library for graphics software based on the OpenGL Shading Language (GLSL)
3574 (license license:expat)))
3576 (define-public lpsolve
3583 (uri (string-append "mirror://sourceforge/lpsolve/lpsolve/" version
3584 "/lp_solve_" version "_source.tar.gz"))
3587 "12pj1idjz31r7c2mb5w03vy1cmvycvbkx9z29s40qdmkp1i7q6i0"))
3588 (modules '((guix build utils)))
3591 (substitute* (list "lp_solve/ccc" "lpsolve55/ccc")
3593 ;; Pretend to be on a 64 bit platform to obtain a common directory
3594 ;; name for the build results on all architectures; nothing else
3595 ;; seems to depend on it.
3596 (("^PLATFORM=.*$") "PLATFORM=ux64\n")
3598 ;; The check for 'isnan' as it is written fails with
3599 ;; "non-floating-point argument in call to function
3600 ;; ‘__builtin_isnan’", which leads to the 'NOISNAN' cpp macro
3601 ;; definition, which in turn leads to bad things. Fix the feature
3603 (("isnan\\(0\\)") "isnan(0.)"))
3605 (build-system gnu-build-system)
3607 `(#:tests? #f ; no check target
3609 (modify-phases %standard-phases
3610 (delete 'configure) ; no configure script
3613 (with-directory-excursion "lpsolve55"
3614 (invoke "bash" "ccc"))
3615 (with-directory-excursion "lp_solve"
3616 (invoke "bash" "ccc"))
3619 (lambda* (#:key outputs #:allow-other-keys)
3620 (let* ((out (assoc-ref outputs "out"))
3621 (bin (string-append out "/bin"))
3622 (lib (string-append out "/lib"))
3623 ;; This is where LibreOffice expects to find the header
3624 ;; files, and where they are installed by Debian.
3625 (include (string-append out "/include/lpsolve")))
3626 (install-file "lpsolve55/bin/ux64/liblpsolve55.a" lib)
3627 (install-file "lpsolve55/bin/ux64/liblpsolve55.so" lib)
3628 (install-file "lp_solve/bin/ux64/lp_solve" bin)
3630 ;; Install a subset of the header files as on Debian
3631 ;; (plus lp_bit.h, which matches the regular expression).
3632 (for-each (lambda (name)
3633 (install-file name include))
3634 (find-files "." "lp_[HMSa-z].*\\.h$"))
3635 (with-directory-excursion "shared"
3636 (for-each (lambda (name)
3637 (install-file name include))
3638 (find-files "." "\\.h$")))
3640 (home-page "http://lpsolve.sourceforge.net/")
3641 (synopsis "Mixed integer linear programming (MILP) solver")
3643 "lp_solve is a mixed integer linear programming solver based on the
3644 revised simplex and the branch-and-bound methods.")
3645 (license license:lgpl2.1+)))
3647 (define-public dealii
3654 (uri (string-append "https://github.com/dealii/dealii/releases/"
3655 "download/v" version "/dealii-" version ".tar.gz"))
3658 "0xhjv0gzswpjbc43xbrpwfc5848g508l01855nszx3g5gwzlhnzw"))
3659 (modules '((guix build utils)))
3661 ;; Remove bundled sources: UMFPACK, TBB, muParser, and boost
3663 (delete-file-recursively "bundled")
3665 (build-system cmake-build-system)
3673 ("arpack" ,arpack-ng)
3674 ("muparser" ,muparser)
3675 ("gfortran" ,gfortran)
3676 ("suitesparse" ,suitesparse))) ;for UMFPACK
3678 `(#:build-type "DebugRelease" ;only supports Release, Debug, or DebugRelease
3680 ;; Work around a bug in libsuitesparseconfig linking
3681 ;; see https://github.com/dealii/dealii/issues/4745
3682 '("-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON")))
3683 (home-page "https://www.dealii.org")
3684 (synopsis "Finite element library")
3686 "Deal.II is a C++ program library targeted at the computational solution
3687 of partial differential equations using adaptive finite elements. The main
3688 aim of deal.II is to enable rapid development of modern finite element codes,
3689 using among other aspects adaptive meshes and a wide array of tools often used
3690 in finite element programs.")
3691 (license license:lgpl2.1+)))
3693 (define-public dealii-openmpi
3694 (package (inherit dealii)
3695 (name "dealii-openmpi")
3698 ;;Supported only with MPI:
3699 ("hdf5" ,hdf5-parallel-openmpi) ;TODO: have petsc-openmpi propagate?
3700 ("p4est" ,p4est-openmpi)
3701 ("petsc" ,petsc-openmpi)
3702 ("slepc" ,slepc-openmpi)
3703 ("metis" ,metis) ;for MUMPS
3704 ("scalapack" ,scalapack) ;for MUMPS
3705 ("mumps" ,mumps-metis-openmpi) ;configure supports only metis orderings
3706 ("arpack" ,arpack-ng-openmpi)
3707 ,@(fold alist-delete (package-inputs dealii)
3708 '("p4est" "arpack"))))
3710 (substitute-keyword-arguments (package-arguments dealii)
3711 ((#:configure-flags cf)
3712 `(cons "-DDEAL_II_WITH_MPI:BOOL=ON"
3714 ((#:phases phases '%standard-phases)
3715 `(modify-phases ,phases
3716 (add-before 'check 'mpi-setup
3717 ,%openmpi-setup)))))
3718 (synopsis "Finite element library (with MPI support)")))
3720 (define-public flann
3729 "http://www.cs.ubc.ca/research/flann/uploads/FLANN/flann-"
3730 version "-src.zip"))
3733 "022w8hph7bli5zbpnk3z1qh1c2sl5hm8fw2ccim651ynn0hr7fyz"))
3734 (patches (search-patches "flann-cmake-3.11.patch"))))
3735 (build-system cmake-build-system)
3737 "octave")) ;46 MiB .mex file that pulls Octave
3739 `(("unzip" ,unzip)))
3742 ("octave" ,octave-cli)
3743 ("python" ,python-2) ; print syntax
3744 ;; ("python2-numpy" ,python2-numpy) ; only required for the tests
3747 `(;; The 'share/flann/octave' contains a .mex file, which is an ELF file
3748 ;; taken 46 MiB unstripped, and 6 MiB stripped.
3749 #:strip-directories '("lib" "lib64" "libexec"
3750 "bin" "sbin" "share/flann/octave")
3752 ;; Save 12 MiB by not installing .a files. Passing
3753 ;; '-DBUILD_STATIC_LIBS=OFF' has no effect.
3754 #:phases (modify-phases %standard-phases
3755 (add-before 'configure 'set-octave-directory
3756 (lambda* (#:key outputs #:allow-other-keys)
3757 ;; Install the .mex file in the "octave" output.
3758 (let ((out (assoc-ref outputs "octave")))
3759 (substitute* "src/matlab/CMakeLists.txt"
3760 (("share/flann/octave")
3761 (string-append out "/share/flann/octave")))
3763 (add-after 'install 'remove-static-libraries
3764 (lambda* (#:key outputs #:allow-other-keys)
3765 (let* ((out (assoc-ref outputs "out"))
3766 (lib (string-append out "/lib")))
3767 (for-each delete-file
3768 (find-files lib "\\.a$"))
3771 #:tests? #f)) ; The test data are downloaded from the Internet.
3772 (home-page "http://www.cs.ubc.ca/research/flann/")
3773 (synopsis "Library for approximate nearest neighbors computation")
3774 (description "FLANN is a library for performing fast approximate
3775 nearest neighbor searches in high dimensional spaces. It implements a
3776 collection of algorithms and a system for automatically choosing the best
3777 algorithm and optimum parameters depending on the dataset.
3779 FLANN is written in C++ and contains bindings for C, Octave and Python.")
3780 (license (license:non-copyleft "file://COPYING"
3781 "See COPYING in the distribution."))))
3783 (define-public wcalc
3790 (uri (string-append "mirror://sourceforge/w-calc/Wcalc/" version "/"
3791 "wcalc-" version ".tar.bz2"))
3794 "1vi8dl6rccqiq1apmpwawyg2ywx6a1ic1d3cvkf2hlwk1z11fb0f"))))
3795 (build-system gnu-build-system)
3798 ("readline" ,readline)))
3799 (home-page "http://w-calc.sourceforge.net/index.php")
3800 (synopsis "Flexible command-line scientific calculator")
3801 (description "Wcalc is a very capable calculator. It has standard functions
3802 (sin, asin, and sinh for example, in either radians or degrees), many
3803 pre-defined constants (pi, e, c, etc.), support for using variables, \"active\"
3804 variables, a command history, hex/octal/binary input and output, unit
3805 conversions, embedded comments, and an expandable expression entry field. It
3806 evaluates expressions using the standard order of operations.")
3807 (license license:gpl2+)))
3815 (uri (string-append "mirror://sourceforge/xaos/XaoS/" version
3816 "/xaos-" version ".tar.gz"))
3819 "15cd1cx1dyygw6g2nhjqq3bsfdj8sj8m4va9n75i0f3ryww3x7wq"))))
3820 (build-system gnu-build-system)
3821 (native-inputs `(("gettext" ,gettext-minimal)))
3822 (inputs `(("libx11" ,libx11)
3827 `(#:tests? #f ;no "check" target
3828 #:make-flags '("LOCALEDIR=$DATAROOTDIR/locale")))
3829 (synopsis "Real-time fractal zoomer")
3830 (description "GNU XaoS is a graphical program that generates fractal
3831 patterns and allows you to zoom in and out of them infinitely in a fluid,
3832 continuous manner. It also includes tutorials that help to explain how fractals
3833 are built. It can generate many different fractal types such as the Mandelbrot
3835 (home-page "https://www.gnu.org/software/xaos/")
3836 (license license:gpl2+)))
3838 (define-public hypre
3846 (url "https://github.com/LLNL/hypre.git")
3847 (commit (string-append "v" version))))
3848 (file-name (git-file-name name version))
3850 (base32 "1lvh4ybqkriyqfg2zmic6mrg1981qv1i9vry1fdgsabn81hb71g4"))
3851 (modules '((guix build utils)))
3854 ;; Remove use of __DATE__ and __TIME__ for reproducibility;
3855 ;; substitute the release date.
3856 (substitute* "src/utilities/HYPRE_utilities.h"
3857 (("Date Compiled: .*$")
3858 "Date Compiled: Oct 19 2018 15:23:00 +0000\"\n"))
3860 (build-system gnu-build-system)
3861 (outputs '("out" ; 6.1 MiB of headers and libraries
3862 "doc")) ; 4.8 MiB of documentation
3866 ("perl" ,perl) ; needed to run 'ppmquant' during tests
3867 ("texlive" ,(texlive-union (list texlive-xypic
3869 texlive-latex-hyperref
3871 ("ghostscript" ,ghostscript)))
3873 `(("blas" ,openblas)
3874 ("lapack" ,lapack)))
3876 `(#:modules ((srfi srfi-1)
3877 ,@%gnu-build-system-modules)
3878 #:configure-flags '("--enable-shared"
3886 (modify-phases %standard-phases
3887 (add-before 'build 'set-HOME
3889 ;; FIXME: texlive-union does not find the built
3890 ;; metafonts, so it tries to generate them in HOME.
3891 (setenv "HOME" "/tmp")
3893 (add-before 'configure 'chdir-src
3894 (lambda _ (chdir "src")))
3896 (lambda* (#:key build target configure-flags
3897 #:allow-other-keys #:rest args)
3898 (let* ((configure (assoc-ref %standard-phases 'configure)))
3901 (list #:configure-flags
3902 (cons (string-append
3903 "--host=" (or target build))
3904 configure-flags)))))))
3905 (add-after 'build 'build-docs
3907 (invoke "make" "-Cdocs" "pdf" "html")))
3910 (setenv "LD_LIBRARY_PATH" (string-append (getcwd) "/hypre/lib"))
3911 (setenv "PATH" (string-append "." ":" (getenv "PATH")))
3912 (invoke "make" "check" "CHECKRUN=")
3913 (for-each (lambda (filename)
3914 (let ((size (stat:size (stat filename))))
3915 (when (positive? size)
3916 (error (format #f "~a size ~d; error indication~%"
3918 (find-files "test" ".*\\.err$"))
3920 (add-after 'install 'install-docs
3921 (lambda* (#:key outputs #:allow-other-keys)
3922 ;; Custom install because docs/Makefile doesn't honor ${docdir}.
3923 (let* ((doc (assoc-ref outputs "doc"))
3924 (docdir (string-append doc "/share/doc/hypre-" ,version)))
3925 (with-directory-excursion "docs"
3926 (for-each (lambda (base)
3927 (install-file (string-append base ".pdf") docdir)
3928 (copy-recursively base docdir)) ; html docs
3929 '("HYPRE_usr_manual"
3930 "HYPRE_ref_manual")))
3932 (home-page "http://www.llnl.gov/casc/hypre/")
3933 (synopsis "Library of solvers and preconditioners for linear equations")
3935 "HYPRE is a software library of high performance preconditioners and
3936 solvers for the solution of large, sparse linear systems of equations. It
3937 features multigrid solvers for both structured and unstructured grid
3939 (license license:lgpl2.1)))
3941 (define-public hypre-openmpi
3942 (package (inherit hypre)
3943 (name "hypre-openmpi")
3946 ,@(package-inputs hypre)))
3948 (substitute-keyword-arguments (package-arguments hypre)
3949 ((#:configure-flags flags)
3951 ,@(delete "--without-MPI" ,flags)))
3953 `(modify-phases ,phases
3954 (add-before 'check 'mpi-setup
3955 ,%openmpi-setup)))))
3956 (synopsis "Parallel solvers and preconditioners for linear equations")
3958 "HYPRE is a software library of high performance preconditioners and
3959 solvers for the solution of large, sparse linear systems of equations on
3960 parallel computers. It features parallel multigrid solvers for both
3961 structured and unstructured grid problems.")))
3963 (define-public matio
3970 (uri (string-append "mirror://sourceforge/matio/matio/" version "/"
3971 "matio-" version ".tar.gz"))
3974 "0y2qymgxank8wdiwc68ap8bxdzrhvyw86i29yh3xgn4z1njfd9ir"))))
3975 (build-system gnu-build-system)
3979 (home-page "http://matio.sourceforge.net/")
3980 (synopsis "Library for reading and writing MAT files")
3981 (description "Matio is a library for reading and writing MAT files. It
3982 supports compressed MAT files, as well as newer (version 7.3) MAT files.")
3983 (license license:bsd-2)))
3990 (origin (method url-fetch)
3991 (uri (string-append "https://github.com/VcDevel/Vc/releases/"
3992 "download/" version "/Vc-" version ".tar.gz"))
3995 "1zmlpn32jzb38smp3j834llmbix3whsrbw0h397qxysbw792kih8"))))
3996 (build-system cmake-build-system)
3999 '("-DBUILD_TESTING=ON"
4000 ;; By default, Vc will optimize for the CPU of the build machine.
4001 ;; Setting this to "none" makes it create portable binaries. See
4002 ;; "cmake/OptimizeForArchitecture.cmake".
4003 "-DTARGET_ARCHITECTURE=none")))
4004 (synopsis "SIMD vector classes for C++")
4005 (description "Vc provides portable, zero-overhead C++ types for explicitly
4006 data-parallel programming. It is a library designed to ease explicit
4007 vectorization of C++ code. Its types enable explicitly stating data-parallel
4008 operations on multiple values. The parallelism is therefore added via the type
4009 system. Vc has an intuitive API and provides portability between different
4010 compilers and compiler versions as well as portability between different vector
4011 instruction sets. Thus, an application written with Vc can be compiled for:
4014 @item SSE2 up to SSE4.2 or SSE4a
4017 @item NEON (in development)
4018 @item NVIDIA GPUs / CUDA (in development)
4020 (home-page "https://github.com/VcDevel/Vc")
4021 ;; "No support_???.cpp file exists for this architecture."
4022 (supported-systems '("x86_64-linux" "i686-linux"))
4023 (license license:bsd-3)))
4025 (define-public reducelcs
4026 ;; This is the last commit which is available upstream, no
4027 ;; release happened since 2010.
4028 (let ((commit "474f88deb968061abe8cf11c959e02319b8ae5c0")
4032 (version (string-append "1.0-" revision "." (string-take commit 7)))
4037 (url "https://github.com/gdv/Reduce-Expand-for-LCS")
4039 (file-name (string-append name "-" version "-checkout"))
4042 "1rllzcfwc042c336mhq262a8ha90x6afq30kvk60r7i4761j4yjm"))))
4043 (build-system gnu-build-system)
4045 `(("openlibm" ,openlibm)))
4047 `(#:tests? #f ; no tests
4049 (modify-phases %standard-phases
4050 (delete 'configure) ; No configure script exists.
4051 (replace 'install ; No install phase exists.
4052 (lambda* (#:key outputs #:allow-other-keys)
4053 (let* ((out (assoc-ref outputs "out"))
4054 (bin (string-append out "/bin")))
4055 (install-file "Approximation" bin)
4056 (install-file "CollectResults" bin)
4057 (install-file "GenerateInstances" bin)
4059 (synopsis "Approximate Longest Commons Subsequence computation tool")
4061 "@code{reduceLCS} is an implementation of the Reduce-Expand
4062 algorithm for LCS. It is a fast program to compute the approximate
4063 Longest Commons Subsequence of a set of strings.")
4064 (home-page "https://github.com/gdv/Reduce-Expand-for-LCS")
4065 (license license:gpl3+))))
4067 (define-public jacal
4074 "http://groups.csail.mit.edu/mac/ftpdir/scm/jacal-"
4077 "055zrn12a1dmy0dqkwrkq3fklbhg3yir6vn0lacp4mvbg8573a3q"))
4078 (patches (search-patches "jacal-fix-texinfo.patch"))))
4079 (build-system gnu-build-system)
4082 (modify-phases %standard-phases
4083 (add-before 'build 'pre-build
4084 ;; Don't use upstream's script - it really doesn't fit into
4085 ;; Guix's functional paradigm.
4086 (lambda* (#:key inputs outputs #:allow-other-keys)
4087 (substitute* "Makefile"
4088 (("^install: install-script") "install: "))))
4089 (add-after 'install 'post-install
4090 ;; Instead, we provide our own simplified script.
4091 (lambda* (#:key inputs outputs #:allow-other-keys)
4092 (let ((wrapper (string-append (assoc-ref outputs "out")
4094 (format (open wrapper (logior O_WRONLY O_CREAT))
4095 (string-append "#!~a\nexec ~a/bin/scm -ip1 "
4096 "-e '(slib:load \"~a/lib/jacal/math\") "
4099 (assoc-ref inputs "scm")
4100 (assoc-ref outputs "out"))
4101 (chmod wrapper #o555))))
4103 (lambda* (#:key outputs #:allow-other-keys)
4104 (invoke "./configure"
4105 (string-append "--prefix="
4106 (assoc-ref outputs "out"))))))))
4107 (inputs `(("scm" ,scm)))
4108 (native-inputs `(("unzip" ,unzip)
4109 ("texinfo" ,texinfo)))
4110 (synopsis "Symbolic mathematics system")
4111 (description "GNU JACAL is an interactive symbolic mathematics program based on
4112 Scheme. It manipulate and simplify a range of mathematical expressions such
4113 as equations, scalars, vectors, and matrices.")
4114 (home-page "https://www.gnu.org/software/jacal/")
4115 (license license:gpl3+)))
4121 (home-page "https://github.com/Z3Prover/z3")
4124 (uri (git-reference (url home-page)
4125 (commit (string-append "z3-" version))))
4126 (file-name (git-file-name name version))
4129 "1sywcqj5y8yp28m4cdvzsgw74kd6zr1s3y1x17ky8pr9prvpvl6x"))))
4130 (build-system gnu-build-system)
4133 (modify-phases %standard-phases
4134 (add-after 'unpack 'fix-compatability
4135 ;; Versions after 4.8.3 have immintrin.h IFDEFed for Windows only.
4137 (substitute* "src/util/mpz.cpp"
4138 (("#include <immintrin.h>") ""))
4140 (add-before 'configure 'bootstrap
4142 (invoke "python" "scripts/mk_make.py")))
4143 ;; work around gnu-build-system's setting --enable-fast-install
4144 ;; (z3's `configure' is a wrapper around the above python file,
4145 ;; which fails when passed --enable-fast-install)
4147 (lambda* (#:key inputs outputs #:allow-other-keys)
4148 (invoke "./configure"
4149 (string-append "--prefix=" (assoc-ref outputs "out")))))
4150 (add-after 'configure 'change-directory
4154 (add-before 'check 'make-test-z3
4156 ;; Build the test suite executable.
4157 (invoke "make" "test-z3" "-j"
4158 (number->string (parallel-job-count)))))
4161 ;; Run all the tests that don't require arguments.
4162 (invoke "./test-z3" "/a"))))))
4165 ("python" ,python-wrapper)))
4166 (synopsis "Theorem prover")
4167 (description "Z3 is a theorem prover and @dfn{satisfiability modulo
4168 theories} (SMT) solver. It provides a C/C++ API, as well as Python bindings.")
4169 (license license:expat)))
4174 (version "2018.11.001")
4177 (uri (string-append "http://elpa.mpcdf.mpg.de/html/Releases/"
4178 version "/elpa-" version ".tar.gz"))
4181 "05hv3v5i6xmziaizw350ff72y1c3k662r85fm3xfdrkclj5zw9yc"))))
4182 (build-system gnu-build-system)
4184 `(("fortran" ,gfortran)
4185 ("perl" ,perl))) ;for configure and deps
4187 `(("blas" ,openblas)))
4192 ;; ELPA unfortunately does not support runtime dispatch, so we can
4193 ;; only enable the "generic" kernels. See the "Cross compilation"
4194 ;; section of INSTALL.md.
4196 "--disable-sse" "--disable-sse-assembly" ;Require SSE3
4197 "--disable-avx" "--disable-avx2" "--disable-avx512"
4198 ,(string-append "CFLAGS=-O3 "
4199 "-funsafe-loop-optimizations -funsafe-math-optimizations "
4200 "-ftree-vect-loop-version -ftree-vectorize "
4201 ,(let ((system (or (%current-target-system)
4202 (%current-system))))
4204 ((or (string-prefix? "x86_64" system)
4205 (string-prefix? "i686" system))
4208 #:parallel-tests? #f ;tests are multi-threaded, via BLAS
4210 (modify-phases %standard-phases
4211 (add-before 'configure 'patch-header-generation
4213 (substitute* "configure"
4214 (("^ *make.*top_srcdir=\"\\$srcdir\"" &)
4215 (string-append & " CPP=\"$CPP\"")))
4217 (add-before 'check 'setup-tests
4219 ;; Decrease test time and RAM use by computing fewer eigenvalues.
4220 ;; The flags are (MATRIX-SIZE, EIGENVALUES, BLOCK-SIZE), where
4221 ;; the default is (500, 250, 16) for C tests and (5000, 150, 16)
4222 ;; for Fortran. This also causes several tests to pass that
4223 ;; otherwise would otherwise fail with matrix size 5000; possibly
4224 ;; due to floating point tolerances that are too tight.
4225 (setenv "TEST_FLAGS" "1500 50 16") ;from elpa.spec
4226 (setenv "OMP_NUM_THREADS" (number->string (parallel-job-count)))
4227 (substitute* "Makefile"
4228 ;; Test scripts are generated, patch the shebang
4229 (("#!/bin/bash") (string-append "#!" (which "sh"))))
4231 (home-page "http://elpa.mpcdf.mpg.de")
4232 (synopsis "Eigenvalue solvers for symmetric matrices")
4234 "The ELPA library provides efficient and scalable direct eigensolvers for
4235 symmetric matrices.")
4236 (license license:lgpl3)))
4238 (define-public elpa-openmpi
4239 (package (inherit elpa)
4240 (name "elpa-openmpi")
4243 ("scalapack" ,scalapack)
4244 ,@(package-inputs elpa)))
4246 (substitute-keyword-arguments (package-arguments elpa)
4247 ((#:configure-flags cf '())
4248 `(cons "--with-mpi=yes" (delete "--with-mpi=no" ,cf)))
4249 ((#:phases phases '%standard-phases)
4250 `(modify-phases ,phases
4251 (add-before 'check 'mpi-setup
4253 ;; Tests use 2 mpi tasks by default, use our remaining build
4254 ;; cores as OpenMP threads.
4255 (setenv "OMP_NUM_THREADS" (number->string
4256 (max (quotient (parallel-job-count) 2)
4258 (,%openmpi-setup)))))))
4259 (synopsis "Eigenvalue solvers for symmetric matrices (with MPI support)")))
4261 (define-public elemental
4268 (url "https://github.com/elemental/Elemental.git")
4269 (commit (string-append "v" version))))
4270 (file-name (git-file-name name version))
4273 "1687xpjjzig27y2pnqv7hv09smpijyfdpz7qjgmcxf4shfajlfkc"))))
4274 (build-system cmake-build-system)
4275 (home-page "http://libelemental.org")
4277 `(("gfortran" ,gfortran)))
4279 `(("blas" ,openblas)
4280 ("gfortran:lib" ,gfortran "lib")
4289 `(#:build-type "Release" ;default RelWithDebInfo not supported
4290 #:configure-flags `("-DEL_DISABLE_PARMETIS:BOOL=YES"
4291 "-DEL_AVOID_COMPLEX_MPI:BOOL=NO"
4292 "-DEL_CACHE_WARNINGS:BOOL=YES"
4293 "-DEL_TESTS:BOOL=YES"
4294 "-DCMAKE_INSTALL_LIBDIR=lib"
4295 "-DGFORTRAN_LIB=gfortran")
4296 #:phases (modify-phases %standard-phases
4297 (add-before 'check 'mpi-setup
4299 (add-before 'check 'setup-tests
4301 ;; Parallelism is done at the MPI layer.
4302 (setenv "OMP_NUM_THREADS" "1")
4304 (add-after 'install 'remove-tests
4305 (lambda* (#:key outputs #:allow-other-keys)
4306 ;; Tests are installed, with no easy configuration
4307 ;; switch to prevent this, so delete them.
4308 (delete-file-recursively
4309 (string-append (assoc-ref outputs "out") "/bin"))
4311 (synopsis "Dense and sparse-direct linear algebra and optimization")
4312 (description "Elemental is a modern C++ library for distributed-memory
4313 dense and sparse-direct linear algebra, conic optimization, and lattice
4315 (license license:bsd-2)))
4317 (define-public mcrl2
4320 (version "201908.0")
4323 (uri (string-append "http://www.mcrl2.org/download/devel/mcrl2-"
4328 "1i4xgl2d5fgiz1mwi50cyfkrrcpm8nxfayfjgmhq7chs58wlhfsz"))))
4333 ("qtbase" ,qtbase)))
4334 (build-system cmake-build-system)
4335 (synopsis "Toolset for the mCRL2 formal specification language")
4337 "@dfn{mCRL2} (micro Common Representation Language 2) is a formal
4338 specification language for describing concurrent discrete event systems. Its
4339 toolset supports analysis and automatic verification, linearisation, simulation,
4340 state-space exploration and generation, and tools to optimise and analyse
4341 specifications. Also, state spaces can be manipulated, visualised and
4343 (home-page "https://mcrl2.org")
4344 (license license:boost1.0)))
4346 (define-public mcrl2-minimal
4349 (name "mcrl2-minimal")
4351 `(("boost" ,boost)))
4353 '(#:configure-flags '("-DMCRL2_ENABLE_GUI_TOOLS=OFF")))))
4355 (define-public r-subplex
4362 (uri (cran-uri "subplex" version))
4365 "10cbgbx1bgsax5z7gz6716g360xpq4mvq19cf4qqrxv02mmwz57z"))))
4366 (build-system r-build-system)
4368 `(("gfortran" ,gfortran)))
4369 (home-page "https://cran.r-project.org/web/packages/subplex")
4370 (synopsis "Unconstrained optimization using the subplex algorithm")
4371 (description "This package implements the Subplex optimization algorithm.
4372 It solves unconstrained optimization problems using a simplex method on
4373 subspaces. The method is well suited for optimizing objective functions that
4374 are noisy or are discontinuous at the solution.")
4375 (license license:gpl3+)))
4377 (define-public r-desolve
4384 (uri (cran-uri "deSolve" version))
4387 "0hkvspq0fp8j64l9zayab2l2nazazhwfgfym0jllh0xv5a12r99s"))))
4388 (properties `((upstream-name . "deSolve")))
4389 (build-system r-build-system)
4391 `(("gfortran" ,gfortran)))
4392 (home-page "https://desolve.r-forge.r-project.org/")
4393 (synopsis "Solvers for initial value problems of differential equations")
4394 (description "This package provides functions that solve initial
4395 value problems of a system of first-order ordinary differential equations (ODE),
4396 of partial differential equations (PDE), of differential algebraic equations
4397 (DAE), and of delay differential equations. The functions provide an interface
4398 to the FORTRAN functions lsoda, lsodar, lsode, lsodes of the ODEPACK collection,
4399 to the FORTRAN functions dvode and daspk and a C-implementation of solvers of
4400 the Runge-Kutta family with fixed or variable time steps. The package contains
4401 routines designed for solving ODEs resulting from 1-D, 2-D and 3-D partial
4402 differential equations (PDE) that have been converted to ODEs by numerical
4404 (license license:gpl2+)))
4406 (define-public tcalc
4413 (uri (string-append "https://sites.google.com/site/mohammedisam2000/tcalc/tcalc-"
4417 "0jq806m4dqfia85nppfm75mml9w57g0cgv4cdw9bp3zymda83s0m"))))
4418 (build-system gnu-build-system)
4419 (synopsis "The terminal calculator")
4421 "The terminal calculator is a small program to help users of the GNU/Linux
4422 terminal do calculations simply and quickly. The formula to be calculated can
4423 be fed to @command{tcalc} through the command line.")
4424 (home-page "https://sites.google.com/site/mohammedisam2000/tcalc")
4425 (license license:gpl3+)))
4427 (define-public sundials
4434 (uri (string-append "https://computation.llnl.gov/projects/sundials/download/"
4435 "sundials-" version ".tar.gz"))
4438 "090s8ymhd0g1s1d44fa73r5yi32hb4biwahhbfi327zd64yn8kd2"))))
4439 (build-system cmake-build-system)
4441 `(("python" ,python-2))) ;for tests; syntax incompatible with python 3
4443 `(("fortran" ,gfortran) ;for fcmix
4445 ("suitesparse" ,suitesparse))) ;TODO: Add hypre
4447 `(#:configure-flags `("-DEXAMPLES_ENABLE_C:BOOL=ON"
4448 "-DEXAMPLES_ENABLE_CXX:BOOL=ON"
4449 "-DEXAMPLES_ENABLE_F77:BOOL=ON"
4450 "-DEXAMPLES_ENABLE_F90:BOOL=ON"
4451 "-DEXAMPLES_INSTALL:BOOL=OFF"
4453 "-DFCMIX_ENABLE:BOOL=ON"
4455 "-DKLU_ENABLE:BOOL=ON"
4456 ,(string-append "-DKLU_INCLUDE_DIR="
4457 (assoc-ref %build-inputs "suitesparse")
4459 ,(string-append "-DKLU_LIBRARY_DIR="
4460 (assoc-ref %build-inputs "suitesparse")
4462 (home-page "https://computation.llnl.gov/projects/sundials")
4463 (synopsis "Suite of nonlinear and differential/algebraic equation solvers")
4464 (description "SUNDIALS is a family of software packages implemented with
4465 the goal of providing robust time integrators and nonlinear solvers that can
4466 easily be incorporated into existing simulation codes.")
4467 (license license:bsd-3)))
4469 (define-public sundials-openmpi
4470 (package (inherit sundials)
4471 (name "sundials-openmpi")
4474 ("petsc" ,petsc-openmpi) ;support in SUNDIALS requires MPI
4475 ,@(package-inputs sundials)))
4477 (substitute-keyword-arguments (package-arguments sundials)
4478 ((#:configure-flags flags '())
4479 `(cons* "-DMPI_ENABLE:BOOL=ON"
4480 "-DPETSC_ENABLE:BOOL=ON"
4481 (string-append "-DPETSC_INCLUDE_DIR="
4482 (assoc-ref %build-inputs "petsc")
4484 (string-append "-DPETSC_LIBRARY_DIR="
4485 (assoc-ref %build-inputs "petsc")
4488 ((#:phases phases '%standard-phases)
4489 `(modify-phases ,phases
4490 (add-before 'check 'mpi-setup
4491 ,%openmpi-setup)))))
4492 (synopsis "SUNDIALS with OpenMPI support")))
4494 (define-public combinatorial-blas
4496 (name "combinatorial-blas")
4501 (uri (string-append "http://eecs.berkeley.edu/~aydin/CombBLAS_FILES/"
4503 (match (string-split version #\.)
4504 ((major minor patch)
4505 (string-append major minor "_" patch))) ;e.g. "16_2"
4509 "1a9wbgdqyy1whhfc0yl0yqkax3amnqa6iihhq48d063gc0jwfd9a"))
4510 (patches (search-patches "combinatorial-blas-awpm.patch"
4511 "combinatorial-blas-io-fix.patch"))))
4512 (build-system cmake-build-system)
4515 ("test-data" ,(origin
4517 (uri (string-append "https://people.eecs.berkeley.edu/~aydin/"
4518 "CombBLAS_FILES/testdata_combblas1.6.1.tgz"))
4521 "01y2781cy3fww7znmidrp85mf8zx0c905w5vzvk1mgrmhhynim87"))))))
4523 `(#:configure-flags '("-DBUILD_SHARED_LIBS:BOOL=YES"
4524 "-DCMAKE_CXX_FLAGS=-DUSE_FUNNEL")
4525 #:parallel-tests? #f ;tests use 'mpiexec -n4'
4527 (modify-phases %standard-phases
4528 (add-before 'check 'mpi-setup
4530 (add-before 'check 'test-setup
4531 (lambda* (#:key inputs #:allow-other-keys)
4532 (setenv "OMP_NUM_THREADS" "2")
4533 (invoke "tar" "xf" (assoc-ref inputs "test-data")))))))
4534 (home-page "https://people.eecs.berkeley.edu/~aydin/CombBLAS/html/")
4535 (synopsis "Linear algebra primitives for graph analytics")
4536 (description "The Combinatorial BLAS (CombBLAS) is an extensible
4537 distributed-memory parallel graph library offering a small but powerful set of
4538 linear algebra primitives specifically targeting graph analytics.")
4540 license:gpl2+ ;include/psort/(funnel|sort)*.h
4541 license:x11 ;usort and psort
4542 license:bsd-3)))) ;CombBLAS and MersenneTwister.h
4544 (define-public dune-common
4546 (name "dune-common")
4551 (uri (string-append "https://dune-project.org/download/"
4552 version "/dune-common-" version ".tar.gz"))
4555 "019wcr1qf7jwyxx1y5y290wdlglylskvbb2m01ljkzcza2xnlmhw"))))
4556 (build-system cmake-build-system)
4559 (modify-phases %standard-phases
4560 (add-after 'build 'build-tests
4561 (lambda* (#:key make-flags #:allow-other-keys)
4562 (apply invoke "make" "build_tests" make-flags)))
4563 ;; These tests fail because they require a fully functional MPI
4565 (add-after 'unpack 'disable-failing-tests
4568 (string-append "--exclude-regex '("
4572 "remoteindicestest-mpi-2"
4575 "variablesizecommunicatortest"
4576 "variablesizecommunicatortest-mpi-2"
4577 "arithmetictestsuitetest"
4578 "assertandreturntest"
4579 "assertandreturntest_ndebug"
4582 "mpicollectivecommunication"
4583 "mpicollectivecommunication-mpi-2"
4585 "mpiguardtest-mpi-2"
4587 "mpihelpertest-mpi-2"
4589 "mpihelpertest2-mpi-2")
4596 ("openmpi" ,openmpi)
4597 ("openblas" ,openblas)
4599 ("superlu" ,superlu)))
4601 `(("gfortran" ,gfortran)
4602 ("pkg-config" ,pkg-config)))
4603 (home-page "https://dune-project.org/")
4604 (synopsis "Distributed and Unified Numerics Environment")
4605 (description "DUNE, the Distributed and Unified Numerics Environment is a
4606 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
4607 grid-based methods. It supports the easy implementation of methods like
4608 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
4609 Differences} (FD).")
4610 ;; GPL version 2 with "runtime exception" to make it behave like LGPLv2.
4611 (license license:gpl2)))
4613 (define-public dune-geometry
4615 (name "dune-geometry")
4620 (uri (string-append "https://dune-project.org/download/"
4621 version "/dune-geometry-" version ".tar.gz"))
4624 "0hlaaxjyv9j05blasvb67sy02hd0w4g9znf68gdh3l731dd1aqbn"))))
4625 (build-system cmake-build-system)
4628 (modify-phases %standard-phases
4629 (add-after 'build 'build-tests
4630 (lambda* (#:key make-flags #:allow-other-keys)
4631 (apply invoke "make" "build_tests" make-flags))))))
4633 `(("dune-common" ,dune-common)
4634 ("openmpi" ,openmpi)
4636 ("openblas" ,openblas)
4638 ("python" ,python)))
4640 `(("gfortran" ,gfortran)
4641 ("pkg-config" ,pkg-config)))
4642 (home-page "https://dune-project.org/")
4643 (synopsis "Distributed and Unified Numerics Environment")
4644 (description "DUNE, the Distributed and Unified Numerics Environment is a
4645 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
4646 grid-based methods. It supports the easy implementation of methods like
4647 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
4650 This package contains the basic DUNE geometry classes.")
4651 ;; GPL version 2 with "runtime exception"
4652 (license license:gpl2)))
4654 (define-public dune-grid
4661 (uri (string-append "https://dune-project.org/download/"
4662 version "/dune-grid-" version ".tar.gz"))
4665 "1jp4vscm9yb9xg0lh7apzccfkhvgbnk652yahigmh3cvzpl4acd0"))))
4666 (build-system cmake-build-system)
4669 (modify-phases %standard-phases
4670 (add-after 'build 'build-tests
4671 (lambda* (#:key make-flags #:allow-other-keys)
4672 (apply invoke "make" "build_tests" make-flags)))
4673 ;; These tests fail because they require a fully functional MPI
4675 (add-after 'unpack 'disable-failing-tests
4678 (string-append "--exclude-regex '("
4682 "conformvolumevtktest"
4684 "nonconformboundaryvtktest"
4685 "subsamplingvtktest"
4691 "test-dgf-yasp-offset"
4693 "test-geogrid-yaspgrid"
4696 "testiteratorranges"
4697 "test-hierarchicsearch"
4698 "test-parallel-ug-mpi-2"
4699 "test-yaspgrid-backuprestore-equidistant"
4700 "test-yaspgrid-backuprestore-equidistant-mpi-2"
4701 "test-yaspgrid-backuprestore-equidistantoffset"
4702 "test-yaspgrid-backuprestore-equidistantoffset-mpi-2"
4703 "test-yaspgrid-backuprestore-tensor"
4704 "test-yaspgrid-backuprestore-tensor-mpi-2"
4705 "test-yaspgrid-tensorgridfactory"
4706 "test-yaspgrid-tensorgridfactory-mpi-2"
4707 "test-yaspgrid-yaspfactory-1d"
4708 "test-yaspgrid-yaspfactory-1d-mpi-2"
4709 "test-yaspgrid-yaspfactory-2d"
4710 "test-yaspgrid-yaspfactory-2d-mpi-2"
4711 "test-yaspgrid-yaspfactory-3d"
4712 "test-yaspgrid-yaspfactory-3d-mpi-2"
4713 "globalindexsettest"
4714 "persistentcontainertest"
4715 "structuredgridfactorytest"
4716 "tensorgridfactorytest"
4722 `(("dune-common" ,dune-common)
4723 ("dune-geometry" ,dune-geometry)
4726 ("openblas" ,openblas)
4727 ("openmpi" ,openmpi)
4728 ("python" ,python)))
4730 `(("gfortran" ,gfortran)
4731 ("pkg-config" ,pkg-config)))
4732 (home-page "https://dune-project.org/")
4733 (synopsis "Distributed and Unified Numerics Environment")
4734 (description "DUNE, the Distributed and Unified Numerics Environment is a
4735 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
4736 grid-based methods. It supports the easy implementation of methods like
4737 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
4740 This package contains the basic DUNE grid classes.")
4741 ;; GPL version 2 with "runtime exception"
4742 (license license:gpl2)))
4744 (define-public dune-istl
4751 (uri (string-append "https://dune-project.org/download/"
4752 version "/dune-istl-" version ".tar.gz"))
4755 "0l2gyrvys5w6wsmk0ckbb7295s80b7yk7qrl7x66akv2jv1nzq2w"))))
4756 (build-system cmake-build-system)
4759 (modify-phases %standard-phases
4760 (add-after 'build 'build-tests
4761 (lambda* (#:key make-flags #:allow-other-keys)
4762 (apply invoke "make" "build_tests" make-flags)))
4763 ;; These tests fail because they require a fully functional MPI
4765 (add-after 'unpack 'disable-failing-tests
4768 (string-append "--exclude-regex '("
4774 "pamg_comm_repart_test"
4782 `(("dune-common" ,dune-common)
4783 ("openmpi" ,openmpi)
4786 ("superlu" ,superlu)
4787 ("openblas" ,openblas)
4789 ("python" ,python)))
4791 `(("gfortran" ,gfortran)
4792 ("pkg-config" ,pkg-config)))
4793 (home-page "https://dune-project.org/")
4794 (synopsis "Distributed and Unified Numerics Environment")
4795 (description "DUNE, the Distributed and Unified Numerics Environment is a
4796 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
4799 This is the iterative solver template library which provides generic sparse
4800 matrix/vector classes and a variety of solvers based on these classes. A
4801 special feature is the use of templates to exploit the recursive block
4802 structure of finite element matrices at compile time. Available solvers
4803 include Krylov methods, (block-) incomplete decompositions and
4804 aggregation-based algebraic multigrid.")
4805 ;; GPL version 2 with "runtime exception"
4806 (license license:gpl2)))
4808 (define-public dune-localfunctions
4810 (name "dune-localfunctions")
4815 (uri (string-append "https://dune-project.org/download/"
4816 version "/dune-localfunctions-" version ".tar.gz"))
4819 "19c6zjinwwpy8jh4v4prhphyd438rapd4x80fj93apmwgw04nrhl"))))
4820 (build-system cmake-build-system)
4823 (modify-phases %standard-phases
4824 (add-after 'build 'build-tests
4825 (lambda* (#:key make-flags #:allow-other-keys)
4826 (apply invoke "make" "build_tests" make-flags))))))
4828 `(("dune-common" ,dune-common)
4829 ("dune-geometry" ,dune-geometry)
4830 ("openmpi" ,openmpi)
4833 ("superlu" ,superlu)
4836 `(("gfortran" ,gfortran)
4837 ("pkg-config" ,pkg-config)))
4838 (home-page "https://dune-project.org/")
4839 (synopsis "Distributed and Unified Numerics Environment") ; TODO
4840 (description "This DUNE module provides interface and implementation for
4841 shape functions defined on the DUNE reference elements. In addition to the
4842 shape function, interpolation operators and special keys are provided which
4843 can be used to assemble global function spaces on finite-element grids.
4845 This package provides an interface and implementation for shape functions
4846 defined on the DUNE reference elements. In addition to the shape function,
4847 interpolation operators and special keys are provided which can be used to
4848 assemble global function spaces on finite-element grids.")
4849 ;; GPL version 2 with "runtime exception"
4850 (license license:gpl2)))
4852 (define-public dune-alugrid
4854 (name "dune-alugrid")
4859 (uri (string-append "https://dune-project.org/download/"
4860 version "/dune-alugrid-" version ".tar.gz"))
4863 "1l9adgyjpra8mvwm445s0lpjshnb63jag85fb2hisbjn6bm320yj"))))
4864 (build-system cmake-build-system)
4866 `(#:tests? #f ; 7 of 8 tests fail because they need a full MPI
4869 (modify-phases %standard-phases
4870 (add-after 'unpack 'patch-include
4872 (substitute* "dune/alugrid/test/test-alugrid.cc"
4873 (("doc/grids/gridfactory/testgrids")
4874 "doc/dune-grid/grids/gridfactory/testgrids"))
4876 (add-after 'build 'build-tests
4877 (lambda* (#:key inputs make-flags #:allow-other-keys)
4878 (setenv "CPLUS_INCLUDE_PATH"
4879 (string-append (assoc-ref inputs "dune-grid") "/share"))
4880 (apply invoke "make" "build_tests" make-flags))))))
4882 `(("dune-common" ,dune-common)
4883 ("dune-geometry" ,dune-geometry)
4884 ("dune-grid" ,dune-grid)
4885 ("openmpi" ,openmpi)
4888 ("openblas" ,openblas)
4890 ("superlu" ,superlu)
4894 `(("gfortran" ,gfortran)
4895 ("pkg-config" ,pkg-config)))
4896 (home-page "https://dune-project.org/")
4897 (synopsis "Distributed and Unified Numerics Environment")
4898 (description "ALUGrid is an adaptive, loadbalancing, unstructured
4899 implementation of the DUNE grid interface supporting either simplices or
4901 (license license:gpl2+)))
4903 (define-public dune-typetree
4905 (name "dune-typetree")
4911 (url "https://gitlab.dune-project.org/staging/dune-typetree.git")
4912 (commit (string-append "v" version))))
4913 (file-name (git-file-name name version))
4916 "0mnv6w2f22lz3j4bdpdjq55vjm8xxfx9v4vvhg9bd36xpsbjpjp9"))))
4917 (build-system cmake-build-system)
4920 (modify-phases %standard-phases
4921 (add-after 'build 'build-tests
4922 (lambda* (#:key make-flags #:allow-other-keys)
4923 (apply invoke "make" "build_tests" make-flags))))))
4925 `(("dune-common" ,dune-common)
4926 ("openmpi" ,openmpi)
4928 ("openblas" ,openblas)
4931 ("superlu" ,superlu)
4934 `(("gfortran" ,gfortran)
4935 ("pkg-config" ,pkg-config)))
4936 (home-page "https://dune-project.org/")
4937 (synopsis "Distributed and Unified Numerics Environment")
4938 (description "TypeTree is a template library for constructing and
4939 operating on statically typed trees of objects.")
4940 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
4941 (license (list license:lgpl3+ license:gpl2))))
4943 (define-public dune-functions
4945 (name "dune-functions")
4951 (url "https://gitlab.dune-project.org/staging/dune-functions.git")
4952 (commit (string-append "v" version))))
4953 (file-name (git-file-name name version))
4956 "1an8gb477n8j0kzpbrv7nr1snh8pxip0gsxq6w63jc83gg3dj200"))))
4957 (build-system cmake-build-system)
4958 (arguments `(#:tests? #f)) ; FIXME: tests require dune-uugrid
4960 `(("dune-common" ,dune-common)
4961 ("dune-istl" ,dune-istl)
4962 ("dune-localfunctions" ,dune-localfunctions)
4963 ("dune-grid" ,dune-grid)
4964 ("dune-geometry" ,dune-geometry)
4965 ("dune-typetree" ,dune-typetree)
4966 ("openmpi" ,openmpi)
4967 ("openblas" ,openblas)
4970 ("superlu" ,superlu)
4973 `(("gfortran" ,gfortran)
4974 ("pkg-config" ,pkg-config)))
4975 (home-page "https://dune-project.org/")
4976 (synopsis "Distributed and Unified Numerics Environment")
4977 (description "The dune-functions module provides an abstraction layer for
4978 global finite element functions. Its two main concepts are functions
4979 implemented as callable objects, and bases of finite element spaces.")
4980 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
4981 (license (list license:lgpl3+ license:gpl2))))
4983 (define-public dune-pdelab
4985 (name "dune-pdelab")
4986 (version "2.6.0-rc1")
4991 (url "https://gitlab.dune-project.org/pdelab/dune-pdelab")
4992 (commit (string-append "v" version))))
4993 (file-name (git-file-name name version))
4996 "07g0s9448z65vjrq88g5rv3340iifil85k170n8kbqchsvi4ny5v"))))
4997 (build-system cmake-build-system)
4998 (arguments '(#:tests? #f)) ; XXX: the tests cannot be compiled
5000 `(("dune-common" ,dune-common)
5001 ("dune-istl" ,dune-istl)
5002 ("dune-localfunctions" ,dune-localfunctions)
5003 ("dune-geometry" ,dune-geometry)
5004 ("dune-grid" ,dune-grid)
5005 ("dune-typetree" ,dune-typetree)
5006 ("dune-functions" ,dune-functions)
5007 ("openmpi" ,openmpi)
5009 ("openblas" ,openblas)
5013 ("superlu" ,superlu)
5016 `(("gfortran" ,gfortran)
5017 ("pkg-config" ,pkg-config)))
5018 (home-page "https://dune-project.org/")
5019 (synopsis "Differential equations solver toolbox")
5020 (description "PDELab is a partial differential equations solver toolbox
5021 built on top of DUNE, the Distributed and Unified Numerics Environment.")
5022 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
5023 (license (list license:lgpl3+ license:gpl2))))
5025 (define-public mlucas
5033 "https://mersenneforum.org/mayer/src/C/mlucas_v" version ".txz"))
5035 (base32 "0h4xj6pyyac79ka5ibqjilfa3s9j3yxnzgpwc57b54kfh2bj3447"))))
5036 (build-system gnu-build-system)
5038 `(("python2" ,python-2)))
5040 `(#:tests? #f ; no tests
5042 (modify-phases %standard-phases
5046 (call-with-output-file "Makefile"
5048 (format port "CC = gcc
5049 CFLAGS = -O3 ~a -DUSE_THREADS
5050 LDLIBS = -lm -lpthread -lrt
5051 Mlucas: $(addsuffix .o,$(basename $(wildcard *.c)))
5053 ,(let ((system (or (%current-target-system)
5054 (%current-system))))
5056 ((string-prefix? "x86_64" system) "-DUSE_SSE2")
5060 (lambda* (#:key outputs #:allow-other-keys)
5061 (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
5062 (install-file "Mlucas" bin)
5063 (install-file "primenet.py" bin))
5065 (home-page "https://www.mersenne.org")
5066 (synopsis "Great Internet Mersenne Prime Search (GIMPS) distributed computing client")
5067 (description "Mlucas performs Lucas-Lehmer primality testing of Mersenne
5068 numbers in search of a world-record prime. You may use it to test any
5069 suitable number as you wish, but it is preferable that you do so in a
5070 coordinated fashion, as part of the Great Internet Mersenne Prime
5071 Search (GIMPS). Mlucas also includes a simple Python script for assignment
5072 management via the GIMPS project's Primenet server.")
5073 (license license:gpl2+)))
5075 (define-public nauty
5082 "https://pallini.di.uniroma1.it/"
5083 "nauty" (string-join (string-split version #\.) "")
5087 "05z6mk7c31j70md83396cdjmvzzip1hqb88pfszzc6k4gy8h3m2y"))))
5088 (build-system gnu-build-system)
5089 (outputs '("out" "lib"))
5091 `(#:test-target "checks"
5093 (modify-phases %standard-phases
5094 ;; Default make target does not build all available
5095 ;; executables. Create them now.
5096 (add-after 'build 'build-extra-programs
5098 (for-each (lambda (target) (invoke "make" target))
5099 '("blisstog" "bliss2dre" "checks6" "sumlines"))
5101 ;; Upstream does not provide any install target.
5103 (lambda* (#:key outputs #:allow-other-keys)
5104 (let* ((out (assoc-ref outputs "out"))
5105 (lib-output (assoc-ref outputs "lib"))
5106 (bin (string-append out "/bin"))
5107 (doc (string-append out "/share/doc/nauty/"))
5108 (include (string-append lib-output "/include/nauty"))
5109 (lib (string-append lib-output "/lib/nauty")))
5110 (for-each (lambda (f) (install-file f bin))
5111 '("dreadnaut" "NRswitchg" "addedgeg" "amtog" "biplabg"
5112 "blisstog" "bliss2dre" "catg" "checks6" "complg"
5113 "converseg" "copyg" "countg" "cubhamg" "deledgeg"
5114 "delptg" "directg" "dretodot" "dretog" "genbg"
5115 "genbgL" "geng" "genquarticg" "genrang" "genspecialg"
5116 "gentourng" "gentreeg" "hamheuristic" "labelg"
5117 "linegraphg" "listg" "multig" "newedgeg" "pickg"
5118 "planarg" "ranlabg" "shortg" "showg" "subdivideg"
5119 "sumlines" "twohamg" "vcolg" "watercluster2"))
5120 (for-each (lambda (f) (install-file f include))
5121 (find-files "." "\\.h$"))
5122 (for-each (lambda (f) (install-file f lib))
5123 (find-files "." "\\.a$"))
5124 (for-each (lambda (f) (install-file f doc))
5125 (append '("formats.txt" "README" "schreier.txt")
5126 (find-files "." "\\.pdf$")))))))))
5128 `(("gmp" ,gmp))) ;for sumlines
5129 (home-page "https://pallini.di.uniroma1.it/")
5130 (synopsis "Library for graph automorphisms")
5131 (description "@code{nauty} (No AUTomorphisms, Yes?) is a set of
5132 procedures for computing automorphism groups of graphs and digraphs.
5134 @code{nauty} computes graph information in the form of a set of
5135 generators, the size of the group, and the orbits of the group; it can
5136 also produce a canonical label. The @code{nauty} suite is written in
5137 C and comes with a command-line interface, a collection of
5138 command-line tools, and an Application Programming Interface (API).
5140 This package provides the static libraries required to run programs
5141 compiled against the nauty library.")
5142 (license license:asl2.0)))
5151 (uri (string-append "https://www.bugseng.com/products/ppl/download/"
5152 "ftp/releases/" version
5153 "/ppl-" version ".tar.gz"))
5156 "1j5aji1g2vmdvc0gqz45n2ll2l2f6czca04wiyfl5g3sm3a6vhvb"))))
5157 (build-system gnu-build-system)
5163 (home-page "https://www.bugseng.com/parma-polyhedra-library")
5165 "Parma Polyhedra Library for computations with polyhedra")
5167 "The Parma Polyhedra Library (PPL) provides numerical abstractions
5168 especially targeted at applications in the field of analysis and
5169 verification of complex systems. These abstractions include convex
5170 polyhedra, defined as the intersection of a finite number of (open or
5171 closed) halfspaces, each described by a linear inequality (strict or
5172 non-strict) with rational coefficients; some special classes of polyhedra
5173 shapes that offer interesting complexity/precision tradeoffs; and grids
5174 which represent regularly spaced points that satisfy a set of linear
5175 congruence relations. The library also supports finite powersets and
5176 products of (any kind of) polyhedra and grids, a mixed integer linear
5177 programming problem solver using an exact-arithmetic version of the simplex
5178 algorithm, a parametric integer programming solver, and primitives for
5179 termination analysis via the automatic synthesis of linear ranking
5181 (license license:gpl3+)))
5183 (define-public speedcrunch
5185 (name "speedcrunch")
5191 (url "https://bitbucket.org/heldercorreia/speedcrunch.git")
5192 (commit (string-append "release-" version))))
5193 (file-name (git-file-name name version))
5196 "0vh7cd1915bjqzkdp3sk25ngy8cq624mkh8c53c5bnzk357kb0fk"))))
5197 (build-system cmake-build-system)
5198 (inputs `(("qtbase" ,qtbase)))
5199 (native-inputs `(("qttools" ,qttools)))
5202 (modify-phases %standard-phases
5203 (add-after 'unpack 'chdir-to-src
5204 (lambda _ (chdir "src") #t)))))
5205 (synopsis "High-precision scientific calculator")
5207 "SpeedCrunch is a high-precision scientific calculator. It features a
5208 syntax-highlighted scrollable display and is designed to be fully used via
5209 keyboard. Some distinctive features are auto-completion of functions and
5210 variables, a formula book, and quick insertion of constants from various
5211 fields of knowledge.")
5212 (home-page "http://speedcrunch.org/")
5213 (license license:gpl2+)))