1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2014, 2015, 2016 Andreas Enge <andreas@enge.fr>
3 ;;; Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org>
4 ;;; Copyright © 2014, 2016, 2017 John Darrington <jmd@gnu.org>
5 ;;; Copyright © 2014, 2015, 2016, 2017, 2018, 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 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 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>
35 ;;; This file is part of GNU Guix.
37 ;;; GNU Guix is free software; you can redistribute it and/or modify it
38 ;;; under the terms of the GNU General Public License as published by
39 ;;; the Free Software Foundation; either version 3 of the License, or (at
40 ;;; your option) any later version.
42 ;;; GNU Guix is distributed in the hope that it will be useful, but
43 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
44 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
45 ;;; GNU General Public License for more details.
47 ;;; You should have received a copy of the GNU General Public License
48 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
50 (define-module (gnu packages maths)
51 #:use-module (ice-9 regex)
52 #:use-module (ice-9 match)
53 #:use-module (gnu packages)
54 #:use-module ((guix licenses) #:prefix license:)
55 #:use-module (guix packages)
56 #:use-module (guix download)
57 #:use-module (guix git-download)
58 #:use-module (guix utils)
59 #:use-module ((guix build utils) #:select (alist-replace))
60 #:use-module (guix build-system cmake)
61 #:use-module (guix build-system gnu)
62 #:use-module (guix build-system python)
63 #:use-module (guix build-system r)
64 #:use-module (guix build-system ruby)
65 #:use-module (gnu packages algebra)
66 #:use-module (gnu packages audio)
67 #:use-module (gnu packages autotools)
68 #:use-module (gnu packages base)
69 #:use-module (gnu packages bison)
70 #:use-module (gnu packages boost)
71 #:use-module (gnu packages check)
72 #:use-module (gnu packages cmake)
73 #:use-module (gnu packages compression)
74 #:use-module (gnu packages curl)
75 #:use-module (gnu packages cyrus-sasl)
76 #:use-module (gnu packages documentation)
77 #:use-module (gnu packages elf)
78 #:use-module (gnu packages flex)
79 #:use-module (gnu packages fltk)
80 #:use-module (gnu packages fontutils)
81 #:use-module (gnu packages gettext)
82 #:use-module (gnu packages gcc)
83 #:use-module (gnu packages gd)
84 #:use-module (gnu packages ghostscript)
85 #:use-module (gnu packages graphviz)
86 #:use-module (gnu packages gtk)
87 #:use-module (gnu packages image)
88 #:use-module (gnu packages java)
89 #:use-module (gnu packages less)
90 #:use-module (gnu packages lisp)
91 #:use-module (gnu packages linux)
92 #:use-module (gnu packages logging)
93 #:use-module (gnu packages lua)
94 #:use-module (gnu packages gnome)
95 #:use-module (gnu packages guile)
96 #:use-module (gnu packages xorg)
97 #:use-module (gnu packages gl)
98 #:use-module (gnu packages imagemagick)
99 #:use-module (gnu packages m4)
100 #:use-module (gnu packages mpi)
101 #:use-module (gnu packages multiprecision)
102 #:use-module (gnu packages netpbm)
103 #:use-module (gnu packages pcre)
104 #:use-module (gnu packages popt)
105 #:use-module (gnu packages perl)
106 #:use-module (gnu packages pkg-config)
107 #:use-module (gnu packages pulseaudio)
108 #:use-module (gnu packages python)
109 #:use-module (gnu packages python-web)
110 #:use-module (gnu packages python-xyz)
111 #:use-module (gnu packages qt)
112 #:use-module (gnu packages readline)
113 #:use-module (gnu packages ruby)
114 #:use-module (gnu packages tbb)
115 #:use-module (gnu packages scheme)
116 #:use-module (gnu packages shells)
117 #:use-module (gnu packages tcl)
118 #:use-module (gnu packages texinfo)
119 #:use-module (gnu packages tex)
120 #:use-module (gnu packages tls)
121 #:use-module (gnu packages version-control)
122 #:use-module (gnu packages wxwidgets)
123 #:use-module (gnu packages xml)
124 #:use-module (srfi srfi-1))
132 (uri (string-append "mirror://gnu/" name "/" name "-" version ".tar.gz"))
134 "1q1887ryqdr9sn0522hc7p16kqwlxxyz5dkmma8ar2nxplhgll7q"))))
135 (build-system gnu-build-system)
136 (inputs `(("gtk+" ,gtk+)
137 ("libxml2" ,libxml2)))
138 (native-inputs `(("pkg-config" ,pkg-config)))
139 (synopsis "Natural deduction first-order logic interface")
140 (description "Aris is a program for performing logical proofs. It supports
141 propositional and predicate logic, as well as Boolean algebra and
142 arithmetical logic. In addition to its predefined inference and equivalence
143 rules, Aris also supports references to older proofs. Its use of standard
144 logical symbols and its natural deduction interface make it easy to use for
146 (license license:gpl3+)
147 (home-page "https://www.gnu.org/software/aris/")))
149 (define-public c-graph
155 (uri (string-append "mirror://gnu/c-graph/c-graph-" version
158 "092412jzxy6wdvpk96pfj499hpmaww8xllavbvlqspfpr7ips9id"))))
159 (build-system gnu-build-system)
161 `(("fortran" ,gfortran)))
162 (synopsis "Visualizing and demonstrating convolution")
164 "GNU C-Graph is a tool for demonstrating the theory of convolution.
165 Thus, it can serve as an excellent aid to students of signal and systems
166 theory in visualizing the convolution process. Rather than forcing the
167 student to write code, the program offers an intuitive interface with
168 interactive dialogs to guide them.")
169 (license license:gpl3+)
170 (home-page "https://www.gnu.org/software/c-graph/")))
179 (uri (string-append "https://github.com/stcorp/coda/releases/download/"
180 version "/coda-" version ".tar.gz"))
182 (base32 "1fbxd2afm7dshd92p10yy8dwbr9gc1h1fmnnnmr7d0c5lnw80245"))
183 (patches (search-patches "coda-use-system-libs.patch"))
184 (modules '((guix build utils)))
186 ;; Make sure we don't use the bundled software.
188 (for-each (lambda (d)
189 (delete-file-recursively (string-append "libcoda/" d)))
190 '("zlib" "pcre" "expat"))
193 `(("fortran" ,gfortran)
195 ("python-numpy" ,python-numpy)))
202 (build-system gnu-build-system)
204 '(#:configure-flags '("--with-hdf4" "--with-hdf5" "--enable-python"
205 "LIBS= -lz -lpcre -lexpat")))
206 (synopsis "A common interface to various earth observation data formats")
208 "The Common Data Access toolbox (CODA) provides a set of interfaces for
209 reading remote sensing data from earth observation data files. It consists of
210 command line applications and interfaces to the C, Fortran, Python, and Java
211 programming languages.")
212 (home-page "https://stcorp.nl/coda")
213 (license license:gpl2+)))
221 (uri (string-append "http://www.qhull.org/download/qhull-"
222 (car (string-split version #\.))
226 "0dm4b2xr3asy6w74khq2zg4gf26zsy3qf9sq7pf7lmrvbj911c3q"))))
227 (build-system cmake-build-system)
228 (synopsis "Calculate convex hulls and related structures")
230 "@code{Qhull} computes the convex hull, Delaunay triangulation, Voronoi
231 diagram, halfspace intersection about a point, furthest-site Delaunay
232 triangulation, and furthest-site Voronoi diagram. The source code runs in 2-d,
233 3-d, 4-d, and higher dimensions. @code{Qhull} implements the Quickhull
234 algorithm for computing the convex hull. It handles roundoff errors from
235 floating point arithmetic. It computes volumes, surface areas, and
236 approximations to the convex hull.
238 @code{Qhull} does not support triangulation of non-convex surfaces, mesh
239 generation of non-convex objects, medium-sized inputs in 9-D and higher, alpha
240 shapes, weighted Voronoi diagrams, Voronoi volumes, or constrained Delaunay
242 (home-page "http://qhull.org")
243 (license (license:non-copyleft "file://COPYING.txt"
244 "See COPYING in the distribution."))))
246 (define-public python-cvxopt
248 (name "python-cvxopt")
253 (url "https://github.com/cvxopt/cvxopt.git")
255 (file-name (git-file-name name version))
258 "05mnjil9palaa48xafdfh4f5pr4z7aqjr995rwl08qfyxs8y0crf"))))
259 (build-system python-build-system)
262 (modify-phases %standard-phases
263 (add-after 'unpack 'find-libraries
264 (lambda* (#:key inputs #:allow-other-keys)
265 (setenv "CVXOPT_BLAS_LIB" "openblas")
266 (setenv "CVXOPT_BUILD_FFTW" "1")
267 (setenv "CVXOPT_BUILD_GLPK" "1")
268 (setenv "CVXOPT_BUILD_GSL" "1")
275 ("openblas" ,openblas)
276 ("suitesparse" ,suitesparse)))
277 (home-page "https://www.cvxopt.org")
278 (synopsis "Python library for convex optimization")
280 "CVXOPT is a package for convex optimization based on the Python
281 programming language. Its main purpose is to make the development of software
282 for convex optimization applications straightforward by building on Python’s
283 extensive standard library and on the strengths of Python as a high-level
284 programming language.")
285 (license license:gpl3+)))
287 (define-public python2-cvxopt
288 (package-with-python2 python-cvxopt))
296 (uri (string-append "mirror://gnu/units/units-" version
299 "0y26kj349i048y4z3xrk90bvciw2j6ds3rka7r7yn3183hirr5b4"))))
300 (build-system gnu-build-system)
302 `(("readline" ,readline)
303 ("python" ,python-wrapper) ;for 'units_cur' script
304 ("python-requests" ,python-requests)))
306 `(#:phases (modify-phases %standard-phases
307 (add-after 'install 'wrap-units_cur
308 (lambda* (#:key outputs #:allow-other-keys)
309 (let* ((out (assoc-ref outputs "out"))
310 (bin (string-append out "/bin")))
311 (wrap-program (string-append bin "/units_cur")
312 `("PYTHONPATH" ":" prefix
313 ,(search-path-as-string->list (getenv "PYTHONPATH"))))
315 (synopsis "Conversion between thousands of scales")
317 "GNU Units converts numeric quantities between units of measure. It
318 can handle scale changes through adaptive usage of standard scale
319 prefixes (micro-, kilo-, etc.). It can also handle nonlinear
320 conversions such as Fahrenheit to Celsius. Its interpreter is powerful
321 enough to be used effectively as a scientific calculator.")
322 (license license:gpl3+)
323 (home-page "https://www.gnu.org/software/units/")))
325 (define-public double-conversion
327 (name "double-conversion")
329 (home-page "https://github.com/google/double-conversion")
332 (uri (git-reference (url home-page)
333 (commit (string-append "v" version))))
334 (file-name (git-file-name name version))
337 "13xwcqk2c0q8c1siw566clxcpvp0xrxvb72mra42wa3nvq9wlsv6"))))
338 (build-system cmake-build-system)
340 '(#:test-target "test"
341 #:configure-flags '("-DBUILD_SHARED_LIBS=ON"
342 "-DBUILD_TESTING=ON")))
343 (synopsis "Conversion routines for IEEE doubles")
345 "The double-conversion library provides binary-decimal and decimal-binary
346 routines for IEEE doubles. The library consists of efficient conversion
347 routines that have been extracted from the V8 JavaScript engine.")
348 (license license:bsd-3)))
350 (define-public dionysus
356 (uri (string-append "mirror://gnu/dionysus/dionysus-" version
360 "194pzs1mlsj4ww6v37qq3961h5hckm5h805cv0r14xj3g9wfx2sk"))))
361 (build-system gnu-build-system)
362 (inputs `(("tcl" ,tcl))) ;for 'tclsh'
363 (synopsis "Local search for universal constants and scientific values")
365 "GNU Dionysus is a convenient system for quickly retrieving the values of
366 mathematical constants used in science and engineering. Values can be
367 searched using a simple command-line tool, choosing from three databases:
368 universal constants, atomic numbers, and constants related to
370 (license license:gpl3+)
371 (home-page "https://www.gnu.org/software/dionysus/")))
379 (uri (string-append "mirror://gnu/gsl/gsl-"
383 "1395y9hlhqadn5g9j8q22224fds5sd92jxi9czfavjj24myasq04"))
384 (patches (search-patches "gsl-test-i686.patch"))))
385 (build-system gnu-build-system)
387 `(;; Currently there are numerous tests that fail on "exotic"
388 ;; architectures such as aarch64 and ppc64le.
389 ,@(if (string-prefix? "aarch64-linux"
390 (or (%current-target-system) (%current-system)))
393 (home-page "https://www.gnu.org/software/gsl/")
394 (synopsis "Numerical library for C and C++")
396 "The GNU Scientific Library is a library for numerical analysis in C
397 and C++. It includes a wide range of mathematical routines, with over 1000
398 functions in total. Subject areas covered by the library include:
399 differential equations, linear algebra, Fast Fourier Transforms and random
401 (license license:gpl3+)))
410 (uri (string-append "mirror://gnu/glpk/glpk-"
414 "040sfaa9jclg2nqdh83w71sv9rc1sznpnfiripjdyr48cady50a2"))))
415 (build-system gnu-build-system)
419 `(#:configure-flags '("--with-gmp")))
420 (home-page "https://www.gnu.org/software/glpk/")
421 (synopsis "GNU Linear Programming Kit, supporting the MathProg language")
423 "GLPK is a C library for solving large-scale linear programming (LP),
424 mixed integer programming (MIP), and other related problems. It supports the
425 GNU MathProg modeling language, a subset of the AMPL language, and features a
426 translator for the language. In addition to the C library, a stand-alone
427 LP/MIP solver is included in the package.")
428 (license license:gpl3+)))
437 (uri (string-append "https://github.com/4ti2/4ti2/releases/download/"
439 (string-map (lambda (c) (if (char=? c #\.) #\_ c))
441 "/4ti2-" version ".tar.gz"))
443 (base32 "0rj92x6p9m3la5gasjbj7sa569im527ffmka5y2sv1amgd3fflrh"))))
444 (build-system gnu-build-system)
446 `(("which" ,(@ (gnu packages base) which)))) ; for the tests
450 (home-page "http://www.4ti2.de/")
451 (synopsis "Mathematical tool suite for problems on linear spaces")
453 "4ti2 implements algorithms for solving algebraic, geometric and
454 combinatorial problems on linear spaces. Among others, it solves systems
455 of linear equations, computes extreme rays of polyhedral cones, solves
456 integer programming problems and computes Markov bases for statistics.")
457 (license license:gpl2+)))
459 (define-public cddlib
466 (uri (string-append "ftp://ftp.math.ethz.ch/users/fukudak/cdd/cddlib-"
467 (string-delete #\. version) ".tar.gz"))
470 "00zdgiqb91vx6gd2103h3ijij0llspsxc6zz3iw2bll39fvkl4xq"))))
471 (build-system gnu-build-system)
474 (home-page "https://www.inf.ethz.ch/personal/fukudak/cdd_home/index.html")
475 (synopsis "Library for convex hulls and extreme rays of polyhedra")
477 "The C-library cddlib implements the Double Description Method of
478 Motzkin et al. for generating all vertices (i.e. extreme points) and extreme
479 rays of a general convex polyhedron given by a system of linear inequalities
480 in arbitrary dimension. It can also be used for the converse operation of
481 computing convex hulls.")
482 (license license:gpl2+)))
484 (define-public arpack-ng
488 (home-page "https://github.com/opencollab/arpack-ng")
491 (uri (git-reference (url home-page) (commit version)))
492 (file-name (git-file-name name version))
495 "1wljl96yqxc9v8r49c37lscwkdp58kaacfb9p6s6nvpm31haax4y"))))
496 (build-system gnu-build-system)
498 `(("autoconf" ,autoconf)
499 ("automake" ,automake)
500 ("libtool" ,libtool)))
503 ("fortran" ,gfortran)))
504 (synopsis "Fortran subroutines for solving eigenvalue problems")
506 "ARPACK-NG is a collection of Fortran77 subroutines designed to solve
507 large scale eigenvalue problems.")
508 (license (license:non-copyleft "file://COPYING"
509 "See COPYING in the distribution."))))
511 (define-public arpack-ng-3.3.0
515 (name (package-name arpack-ng))
516 (home-page (package-home-page arpack-ng))
520 (uri (string-append home-page "/archive/" version ".tar.gz"))
521 (file-name (string-append name "-" version ".tar.gz"))
524 "1cz53wqzcf6czmcpfb3vb61xi0rn5bwhinczl65hpmbrglg82ndd"))))))
526 (define-public arpack-ng-openmpi
527 (package (inherit arpack-ng)
528 (name "arpack-ng-openmpi")
531 ,@(package-inputs arpack-ng)))
533 (substitute-keyword-arguments (package-arguments arpack-ng)
534 ((#:configure-flags _ '())
536 ((#:phases phases '%standard-phases)
537 `(modify-phases ,phases
538 (add-before 'check 'mpi-setup
540 (synopsis "Fortran subroutines for solving eigenvalue problems with MPI")))
542 (define-public lapack
549 (uri (string-append "http://www.netlib.org/lapack/lapack-"
553 "1j51r7n5w4k7r3lrvy7710xrpkg40wf4rqnmngfz6ck9ypckzign"))))
554 (build-system cmake-build-system)
555 (home-page "http://www.netlib.org/lapack/")
556 (inputs `(("fortran" ,gfortran)
557 ("python" ,python-2)))
559 `(#:configure-flags (list
560 "-DBUILD_SHARED_LIBS:BOOL=YES"
563 ;; Build the 'LAPACKE_clatms' functions.
564 "-DLAPACKE_WITH_TMG=ON")
566 (modify-phases %standard-phases
567 (add-before 'check 'patch-python
568 (lambda* (#:key inputs #:allow-other-keys)
569 (let ((python (assoc-ref inputs "python")))
570 (substitute* "lapack_testing.py"
571 (("/usr/bin/env python") python)))
573 (synopsis "Library for numerical linear algebra")
575 "LAPACK is a Fortran 90 library for solving the most commonly occurring
576 problems in numerical linear algebra.")
577 (license (license:non-copyleft "file://LICENSE"
578 "See LICENSE in the distribution."))))
580 (define-public scalapack
587 (uri (string-append "http://www.netlib.org/scalapack/scalapack-"
591 "0p1r61ss1fq0bs8ynnx7xq4wwsdvs32ljvwjnx6yxr8gd6pawx0c"))
592 (patches (search-patches "scalapack-blacs-mpi-deprecations.patch"))))
593 (build-system cmake-build-system)
596 ("fortran" ,gfortran)
597 ("lapack" ,lapack))) ;for testing only
599 `(#:configure-flags `("-DBUILD_SHARED_LIBS:BOOL=YES")
600 #:phases (modify-phases %standard-phases
601 (add-before 'check 'mpi-setup
603 (home-page "http://www.netlib.org/scalapack/")
604 (synopsis "Library for scalable numerical linear algebra")
606 "ScaLAPACK is a Fortran 90 library of high-performance linear algebra
607 routines on parallel distributed memory machines. ScaLAPACK solves dense and
608 banded linear systems, least squares problems, eigenvalue problems, and
609 singular value problems.")
610 (license (license:non-copyleft "file://LICENSE"
611 "See LICENSE in the distribution."))))
613 (define-public gnuplot
619 (uri (string-append "mirror://sourceforge/gnuplot/gnuplot/"
623 (base32 "1vllgap08nhvdmc03idmkdnk9cfl2bp81hps50q1pqrr640qzp9m"))))
624 (build-system gnu-build-system)
625 (inputs `(("readline" ,readline)
631 `(("pkg-config" ,pkg-config)
632 ("texlive" ,texlive-tiny)))
633 (arguments `(#:configure-flags (list (string-append
634 "--with-texdir=" %output
635 "/texmf-local/tex/latex/gnuplot"))))
636 (home-page "http://www.gnuplot.info")
637 (synopsis "Command-line driven graphing utility")
638 (description "Gnuplot is a portable command-line driven graphing
639 utility. It was originally created to allow scientists and students to
640 visualize mathematical functions and data interactively, but has grown to
641 support many non-interactive uses such as web scripting. It is also used as a
642 plotting engine by third-party applications like Octave.")
643 ;; X11 Style with the additional restriction that derived works may only be
644 ;; distributed as patches to the original.
645 (license (license:fsf-free
646 "http://gnuplot.cvs.sourceforge.net/gnuplot/gnuplot/Copyright"))))
656 (url "https://github.com/OkoSanto/GCTP.git")
657 (commit (string-append "v" version))))
658 (file-name (git-file-name name version))
660 (base32 "11wqmd443b4nksdbzp1msdws3av948nmwq1xz80w6hka3ss2aigd"))))
662 `(("fortran" ,gfortran)))
663 (build-system gnu-build-system)
664 (synopsis "General Cartographic Transformation Package (GCTP)")
666 "The General Cartographic Transformation Package (GCTP) is a system of
667 software routines designed to permit the transformation of coordinate pairs
668 from one map projection to another. The GCTP is the standard computer
669 software used by the National Mapping Division for map projection
671 (home-page "https://github.com/OkoSanto/GCTP")
672 (license license:public-domain))) ;https://www2.usgs.gov/laws/info_policies.html
681 (uri (string-append "https://support.hdfgroup.org/ftp/HDF/releases/HDF"
682 version "/src/hdf-" version ".tar.bz2"))
684 (base32 "1wz0586zh91pqb95wvr0pbh71a8rz358fdj6n2ksp85x2cis9lsm"))
685 (patches (search-patches "hdf4-architectures.patch"
686 "hdf4-reproducibility.patch"
687 "hdf4-shared-fortran.patch"))))
688 (build-system gnu-build-system)
690 `(("gfortran" ,gfortran)
695 ("libjpeg" ,libjpeg)))
697 `(#:parallel-tests? #f
698 #:configure-flags '("--enable-shared")
700 (modify-phases %standard-phases
701 ;; This is inspired by two of Debian's patches.
702 (add-before 'configure 'add-more-aarch64-support
704 (substitute* '("mfhdf/ncgen/ncgen.l"
705 "mfhdf/ncgen/ncgenyy.c"
706 "mfhdf/libsrc/netcdf.h.in")
707 (("AIX5L64") "__aarch64__"))
709 (add-before 'configure 'patchbuild
712 '("mfhdf/hdfimport/testutil.sh.in" "hdf/util/testutil.sh.in")
714 (("/bin/mkdir") "mkdir"))
715 (substitute* (find-files "." "^Makefile\\.in$")
716 (("@HDF_BUILD_XDR_TRUE@XDR_ADD = \
717 -R\\$\\(abs_top_builddir\\)/mfhdf/xdr/\\.libs") "")
718 (("@HDF_BUILD_SHARED_TRUE@AM_LDFLAGS = \
719 -R\\$\\(abs_top_builddir\\)/mfhdf/libsrc/\\.libs \
720 -R\\$\\(abs_top_builddir\\)/hdf/src/\\.libs \\$\\(XDR_ADD\\)") ""))
722 (add-after 'configure 'patch-settings
724 ;; libhdf4.settings contains the full path of the
725 ;; compilers used, and its contents are included in
726 ;; .so-files. We truncate the hashes to avoid
727 ;; unnecessary store references to those compilers:
728 (substitute* "libhdf4.settings"
729 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
730 (string-append prefix (string-take hash 10) "...")))
733 (home-page "https://www.hdfgroup.org/products/hdf4/")
735 "Library and multi-object file format for storing and managing data")
736 (description "HDF4 is a library and multi-object file format for storing
737 and managing data between machines. HDF4 is an older hierarchical data format,
738 incompatible with HDF5.")
740 (license:non-copyleft
741 "https://www.hdfgroup.org/ftp/HDF/HDF_Current/src/unpacked/COPYING"))))
743 (define-public hdf4-alt
748 (substitute-keyword-arguments (package-arguments hdf4)
749 ((#:configure-flags flags) `(cons* "--disable-netcdf" ,flags))))
751 "HDF4 without netCDF API, can be combined with the regular netCDF library")))
760 (uri (list (string-append "https://support.hdfgroup.org/ftp/HDF5/releases/"
761 "hdf5-" (version-major+minor version)
762 "/hdf5-" version "/src/hdf5-"
764 (string-append "https://support.hdfgroup.org/ftp/HDF5/"
766 (match (string-split version #\.)
768 (string-append major minor)))
769 "/src/hdf5-" version ".tar.bz2")))
771 (base32 "03glk4w4wyb1jyb443g53y3y1ncnf6mj2cqwm6avfr2awkgb3cg5"))
772 (patches (search-patches "hdf5-config-date.patch"
773 "hdf5-1.8-mpi-deprecations.patch"))))
774 (build-system gnu-build-system)
778 `(("gfortran" ,gfortran)
779 ("perl" ,perl))) ;part of the test machinery needs Perl
780 (outputs '("out" ; core library
781 "fortran")) ; fortran interface
783 `(;; Some of the users, notably Flann, need the C++ interface.
784 #:configure-flags '("--enable-cxx"
786 "--enable-fortran2003"
788 ;; Build a thread-safe library. Unfortunately,
789 ;; 'configure' invites you to either turn off C++,
790 ;; Fortran, and the high-level interface (HL), or
791 ;; to pass '--enable-unsupported'. Debian
792 ;; packagers chose to pass '--enable-unsupported'
793 ;; and we follow their lead here.
794 "--enable-threadsafe"
796 "--enable-unsupported")
797 ;; Use -fPIC to allow the R bindings to link with the static libraries
798 #:make-flags (list "CFLAGS=-fPIC"
801 (modify-phases %standard-phases
802 (add-before 'configure 'patch-configure
803 (lambda* (#:key outputs #:allow-other-keys)
804 (substitute* "configure"
806 (substitute* "fortran/src/Makefile.in"
807 (("libhdf5_fortran_la_LDFLAGS =")
808 (string-append "libhdf5_fortran_la_LDFLAGS = -Wl-rpath="
809 (assoc-ref outputs "fortran") "/lib")))
810 (substitute* "hl/fortran/src/Makefile.in"
811 (("libhdf5hl_fortran_la_LDFLAGS =")
812 (string-append "libhdf5hl_fortran_la_LDFLAGS = -Wl,-rpath="
813 (assoc-ref outputs "fortran") "/lib")))
815 (add-after 'configure 'patch-settings
817 ;; libhdf5.settings contains the full path of the
818 ;; compilers used, and its contents are included in
819 ;; libhdf5.so. We truncate the hashes to avoid
820 ;; unnecessary store references to those compilers:
821 (substitute* "src/libhdf5.settings"
822 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
823 (string-append prefix (string-take hash 10) "..."))
824 ;; Don't record the build-time kernel version to make the
825 ;; settings file reproducible.
826 (("Uname information:.*")
827 "Uname information: Linux\n"))
829 (add-after 'install 'patch-references
830 (lambda* (#:key inputs outputs #:allow-other-keys)
831 (let ((bin (string-append (assoc-ref outputs "out") "/bin"))
832 (zlib (assoc-ref inputs "zlib")))
833 (substitute* (find-files bin "h5p?cc")
835 (string-append "-L" zlib "/lib " lib)))
837 (add-after 'install 'split
838 (lambda* (#:key inputs outputs #:allow-other-keys)
839 ;; Move all fortran-related files
840 (let* ((out (assoc-ref outputs "out"))
841 (bin (string-append out "/bin"))
842 (lib (string-append out "/lib"))
843 (inc (string-append out "/include"))
844 (ex (string-append out "/share/hdf5_examples/fortran"))
845 (fort (assoc-ref outputs "fortran"))
846 (fbin (string-append fort "/bin"))
847 (flib (string-append fort "/lib"))
848 (finc (string-append fort "/include"))
849 (fex (string-append fort "/share/hdf5_examples/fortran")))
854 ;; Note: When built with --enable-parallel, the 'h5fc' file
855 ;; doesn't exist, hence this condition.
856 (when (file-exists? (string-append bin "/h5fc"))
857 (rename-file (string-append bin "/h5fc")
858 (string-append fbin "/h5fc")))
859 (for-each (lambda (file)
861 (string-append flib "/" (basename file))))
862 (find-files lib ".*fortran.*"))
863 (for-each (lambda (file)
865 (string-append finc "/" (basename file))))
866 (find-files inc ".*mod"))
867 (for-each (lambda (file)
869 (string-append fex "/" (basename file))))
870 (find-files ex ".*"))
871 (delete-file-recursively ex))
873 (home-page "http://www.hdfgroup.org")
874 (synopsis "Management suite for extremely large and complex data")
875 (description "HDF5 is a suite that makes possible the management of
876 extremely large and complex data collections.")
877 (license (license:x11-style
878 "http://www.hdfgroup.org/ftp/HDF5/current/src/unpacked/COPYING"))))
880 (define-public hdf5-1.10
881 (package (inherit hdf5)
886 (uri (list (string-append "https://support.hdfgroup.org/ftp/HDF5/releases/"
887 "hdf5-" (version-major+minor version)
888 "/hdf5-" version "/src/hdf5-"
890 (string-append "https://support.hdfgroup.org/ftp/HDF5/"
893 (take (string-split version #\.) 2))
894 "/src/hdf5-" version ".tar.bz2")))
896 (base32 "1pr85fa1sh2ky6ai2hs3f21lp252grl2cq3wbyi4rh7dm83gyrqj"))
897 (patches (search-patches "hdf5-config-date.patch"
898 "hdf5-mpi-deprecations.patch"))))))
900 (define-public hdf-java
908 "http://www.hdfgroup.org/ftp/HDF5/releases/HDF-JAVA/hdfjni-"
909 version "/src/CMake-hdfjava-" version ".tar.gz"))
911 (base32 "0m1gp2aspcblqzmpqbdpfp6giskws85ds6p5gz8sx7asyp7wznpr"))
912 (modules '((guix build utils)))
913 (snippet ; Make sure we don't use the bundled sources and binaries.
915 (for-each delete-file
916 (list "SZip.tar.gz" "ZLib.tar.gz" "JPEG8d.tar.gz"
917 "HDF4.tar.gz" "HDF5.tar.gz"))
918 (delete-file-recursively ,(string-append "hdfjava-" version "/lib"))
920 (build-system gnu-build-system)
922 `(("jdk" ,icedtea "jdk")
923 ("automake" ,automake) ; For up to date 'config.guess' and 'config.sub'.
925 ("hamcrest-core" ,java-hamcrest-core)
926 ("junit" ,java-junit)
927 ("slf4j-simple" ,java-slf4j-simple)))
933 ("slf4j-api" ,java-slf4j-api)))
936 (list (string-append "--target=" ,(or (%current-target-system) (%current-system)))
937 (string-append "--with-jdk=" (assoc-ref %build-inputs "jdk") "/include,"
938 (assoc-ref %build-inputs "jdk") "/lib" )
939 (string-append "--with-hdf4=" (assoc-ref %build-inputs "hdf4") "/lib")
940 (string-append "--with-hdf5=" (assoc-ref %build-inputs "hdf5") "/lib"))
943 (list (string-append "HDFLIB=" (assoc-ref %build-inputs "hdf4") "/lib")
944 (string-append "HDF5LIB=" (assoc-ref %build-inputs "hdf5") "/lib")
945 (string-append "ZLIB=" (assoc-ref %build-inputs "zlib") "/lib/libz.so")
946 (string-append "JPEGLIB="
947 (assoc-ref %build-inputs "libjpeg") "/lib/libjpeg.so")
951 (modify-phases %standard-phases
952 (add-before 'configure 'chdir-to-source
953 (lambda _ (chdir ,(string-append "hdfjava-" version)) #t))
954 (add-before 'configure 'patch-build
955 (lambda* (#:key inputs outputs #:allow-other-keys)
956 (substitute* "configure"
957 (("COPT=\"") "COPT=\"-O2 ") ; CFLAGS is ignored in Makefiles
958 (("/bin/cat") (which "cat")))
959 ;; Set classpath for compilation
960 (substitute* '("hdf/hdf5lib/Makefile.in"
961 "hdf/hdf5lib/exceptions/Makefile.in"
962 "hdf/hdflib/Makefile.in")
963 (("\\$\\(TOP\\)/lib/slf4j-api-1\\.7\\.5\\.jar")
964 (string-append (assoc-ref inputs "slf4j-api")
965 "/share/java/slf4j-api.jar")))
966 ;; Replace outdated config.sub and config.guess:
967 (with-directory-excursion "config"
968 (for-each (lambda (file)
970 (string-append (assoc-ref inputs "automake")
972 ,(version-major+minor (package-version automake))
974 '("config.sub" "config.guess")))
976 ;; Fix embedded version number
977 (let ((hdf5version (list ,@(string-split (package-version hdf5) #\.))))
978 (substitute* "hdf/hdf5lib/H5.java"
980 (string-join hdf5version ", "))))
982 (mkdir-p (string-append (assoc-ref outputs "out")))
983 ;; Set classpath for tests
984 (let* ((build-dir (getcwd))
985 (lib (string-append build-dir "/lib"))
986 (jhdf (string-append lib "/jhdf.jar"))
987 (jhdf5 (string-append lib "/jhdf5.jar"))
990 (string-append (assoc-ref inputs i)
991 "/share/java/" i ".jar"))
992 '("junit" "hamcrest-core" "slf4j-api" "slf4j-simple")))
994 (string-join `("." ,build-dir ,jhdf ,jhdf5 ,@testjars) ":")))
996 (substitute* '("test/hdf5lib/Makefile.in"
997 "test/hdf5lib/junit.sh.in"
998 "examples/runExample.sh.in")
1000 (string-append (assoc-ref inputs "coreutils")
1003 (string-append (assoc-ref inputs "coreutils")
1005 (("CLASSPATH=[^\n]*")
1006 (string-append "CLASSPATH=" class-path)))
1007 (setenv "CLASSPATH" class-path))
1009 (add-before 'check 'build-examples
1011 (apply invoke `("javac"
1012 ,@(find-files "examples" ".*\\.java"))))))
1014 #:parallel-build? #f
1016 #:parallel-tests? #f ))
1017 (home-page "https://support.hdfgroup.org/products/java")
1018 (synopsis "Java interface for the HDF4 and HDF5 libraries")
1019 (description "Java HDF Interface (JHI) and Java HDF5 Interface (JHI5) use
1020 the Java Native Interface to wrap the HDF4 and HDF5 libraries, which are
1023 ;; BSD-style license:
1024 (license (license:x11-style
1025 "https://support.hdfgroup.org/ftp/HDF5/hdf-java\
1026 /current/src/unpacked/COPYING"))))
1028 (define-public hdf-eos2
1035 (uri "ftp://edhs1.gsfc.nasa.gov\
1036 /edhs/hdfeos/latest_release/HDF-EOS2.19v1.00.tar.Z")
1038 (base32 "0c9fcz25s292ldap12wxmlrvnyz99z24p63d8fwx51bf8s0s1zrz"))
1039 (patches (search-patches "hdf-eos2-remove-gctp.patch"
1040 "hdf-eos2-build-shared.patch"
1041 "hdf-eos2-fortrantests.patch"))))
1042 (build-system gnu-build-system)
1044 `(("gfortran" ,gfortran)))
1046 `(("hdf4" ,hdf4-alt) ; assume most HDF-EOS2 users won't use the HDF4 netCDF API
1048 ("libjpeg" ,libjpeg)
1051 `( #:configure-flags '("--enable-install-include" "--enable-shared"
1052 "CC=h4cc -Df2cFortran" "LIBS=-lgctp")
1053 #:parallel-tests? #f))
1054 (home-page "http://hdfeos.org/software/library.php#HDF-EOS2")
1055 (synopsis "HDF4-based data format for NASA's Earth Observing System")
1056 (description "HDF-EOS2 is a software library built on HDF4 which supports
1057 the construction of data structures used in NASA's Earth Observing
1058 System (Grid, Point and Swath).")
1060 ;; Source files carry a permissive license header.
1061 (license (license:non-copyleft home-page))))
1063 (define-public hdf-eos5
1069 (uri (string-append "ftp://edhs1.gsfc.nasa.gov\
1070 /edhs/hdfeos5/latest_release/HDF-EOS5." version ".tar.Z"))
1073 "1p83333nzzy8rn5chxlm0hrkjjnhh2w1ji8ac0f9q4xzg838i58i"))
1074 (patches (search-patches "hdf-eos5-build-shared.patch"
1075 "hdf-eos5-remove-gctp.patch"
1076 "hdf-eos5-fix-szip.patch"
1077 "hdf-eos5-fortrantests.patch"))))
1079 `(("gfortran" ,gfortran)))
1080 (build-system gnu-build-system)
1086 `(#:configure-flags '("--enable-install-include" "--enable-shared"
1087 "CC=h5cc -Df2cFortran" "LIBS=-lgctp")
1088 #:parallel-tests? #f))
1089 (synopsis "HDF5-based data format for NASA's Earth Observing System")
1091 "HDF-EOS5 is a software library built on HDF5 to support the construction
1092 of data structures used in NASA's Earth Observing System (Grid, Point and
1094 (home-page "http://www.hdfeos.org/software/library.php#HDF-EOS5")
1096 ;; Source files carry a permissive license header.
1097 (license (license:non-copyleft home-page))))
1099 (define-public hdf5-parallel-openmpi
1100 (package (inherit hdf5)
1101 (name "hdf5-parallel-openmpi")
1104 ,@(package-inputs hdf5)))
1106 (substitute-keyword-arguments (package-arguments hdf5)
1107 ((#:configure-flags flags)
1108 ``("--enable-parallel"
1109 ,@(delete "--enable-cxx"
1110 (delete "--enable-threadsafe" ,flags))))
1112 `(modify-phases ,phases
1113 (add-after 'build 'mpi-setup
1115 (add-before 'check 'patch-tests
1117 ;; OpenMPI's mpirun will exit with non-zero status if it
1118 ;; detects an "abnormal termination", i.e. any process not
1119 ;; calling MPI_Finalize(). Since the test is explicitly
1120 ;; avoiding MPI_Finalize so as not to have at_exit and thus
1121 ;; H5C_flush_cache from being called, mpirun will always
1122 ;; complain, so turn this test off.
1123 (substitute* "testpar/Makefile"
1124 (("(^TEST_PROG_PARA.*)t_pflush1(.*)" front back)
1125 (string-append front back "\n")))
1126 (substitute* "tools/h5diff/testph5diff.sh"
1127 (("/bin/sh") (which "sh")))
1129 (synopsis "Management suite for data with parallel IO support")))
1131 (define-public h5check
1138 (uri (string-append "http://www.hdfgroup.org/ftp/HDF5/tools/"
1139 "h5check/src/h5check-" version ".tar.gz"))
1142 "1gm76jbwhz9adbxgn14zx8cj33dmjdr2g5xcy0m9c2gakp8w59kj"))))
1143 (build-system gnu-build-system)
1144 (inputs `(("hdf5" ,hdf5))) ;h5cc for tests
1145 (home-page "https://www.hdfgroup.org/products/hdf5_tools/h5check.html")
1146 (synopsis "HDF5 format checker")
1147 (description "@code{h5check} is a validation tool for verifying that an
1148 HDF5 file is encoded according to the HDF File Format Specification.")
1149 (license (license:x11-style "file://COPYING"))))
1157 (uri (string-append "mirror://sourceforge/itpp/itpp/"
1162 "14ddy2xnb6sgp4hiax9v5sv4pr4l4dd4ps76nfha3nrpr1ikhcqm"))))
1163 (build-system cmake-build-system)
1164 (arguments `(#:tests? #f)) ; Tests require googletest *sources*
1165 (inputs `(("lapack" ,lapack)
1167 ;; FIXME: Even though the fonts are available dvips complains:
1168 ;; "Font cmmi10 not found; characters will be left blank."
1170 `(("texlive" ,texlive-tiny)
1171 ("ghostscript" ,ghostscript)
1172 ("doxygen" ,doxygen)))
1173 (home-page "http://itpp.sourceforge.net")
1174 (synopsis "C++ library of maths, signal processing and communication classes")
1175 (description "IT++ is a C++ library of mathematical, signal processing and
1176 communication classes and functions. Its main use is in simulation of
1177 communication systems and for performing research in the area of
1178 communications. The kernel of the library consists of generic vector and
1179 matrix classes, and a set of accompanying routines. Such a kernel makes IT++
1180 similar to MATLAB, GNU Octave or SciPy.")
1181 (license license:gpl3+)))
1183 (define-public netcdf
1190 (uri (string-append "ftp://ftp.unidata.ucar.edu/pub/netcdf/"
1191 "netcdf-" version ".tar.gz"))
1194 "1blc7ik5yin7i0ls2kag0a9xjk12m0dzx6v1x88az3ras3scci2d"))
1195 (patches (search-patches "netcdf-date-time.patch"
1196 "netcdf-tst_h_par.patch"))))
1197 (build-system gnu-build-system)
1200 ("doxygen" ,doxygen)
1201 ("graphviz" ,graphviz)))
1203 `(("hdf4" ,hdf4-alt)
1206 ("libjpeg" ,libjpeg)))
1208 `(#:configure-flags '("--enable-doxygen" "--enable-dot" "--enable-hdf4")
1210 #:phases (modify-phases %standard-phases
1211 (add-before 'configure 'fix-source-date
1213 ;; As we ${SOURCE_DATE_EPOCH} evaluates to "1" in the build
1214 ;; environment, `date -u -d ${SOURCE_DATE_EPOCH}` will evaluate
1215 ;; to '1st hour of the current day', and therefore makes the
1216 ;; package not reproducible.
1217 (substitute* "./configure"
1218 (("date -u -d \"\\$\\{SOURCE_DATE_EPOCH\\}\"")
1219 "date --date='@0'"))
1221 (add-after 'configure 'patch-settings
1223 ;; libnetcdf.settings contains the full filename of the compilers
1224 ;; used to build the library. We truncate the hashes of those
1225 ;; filenames to avoid unnecessary references to the corresponding
1227 (substitute* "libnetcdf.settings"
1228 (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
1229 (string-append prefix (string-take hash 10) "...")))
1232 #:parallel-tests? #f)) ;various race conditions
1233 (home-page "http://www.unidata.ucar.edu/software/netcdf/")
1234 (synopsis "Library for scientific data")
1235 (description "NetCDF is an interface for scientific data access and a
1236 software library that provides an implementation of the interface. The netCDF
1237 library defines a machine-independent format for representing scientific data.
1238 Together, the interface, library, and format support the creation, access, and
1239 sharing of scientific data.")
1240 (license (license:x11-style "file://COPYRIGHT"))))
1242 (define-public netcdf-parallel-openmpi
1243 (package (inherit netcdf)
1244 (name "netcdf-parallel-openmpi")
1247 ,@(alist-replace "hdf5" (list hdf5-parallel-openmpi)
1248 (package-inputs netcdf))))
1249 ;; TODO: Replace pkg-config references in nc-config with absolute references
1251 (substitute-keyword-arguments (package-arguments netcdf)
1252 ((#:configure-flags flags)
1253 `(cons* "CC=mpicc" "CXX=mpicxx"
1254 "--enable-parallel-tests"
1255 ;; Shared libraries not supported with parallel IO.
1256 "--disable-shared" "--with-pic"
1259 (define-public netcdf-fortran
1261 (name "netcdf-fortran")
1266 "ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-fortran-"
1270 "0xaxdcg1p83zmypwml3swsnr3ccn38inwldyr1l3wa4dbwbrblxj"))))
1271 (build-system gnu-build-system)
1273 `(#:parallel-tests? #f))
1275 `(("netcdf" ,netcdf)))
1277 `(("gfortran" ,gfortran)))
1278 (synopsis "Fortran interface for the netCDF library")
1279 (description (package-description netcdf))
1280 (home-page (package-home-page netcdf))
1281 (license (package-license netcdf))))
1283 (define-public nlopt
1289 (uri (string-append "http://ab-initio.mit.edu/nlopt/nlopt-"
1292 (base32 "12cfkkhcdf4zmb6h7y6qvvdvqjs2xf9sjpa3rl3bq76px4yn76c0"))))
1293 (build-system gnu-build-system)
1295 `(;; Shared libraries are not built by default. They are required to
1296 ;; build the Guile, Octave, and Python bindings.
1297 #:configure-flags '("--enable-shared")
1300 (modify-phases %standard-phases
1301 (add-before 'configure 'set-libnlopt-file-name
1302 (lambda* (#:key outputs #:allow-other-keys)
1303 ;; Make sure the Scheme module refers to the library by its
1304 ;; absolute file name (we cannot do that from a snippet
1305 ;; because the expansion of @libdir@ contains
1307 (let ((out (assoc-ref outputs "out")))
1308 (substitute* "swig/nlopt.scm.in"
1310 (string-append out "/lib/libnlopt")))
1312 (inputs `(("guile" ,guile-2.0)))
1313 (native-inputs `(("pkg-config" ,pkg-config)))
1314 (home-page "http://ab-initio.mit.edu/wiki/")
1315 (synopsis "Library for nonlinear optimization")
1316 (description "NLopt is a library for nonlinear optimization, providing a
1317 common interface for a number of different free optimization routines available
1318 online as well as original implementations of various other algorithms.")
1319 (license license:lgpl2.1+)))
1321 (define-public ipopt
1328 "http://www.coin-or.org/download/source/Ipopt/Ipopt-"
1332 "07yn9rzdswjk8n246qq6ci9ssf2bcplkifcpsfz9j6cdxw9vgbkv"))
1333 (modules '((guix build utils)))
1335 ;; Make sure we don't use the bundled software.
1337 (delete-file-recursively "ThirdParty")
1339 (build-system gnu-build-system)
1341 '(#:phases (modify-phases %standard-phases
1342 (add-after 'install 'add--L-flags-in-ipopt.pc
1343 (lambda* (#:key inputs outputs #:allow-other-keys)
1344 ;; The '.pc' file lists '-llapack -lblas' in "Libs";
1345 ;; move it to "Libs.private" where it belongs, and add a
1346 ;; '-L' flag for LAPACK.
1347 (let ((out (assoc-ref outputs "out"))
1348 (lapack (assoc-ref inputs "lapack")))
1349 (substitute* (string-append out "/lib/pkgconfig/"
1351 (("Libs: (.*)-llapack -lblas(.*)$" _ before after)
1352 (string-append "Libs: " before " " after "\n"
1353 "Libs.private: " before
1354 "-L" lapack "/lib -llapack -lblas "
1358 `(("gfortran" ,gfortran)))
1360 ;; TODO: Maybe add dependency on COIN-MUMPS, ASL, and HSL.
1361 `(("lapack" ,lapack))) ;for both libblas and liblapack
1362 (home-page "http://www.coin-or.org")
1363 (synopsis "Large-scale nonlinear optimizer")
1365 "The Interior Point Optimizer (IPOPT) is a software package for
1366 large-scale nonlinear optimization. It provides C++, C, and Fortran
1368 (license license:epl1.0)))
1376 (uri (string-append "https://www.coin-or.org/download/source/"
1377 "Clp/Clp-" version ".tgz"))
1380 "1wdg820g3iikf9344ijwsc8sy6c0m6im42bzzizm6rlmkvnmxhk9"))
1381 (modules '((guix build utils)))
1383 ;; Make sure we don't use the bundled software.
1385 (delete-file-recursively "ThirdParty")
1387 (build-system gnu-build-system)
1389 `(("gfortran" ,gfortran)
1390 ("pkg-config" ,pkg-config)))
1392 `(("openblas" ,openblas)))
1393 (home-page "https://www.coin-or.org")
1394 (synopsis "Linear programming solver")
1396 "CLP is a high quality linear programming solver. Its main strengths are
1397 its dual and primal Simplex algorithms. It also has a barrier algorithm for
1398 linear and quadratic objectives. There are limited facilities for nonlinear
1399 and quadratic objectives using the Simplex algorithm.")
1400 (license license:epl1.0)))
1402 (define-public ceres
1404 (name "ceres-solver")
1406 (home-page "http://ceres-solver.org/")
1409 (uri (string-append home-page "ceres-solver-"
1413 "13lfxy8x58w8vprr0nkbzziaijlh0vvqshgahvcgw0mrqdgh0i27"))))
1414 (build-system cmake-build-system)
1416 ;; TODO: Build HTML user documentation and install separately.
1417 '(#:configure-flags '("-DBUILD_EXAMPLES=OFF"
1418 "-DBUILD_SHARED_LIBS=ON")
1420 #:phases (modify-phases %standard-phases
1421 (add-before 'configure 'set-library-directory
1423 ;; Install libraries to lib/, not lib64/.
1424 (substitute* "internal/ceres/CMakeLists.txt"
1425 (("set\\(LIB_SUFFIX \"64\"\\)")
1426 "set(LIB_SUFFIX \"\")"))
1429 `(("pkg-config" ,pkg-config)))
1431 `(("glog" ,glog))) ;for #include <glog/glog.h>
1436 ("suitesparse" ,suitesparse)
1437 ("gflags" ,gflags)))
1438 (synopsis "C++ library for solving large optimization problems")
1440 "Ceres Solver is a C++ library for modeling and solving large,
1441 complicated optimization problems. It is a feature rich, mature and
1442 performant library which has been used in production since 2010. Ceres Solver
1443 can solve two kinds of problems:
1445 @item non-linear least squares problems with bounds constraints;
1446 @item general unconstrained optimization problems.
1448 (license license:bsd-3)))
1450 ;; For a fully featured Octave, users are strongly recommended also to install
1451 ;; the following packages: less, ghostscript, gnuplot.
1452 (define-public octave-cli
1459 (uri (string-append "mirror://gnu/octave/octave-"
1463 "11wwxpy2q1bhxs2v41bqn05i2sb0905cj1xil6mg8l4k2kka4cq6"))))
1464 (build-system gnu-build-system)
1466 `(("lapack" ,lapack)
1468 ("readline" ,readline)
1473 ("arpack" ,arpack-ng)
1476 ("fontconfig" ,fontconfig)
1477 ("freetype" ,freetype)
1484 ("texinfo" ,texinfo)
1485 ("graphicsmagick" ,graphicsmagick)
1486 ("suitesparse" ,suitesparse)
1487 ("libsndfile" ,libsndfile)
1488 ("portaudio" ,portaudio)
1489 ("alsa-lib" ,alsa-lib)))
1492 ("gfortran" ,gfortran)
1493 ("pkg-config" ,pkg-config)
1495 ;; The following inputs are not actually used in the build process.
1496 ;; However, the ./configure gratuitously tests for their existence and
1497 ;; assumes that programs not present at build time are also not, and
1498 ;; can never be, available at run time! If these inputs are therefore
1499 ;; not present, support for them will be built out. However, Octave
1500 ;; will still run without them, albeit without the features they
1503 ("ghostscript" ,ghostscript)
1504 ("gnuplot" ,gnuplot)))
1505 ;; Octave code uses this variable to detect directories holding multiple CA
1506 ;; certificates to verify peers with. This is required for the networking
1507 ;; functions that require encryption to work properly.
1508 (native-search-paths
1509 (list (search-path-specification
1510 (variable "CURLOPT_CAPATH")
1511 (files '("etc/ssl/certs")))))
1514 (list (string-append "--with-shell="
1515 (assoc-ref %build-inputs "bash")
1518 (modify-phases %standard-phases
1519 (add-after 'configure 'configure-makeinfo
1520 (lambda* (#:key inputs #:allow-other-keys)
1521 (substitute* "libinterp/corefcn/help.h"
1524 "\"" (assoc-ref inputs "texinfo") "/bin/makeinfo\"")))
1526 (home-page "https://www.gnu.org/software/octave/")
1527 (synopsis "High-level language for numerical computation")
1528 (description "GNU Octave is a high-level interpreted language that is
1529 specialized for numerical computations. It can be used for both linear and
1530 non-linear applications and it provides great support for visualizing results.
1531 Work may be performed both at the interactive command-line as well as via
1533 (license license:gpl3+)))
1535 (define-public octave
1536 (package (inherit octave-cli)
1539 (inherit (package-source octave-cli))))
1541 `(("qscintilla" ,qscintilla)
1543 ,@(package-inputs octave-cli)))
1545 `(("qttools" , qttools) ;for lrelease
1546 ("texlive" ,texlive) ;for texi2dvi
1547 ,@(package-native-inputs octave-cli)))
1549 (substitute-keyword-arguments (package-arguments octave-cli)
1551 `(modify-phases ,phases
1552 (add-before 'configure 'patch-qscintilla-library-name
1553 (lambda* (#:key inputs #:allow-other-keys)
1554 ;; The QScintilla library that the Octave configure script tries
1555 ;; to link with should be named libqscintilla-qt5.so, but the
1556 ;; QScintilla input provides the shared library as
1557 ;; libqscintilla2_qt5.so.
1558 (substitute* "configure"
1559 (("qscintilla2-qt5")
1563 (define-public qtoctave
1564 (deprecated-package "qtoctave" octave))
1566 (define-public opencascade-oce
1568 (name "opencascade-oce")
1574 (url "https://github.com/tpaviot/oce.git")
1575 (commit (string-append "OCE-" version))))
1576 (file-name (git-file-name name version))
1577 (patches (search-patches "opencascade-oce-glibc-2.26.patch"))
1579 (base32 "0rg5wzkvfmzfl6v2amyryb8dnjad0nn9kyr607wy2gch6rciah69"))))
1580 (build-system cmake-build-system)
1583 (list "-DOCE_TESTING:BOOL=ON"
1584 "-DOCE_USE_TCL_TEST_FRAMEWORK:BOOL=ON"
1585 "-DOCE_DRAW:BOOL=ON"
1586 (string-append "-DOCE_INSTALL_PREFIX:PATH="
1587 (assoc-ref %outputs "out"))
1588 "-UCMAKE_INSTALL_RPATH")))
1590 `(("freetype" ,freetype)
1597 `(("python" ,python-wrapper)))
1598 (home-page "https://github.com/tpaviot/oce")
1599 (synopsis "Libraries for 3D modeling and numerical simulation")
1601 "Open CASCADE is a set of libraries for the development of applications
1602 dealing with 3D CAD data or requiring industrial 3D capabilities. It includes
1603 C++ class libraries providing services for 3D surface and solid modeling, CAD
1604 data exchange, and visualization. It is used for development of specialized
1605 software dealing with 3D models in design (CAD), manufacturing (CAM),
1606 numerical simulation (CAE), measurement equipment (CMM), and quality
1607 control (CAQ) domains.
1609 This is the ``Community Edition'' (OCE) of Open CASCADE, which gathers
1610 patches, improvements, and experiments contributed by users over the official
1611 Open CASCADE library.")
1612 (license (list license:lgpl2.1; OCE libraries, with an exception for the
1613 ; use of header files; see
1614 ; OCCT_LGPL_EXCEPTION.txt
1615 license:public-domain; files
1616 ; src/Standard/Standard_StdAllocator.hxx and
1617 ; src/NCollection/NCollection_StdAllocator.hxx
1618 license:expat; file src/OpenGl/OpenGl_glext.h
1619 license:bsd-3)))); test framework gtest
1628 (uri (string-append "http://gmsh.info/src/gmsh-"
1629 version "-source.tgz"))
1631 (base32 "1slf0bfkwrcgn6296wb4qhbk4ahz6i4wfb10hnim08x05vrylag8"))
1632 (modules '((guix build utils)))
1634 ;; Remove non-free METIS code
1636 (delete-file-recursively "contrib/Metis")
1638 (build-system cmake-build-system)
1641 ("gfortran" ,gfortran)
1647 ("opencascade-oce" ,opencascade-oce)
1649 ("libxext" ,libxext)))
1651 `(("fontconfig" ,fontconfig)
1652 ("libxft" ,libxft)))
1654 `(#:configure-flags `("-DENABLE_METIS:BOOL=OFF"
1655 "-DENABLE_BUILD_SHARED:BOOL=ON"
1656 "-DENABLE_BUILD_DYNAMIC:BOOL=ON")))
1657 (home-page "http://www.geuz.org/gmsh/")
1658 (synopsis "3D finite element grid generator")
1659 (description "Gmsh is a 3D finite element grid generator with a built-in
1660 CAD engine and post-processor. Its design goal is to provide a fast, light
1661 and user-friendly meshing tool with parametric input and advanced
1662 visualization capabilities. Gmsh is built around four modules: geometry,
1663 mesh, solver and post-processing. The specification of any input to these
1664 modules is done either interactively using the graphical user interface or in
1665 ASCII text files using Gmsh's own scripting language.")
1666 (license license:gpl2+)))
1668 (define-public maxflow
1675 (url "https://github.com/gerddie/maxflow.git")
1676 (commit "42401fa54823d16b9da47716f04e5d9ef1605875")))
1677 (file-name (string-append name "-" version "-checkout"))
1680 "0rll38whw55h0vcjrrwdnh9ascvxby0ph7n1l0d12z17cg215kkb"))))
1681 (build-system cmake-build-system)
1682 (home-page "http://pub.ist.ac.at/~vnk/software.html")
1683 (synopsis "Library implementing Maxflow algorithm")
1684 (description "An implementation of the maxflow algorithm described in
1685 @cite{An Experimental Comparison of Min-Cut/Max-Flow Algorithms for
1686 Energy Minimization in Computer Vision.\n
1687 Yuri Boykov and Vladimir Kolmogorov.\n
1688 In IEEE Transactions on Pattern Analysis and Machine Intelligence,\n
1690 (license license:gpl3+)))
1692 (define-public petsc
1699 ;; The *-lite-* tarball does not contain the *large* documentation
1700 (uri (string-append "http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/"
1701 "petsc-lite-" version ".tar.gz"))
1703 (base32 "1645nwwcp9bcnfnxikk480mhbbacdvhsay2c401818hk97dqj5nx"))))
1704 (outputs '("out" ; libraries and headers
1705 "examples")) ; ~30MiB of examples
1706 (build-system gnu-build-system)
1708 `(("python" ,python-2)))
1710 `(("gfortran" ,gfortran)
1712 ("superlu" ,superlu)
1713 ;; leaving out hdf5 and fftw, as petsc expects them to be built with mpi
1714 ;; leaving out opengl, as configuration seems to only be for mac
1717 `(#:test-target "test"
1718 #:parallel-build? #f ; build is parallel by default
1724 ;; Honor (parallel-job-count) for build. Do not use --with-make-np,
1725 ;; whose value is dumped to $out/lib/petsc/conf/petscvariables.
1726 (list (format #f "MAKE_NP=~a" (parallel-job-count)))
1728 (modify-phases %standard-phases
1730 ;; PETSc's configure script is actually a python script, so we can't
1731 ;; run it with bash.
1732 (lambda* (#:key outputs (configure-flags '())
1734 (let* ((prefix (assoc-ref outputs "out"))
1735 (flags `(,(string-append "--prefix=" prefix)
1736 ,@configure-flags)))
1737 (format #t "build directory: ~s~%" (getcwd))
1738 (format #t "configure flags: ~s~%" flags)
1739 (apply invoke "./configure" flags))))
1740 (add-after 'configure 'clean-local-references
1741 (lambda* (#:key outputs #:allow-other-keys)
1742 (let ((out (assoc-ref outputs "out")))
1743 (substitute* (find-files "." "^petsc(conf|machineinfo).h$")
1744 ;; Prevent build directory from leaking into compiled code
1746 ;; Scrub timestamp for reproducibility
1747 ((".*Libraries compiled on.*") ""))
1748 (substitute* (find-files "." "petscvariables")
1749 ;; Do not expose build machine characteristics, set to defaults.
1750 (("MAKE_NP = [:digit:]+") "MAKE_NP = 2")
1751 (("NPMAX = [:digit:]+") "NPMAX = 2"))
1753 (add-after 'install 'clean-install
1754 ;; Try to keep installed files from leaking build directory names.
1755 (lambda* (#:key inputs outputs #:allow-other-keys)
1756 (let ((out (assoc-ref outputs "out")))
1757 (substitute* (map (lambda (file)
1758 (string-append out "/lib/petsc/conf/" file))
1759 '("petscvariables"))
1761 ;; Make compiler references point to the store
1762 (substitute* (string-append out "/lib/petsc/conf/petscvariables")
1763 (("= (gcc|g\\+\\+|gfortran)" _ compiler)
1764 (string-append "= " (which compiler))))
1765 ;; PETSc installs some build logs, which aren't necessary.
1766 (for-each (lambda (file)
1767 (let ((f (string-append out "/lib/petsc/conf/" file)))
1768 (when (file-exists? f)
1770 '("configure.log" "make.log" "gmake.log"
1771 "test.log" "error.log" "RDict.db"
1772 "PETScBuildInternal.cmake"
1773 ;; Once installed, should uninstall with Guix
1776 (add-after 'install 'move-examples
1777 (lambda* (#:key outputs #:allow-other-keys)
1778 (let* ((out (assoc-ref outputs "out"))
1779 (examples (assoc-ref outputs "examples"))
1780 (exdir (string-append out "/share/petsc/examples"))
1781 (exdir' (string-append examples "/share/petsc/examples")))
1782 (copy-recursively exdir exdir')
1783 (delete-file-recursively exdir)
1785 (home-page "http://www.mcs.anl.gov/petsc")
1786 (synopsis "Library to solve PDEs")
1787 (description "PETSc, pronounced PET-see (the S is silent), is a suite of
1788 data structures and routines for the scalable (parallel) solution of
1789 scientific applications modeled by partial differential equations.")
1790 (license (license:non-copyleft
1791 "http://www.mcs.anl.gov/petsc/documentation/copyright.html"))))
1793 (define-public petsc-complex
1794 (package (inherit petsc)
1795 (name "petsc-complex")
1797 (substitute-keyword-arguments (package-arguments petsc)
1798 ((#:configure-flags cf)
1799 `(cons "--with-scalar-type=complex" ,cf))))
1800 (synopsis "Library to solve PDEs (with complex scalars)")))
1802 (define-public petsc-openmpi
1803 (package (inherit petsc)
1804 (name "petsc-openmpi")
1806 `(("hdf5" ,hdf5-parallel-openmpi)
1807 ("hypre" ,hypre-openmpi)
1809 ("mumps" ,mumps-openmpi)
1810 ("openmpi" ,openmpi)
1811 ("scalapack" ,scalapack)
1812 ("scotch" ,pt-scotch32)
1813 ,@(package-inputs petsc)))
1815 (substitute-keyword-arguments (package-arguments petsc)
1816 ((#:configure-flags cf)
1818 "--with-mpiexec=mpirun"
1821 "--with-scalapack=1"
1823 ,(string-append "--with-mpi-dir="
1824 (assoc-ref %build-inputs "openmpi"))
1825 ,(string-append "--with-hdf5-include="
1826 (assoc-ref %build-inputs "hdf5") "/include")
1827 ,(string-append "--with-hdf5-lib="
1828 (assoc-ref %build-inputs "hdf5") "/lib/libhdf5.a")
1829 ,@(delete "--with-mpi=0" ,cf)))
1831 `(modify-phases ,phases
1832 (add-before 'configure 'mpi-setup
1833 ,%openmpi-setup)))))
1834 (synopsis "Library to solve PDEs (with MUMPS and MPI support)")))
1836 (define-public petsc-complex-openmpi
1837 (package (inherit petsc-complex)
1838 (name "petsc-complex-openmpi")
1840 `(("openmpi" ,openmpi)
1841 ,@(package-inputs petsc-complex)))
1843 (substitute-keyword-arguments (package-arguments petsc-complex)
1844 ((#:configure-flags cf)
1845 ``("--with-mpiexec=mpirun"
1846 ,(string-append "--with-mpi-dir="
1847 (assoc-ref %build-inputs "openmpi"))
1848 ,@(delete "--with-mpi=0" ,cf)))
1850 `(modify-phases ,phases
1851 (add-before 'configure 'mpi-setup
1852 ,%openmpi-setup)))))
1853 (synopsis "Library to solve PDEs (with complex scalars and MPI support)")))
1855 (define-public python-petsc4py
1857 (name "python-petsc4py")
1862 (uri (pypi-uri "petsc4py" version))
1865 "094hcnran0r2z1wlvmjswsz3ski1m9kqrl5l0ax8jjhnk55x0flh"))))
1866 (build-system python-build-system)
1869 (modify-phases %standard-phases
1870 (add-before 'build 'pre-build
1872 ;; Define path to PETSc installation.
1873 (setenv "PETSC_DIR" (assoc-ref %build-inputs "petsc"))
1875 (add-before 'check 'mpi-setup
1878 `(("petsc" ,petsc-openmpi)
1879 ("python-numpy" ,python-numpy)))
1880 (home-page "https://bitbucket.org/petsc/petsc4py/")
1881 (synopsis "Python bindings for PETSc")
1882 (description "PETSc, the Portable, Extensible Toolkit for
1883 Scientific Computation, is a suite of data structures and routines for
1884 the scalable (parallel) solution of scientific applications modeled by
1885 partial differential equations. It employs the MPI standard for all
1886 message-passing communication. @code{petsc4py} provides Python
1887 bindings to almost all functions of PETSc.")
1888 (license license:bsd-3)))
1890 (define-public python-kiwisolver
1892 (name "python-kiwisolver")
1896 (uri (pypi-uri "kiwisolver" version))
1899 "0y22ci86znwwwfhbmvbgdfnbi6lv5gv2xkdlxvjw7lml43ayafyf"))))
1900 (build-system python-build-system)
1901 (home-page "https://github.com/nucleic/kiwi")
1902 (synopsis "Fast implementation of the Cassowary constraint solver")
1904 "Kiwi is an efficient C++ implementation of the Cassowary constraint
1905 solving algorithm. Kiwi has been designed from the ground up to be
1906 lightweight and fast. Kiwi ranges from 10x to 500x faster than the original
1907 Cassowary solver with typical use cases gaining a 40x improvement. Memory
1908 savings are consistently > 5x.")
1909 (license license:bsd-3)))
1911 (define-public python2-kiwisolver
1912 (package-with-python2 python-kiwisolver))
1914 (define-public slepc
1921 (uri (string-append "http://slepc.upv.es/download/distrib/slepc-"
1925 "1yq84q9wannc8xwapxpay4ypdd675picwi395hhsdvng9q6hf5j8"))))
1926 (build-system gnu-build-system)
1928 `(("python" ,python-2)
1929 ("petsc:examples" ,petsc "examples"))) ;for gmakegen.py script
1931 `(("arpack" ,arpack-ng)
1932 ("gfortran" ,gfortran)))
1934 `(("petsc" ,petsc)))
1936 `(#:parallel-build? #f ;build is parallel by default
1938 `(,(string-append "--with-arpack-dir="
1939 (assoc-ref %build-inputs "arpack") "/lib"))
1940 #:make-flags ;honor (parallel-job-count)
1941 `(,(format #f "MAKE_NP=~a" (parallel-job-count))
1942 ,(string-append "PETSCCONFIGDIR="
1943 (assoc-ref %build-inputs "petsc:examples")
1944 "/share/petsc/examples/config"))
1946 (modify-phases %standard-phases
1948 ;; configure is a python script, so we can't run it with bash.
1949 (lambda* (#:key inputs outputs (configure-flags '())
1951 (let* ((prefix (assoc-ref outputs "out"))
1952 (flags `(,(string-append "--prefix=" prefix)
1953 ,@configure-flags)))
1954 (format #t "build directory: ~s~%" (getcwd))
1955 (format #t "configure flags: ~s~%" flags)
1956 (setenv "SLEPC_DIR" (getcwd))
1957 (setenv "PETSC_DIR" (assoc-ref inputs "petsc"))
1958 (apply invoke "./configure" flags))))
1959 (add-after 'install 'delete-doc
1960 ;; TODO: SLEPc installs HTML documentation alongside headers in
1961 ;; $out/include. We'd like to move them to share/doc, but delete
1962 ;; them for now, as they are incomplete and installing the complete
1963 ;; documentation is difficult.
1964 (lambda* (#:key outputs #:allow-other-keys)
1965 (let* ((out (assoc-ref outputs "out")))
1966 (for-each delete-file (find-files out "\\.html$"))
1968 (add-after 'install 'clean-install
1969 ;; Clean up unnecessary build logs from installation.
1970 (lambda* (#:key outputs #:allow-other-keys)
1971 (let ((out (assoc-ref outputs "out")))
1972 (for-each (lambda (file)
1973 (let ((f (string-append out "/lib/slepc/conf/" file)))
1974 (when (file-exists? f)
1976 '("configure.log" "make.log" "gmake.log"
1977 "test.log" "error.log" "RDict.db"
1980 (home-page "http://slepc.upv.es")
1981 (synopsis "Scalable library for eigenproblems")
1982 (description "SLEPc is a software library for the solution of large sparse
1983 eigenproblems on parallel computers. It can be used for the solution of
1984 linear eigenvalue problems formulated in either standard or generalized form,
1985 as well as other related problems such as the singular value decomposition.
1986 The emphasis of the software is on methods and techniques appropriate for
1987 problems in which the associated matrices are sparse, for example, those
1988 arising after the discretization of partial differential equations.")
1989 (license license:bsd-2)))
1991 (define-public slepc-complex
1992 (package (inherit slepc)
1993 (name "slepc-complex")
1995 `(("petsc" ,petsc-complex)
1996 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
1997 (synopsis "Scalable library for eigenproblems (with complex scalars)")))
1999 (define-public slepc-openmpi
2000 (package (inherit slepc)
2001 (name "slepc-openmpi")
2003 (substitute-keyword-arguments (package-arguments slepc)
2004 ((#:phases phases '%standard-phases)
2005 `(modify-phases ,phases
2006 (add-before 'check 'mpi-setup
2007 ,%openmpi-setup)))))
2010 ("arpack" ,arpack-ng-openmpi)
2011 ,@(alist-delete "arpack" (package-inputs slepc))))
2013 `(("petsc" ,petsc-openmpi)
2014 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
2015 (synopsis "Scalable library for eigenproblems (with MPI support)")))
2017 (define-public slepc-complex-openmpi
2018 (package (inherit slepc-openmpi)
2019 (name "slepc-complex-openmpi")
2021 `(("petsc" ,petsc-complex-openmpi)
2022 ,@(alist-delete "petsc" (package-propagated-inputs slepc-openmpi))))
2023 (synopsis "Scalable library for eigenproblems (with complex scalars and MPI support)")))
2025 (define-public python-slepc4py
2027 (name "python-slepc4py")
2032 (uri (pypi-uri "slepc4py" version))
2035 "0x049dyc8frgh79fvvavf4vlbqp4mgm61nsaivzdav4316vvlv1j"))))
2036 (build-system python-build-system)
2039 (modify-phases %standard-phases
2040 (add-before 'build 'pre-build
2042 ;; Define path to PETSc installation.
2043 (setenv "PETSC_DIR" (assoc-ref %build-inputs "petsc"))
2044 ;; Define path to SLEPc installation.
2045 (setenv "SLEPC_DIR" (assoc-ref %build-inputs "slepc"))
2047 (add-before 'check 'mpi-setup
2050 `(("python-numpy" ,python-numpy)
2051 ("python-petsc4py" ,python-petsc4py)
2052 ("slepc" ,slepc-openmpi)))
2053 (home-page "https://bitbucket.org/slepc/slepc4py/")
2054 (synopsis "Python bindings for SLEPc")
2055 (description "SLEPc, the Scalable Library for Eigenvalue Problem
2056 Computations, is based on PETSc, the Portable, Extensible Toolkit for
2057 Scientific Computation. It employs the MPI standard for all
2058 message-passing communication. @code{slepc4py} provides Python
2059 bindings to almost all functions of SLEPc.")
2060 (license license:bsd-3)))
2062 (define-public mumps
2069 (uri (string-append "http://mumps.enseeiht.fr/MUMPS_"
2073 "1s9asin08zqzmh08257sdghhivvy9vjif7c53fhaxaax2kd5qd7b"))
2074 (patches (search-patches "mumps-build-parallelism.patch"))))
2075 (build-system gnu-build-system)
2077 `(("fortran" ,gfortran)
2078 ;; These are required for linking against mumps, but we let the user
2079 ;; declare the dependency.
2082 ("scotch" ,scotch)))
2084 `(#:modules ((ice-9 match)
2087 ,@%gnu-build-system-modules)
2089 (modify-phases %standard-phases
2091 (lambda* (#:key inputs #:allow-other-keys)
2092 (call-with-output-file "Makefile.inc"
2103 INCSEQ = -I$(topdir)/libseq
2104 LIBSEQ = -L$(topdir)/libseq -lmpiseq
2105 LIBSEQNEEDED = libseqneeded~;
2109 AR = ar vr # rules require trailing space, ugh...
2111 LIBBLAS = -L~a -lopenblas~@[
2112 SCALAP = -L~a -lscalapack~]
2113 LIBOTHERS = -pthread
2116 OPTF = -O2 -DALLOW_NON_INIT $(PIC)
2120 LIBS = $(SCALAP) $(LIBSEQ)
2121 LPORDDIR = $(topdir)/PORD/lib
2122 IPORD = -I$(topdir)/PORD/include
2123 LPORD = -L$(LPORDDIR) -lpord
2124 ORDERINGSF = -Dpord~@[
2126 IMETIS = -I$(METISDIR)/include
2127 LMETIS = -L$(METISDIR)/lib -lmetis
2128 ORDERINGSF += -Dmetis~]~@[~:{
2130 ISCOTCH = -I$(SCOTCHDIR)/include
2131 LSCOTCH = -L$(SCOTCHDIR)/lib ~a-lesmumps -lscotch -lscotcherr
2132 ORDERINGSF += ~a~}~]
2133 ORDERINGSC = $(ORDERINGSF)
2134 LORDERINGS = $(LPORD) $(LMETIS) $(LSCOTCH)
2135 IORDERINGSF = $(ISCOTCH)
2136 IORDERINGSC = $(IPORD) $(IMETIS) $(ISCOTCH)"
2137 (assoc-ref inputs "mpi")
2138 (assoc-ref inputs "blas")
2139 (assoc-ref inputs "scalapack")
2140 (assoc-ref inputs "metis")
2141 (match (list (assoc-ref inputs "pt-scotch")
2142 (assoc-ref inputs "scotch"))
2146 `((,scotch "" "-Dscotch")))
2149 "-lptesmumps -lptscotch -lptscotcherr "
2150 "-Dptscotch")))))))))
2152 ;; By default only the d-precision library is built. Make with "all"
2153 ;; target so that all precision libraries and examples are built.
2155 (invoke "make" "all"
2156 (format #f "-j~a" (parallel-job-count)))))
2158 ;; Run the simple test drivers, which read test input from stdin:
2159 ;; from the "real" input for the single- and double-precision
2160 ;; testers, and from the "cmplx" input for complex-precision
2161 ;; testers. The EXEC-PREFIX key is used by the mumps-openmpi
2162 ;; package to prefix execution with "mpirun".
2163 (lambda* (#:key (exec-prefix '()) #:allow-other-keys)
2164 (with-directory-excursion "examples"
2167 (let ((tester (apply open-pipe*
2170 ,(string-append "./" prec
2172 (input (open-input-file
2173 (string-append "input_simpletest_" type))))
2175 (dump-port input tester)
2177 (zero? (close-pipe tester)))))
2179 '("real" "real" "cmplx" "cmplx")))))
2181 (lambda* (#:key outputs #:allow-other-keys)
2182 (let* ((out (assoc-ref outputs "out"))
2183 (libdir (string-append out "/lib")))
2184 (copy-recursively "lib" libdir)
2185 (copy-recursively "include" (string-append out "/include"))
2186 (when (file-exists? "libseq/libmpiseq.a")
2187 (install-file "libseq/libmpiseq.a" libdir))
2189 (home-page "http://mumps.enseeiht.fr")
2190 (synopsis "Multifrontal sparse direct solver")
2192 "MUMPS (MUltifrontal Massively Parallel sparse direct Solver) solves a
2193 sparse system of linear equations A x = b using Gaussian elimination.")
2194 (license license:cecill-c)))
2196 (define-public mumps-metis
2197 (package (inherit mumps)
2198 (name "mumps-metis")
2200 (alist-delete "scotch" (package-inputs mumps)))))
2202 (define-public mumps-openmpi
2203 (package (inherit mumps)
2204 (name "mumps-openmpi")
2207 ("scalapack" ,scalapack)
2208 ("pt-scotch" ,pt-scotch)
2209 ,@(alist-delete "scotch" (package-inputs mumps))))
2211 (substitute-keyword-arguments (package-arguments mumps)
2213 `(modify-phases ,phases
2214 (add-before 'check 'mpi-setup
2218 ((assoc-ref ,phases 'check)
2219 #:exec-prefix '("mpirun" "-n" "2"))))))))
2220 (synopsis "Multifrontal sparse direct solver (with MPI)")))
2222 (define-public mumps-metis-openmpi
2223 (package (inherit mumps-openmpi)
2224 (name "mumps-metis-openmpi")
2226 (alist-delete "pt-scotch" (package-inputs mumps-openmpi)))))
2228 (define-public r-quadprog
2235 (uri (cran-uri "quadprog" version))
2238 "0vg7i9p241bwvfdspjbydjrsvgipl6nsb8bjigp0hbbgvxbixx0s"))))
2239 (build-system r-build-system)
2241 `(("gfortran" ,gfortran)))
2242 (home-page "https://cran.r-project.org/web/packages/quadprog")
2243 (synopsis "Functions to solve quadratic programming problems")
2245 "This package contains routines and documentation for solving quadratic
2246 programming problems.")
2247 (license license:gpl3+)))
2249 (define-public r-pracma
2255 (uri (cran-uri "pracma" version))
2257 (base32 "0isd3s0i4mzmva8lkh0j76hwjy1w50q7d1n9lhxsnnkgalx3xs1g"))))
2258 (build-system r-build-system)
2259 (home-page "https://cran.r-project.org/web/packages/pracma/")
2260 (synopsis "Practical numerical math functions")
2261 (description "This package provides functions for numerical analysis and
2262 linear algebra, numerical optimization, differential equations, plus some
2263 special functions. It uses Matlab function names where appropriate to simplify
2265 (license license:gpl3+)))
2267 (define-public ruby-asciimath
2269 (name "ruby-asciimath")
2274 (uri (rubygems-uri "asciimath" version))
2277 "1d80kiph5mc78zps7si1hv48kv4k12mzaq8jk5kb3pqpjdr72qmc"))))
2278 (build-system ruby-build-system)
2281 (modify-phases %standard-phases
2283 ;; https://github.com/asciidoctor/asciimath/commit/1c06fdc8086077f4785479f78b0823a4a72d7948
2284 (add-after 'unpack 'patch-remove-spurious-backslashes
2286 (substitute* "spec/parser_spec.rb"
2291 `(("bundler" ,bundler)
2292 ("ruby-rspec" ,ruby-rspec)))
2293 (synopsis "AsciiMath parsing and conversion library")
2295 "A pure Ruby AsciiMath parsing and conversion library. AsciiMath is an
2296 easy-to-write markup language for mathematics.")
2297 (home-page "https://github.com/asciidoctor/asciimath")
2298 (license license:expat)))
2300 (define-public superlu
2307 (uri (string-append "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/"
2308 "superlu_" version ".tar.gz"))
2310 (base32 "0qzlb7cd608q62kyppd0a8c65l03vrwqql6gsm465rky23b6dyr8"))
2311 (modules '((guix build utils)))
2313 ;; Replace the non-free implementation of MC64 with a stub adapted
2316 (use-modules (ice-9 regex)
2318 (call-with-output-file "SRC/mc64ad.c"
2323 void mc64id_(int *a) {
2324 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
2327 void mc64ad_ (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
2328 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
2329 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
2332 ;; Remove the corresponding license verbiage. MC64 license follows
2333 ;; a "------" line separator.
2334 (with-atomic-file-replacement "License.txt"
2335 (let ((rx (make-regexp "-{8}")))
2338 (let ((line (read-line in 'concat)))
2339 (unless (regexp-exec rx line)
2343 (build-system cmake-build-system)
2347 `(("blas" ,openblas)
2348 ("gfortran" ,gfortran)))
2350 `(#:configure-flags '("-Denable_blaslib:BOOL=NO" ;do not use internal cblas
2351 "-DTPL_BLAS_LIBRARIES=openblas"
2352 "-DBUILD_SHARED_LIBS:BOOL=YES")))
2353 (home-page "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/")
2354 (synopsis "Supernodal direct solver for sparse linear systems")
2356 "SuperLU is a general purpose library for the direct solution of large,
2357 sparse, nonsymmetric systems of linear equations on high performance machines.
2358 The library is written in C and is callable from either C or Fortran. The
2359 library routines perform an LU decomposition with partial pivoting and
2360 triangular system solves through forward and back substitution. The library
2361 also provides threshold-based ILU factorization preconditioners.")
2362 (license (list license:bsd-3
2363 license:gpl2+ ;EXAMPLE/*fgmr.c
2364 (license:fsf-free "file://SRC/colamd.h")))))
2366 (define-public superlu-dist
2368 (name "superlu-dist")
2373 (uri (string-append "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/"
2374 "superlu_dist_" version ".tar.gz"))
2376 (base32 "0pqgcgh1yxhfzs99fas3mggajzd5wca3nbyp878rziy74gfk03dl"))
2377 (modules '((guix build utils)))
2379 ;; Replace the non-free implementation of MC64 with a stub
2381 (call-with-output-file "SRC/mc64ad_dist.c"
2386 void mc64id_dist(int *a) {
2387 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
2390 void mc64ad_dist (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
2391 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
2392 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
2395 (substitute* "SRC/util.c" ;adjust default algorithm
2396 (("RowPerm[[:blank:]]*=[[:blank:]]*LargeDiag_MC64;")
2397 ;; TODO: set to "LargeDiag_AWPM" once combinatorial-blas has
2398 ;; general (i.e. non-square) processor-grid support.
2399 "RowPerm = NOROWPERM;"))
2401 (patches (search-patches "superlu-dist-scotchmetis.patch"
2402 "superlu-dist-awpm-grid.patch"
2403 "superlu-dist-fix-mpi-deprecations.patch"))))
2404 (build-system cmake-build-system)
2408 `(("gfortran" ,gfortran)
2411 ("combblas" ,combinatorial-blas)))
2413 `(("mpi" ,openmpi) ;headers include MPI heades
2414 ("parmetis" ,pt-scotch32 "metis")
2415 ("pt-scotch" ,pt-scotch32)))
2417 `(#:parallel-tests? #f ;tests use MPI and OpenMP
2418 #:configure-flags (list "-DBUILD_SHARED_LIBS:BOOL=YES"
2419 "-DTPL_ENABLE_COMBBLASLIB=YES"
2420 "-DTPL_BLAS_LIBRARIES=-lopenblas"
2421 "-DTPL_LAPACK_LIBRARIES=-llapack"
2422 (string-append "-DTPL_PARMETIS_LIBRARIES="
2424 '("ptscotchparmetis" "ptscotch" "ptscotcherr"
2425 "scotchmetis" "scotch" "scotcherr")
2427 (string-append "-DTPL_PARMETIS_INCLUDE_DIRS="
2428 (assoc-ref %build-inputs "parmetis")
2430 "-DTPL_ENABLE_COMBBLASLIB=ON"
2431 (string-append "-DTPL_COMBBLAS_INCLUDE_DIRS="
2432 (assoc-ref %build-inputs "combblas")
2433 "/include/CombBLAS;"
2434 (assoc-ref %build-inputs "combblas")
2435 "/include/BipartiteMatchings")
2436 "-DTPL_COMBBLAS_LIBRARIES=CombBLAS")
2438 (modify-phases %standard-phases
2439 (add-before 'configure 'set-c++-standard
2441 (substitute* "CMakeLists.txt"
2442 ;; AWPM headers require C++14
2443 (("CMAKE_CXX_STANDARD 11") "CMAKE_CXX_STANDARD 14"))))
2444 (add-before 'check 'mpi-setup
2446 (add-before 'check 'omp-setup
2447 (lambda _ (setenv "OMP_NUM_THREADS" "1") #t)))))
2448 (home-page (package-home-page superlu))
2449 (synopsis "Parallel supernodal direct solver")
2451 "SuperLU_DIST is a parallel extension to the serial SuperLU library.
2452 It is targeted for distributed memory parallel machines. SuperLU_DIST is
2453 implemented in ANSI C, and MPI for communications.")
2454 (license license:bsd-3)))
2456 (define-public scotch
2463 (uri (string-append "https://gforge.inria.fr/frs/download.php/"
2464 "latestfile/298/scotch_" version ".tar.gz"))
2466 (base32 "1ky4k9r6jvajhqaqnnx6h8fkmds2yxgp70dpr1qzwcyhi2nhqvv8"))
2467 (patches (search-patches "scotch-build-parallelism.patch"
2468 "scotch-integer-declarations.patch"))))
2469 (build-system gnu-build-system)
2474 (outputs '("out" "metis"))
2476 `(#:make-flags (list (string-append "prefix=" %output))
2478 (modify-phases %standard-phases
2480 'unpack 'chdir-to-src
2481 (lambda _ (chdir "src") #t))
2485 (call-with-output-file "Makefile.inc"
2499 CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
2500 LDFLAGS = -lz -lm -lrt -lpthread
2502 LEX = flex -Pscotchyy -olex.yy.c
2507 YACC = bison -pscotchyy -y -b y
2509 '("COMMON_FILE_COMPRESS_GZ"
2511 "COMMON_RANDOM_FIXED_SEED"
2512 "INTSIZE64" ;use 'int64_t'
2513 ;; Prevents symbolc clashes with libesmumps
2515 ;; XXX: Causes invalid frees in superlu-dist tests
2517 ;; "SCOTCH_PTHREAD_NUMBER=2"
2518 "restrict=__restrict"))))
2520 (add-after 'build 'build-esmumps
2523 (format #f "-j~a" (parallel-job-count))
2525 (add-before 'install 'make-install-dirs
2526 (lambda* (#:key outputs #:allow-other-keys)
2527 (mkdir (assoc-ref outputs "out"))))
2528 (add-after 'install 'install-metis
2529 (lambda* (#:key outputs #:allow-other-keys)
2530 (let ((out (assoc-ref outputs "metis")))
2532 ;; metis files are not installed with 'make install'
2533 (for-each (lambda (f)
2534 (install-file f (string-append out "/include")))
2535 (find-files "../include/" ".*metis\\.h"))
2536 (for-each (lambda (f)
2537 (install-file f (string-append out "/lib")))
2538 (find-files "../lib/" ".*metis\\..*"))
2540 (home-page "http://www.labri.fr/perso/pelegrin/scotch/")
2541 (synopsis "Programs and libraries for graph algorithms")
2542 (description "SCOTCH is a set of programs and libraries which implement
2543 the static mapping and sparse matrix reordering algorithms developed within
2544 the SCOTCH project. Its purpose is to apply graph theory, with a divide and
2545 conquer approach, to scientific computing problems such as graph and mesh
2546 partitioning, static mapping, and sparse matrix ordering, in application
2547 domains ranging from structural mechanics to operating systems or
2549 ;; See LICENSE_en.txt
2550 (license license:cecill-c)))
2552 (define-public scotch32
2553 ;; This is the 'INTSIZE32' variant, which uses 32-bit integers, as needed by
2554 ;; some applications.
2555 (package (inherit scotch)
2558 (substitute-keyword-arguments (package-arguments scotch)
2559 ((#:phases scotch-phases)
2560 `(modify-phases ,scotch-phases
2564 (call-with-output-file "Makefile.inc"
2578 CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
2579 LDFLAGS = -lz -lm -lrt -lpthread
2581 LEX = flex -Pscotchyy -olex.yy.c
2586 YACC = bison -pscotchyy -y -b y
2588 '("COMMON_FILE_COMPRESS_GZ"
2590 "COMMON_RANDOM_FIXED_SEED"
2591 "INTSIZE32" ;use 32-bit integers. See INSTALL.txt
2592 ;; Prevents symbolc clashes with libesmumps
2594 ;; XXX: Causes invalid frees in superlu-dist tests
2596 ;; "SCOTCH_PTHREAD_NUMBER=2"
2597 "restrict=__restrict"))))))))))
2599 "Programs and libraries for graph algorithms (32-bit integers)")))
2601 (define-public pt-scotch
2602 (package (inherit scotch)
2605 `(("openmpi" ,openmpi))) ;Headers include MPI headers
2607 (substitute-keyword-arguments (package-arguments scotch)
2608 ((#:phases scotch-phases)
2609 `(modify-phases ,scotch-phases
2613 (invoke "make" (format #f "-j~a" (parallel-job-count))
2614 "ptscotch" "ptesmumps")
2616 ;; Install the serial metis compatibility library
2617 (invoke "make" "-C" "libscotchmetis" "install")))
2618 (add-before 'check 'mpi-setup
2622 (invoke "make" "ptcheck")))))))
2623 (synopsis "Programs and libraries for graph algorithms (with MPI)")))
2625 (define-public pt-scotch32
2626 (package (inherit scotch32)
2627 (name "pt-scotch32")
2629 `(("openmpi" ,openmpi))) ;headers include MPI headers
2631 (substitute-keyword-arguments (package-arguments scotch32)
2632 ((#:phases scotch32-phases)
2633 `(modify-phases ,scotch32-phases
2636 (invoke "make" (format #f "-j~a" (parallel-job-count))
2637 "ptscotch" "ptesmumps")
2638 ;; Install the serial metis compatibility library
2639 (invoke "make" "-C" "libscotchmetis" "install")))
2640 (add-before 'check 'mpi-setup
2644 (invoke "make" "ptcheck")))))))
2646 "Programs and libraries for graph algorithms (with MPI and 32-bit integers)")))
2648 (define-public metis
2655 (uri (string-append "http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/"
2656 "metis-" version ".tar.gz"))
2659 "1cjxgh41r8k6j029yxs8msp3z6lcnpm16g5pvckk35kc7zhfpykn"))))
2660 (build-system cmake-build-system)
2662 `(("blas" ,openblas)))
2664 `(#:tests? #f ;no tests
2665 #:configure-flags `("-DSHARED=ON"
2666 ,(string-append "-DGKLIB_PATH=" (getcwd)
2667 "/metis-" ,version "/GKlib"))))
2668 (home-page "http://glaros.dtc.umn.edu/gkhome/metis/metis/overview")
2669 (synopsis "Graph partitioning and fill-reducing matrix ordering library")
2671 "METIS is a set of serial programs for partitioning graphs, partitioning
2672 finite element meshes, and producing fill-reducing orderings for sparse
2673 matrices. The algorithms implemented in METIS are based on the multilevel
2674 recursive-bisection, multilevel k-way, and multi-constraint partitioning
2676 (license license:asl2.0))) ;As of version 5.0.3
2678 (define-public p4est
2685 (uri (string-append "http://p4est.github.io/release/p4est-"
2689 "16h267z256kxcxfjs390qqzv19hr58vrj4x8lndb7alnk2vca8n5"))))
2690 (build-system gnu-build-system)
2692 `(("fortran" ,gfortran)
2697 `(#:configure-flags `(,(string-append "BLAS_LIBS=-L"
2698 (assoc-ref %build-inputs "blas")
2700 ,(string-append "LAPACK_LIBS=-L"
2701 (assoc-ref %build-inputs "lapack")
2703 #:phases (modify-phases %standard-phases
2704 (add-before 'check 'mpi-setup
2706 (home-page "http://www.p4est.org")
2707 (synopsis "Adaptive mesh refinement on forests of octrees")
2709 "The p4est software library enables the dynamic management of a
2710 collection of adaptive octrees, conveniently called a forest of octrees.
2711 p4est is designed to work in parallel and scales to hundreds of thousands of
2713 (license license:gpl2+)))
2715 (define-public p4est-openmpi
2716 (package (inherit p4est)
2717 (name "p4est-openmpi")
2720 ,@(package-inputs p4est)))
2722 (substitute-keyword-arguments (package-arguments p4est)
2723 ((#:configure-flags cf)
2724 ``("--enable-mpi" ,@,cf))))
2725 (synopsis "Parallel adaptive mesh refinement on forests of octrees")))
2727 (define-public gsegrafix
2734 (uri (string-append "mirror://gnu/" name "/" name "-"
2738 "1b13hvx063zv970y750bx41wpx6hwd5ngjhbdrna8w8yy5kmxcda"))))
2739 (build-system gnu-build-system)
2741 `(#:configure-flags '("LDFLAGS=-lm")))
2743 `(("libgnomecanvas" ,libgnomecanvas)
2744 ("libbonoboui" ,libbonoboui)
2745 ("libgnomeui" ,libgnomeui)
2746 ("libgnomeprintui" ,libgnomeprintui)
2749 `(("pkg-config" ,pkg-config)))
2750 (home-page "https://www.gnu.org/software/gsegrafix/")
2751 (synopsis "GNOME application to create scientific and engineering plots")
2752 (description "GSEGrafix is an application which produces high-quality graphical
2753 plots for science and engineering. Plots are specified via simple ASCII
2754 parameter files and data files and are presented in an anti-aliased GNOME
2755 canvas. The program supports rectangular two-dimensional plots, histograms,
2756 polar-axis plots and three-dimensional plots. Plots can be printed or saved
2757 to BMP, JPEG or PNG image formats.")
2758 (license license:gpl3+)))
2760 (define-public maxima
2767 (uri (string-append "mirror://sourceforge/maxima/Maxima-source/"
2768 version "-source/" name "-" version ".tar.gz"))
2771 "0xyahp4c6509haxh4n1swiqm3421gplkdisa0zypclh3252sbzfw"))
2772 (patches (search-patches "maxima-defsystem-mkdir.patch"))))
2773 (build-system gnu-build-system)
2776 ("gnuplot" ,gnuplot) ;for plots
2778 ("tk" ,tk))) ;Tcl/Tk is used by 'xmaxima'
2780 `(("texinfo" ,texinfo)
2782 ("python" ,python)))
2785 (list "--enable-gcl"
2786 (string-append "--with-posix-shell="
2787 (assoc-ref %build-inputs "bash")
2789 (string-append "--with-wish="
2790 (assoc-ref %build-inputs "tk")
2792 (let ((v ,(package-version tk)))
2793 (string-take v (string-index-right v #\.)))))
2794 ;; By default Maxima attempts to write temporary files to
2795 ;; '/tmp/nix-build-maxima-*', which won't exist at run time.
2796 ;; Work around that.
2797 #:make-flags (list "TMPDIR=/tmp")
2799 (modify-phases %standard-phases
2800 (add-after 'unpack 'patch-paths
2801 (lambda* (#:key inputs #:allow-other-keys)
2802 (let* ((sed (string-append (assoc-ref inputs "sed") "/bin/sed"))
2803 (coreutils (assoc-ref inputs "coreutils"))
2804 (dirname (string-append coreutils "/bin/dirname"))
2805 (head (string-append coreutils "/bin/head"))
2806 (perl (string-append (assoc-ref inputs "perl") "/bin/perl"))
2807 (python (string-append (assoc-ref inputs "python")
2809 (substitute* "src/maxima.in"
2810 (("sed ") (string-append sed " "))
2811 (("dirname") dirname)
2813 (substitute* "doc/info/Makefile.in"
2814 (("/usr/bin/env perl") perl))
2815 (substitute* "doc/info/build_html.sh.in"
2816 (("python") python))
2818 (add-before 'check 'pre-check
2820 (chmod "src/maxima" #o555)
2824 ;; This is derived from the testing code in the "debian/rules" file
2825 ;; of Debian's Maxima package.
2826 ;; If Maxima can successfully run this, the binary to be installed
2832 "--batch-string=\"run_testsuite();\" "
2833 "| grep -q \"No unexpected errors found\""))))
2834 ;; Make sure the doc and emacs files are found in the
2835 ;; standard location. Also configure maxima to find gnuplot
2836 ;; without having it on the PATH.
2837 (add-after 'install 'post-install
2838 (lambda* (#:key outputs inputs #:allow-other-keys)
2839 (let* ((gnuplot (assoc-ref inputs "gnuplot"))
2840 (out (assoc-ref outputs "out"))
2841 (datadir (string-append out "/share/maxima/" ,version))
2842 (binutils (string-append (assoc-ref inputs "binutils")
2844 (with-directory-excursion out
2845 (mkdir-p "share/emacs")
2846 (mkdir-p "share/doc")
2848 (string-append datadir "/doc/")
2849 (string-append out "/share/doc/maxima"))
2850 (with-atomic-file-replacement
2851 (string-append datadir "/share/maxima-init.lisp")
2853 (format out "~a ~s~a~%"
2854 "(setf $gnuplot_command "
2855 (string-append gnuplot "/bin/gnuplot") ")")
2856 (dump-port in out))))
2857 ;; Ensure that Maxima will have access to the GNU binutils
2858 ;; components at runtime.
2859 (wrap-program (string-append out "/bin/maxima")
2860 `("PATH" prefix (,binutils))))
2862 (home-page "http://maxima.sourceforge.net")
2863 (synopsis "Numeric and symbolic expression manipulation")
2864 (description "Maxima is a system for the manipulation of symbolic and
2865 numerical expressions. It yields high precision numeric results by using
2866 exact fractions, arbitrary precision integers, and variable precision floating
2868 ;; Some files are lgpl2.1+. Some are gpl2+. Some explicitly state gpl1+.
2869 ;; Others simply say "GNU General Public License" without stating a
2870 ;; version (which implicitly means gpl1+).
2871 ;; At least one file (src/maxima.asd) says "version 2."
2872 ;; GPLv2 only is therefore the smallest subset.
2873 (license license:gpl2)))
2875 (define-public wxmaxima
2883 (url "https://github.com/wxMaxima-developers/wxmaxima.git")
2884 (commit (string-append "Version-" version))))
2885 (file-name (git-file-name name version))
2888 "0zaz71fh156b9inrxf86scnix247al5pl9v18cxhjxcm0lanqxdp"))))
2889 (build-system cmake-build-system)
2891 `(("gettext" ,gettext-minimal)))
2893 `(("wxwidgets" ,wxwidgets)
2896 ("adwaita-icon-theme" ,adwaita-icon-theme)
2898 ("shared-mime-info" ,shared-mime-info)))
2900 `(#:tests? #f ; no check target
2902 (modify-phases %standard-phases
2903 (add-after 'install 'wrap-program
2904 (lambda* (#:key inputs outputs #:allow-other-keys)
2905 (wrap-program (string-append (assoc-ref outputs "out")
2908 (,(string-append (assoc-ref inputs "maxima")
2910 ;; For GtkFileChooserDialog.
2911 `("GSETTINGS_SCHEMA_DIR" =
2912 (,(string-append (assoc-ref inputs "gtk+")
2913 "/share/glib-2.0/schemas")))
2914 `("XDG_DATA_DIRS" ":" prefix
2915 (;; Needed by gdk-pixbuf to know supported icon formats.
2917 (assoc-ref inputs "shared-mime-info") "/share")
2918 ;; The default icon theme of GTK+.
2920 (assoc-ref inputs "adwaita-icon-theme") "/share"))))
2922 (home-page "https://andrejv.github.io/wxmaxima/")
2923 (synopsis "Graphical user interface for the Maxima computer algebra system")
2925 "wxMaxima is a graphical user interface for the Maxima computer algebra
2926 system. It eases the use of Maxima by making most of its commands available
2927 through a menu system and by providing input dialogs for commands that require
2928 more than one argument. It also implements its own display engine that
2929 outputs mathematical symbols directly instead of depicting them with ASCII
2932 wxMaxima also features 2D and 3D inline plots, simple animations, mixing of
2933 text and mathematical calculations to create documents, exporting of input and
2934 output to TeX, and a browser for Maxima's manual including command index and
2935 full text searching.")
2936 (license license:gpl2+)))
2938 (define-public armadillo
2944 (uri (string-append "mirror://sourceforge/arma/armadillo-"
2948 "1ka1vd9fcmvp12qkcm4888dkfqwnalvv00x04wy29f3nx3qwczby"))))
2949 (build-system cmake-build-system)
2950 (arguments `(#:tests? #f)) ; no test target
2952 `(("openblas" ,openblas)
2954 ("arpack" ,arpack-ng)))
2955 (home-page "http://arma.sourceforge.net/")
2956 (synopsis "C++ linear algebra library")
2958 "Armadillo is a C++ linear algebra library, aiming towards a good balance
2959 between speed and ease of use. It is useful for algorithm development
2960 directly in C++, or quick conversion of research code into production
2961 environments. It can be used for machine learning, pattern recognition,
2962 signal processing, bioinformatics, statistics, econometrics, etc. The library
2963 provides efficient classes for vectors, matrices and cubes, as well as 150+
2964 associated functions (eg. contiguous and non-contiguous submatrix views).")
2965 (license license:asl2.0)))
2967 (define-public muparser
2968 ;; When switching download sites, muparser re-issued a 2.2.5 release with a
2969 ;; different hash. In order to make `guix package --upgrade` work correctly,
2970 ;; we set a Guix packaging revision.
2971 ;; When the next version of muparser is released, we can remove
2972 ;; UPSTREAM-VERSION and REVISION and use the plain VERSION.
2973 (let ((upstream-version "2.2.5")
2977 (version (string-append upstream-version "-" revision))
2982 (url "https://github.com/beltoforion/muparser.git")
2983 (commit (string-append "v" upstream-version))))
2984 (file-name (git-file-name name version))
2986 (base32 "0f0g4995xngf1pp3zr4p6ai2f8v6f8bxwa0k8ayjjiv1l8h44m24"))))
2987 (build-system gnu-build-system)
2989 `(#:configure-flags '("--enable-samples=no")
2990 #:tests? #f)) ;no "check" target
2991 (home-page "http://muparser.beltoforion.de/")
2992 (synopsis "Fast parser library for mathematical expressions")
2994 "muParser is an extensible high performance math parser library. It is
2995 based on transforming an expression into a bytecode and precalculating constant
2997 (license license:expat))))
2999 (define-public openblas
3006 (uri (string-append "mirror://sourceforge/openblas/v" version "/OpenBLAS%20"
3007 version "%20version.tar.gz"))
3008 (file-name (string-append name "-" version ".tar.gz"))
3011 "062kg4ny1ywz7k5grpb4pbf0hba0w6manbajwkmv4f477a31sxpl"))))
3012 (build-system gnu-build-system)
3014 `(#:test-target "test"
3015 ;; DYNAMIC_ARCH is only supported on x86. When it is disabled and no
3016 ;; TARGET is specified, OpenBLAS will tune itself to the build host, so
3017 ;; we need to disable substitutions.
3019 ,(let ((system (or (%current-target-system) (%current-system))))
3020 (or (string-prefix? "x86_64" system)
3021 (string-prefix? "i686" system)
3022 (string-prefix? "mips" system)
3023 (string-prefix? "aarch64" system)))
3025 (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
3027 "MAKE_NB_JOBS=0" ;use jobserver for submakes
3028 ;; Build the library for all supported CPUs. This allows
3029 ;; switching CPU targets at runtime with the environment variable
3030 ;; OPENBLAS_CORETYPE=<type>, where "type" is a supported CPU type.
3031 ;; Unfortunately, this is not supported on non-x86 architectures,
3032 ;; where it leads to failed builds.
3033 ,@(let ((system (or (%current-target-system) (%current-system))))
3035 ((or (string-prefix? "x86_64" system)
3036 (string-prefix? "i686" system))
3037 '("DYNAMIC_ARCH=1"))
3038 ;; On MIPS we force the "SICORTEX" TARGET, as for the other
3039 ;; two available MIPS targets special extended instructions
3040 ;; for Loongson cores are used.
3041 ((string-prefix? "mips" system)
3042 '("TARGET=SICORTEX"))
3043 ;; On aarch64 force the generic 'armv8-a' target
3044 ((string-prefix? "aarch64" system)
3047 ;; no configure script
3049 (modify-phases %standard-phases
3051 (add-before 'build 'set-extralib
3052 (lambda* (#:key inputs #:allow-other-keys)
3053 ;; Get libgfortran found when building in utest.
3055 (string-append "-L" (assoc-ref inputs "fortran-lib")
3059 `(("fortran-lib" ,gfortran "lib")))
3062 ("fortran" ,gfortran)
3064 (home-page "http://www.openblas.net/")
3065 (synopsis "Optimized BLAS library based on GotoBLAS")
3067 "OpenBLAS is a BLAS library forked from the GotoBLAS2-1.13 BSD version.")
3068 (license license:bsd-3)))
3070 (define-public openblas-ilp64
3071 (package (inherit openblas)
3072 (name "openblas-ilp64")
3073 (supported-systems '("x86_64-linux" "aarch64-linux" "mips64el-linux"))
3075 (substitute-keyword-arguments (package-arguments openblas)
3076 ((#:make-flags flags '())
3077 `(append (list "INTERFACE64=1" "LIBNAMESUFFIX=ilp64")
3079 (synopsis "Optimized BLAS library based on GotoBLAS (ILP64 version)")
3080 (license license:bsd-3)))
3082 (define* (make-blis implementation #:optional substitutable?)
3083 "Return a BLIS package with the given IMPLEMENTATION (see config/ in the
3084 source tree for a list of implementations.)
3086 SUBSTITUTABLE? determines whether the package is made available as a
3089 Currently the specialization must be selected at configure-time, but work is
3090 underway to allow BLIS to select the right optimized kernels at run time:
3091 <https://github.com/flame/blis/issues/129>."
3093 (name (if (string=? implementation "reference")
3095 (string-append "blis-" implementation)))
3097 (home-page "https://github.com/flame/blis")
3100 (uri (git-reference (url home-page) (commit version)))
3103 "1wr79a50nm4abhw8w3sn96nmwp5mrzifcigk7khw9qcgyyyqayfh"))
3104 (file-name (git-file-name "blis" version))))
3105 (build-system gnu-build-system)
3107 `(#:test-target "test"
3109 #:substitutable? ,substitutable?
3111 #:phases (modify-phases %standard-phases
3113 (lambda* (#:key outputs #:allow-other-keys)
3114 ;; This is a home-made 'configure' script.
3115 (let ((out (assoc-ref outputs "out")))
3116 (invoke "./configure" "-p" out
3120 "--enable-threading=openmp"
3123 (add-before 'check 'show-test-output
3125 ;; By default "make check" is silent. Make it verbose.
3126 (system "tail -F output.testsuite &")
3128 (synopsis "High-performance basic linear algebra (BLAS) routines")
3130 "BLIS is a portable software framework for instantiating high-performance
3131 BLAS-like dense linear algebra libraries. The framework was designed to
3132 isolate essential kernels of computation that, when optimized, immediately
3133 enable optimized implementations of most of its commonly used and
3134 computationally intensive operations. While BLIS exports a new BLAS-like API,
3135 it also includes a BLAS compatibility layer which gives application developers
3136 access to BLIS implementations via traditional BLAS routine calls.")
3137 (license license:bsd-3)))
3140 ;; This is the "reference" implementation, which is the non-optimized but
3141 ;; portable variant (no assembly).
3142 (make-blis "reference" #t))
3144 (define ignorance blis)
3146 (define-syntax-rule (blis/x86_64 processor)
3147 "Expand to a package specialized for PROCESSOR."
3149 (inherit (make-blis processor))
3150 (supported-systems '("x86_64-linux"))))
3152 (define-public blis-sandybridge
3153 ;; BLIS specialized for Sandy Bridge processors (launched 2011):
3154 ;; <http://ark.intel.com/products/codename/29900/Sandy-Bridge>.
3155 (blis/x86_64 "sandybridge"))
3157 (define-public blis-haswell
3158 ;; BLIS specialized for Haswell processors (launched 2013):
3159 ;; <http://ark.intel.com/products/codename/42174/Haswell>.
3160 (blis/x86_64 "haswell"))
3162 (define-public blis-knl
3163 ;; BLIS specialized for Knights Landing processor (launched 2016):
3164 ;; <http://ark.intel.com/products/series/92650/Intel-Xeon-Phi-x200-Product-Family>.
3165 (blis/x86_64 "knl"))
3168 (define-public openlibm
3176 (url "https://github.com/JuliaLang/openlibm.git")
3177 (commit (string-append "v" version))))
3178 (file-name (git-file-name name version))
3180 (base32 "08wfchmmr5200fvmn1kwq9byc1fhsq46hn0y5k8scdl74771c7gh"))))
3181 (build-system gnu-build-system)
3184 (list (string-append "prefix=" (assoc-ref %outputs "out")))
3186 ;; no configure script
3187 (modify-phases %standard-phases (delete 'configure))
3188 #:tests? #f)) ;the tests are part of the default target
3189 (home-page "http://openlibm.org/")
3190 (synopsis "Portable C mathematical library (libm)")
3192 "OpenLibm is an effort to have a high quality, portable, standalone C
3193 mathematical library (libm). It can be used standalone in applications and
3194 programming language implementations. The project was born out of a need to
3195 have a good libm for the Julia programming language that worked consistently
3196 across compilers and operating systems, and in 32-bit and 64-bit
3198 ;; Each architecture has its own make target, and there is none for mips.
3199 (supported-systems (delete "mips64el-linux" %supported-systems))
3200 ;; See LICENSE.md for details.
3201 (license (list license:expat
3204 license:public-domain
3205 license:lgpl2.1+))))
3207 (define-public openspecfun
3209 (name "openspecfun")
3215 (url "https://github.com/JuliaLang/openspecfun.git")
3216 (commit (string-append "v" version))))
3217 (file-name (git-file-name name version))
3219 (base32 "0pfw6l3ch7isz403llx7inxlvavqh01jh1hb9dpidi86sjjx9kfh"))))
3220 (build-system gnu-build-system)
3222 '(#:tests? #f ; no "check" target
3224 (list (string-append "prefix=" (assoc-ref %outputs "out")))
3226 (modify-phases %standard-phases
3227 (delete 'configure)))) ; no configure script
3229 `(("fortran" ,gfortran)))
3230 (home-page "https://github.com/JuliaLang/openspecfun")
3231 (synopsis "Collection of special mathematical functions")
3233 "Openspecfun provides AMOS and Faddeeva. AMOS (from Netlib) is a
3234 portable package for Bessel Functions of a Complex Argument and Nonnegative
3235 Order; it contains subroutines for computing Bessel functions and Airy
3236 functions. Faddeeva allows computing the various error functions of arbitrary
3237 complex arguments (Faddeeva function, error function, complementary error
3238 function, scaled complementary error function, imaginary error function, and
3239 Dawson function); given these, one can also easily compute Voigt functions,
3240 Fresnel integrals, and similar related functions as well.")
3241 ;; Faddeeva is released under the Expat license; AMOS is included as
3242 ;; public domain software.
3243 (license (list license:expat license:public-domain))))
3245 (define-public suitesparse
3247 (name "suitesparse")
3253 "http://faculty.cse.tamu.edu/davis/SuiteSparse/SuiteSparse-"
3257 "1dnr6pmjzc2qmbkmb4shigx1l74ilf6abn7svyd6brxgvph8vadr"))
3258 (modules '((guix build utils)))
3260 ;; Remove bundled metis source
3262 (delete-file-recursively "metis-5.1.0")
3264 (build-system gnu-build-system)
3266 '(#:tests? #f ;no "check" target
3271 "MY_METIS_LIB=-lmetis"
3272 (string-append "INSTALL_LIB="
3273 (assoc-ref %outputs "out") "/lib")
3274 (string-append "INSTALL_INCLUDE="
3275 (assoc-ref %outputs "out") "/include")
3278 (modify-phases %standard-phases
3279 (delete 'configure)))) ;no configure script
3284 (home-page "http://faculty.cse.tamu.edu/davis/suitesparse.html")
3285 (synopsis "Suite of sparse matrix software")
3287 "SuiteSparse is a suite of sparse matrix algorithms, including: UMFPACK,
3288 multifrontal LU factorization; CHOLMOD, supernodal Cholesky; SPQR,
3289 multifrontal QR; KLU and BTF, sparse LU factorization, well-suited for circuit
3290 simulation; ordering methods (AMD, CAMD, COLAMD, and CCOLAMD); CSparse and
3291 CXSparse, a concise sparse Cholesky factorization package; and many other
3294 ;; AMD, CAMD, BTF, COLAMD, CCOLAMD, CSparse, CXSparse, KLU, LDL
3296 ;; GPUQREngine, RBio, SuiteSparse_GPURuntime, SuiteSparseQR, UMFPACK
3297 (license (list license:gpl2+ license:lgpl2.1+))))
3299 (define-public atlas
3305 (uri (string-append "mirror://sourceforge/math-atlas/Stable/"
3306 version "/atlas" version ".tar.bz2"))
3309 "1dyjlq3fiparvm8ypwk6rsmjzmnwk81l88gkishphpvc79ryp216"))))
3310 (build-system gnu-build-system)
3311 (home-page "http://math-atlas.sourceforge.net/")
3312 (inputs `(("gfortran" ,gfortran)
3313 ("lapack-tar" ,(package-source lapack))))
3314 (outputs '("out" "doc"))
3315 ;; For the moment we drop support for MIPS at it fails to compile. See
3316 ;; https://lists.gnu.org/archive/html/guix-devel/2014-11/msg00516.html
3317 (supported-systems (delete "mips64el-linux" %supported-systems))
3319 `(#:parallel-build? #f
3320 #:parallel-tests? #f
3322 ;; ATLAS tunes itself for the machine it is built on, as explained at
3323 ;; <http://lists.gnu.org/archive/html/guix-devel/2014-10/msg00305.html>.
3324 ;; For this reason, we want users to build it locally instead of using
3328 #:modules ((srfi srfi-26)
3329 (guix build gnu-build-system)
3332 `(;; Generate position independent code suitable for dynamic libraries
3333 ;; and use WALL timer to get more accurate timing.
3334 "-Fa" "alg" "-fPIC" "-D" "c" "-DWALL"
3337 ,,(if (string-match "64" (%current-system))
3340 ;; Disable parallel build as it gives errors: atlas_pthread.h is
3341 ;; needed to compile C files before it is generated.
3342 "-Ss" "pmake" "make -j 1"
3343 ;; Probe is failing for MIPS. We therefore define the system
3344 ;; architecture explicitly by setting (-A) MACHINETYPE = 49
3345 ;; 'MIPSR1xK' and (-V) ISA = 1 'none'.
3346 ,,@(if (string-prefix? "mips" (%current-system))
3347 (list "-A" "49" "-V" "1")
3349 ;; Generate shared libraries.
3351 ;; Build a full LAPACK library.
3352 ,(string-append "--with-netlib-lapack-tarfile="
3353 (assoc-ref %build-inputs "lapack-tar")))
3355 (modify-phases %standard-phases
3356 (add-after 'install 'install-doc
3357 (lambda* (#:key outputs inputs #:allow-other-keys)
3358 (let ((doc (string-append (assoc-ref outputs "doc")
3359 "/share/doc/atlas")))
3361 (for-each (cut install-file <> doc)
3362 (find-files "../ATLAS/doc" ".*"))
3364 (add-after 'check 'check-pt
3365 (lambda _ (invoke "make" "ptcheck")))
3366 ;; Fix files required to run configure.
3367 (add-before 'configure 'fix-/bin/sh
3369 ;; Use `sh', not `/bin/sh'.
3370 (substitute* (find-files "." "Makefile|configure|SpewMakeInc\\.c")
3373 ;; Fix /bin/sh in generated make files.
3374 (add-after 'configure 'fix-/bin/sh-in-generated-files
3376 (substitute* (find-files "." "^[Mm]ake\\.inc.*")
3379 ;; ATLAS configure program does not accepts the default flags
3380 ;; passed by the 'gnu-build-system'.
3382 (lambda* (#:key native-inputs inputs outputs
3383 (configure-flags '())
3384 #:allow-other-keys #:rest args)
3385 (let* ((prefix (assoc-ref outputs "out"))
3386 (bash (or (and=> (assoc-ref
3387 (or native-inputs inputs) "bash")
3388 (cut string-append <> "/bin/bash"))
3390 (flags `(,(string-append "--prefix=" prefix)
3392 (abs-srcdir (getcwd))
3393 (srcdir (string-append "../" (basename abs-srcdir))))
3394 (format #t "source directory: ~s (relative from build: ~s)~%"
3398 (format #t "build directory: ~s~%" (getcwd))
3399 (format #t "configure flags: ~s~%" flags)
3401 (string-append srcdir "/configure")
3403 (synopsis "Automatically Tuned Linear Algebra Software")
3405 "ATLAS is an automatically tuned linear algebra software library
3406 providing C and Fortran77 interfaces to a portably efficient BLAS
3407 implementation, as well as a few routines from LAPACK.
3409 Optimization occurs at build time. For this reason, the library is built on
3410 the machine where it is installed, without resorting to pre-built substitutes.
3412 Before building the library, CPU throttling should be disabled. This can be
3413 done in the BIOS, or, on GNU/Linux, with the following command:
3416 # cpupower --governor performance
3419 Failure to do so will result in a library with poor performance.")
3420 (license license:bsd-3)))
3429 (uri (string-append "https://github.com/g-truc/glm/releases/download/"
3430 version "/glm-" version ".zip"))
3433 "1vmg7hb4xvsa77zpbwiw6lqc7pyaj56dihx6xriny5b9rrh4iqsg"))))
3434 (build-system cmake-build-system)
3436 `(("unzip" ,unzip)))
3437 (home-page "https://glm.g-truc.net/")
3438 (synopsis "OpenGL Mathematics library")
3439 (description "OpenGL Mathematics (GLM) is a header-only C++ mathematics
3440 library for graphics software based on the OpenGL Shading Language (GLSL)
3442 (license license:expat)))
3444 (define-public lpsolve
3451 (uri (string-append "mirror://sourceforge/lpsolve/lpsolve/" version
3452 "/lp_solve_" version "_source.tar.gz"))
3455 "12pj1idjz31r7c2mb5w03vy1cmvycvbkx9z29s40qdmkp1i7q6i0"))
3456 (modules '((guix build utils)))
3459 (substitute* (list "lp_solve/ccc" "lpsolve55/ccc")
3461 ;; Pretend to be on a 64 bit platform to obtain a common directory
3462 ;; name for the build results on all architectures; nothing else
3463 ;; seems to depend on it.
3464 (("^PLATFORM=.*$") "PLATFORM=ux64\n")
3466 ;; The check for 'isnan' as it is written fails with
3467 ;; "non-floating-point argument in call to function
3468 ;; ‘__builtin_isnan’", which leads to the 'NOISNAN' cpp macro
3469 ;; definition, which in turn leads to bad things. Fix the feature
3471 (("isnan\\(0\\)") "isnan(0.)"))
3473 (build-system gnu-build-system)
3475 `(#:tests? #f ; no check target
3477 (modify-phases %standard-phases
3478 (delete 'configure) ; no configure script
3481 (with-directory-excursion "lpsolve55"
3482 (invoke "bash" "ccc"))
3483 (with-directory-excursion "lp_solve"
3484 (invoke "bash" "ccc"))
3487 (lambda* (#:key outputs #:allow-other-keys)
3488 (let* ((out (assoc-ref outputs "out"))
3489 (bin (string-append out "/bin"))
3490 (lib (string-append out "/lib"))
3491 ;; This is where LibreOffice expects to find the header
3492 ;; files, and where they are installed by Debian.
3493 (include (string-append out "/include/lpsolve")))
3494 (install-file "lpsolve55/bin/ux64/liblpsolve55.a" lib)
3495 (install-file "lpsolve55/bin/ux64/liblpsolve55.so" lib)
3496 (install-file "lp_solve/bin/ux64/lp_solve" bin)
3498 ;; Install a subset of the header files as on Debian
3499 ;; (plus lp_bit.h, which matches the regular expression).
3500 (for-each (lambda (name)
3501 (install-file name include))
3502 (find-files "." "lp_[HMSa-z].*\\.h$"))
3503 (with-directory-excursion "shared"
3504 (for-each (lambda (name)
3505 (install-file name include))
3506 (find-files "." "\\.h$")))
3508 (home-page "http://lpsolve.sourceforge.net/")
3509 (synopsis "Mixed integer linear programming (MILP) solver")
3511 "lp_solve is a mixed integer linear programming solver based on the
3512 revised simplex and the branch-and-bound methods.")
3513 (license license:lgpl2.1+)))
3515 (define-public dealii
3522 (uri (string-append "https://github.com/dealii/dealii/releases/"
3523 "download/v" version "/dealii-" version ".tar.gz"))
3526 "0r7f8rhl3xr94imd372plizdcbqk0a70w73lwc3vw912dxk0sbyz"))
3527 (patches (search-patches "dealii-mpi-deprecations.patch"))
3528 (modules '((guix build utils)))
3530 ;; Remove bundled sources: UMFPACK, TBB, muParser, and boost
3532 (delete-file-recursively "bundled")
3534 (build-system cmake-build-system)
3542 ("arpack" ,arpack-ng)
3543 ("muparser" ,muparser)
3544 ("gfortran" ,gfortran)
3545 ("suitesparse" ,suitesparse))) ;for UMFPACK
3547 `(#:build-type "DebugRelease" ;only supports Release, Debug, or DebugRelease
3549 ;; Work around a bug in libsuitesparseconfig linking
3550 ;; see https://github.com/dealii/dealii/issues/4745
3551 '("-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON")))
3552 (home-page "https://www.dealii.org")
3553 (synopsis "Finite element library")
3555 "Deal.II is a C++ program library targeted at the computational solution
3556 of partial differential equations using adaptive finite elements. The main
3557 aim of deal.II is to enable rapid development of modern finite element codes,
3558 using among other aspects adaptive meshes and a wide array of tools often used
3559 in finite element programs.")
3560 (license license:lgpl2.1+)))
3562 (define-public dealii-openmpi
3563 (package (inherit dealii)
3564 (name "dealii-openmpi")
3567 ;;Supported only with MPI:
3568 ("hdf5" ,hdf5-parallel-openmpi) ;TODO: have petsc-openmpi propagate?
3569 ("p4est" ,p4est-openmpi)
3570 ("petsc" ,petsc-openmpi)
3571 ("slepc" ,slepc-openmpi)
3572 ("metis" ,metis) ;for MUMPS
3573 ("scalapack" ,scalapack) ;for MUMPS
3574 ("mumps" ,mumps-metis-openmpi) ;configure supports only metis orderings
3575 ("arpack" ,arpack-ng-openmpi)
3576 ,@(fold alist-delete (package-inputs dealii)
3577 '("p4est" "arpack"))))
3579 (substitute-keyword-arguments (package-arguments dealii)
3580 ((#:configure-flags cf)
3581 `(cons "-DDEAL_II_WITH_MPI:BOOL=ON"
3583 ((#:phases phases '%standard-phases)
3584 `(modify-phases ,phases
3585 (add-before 'check 'mpi-setup
3586 ,%openmpi-setup)))))
3587 (synopsis "Finite element library (with MPI support)")))
3589 (define-public flann
3598 "http://www.cs.ubc.ca/research/flann/uploads/FLANN/flann-"
3599 version "-src.zip"))
3602 "022w8hph7bli5zbpnk3z1qh1c2sl5hm8fw2ccim651ynn0hr7fyz"))
3603 (patches (search-patches "flann-cmake-3.11.patch"))))
3604 (build-system cmake-build-system)
3606 "octave")) ;46 MiB .mex file that pulls Octave
3608 `(("unzip" ,unzip)))
3611 ("octave" ,octave-cli)
3612 ("python" ,python-2) ; print syntax
3613 ;; ("python2-numpy" ,python2-numpy) ; only required for the tests
3616 `(;; The 'share/flann/octave' contains a .mex file, which is an ELF file
3617 ;; taken 46 MiB unstripped, and 6 MiB stripped.
3618 #:strip-directories '("lib" "lib64" "libexec"
3619 "bin" "sbin" "share/flann/octave")
3621 ;; Save 12 MiB by not installing .a files. Passing
3622 ;; '-DBUILD_STATIC_LIBS=OFF' has no effect.
3623 #:phases (modify-phases %standard-phases
3624 (add-before 'configure 'set-octave-directory
3625 (lambda* (#:key outputs #:allow-other-keys)
3626 ;; Install the .mex file in the "octave" output.
3627 (let ((out (assoc-ref outputs "octave")))
3628 (substitute* "src/matlab/CMakeLists.txt"
3629 (("share/flann/octave")
3630 (string-append out "/share/flann/octave")))
3632 (add-after 'install 'remove-static-libraries
3633 (lambda* (#:key outputs #:allow-other-keys)
3634 (let* ((out (assoc-ref outputs "out"))
3635 (lib (string-append out "/lib")))
3636 (for-each delete-file
3637 (find-files lib "\\.a$"))
3640 #:tests? #f)) ; The test data are downloaded from the Internet.
3641 (home-page "http://www.cs.ubc.ca/research/flann/")
3642 (synopsis "Library for approximate nearest neighbors computation")
3643 (description "FLANN is a library for performing fast approximate
3644 nearest neighbor searches in high dimensional spaces. It implements a
3645 collection of algorithms and a system for automatically choosing the best
3646 algorithm and optimum parameters depending on the dataset.
3648 FLANN is written in C++ and contains bindings for C, Octave and Python.")
3649 (license (license:non-copyleft "file://COPYING"
3650 "See COPYING in the distribution."))))
3652 (define-public wcalc
3659 (uri (string-append "mirror://sourceforge/w-calc/Wcalc/" version "/"
3660 "wcalc-" version ".tar.bz2"))
3663 "1vi8dl6rccqiq1apmpwawyg2ywx6a1ic1d3cvkf2hlwk1z11fb0f"))))
3664 (build-system gnu-build-system)
3667 ("readline" ,readline)))
3668 (home-page "http://w-calc.sourceforge.net/index.php")
3669 (synopsis "Flexible command-line scientific calculator")
3670 (description "Wcalc is a very capable calculator. It has standard functions
3671 (sin, asin, and sinh for example, in either radians or degrees), many
3672 pre-defined constants (pi, e, c, etc.), support for using variables, \"active\"
3673 variables, a command history, hex/octal/binary input and output, unit
3674 conversions, embedded comments, and an expandable expression entry field. It
3675 evaluates expressions using the standard order of operations.")
3676 (license license:gpl2+)))
3684 (uri (string-append "mirror://sourceforge/xaos/XaoS/" version
3685 "/xaos-" version ".tar.gz"))
3688 "15cd1cx1dyygw6g2nhjqq3bsfdj8sj8m4va9n75i0f3ryww3x7wq"))))
3689 (build-system gnu-build-system)
3690 (native-inputs `(("gettext" ,gettext-minimal)))
3691 (inputs `(("libx11" ,libx11)
3696 `(#:tests? #f ;no "check" target
3697 #:make-flags '("LOCALEDIR=$DATAROOTDIR/locale")))
3698 (synopsis "Real-time fractal zoomer")
3699 (description "GNU XaoS is a graphical program that generates fractal
3700 patterns and allows you to zoom in and out of them infinitely in a fluid,
3701 continuous manner. It also includes tutorials that help to explain how fractals
3702 are built. It can generate many different fractal types such as the Mandelbrot
3704 (home-page "https://www.gnu.org/software/xaos/")
3705 (license license:gpl2+)))
3707 (define-public hypre
3715 (url "https://github.com/LLNL/hypre.git")
3716 (commit (string-append "v" version))))
3717 (file-name (git-file-name name version))
3719 (base32 "1lvh4ybqkriyqfg2zmic6mrg1981qv1i9vry1fdgsabn81hb71g4"))
3720 (modules '((guix build utils)))
3723 ;; Remove use of __DATE__ and __TIME__ for reproducibility;
3724 ;; substitute the release date.
3725 (substitute* "src/utilities/HYPRE_utilities.h"
3726 (("Date Compiled: .*$")
3727 "Date Compiled: Oct 19 2018 15:23:00 +0000\"\n"))
3729 (build-system gnu-build-system)
3730 (outputs '("out" ; 6.1 MiB of headers and libraries
3731 "doc")) ; 4.8 MiB of documentation
3735 ("perl" ,perl) ; needed to run 'ppmquant' during tests
3736 ("texlive" ,(texlive-union (list texlive-generic-xypic
3738 texlive-latex-hyperref
3740 ("ghostscript" ,ghostscript)))
3742 `(("blas" ,openblas)
3743 ("lapack" ,lapack)))
3745 `(#:modules ((srfi srfi-1)
3746 ,@%gnu-build-system-modules)
3747 #:configure-flags '("--enable-shared"
3755 (modify-phases %standard-phases
3756 (add-before 'build 'set-HOME
3758 ;; FIXME: texlive-union does not find the built
3759 ;; metafonts, so it tries to generate them in HOME.
3760 (setenv "HOME" "/tmp")
3762 (add-before 'configure 'chdir-src
3763 (lambda _ (chdir "src")))
3765 (lambda* (#:key build target configure-flags
3766 #:allow-other-keys #:rest args)
3767 (let* ((configure (assoc-ref %standard-phases 'configure)))
3770 (list #:configure-flags
3771 (cons (string-append
3772 "--host=" (or target build))
3773 configure-flags)))))))
3774 (add-after 'build 'build-docs
3776 (invoke "make" "-Cdocs" "pdf" "html")))
3779 (setenv "LD_LIBRARY_PATH" (string-append (getcwd) "/hypre/lib"))
3780 (setenv "PATH" (string-append "." ":" (getenv "PATH")))
3781 (invoke "make" "check" "CHECKRUN=")
3782 (for-each (lambda (filename)
3783 (let ((size (stat:size (stat filename))))
3784 (when (positive? size)
3785 (error (format #f "~a size ~d; error indication~%"
3787 (find-files "test" ".*\\.err$"))
3789 (add-after 'install 'install-docs
3790 (lambda* (#:key outputs #:allow-other-keys)
3791 ;; Custom install because docs/Makefile doesn't honor ${docdir}.
3792 (let* ((doc (assoc-ref outputs "doc"))
3793 (docdir (string-append doc "/share/doc/hypre-" ,version)))
3794 (with-directory-excursion "docs"
3795 (for-each (lambda (base)
3796 (install-file (string-append base ".pdf") docdir)
3797 (copy-recursively base docdir)) ; html docs
3798 '("HYPRE_usr_manual"
3799 "HYPRE_ref_manual")))
3801 (home-page "http://www.llnl.gov/casc/hypre/")
3802 (synopsis "Library of solvers and preconditioners for linear equations")
3804 "HYPRE is a software library of high performance preconditioners and
3805 solvers for the solution of large, sparse linear systems of equations. It
3806 features multigrid solvers for both structured and unstructured grid
3808 (license license:lgpl2.1)))
3810 (define-public hypre-openmpi
3811 (package (inherit hypre)
3812 (name "hypre-openmpi")
3815 ,@(package-inputs hypre)))
3817 (substitute-keyword-arguments (package-arguments hypre)
3818 ((#:configure-flags flags)
3820 ,@(delete "--without-MPI" ,flags)))
3822 `(modify-phases ,phases
3823 (add-before 'check 'mpi-setup
3824 ,%openmpi-setup)))))
3825 (synopsis "Parallel solvers and preconditioners for linear equations")
3827 "HYPRE is a software library of high performance preconditioners and
3828 solvers for the solution of large, sparse linear systems of equations on
3829 parallel computers. It features parallel multigrid solvers for both
3830 structured and unstructured grid problems.")))
3832 (define-public matio
3839 (uri (string-append "mirror://sourceforge/matio/matio/" version "/"
3840 "matio-" version ".tar.gz"))
3843 "0y2qymgxank8wdiwc68ap8bxdzrhvyw86i29yh3xgn4z1njfd9ir"))))
3844 (build-system gnu-build-system)
3848 (home-page "http://matio.sourceforge.net/")
3849 (synopsis "Library for reading and writing MAT files")
3850 (description "Matio is a library for reading and writing MAT files. It
3851 supports compressed MAT files, as well as newer (version 7.3) MAT files.")
3852 (license license:bsd-2)))
3859 (origin (method url-fetch)
3860 (uri (string-append "https://github.com/VcDevel/Vc/releases/"
3861 "download/" version "/Vc-" version ".tar.gz"))
3864 "1zmlpn32jzb38smp3j834llmbix3whsrbw0h397qxysbw792kih8"))))
3865 (build-system cmake-build-system)
3868 '("-DBUILD_TESTING=ON"
3869 ;; By default, Vc will optimize for the CPU of the build machine.
3870 ;; Setting this to "none" makes it create portable binaries. See
3871 ;; "cmake/OptimizeForArchitecture.cmake".
3872 "-DTARGET_ARCHITECTURE=none")))
3873 (synopsis "SIMD vector classes for C++")
3874 (description "Vc provides portable, zero-overhead C++ types for explicitly
3875 data-parallel programming. It is a library designed to ease explicit
3876 vectorization of C++ code. Its types enable explicitly stating data-parallel
3877 operations on multiple values. The parallelism is therefore added via the type
3878 system. Vc has an intuitive API and provides portability between different
3879 compilers and compiler versions as well as portability between different vector
3880 instruction sets. Thus, an application written with Vc can be compiled for:
3883 @item SSE2 up to SSE4.2 or SSE4a
3886 @item NEON (in development)
3887 @item NVIDIA GPUs / CUDA (in development)
3889 (home-page "https://github.com/VcDevel/Vc")
3890 ;; "No support_???.cpp file exists for this architecture."
3891 (supported-systems '("x86_64-linux" "i686-linux"))
3892 (license license:bsd-3)))
3894 (define-public reducelcs
3895 ;; This is the last commit which is available upstream, no
3896 ;; release happened since 2010.
3897 (let ((commit "474f88deb968061abe8cf11c959e02319b8ae5c0")
3901 (version (string-append "1.0-" revision "." (string-take commit 7)))
3906 (url "https://github.com/gdv/Reduce-Expand-for-LCS")
3908 (file-name (string-append name "-" version "-checkout"))
3911 "1rllzcfwc042c336mhq262a8ha90x6afq30kvk60r7i4761j4yjm"))))
3912 (build-system gnu-build-system)
3914 `(("openlibm" ,openlibm)))
3916 `(#:tests? #f ; no tests
3918 (modify-phases %standard-phases
3919 (delete 'configure) ; No configure script exists.
3920 (replace 'install ; No install phase exists.
3921 (lambda* (#:key outputs #:allow-other-keys)
3922 (let* ((out (assoc-ref outputs "out"))
3923 (bin (string-append out "/bin")))
3924 (install-file "Approximation" bin)
3925 (install-file "CollectResults" bin)
3926 (install-file "GenerateInstances" bin)
3928 (synopsis "Approximate Longest Commons Subsequence computation tool")
3930 "@code{reduceLCS} is an implementation of the Reduce-Expand
3931 algorithm for LCS. It is a fast program to compute the approximate
3932 Longest Commons Subsequence of a set of strings.")
3933 (home-page "https://github.com/gdv/Reduce-Expand-for-LCS")
3934 (license license:gpl3+))))
3936 (define-public jacal
3943 "http://groups.csail.mit.edu/mac/ftpdir/scm/jacal-"
3946 "055zrn12a1dmy0dqkwrkq3fklbhg3yir6vn0lacp4mvbg8573a3q"))
3947 (patches (search-patches "jacal-fix-texinfo.patch"))))
3948 (build-system gnu-build-system)
3951 (modify-phases %standard-phases
3952 (add-before 'build 'pre-build
3953 ;; Don't use upstream's script - it really doesn't fit into
3954 ;; Guix's functional paradigm.
3955 (lambda* (#:key inputs outputs #:allow-other-keys)
3956 (substitute* "Makefile"
3957 (("^install: install-script") "install: "))))
3958 (add-after 'install 'post-install
3959 ;; Instead, we provide our own simplified script.
3960 (lambda* (#:key inputs outputs #:allow-other-keys)
3961 (let ((wrapper (string-append (assoc-ref outputs "out")
3963 (format (open wrapper (logior O_WRONLY O_CREAT))
3964 (string-append "#!~a\nexec ~a/bin/scm -ip1 "
3965 "-e '(slib:load \"~a/lib/jacal/math\") "
3968 (assoc-ref inputs "scm")
3969 (assoc-ref outputs "out"))
3970 (chmod wrapper #o555))))
3972 (lambda* (#:key outputs #:allow-other-keys)
3973 (invoke "./configure"
3974 (string-append "--prefix="
3975 (assoc-ref outputs "out"))))))))
3976 (inputs `(("scm" ,scm)))
3977 (native-inputs `(("unzip" ,unzip)
3978 ("texinfo" ,texinfo)))
3979 (synopsis "Symbolic mathematics system")
3980 (description "GNU JACAL is an interactive symbolic mathematics program based on
3981 Scheme. It manipulate and simplify a range of mathematical expressions such
3982 as equations, scalars, vectors, and matrices.")
3983 (home-page "https://www.gnu.org/software/jacal/")
3984 (license license:gpl3+)))
3990 (home-page "https://github.com/Z3Prover/z3")
3993 (uri (git-reference (url home-page)
3994 (commit (string-append "z3-" version))))
3995 (file-name (git-file-name name version))
3998 "014igqm5vwswz0yhz0cdxsj3a6dh7i79hvhgc3jmmmz3z0xm1gyn"))))
3999 (build-system gnu-build-system)
4002 (modify-phases %standard-phases
4003 (add-after 'unpack 'fix-compatability
4004 ;; Versions after 4.8.3 have immintrin.h IFDEFed for Windows only.
4006 (substitute* "src/util/mpz.cpp"
4007 (("#include <immintrin.h>") ""))
4009 (add-before 'configure 'bootstrap
4011 (invoke "python" "scripts/mk_make.py")))
4012 ;; work around gnu-build-system's setting --enable-fast-install
4013 ;; (z3's `configure' is a wrapper around the above python file,
4014 ;; which fails when passed --enable-fast-install)
4016 (lambda* (#:key inputs outputs #:allow-other-keys)
4017 (invoke "./configure"
4018 (string-append "--prefix=" (assoc-ref outputs "out")))))
4019 (add-after 'configure 'change-directory
4023 (add-before 'check 'make-test-z3
4025 ;; Build the test suite executable.
4026 (invoke "make" "test-z3" "-j"
4027 (number->string (parallel-job-count)))))
4030 ;; Run all the tests that don't require arguments.
4031 (invoke "./test-z3" "/a"))))))
4034 ("python" ,python-wrapper)))
4035 (synopsis "Theorem prover")
4036 (description "Z3 is a theorem prover and @dfn{satisfiability modulo
4037 theories} (SMT) solver. It provides a C/C++ API, as well as Python bindings.")
4038 (license license:expat)))
4043 (version "2018.11.001")
4046 (uri (string-append "http://elpa.mpcdf.mpg.de/html/Releases/"
4047 version "/elpa-" version ".tar.gz"))
4050 "05hv3v5i6xmziaizw350ff72y1c3k662r85fm3xfdrkclj5zw9yc"))))
4051 (build-system gnu-build-system)
4053 `(("fortran" ,gfortran)
4054 ("perl" ,perl))) ;for configure and deps
4056 `(("blas" ,openblas)))
4061 ;; ELPA unfortunately does not support runtime dispatch, so we can
4062 ;; only enable the "generic" kernels. See the "Cross compilation"
4063 ;; section of INSTALL.md.
4065 "--disable-sse" "--disable-sse-assembly" ;Require SSE3
4066 "--disable-avx" "--disable-avx2" "--disable-avx512"
4067 ,(string-append "CFLAGS=-O3 "
4068 "-funsafe-loop-optimizations -funsafe-math-optimizations "
4069 "-ftree-vect-loop-version -ftree-vectorize "
4070 ,(let ((system (or (%current-target-system)
4071 (%current-system))))
4073 ((or (string-prefix? "x86_64" system)
4074 (string-prefix? "i686" system))
4077 #:parallel-tests? #f ;tests are multi-threaded, via BLAS
4079 (modify-phases %standard-phases
4080 (add-before 'configure 'patch-header-generation
4082 (substitute* "configure"
4083 (("^ *make.*top_srcdir=\"\\$srcdir\"" &)
4084 (string-append & " CPP=\"$CPP\"")))
4086 (add-before 'check 'setup-tests
4088 ;; Decrease test time and RAM use by computing fewer eigenvalues.
4089 ;; The flags are (MATRIX-SIZE, EIGENVALUES, BLOCK-SIZE), where
4090 ;; the default is (500, 250, 16) for C tests and (5000, 150, 16)
4091 ;; for Fortran. This also causes several tests to pass that
4092 ;; otherwise would otherwise fail with matrix size 5000; possibly
4093 ;; due to floating point tolerances that are too tight.
4094 (setenv "TEST_FLAGS" "1500 50 16") ;from elpa.spec
4095 (setenv "OMP_NUM_THREADS" (number->string (parallel-job-count)))
4096 (substitute* "Makefile"
4097 ;; Test scripts are generated, patch the shebang
4098 (("#!/bin/bash") (string-append "#!" (which "sh"))))
4100 (home-page "http://elpa.mpcdf.mpg.de")
4101 (synopsis "Eigenvalue solvers for symmetric matrices")
4103 "The ELPA library provides efficient and scalable direct eigensolvers for
4104 symmetric matrices.")
4105 (license license:lgpl3)))
4107 (define-public elpa-openmpi
4108 (package (inherit elpa)
4109 (name "elpa-openmpi")
4112 ("scalapack" ,scalapack)
4113 ,@(package-inputs elpa)))
4115 (substitute-keyword-arguments (package-arguments elpa)
4116 ((#:configure-flags cf '())
4117 `(cons "--with-mpi=yes" (delete "--with-mpi=no" ,cf)))
4118 ((#:phases phases '%standard-phases)
4119 `(modify-phases ,phases
4120 (add-before 'check 'mpi-setup
4122 ;; Tests use 2 mpi tasks by default, use our remaining build
4123 ;; cores as OpenMP threads.
4124 (setenv "OMP_NUM_THREADS" (number->string
4125 (max (quotient (parallel-job-count) 2)
4127 (,%openmpi-setup)))))))
4128 (synopsis "Eigenvalue solvers for symmetric matrices (with MPI support)")))
4130 (define-public elemental
4137 (url "https://github.com/elemental/Elemental.git")
4138 (commit (string-append "v" version))))
4139 (file-name (git-file-name name version))
4142 "1687xpjjzig27y2pnqv7hv09smpijyfdpz7qjgmcxf4shfajlfkc"))))
4143 (build-system cmake-build-system)
4144 (home-page "http://libelemental.org")
4146 `(("gfortran" ,gfortran)))
4148 `(("blas" ,openblas)
4149 ("gfortran:lib" ,gfortran "lib")
4158 `(#:build-type "Release" ;default RelWithDebInfo not supported
4159 #:configure-flags `("-DEL_DISABLE_PARMETIS:BOOL=YES"
4160 "-DEL_AVOID_COMPLEX_MPI:BOOL=NO"
4161 "-DEL_CACHE_WARNINGS:BOOL=YES"
4162 "-DEL_TESTS:BOOL=YES"
4163 "-DCMAKE_INSTALL_LIBDIR=lib"
4164 "-DGFORTRAN_LIB=gfortran")
4165 #:phases (modify-phases %standard-phases
4166 (add-before 'check 'mpi-setup
4168 (add-before 'check 'setup-tests
4170 ;; Parallelism is done at the MPI layer.
4171 (setenv "OMP_NUM_THREADS" "1")
4173 (add-after 'install 'remove-tests
4174 (lambda* (#:key outputs #:allow-other-keys)
4175 ;; Tests are installed, with no easy configuration
4176 ;; switch to prevent this, so delete them.
4177 (delete-file-recursively
4178 (string-append (assoc-ref outputs "out") "/bin"))
4180 (synopsis "Dense and sparse-direct linear algebra and optimization")
4181 (description "Elemental is a modern C++ library for distributed-memory
4182 dense and sparse-direct linear algebra, conic optimization, and lattice
4184 (license license:bsd-2)))
4186 (define-public mcrl2
4189 (version "201707.1.15162")
4192 (uri (string-append "http://www.mcrl2.org/download/devel/mcrl2-"
4197 "1ziww2fchsklm25hl9p2mngssxfh9w07nc114cncqaxfibqp2p8f"))))
4199 `(("subversion" ,subversion)))
4204 ("qtbase" ,qtbase)))
4205 (build-system cmake-build-system)
4206 (synopsis "Toolset for the mCRL2 formal specification language")
4208 "@dfn{mCRL2} (micro Common Representation Language 2) is a formal
4209 specification language for describing concurrent discrete event systems. Its
4210 toolset supports analysis and automatic verification, linearisation, simulation,
4211 state-space exploration and generation, and tools to optimise and analyse
4212 specifications. Also, state spaces can be manipulated, visualised and
4214 (home-page "https://mcrl2.org")
4215 (license license:boost1.0)))
4217 (define-public r-subplex
4224 (uri (cran-uri "subplex" version))
4227 "10cbgbx1bgsax5z7gz6716g360xpq4mvq19cf4qqrxv02mmwz57z"))))
4228 (build-system r-build-system)
4230 `(("gfortran" ,gfortran)))
4231 (home-page "https://cran.r-project.org/web/packages/subplex")
4232 (synopsis "Unconstrained optimization using the subplex algorithm")
4233 (description "This package implements the Subplex optimization algorithm.
4234 It solves unconstrained optimization problems using a simplex method on
4235 subspaces. The method is well suited for optimizing objective functions that
4236 are noisy or are discontinuous at the solution.")
4237 (license license:gpl3+)))
4239 (define-public r-desolve
4246 (uri (cran-uri "deSolve" version))
4249 "0qqc4mknw1jblzcmph1dg3k1p6w42yal0k1xjh8pqk7yb3a75hs5"))))
4250 (properties `((upstream-name . "deSolve")))
4251 (build-system r-build-system)
4253 `(("gfortran" ,gfortran)))
4254 (home-page "https://desolve.r-forge.r-project.org/")
4255 (synopsis "Solvers for initial value problems of differential equations")
4256 (description "This package provides functions that solve initial
4257 value problems of a system of first-order ordinary differential equations (ODE),
4258 of partial differential equations (PDE), of differential algebraic equations
4259 (DAE), and of delay differential equations. The functions provide an interface
4260 to the FORTRAN functions lsoda, lsodar, lsode, lsodes of the ODEPACK collection,
4261 to the FORTRAN functions dvode and daspk and a C-implementation of solvers of
4262 the Runge-Kutta family with fixed or variable time steps. The package contains
4263 routines designed for solving ODEs resulting from 1-D, 2-D and 3-D partial
4264 differential equations (PDE) that have been converted to ODEs by numerical
4266 (license license:gpl2+)))
4268 (define-public tcalc
4275 (uri (string-append "https://sites.google.com/site/mohammedisam2000/tcalc/tcalc-"
4279 "0jq806m4dqfia85nppfm75mml9w57g0cgv4cdw9bp3zymda83s0m"))))
4280 (build-system gnu-build-system)
4281 (synopsis "The terminal calculator")
4283 "The terminal calculator is a small program to help users of the GNU/Linux
4284 terminal do calculations simply and quickly. The formula to be calculated can
4285 be fed to @command{tcalc} through the command line.")
4286 (home-page "https://sites.google.com/site/mohammedisam2000/tcalc")
4287 (license license:gpl3+)))
4289 (define-public sundials
4296 (uri (string-append "https://computation.llnl.gov/projects/sundials/download/"
4297 "sundials-" version ".tar.gz"))
4300 "090s8ymhd0g1s1d44fa73r5yi32hb4biwahhbfi327zd64yn8kd2"))))
4301 (build-system cmake-build-system)
4303 `(("python" ,python-2))) ;for tests; syntax incompatible with python 3
4305 `(("fortran" ,gfortran) ;for fcmix
4307 ("suitesparse" ,suitesparse))) ;TODO: Add hypre
4309 `(#:configure-flags `("-DEXAMPLES_ENABLE_C:BOOL=ON"
4310 "-DEXAMPLES_ENABLE_CXX:BOOL=ON"
4311 "-DEXAMPLES_ENABLE_F77:BOOL=ON"
4312 "-DEXAMPLES_ENABLE_F90:BOOL=ON"
4313 "-DEXAMPLES_INSTALL:BOOL=OFF"
4315 "-DFCMIX_ENABLE:BOOL=ON"
4317 "-DKLU_ENABLE:BOOL=ON"
4318 ,(string-append "-DKLU_INCLUDE_DIR="
4319 (assoc-ref %build-inputs "suitesparse")
4321 ,(string-append "-DKLU_LIBRARY_DIR="
4322 (assoc-ref %build-inputs "suitesparse")
4324 (home-page "https://computation.llnl.gov/projects/sundials")
4325 (synopsis "Suite of nonlinear and differential/algebraic equation solvers")
4326 (description "SUNDIALS is a family of software packages implemented with
4327 the goal of providing robust time integrators and nonlinear solvers that can
4328 easily be incorporated into existing simulation codes.")
4329 (license license:bsd-3)))
4331 (define-public sundials-openmpi
4332 (package (inherit sundials)
4333 (name "sundials-openmpi")
4336 ("petsc" ,petsc-openmpi) ;support in SUNDIALS requires MPI
4337 ,@(package-inputs sundials)))
4339 (substitute-keyword-arguments (package-arguments sundials)
4340 ((#:configure-flags flags '())
4341 `(cons* "-DMPI_ENABLE:BOOL=ON"
4342 "-DPETSC_ENABLE:BOOL=ON"
4343 (string-append "-DPETSC_INCLUDE_DIR="
4344 (assoc-ref %build-inputs "petsc")
4346 (string-append "-DPETSC_LIBRARY_DIR="
4347 (assoc-ref %build-inputs "petsc")
4350 ((#:phases phases '%standard-phases)
4351 `(modify-phases ,phases
4352 (add-before 'check 'mpi-setup
4353 ,%openmpi-setup)))))
4354 (synopsis "SUNDIALS with OpenMPI support")))
4356 (define-public combinatorial-blas
4358 (name "combinatorial-blas")
4363 (uri (string-append "http://eecs.berkeley.edu/~aydin/CombBLAS_FILES/"
4365 (match (string-split version #\.)
4366 ((major minor patch)
4367 (string-append major minor "_" patch))) ;e.g. "16_2"
4371 "1a9wbgdqyy1whhfc0yl0yqkax3amnqa6iihhq48d063gc0jwfd9a"))
4372 (patches (search-patches "combinatorial-blas-awpm.patch"
4373 "combinatorial-blas-io-fix.patch"))))
4374 (build-system cmake-build-system)
4377 ("test-data" ,(origin
4379 (uri (string-append "https://people.eecs.berkeley.edu/~aydin/"
4380 "CombBLAS_FILES/testdata_combblas1.6.1.tgz"))
4383 "01y2781cy3fww7znmidrp85mf8zx0c905w5vzvk1mgrmhhynim87"))))))
4385 `(#:configure-flags '("-DBUILD_SHARED_LIBS:BOOL=YES"
4386 "-DCMAKE_CXX_FLAGS=-DUSE_FUNNEL")
4387 #:parallel-tests? #f ;tests use 'mpiexec -n4'
4389 (modify-phases %standard-phases
4390 (add-before 'check 'mpi-setup
4392 (add-before 'check 'test-setup
4393 (lambda* (#:key inputs #:allow-other-keys)
4394 (setenv "OMP_NUM_THREADS" "2")
4395 (invoke "tar" "xf" (assoc-ref inputs "test-data")))))))
4396 (home-page "https://people.eecs.berkeley.edu/~aydin/CombBLAS/html/")
4397 (synopsis "Linear algebra primitives for graph analytics")
4398 (description "The Combinatorial BLAS (CombBLAS) is an extensible
4399 distributed-memory parallel graph library offering a small but powerful set of
4400 linear algebra primitives specifically targeting graph analytics.")
4402 license:gpl2+ ;include/psort/(funnel|sort)*.h
4403 license:x11 ;usort and psort
4404 license:bsd-3)))) ;CombBLAS and MersenneTwister.h
4406 (define-public dune-common
4408 (name "dune-common")
4413 (uri (string-append "https://dune-project.org/download/"
4414 version "/dune-common-" version ".tar.gz"))
4417 "019wcr1qf7jwyxx1y5y290wdlglylskvbb2m01ljkzcza2xnlmhw"))))
4418 (build-system cmake-build-system)
4421 (modify-phases %standard-phases
4422 (add-after 'build 'build-tests
4423 (lambda* (#:key make-flags #:allow-other-keys)
4424 (apply invoke "make" "build_tests" make-flags)))
4425 ;; These tests fail because they require a fully functional MPI
4427 (add-after 'unpack 'disable-failing-tests
4430 (string-append "--exclude-regex '("
4434 "remoteindicestest-mpi-2"
4437 "variablesizecommunicatortest"
4438 "variablesizecommunicatortest-mpi-2"
4439 "arithmetictestsuitetest"
4440 "assertandreturntest"
4441 "assertandreturntest_ndebug"
4444 "mpicollectivecommunication"
4445 "mpicollectivecommunication-mpi-2"
4447 "mpiguardtest-mpi-2"
4449 "mpihelpertest-mpi-2"
4451 "mpihelpertest2-mpi-2")
4458 ("openmpi" ,openmpi)
4459 ("openblas" ,openblas)
4461 ("superlu" ,superlu)))
4463 `(("gfortran" ,gfortran)
4464 ("pkg-config" ,pkg-config)))
4465 (home-page "https://dune-project.org/")
4466 (synopsis "Distributed and Unified Numerics Environment")
4467 (description "DUNE, the Distributed and Unified Numerics Environment is a
4468 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
4469 grid-based methods. It supports the easy implementation of methods like
4470 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
4471 Differences} (FD).")
4472 ;; GPL version 2 with "runtime exception" to make it behave like LGPLv2.
4473 (license license:gpl2)))
4475 (define-public dune-geometry
4477 (name "dune-geometry")
4482 (uri (string-append "https://dune-project.org/download/"
4483 version "/dune-geometry-" version ".tar.gz"))
4486 "0hlaaxjyv9j05blasvb67sy02hd0w4g9znf68gdh3l731dd1aqbn"))))
4487 (build-system cmake-build-system)
4490 (modify-phases %standard-phases
4491 (add-after 'build 'build-tests
4492 (lambda* (#:key make-flags #:allow-other-keys)
4493 (apply invoke "make" "build_tests" make-flags))))))
4495 `(("dune-common" ,dune-common)
4496 ("openmpi" ,openmpi)
4498 ("openblas" ,openblas)
4500 ("python" ,python)))
4502 `(("gfortran" ,gfortran)
4503 ("pkg-config" ,pkg-config)))
4504 (home-page "https://dune-project.org/")
4505 (synopsis "Distributed and Unified Numerics Environment")
4506 (description "DUNE, the Distributed and Unified Numerics Environment is a
4507 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
4508 grid-based methods. It supports the easy implementation of methods like
4509 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
4512 This package contains the basic DUNE geometry classes.")
4513 ;; GPL version 2 with "runtime exception"
4514 (license license:gpl2)))
4516 (define-public dune-grid
4523 (uri (string-append "https://dune-project.org/download/"
4524 version "/dune-grid-" version ".tar.gz"))
4527 "1jp4vscm9yb9xg0lh7apzccfkhvgbnk652yahigmh3cvzpl4acd0"))))
4528 (build-system cmake-build-system)
4531 (modify-phases %standard-phases
4532 (add-after 'build 'build-tests
4533 (lambda* (#:key make-flags #:allow-other-keys)
4534 (apply invoke "make" "build_tests" make-flags)))
4535 ;; These tests fail because they require a fully functional MPI
4537 (add-after 'unpack 'disable-failing-tests
4540 (string-append "--exclude-regex '("
4544 "conformvolumevtktest"
4546 "nonconformboundaryvtktest"
4547 "subsamplingvtktest"
4553 "test-dgf-yasp-offset"
4555 "test-geogrid-yaspgrid"
4558 "testiteratorranges"
4559 "test-hierarchicsearch"
4560 "test-parallel-ug-mpi-2"
4561 "test-yaspgrid-backuprestore-equidistant"
4562 "test-yaspgrid-backuprestore-equidistant-mpi-2"
4563 "test-yaspgrid-backuprestore-equidistantoffset"
4564 "test-yaspgrid-backuprestore-equidistantoffset-mpi-2"
4565 "test-yaspgrid-backuprestore-tensor"
4566 "test-yaspgrid-backuprestore-tensor-mpi-2"
4567 "test-yaspgrid-tensorgridfactory"
4568 "test-yaspgrid-tensorgridfactory-mpi-2"
4569 "test-yaspgrid-yaspfactory-1d"
4570 "test-yaspgrid-yaspfactory-1d-mpi-2"
4571 "test-yaspgrid-yaspfactory-2d"
4572 "test-yaspgrid-yaspfactory-2d-mpi-2"
4573 "test-yaspgrid-yaspfactory-3d"
4574 "test-yaspgrid-yaspfactory-3d-mpi-2"
4575 "globalindexsettest"
4576 "persistentcontainertest"
4577 "structuredgridfactorytest"
4578 "tensorgridfactorytest"
4584 `(("dune-common" ,dune-common)
4585 ("dune-geometry" ,dune-geometry)
4588 ("openblas" ,openblas)
4589 ("openmpi" ,openmpi)
4590 ("python" ,python)))
4592 `(("gfortran" ,gfortran)
4593 ("pkg-config" ,pkg-config)))
4594 (home-page "https://dune-project.org/")
4595 (synopsis "Distributed and Unified Numerics Environment")
4596 (description "DUNE, the Distributed and Unified Numerics Environment is a
4597 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
4598 grid-based methods. It supports the easy implementation of methods like
4599 @dfn{Finite Elements} (FE), @dfn{Finite Volumes} (FV), and also @dfn{Finite
4602 This package contains the basic DUNE grid classes.")
4603 ;; GPL version 2 with "runtime exception"
4604 (license license:gpl2)))
4606 (define-public dune-istl
4613 (uri (string-append "https://dune-project.org/download/"
4614 version "/dune-istl-" version ".tar.gz"))
4617 "0l2gyrvys5w6wsmk0ckbb7295s80b7yk7qrl7x66akv2jv1nzq2w"))))
4618 (build-system cmake-build-system)
4621 (modify-phases %standard-phases
4622 (add-after 'build 'build-tests
4623 (lambda* (#:key make-flags #:allow-other-keys)
4624 (apply invoke "make" "build_tests" make-flags)))
4625 ;; These tests fail because they require a fully functional MPI
4627 (add-after 'unpack 'disable-failing-tests
4630 (string-append "--exclude-regex '("
4636 "pamg_comm_repart_test"
4644 `(("dune-common" ,dune-common)
4645 ("openmpi" ,openmpi)
4648 ("superlu" ,superlu)
4649 ("openblas" ,openblas)
4651 ("python" ,python)))
4653 `(("gfortran" ,gfortran)
4654 ("pkg-config" ,pkg-config)))
4655 (home-page "https://dune-project.org/")
4656 (synopsis "Distributed and Unified Numerics Environment")
4657 (description "DUNE, the Distributed and Unified Numerics Environment is a
4658 modular toolbox for solving @dfn{partial differential equations} (PDEs) with
4661 This is the iterative solver template library which provides generic sparse
4662 matrix/vector classes and a variety of solvers based on these classes. A
4663 special feature is the use of templates to exploit the recursive block
4664 structure of finite element matrices at compile time. Available solvers
4665 include Krylov methods, (block-) incomplete decompositions and
4666 aggregation-based algebraic multigrid.")
4667 ;; GPL version 2 with "runtime exception"
4668 (license license:gpl2)))
4670 (define-public dune-localfunctions
4672 (name "dune-localfunctions")
4677 (uri (string-append "https://dune-project.org/download/"
4678 version "/dune-localfunctions-" version ".tar.gz"))
4681 "19c6zjinwwpy8jh4v4prhphyd438rapd4x80fj93apmwgw04nrhl"))))
4682 (build-system cmake-build-system)
4685 (modify-phases %standard-phases
4686 (add-after 'build 'build-tests
4687 (lambda* (#:key make-flags #:allow-other-keys)
4688 (apply invoke "make" "build_tests" make-flags))))))
4690 `(("dune-common" ,dune-common)
4691 ("dune-geometry" ,dune-geometry)
4692 ("openmpi" ,openmpi)
4695 ("superlu" ,superlu)
4698 `(("gfortran" ,gfortran)
4699 ("pkg-config" ,pkg-config)))
4700 (home-page "https://dune-project.org/")
4701 (synopsis "Distributed and Unified Numerics Environment") ; TODO
4702 (description "This DUNE module provides interface and implementation for
4703 shape functions defined on the DUNE reference elements. In addition to the
4704 shape function, interpolation operators and special keys are provided which
4705 can be used to assemble global function spaces on finite-element grids.
4707 This package provides an interface and implementation for shape functions
4708 defined on the DUNE reference elements. In addition to the shape function,
4709 interpolation operators and special keys are provided which can be used to
4710 assemble global function spaces on finite-element grids.")
4711 ;; GPL version 2 with "runtime exception"
4712 (license license:gpl2)))
4714 (define-public dune-alugrid
4716 (name "dune-alugrid")
4721 (uri (string-append "https://dune-project.org/download/"
4722 version "/dune-alugrid-" version ".tar.gz"))
4725 "1l9adgyjpra8mvwm445s0lpjshnb63jag85fb2hisbjn6bm320yj"))))
4726 (build-system cmake-build-system)
4728 `(#:tests? #f ; 7 of 8 tests fail because they need a full MPI
4731 (modify-phases %standard-phases
4732 (add-after 'unpack 'patch-include
4734 (substitute* "dune/alugrid/test/test-alugrid.cc"
4735 (("doc/grids/gridfactory/testgrids")
4736 "doc/dune-grid/grids/gridfactory/testgrids"))
4738 (add-after 'build 'build-tests
4739 (lambda* (#:key inputs make-flags #:allow-other-keys)
4740 (setenv "CPLUS_INCLUDE_PATH"
4741 (string-append (assoc-ref inputs "dune-grid") "/share:"
4742 (getenv "CPLUS_INCLUDE_PATH")))
4743 (apply invoke "make" "build_tests" make-flags))))))
4745 `(("dune-common" ,dune-common)
4746 ("dune-geometry" ,dune-geometry)
4747 ("dune-grid" ,dune-grid)
4748 ("openmpi" ,openmpi)
4751 ("openblas" ,openblas)
4753 ("superlu" ,superlu)
4757 `(("gfortran" ,gfortran)
4758 ("pkg-config" ,pkg-config)))
4759 (home-page "https://dune-project.org/")
4760 (synopsis "Distributed and Unified Numerics Environment")
4761 (description "ALUGrid is an adaptive, loadbalancing, unstructured
4762 implementation of the DUNE grid interface supporting either simplices or
4764 (license license:gpl2+)))
4766 (define-public dune-typetree
4768 (name "dune-typetree")
4774 (url "https://gitlab.dune-project.org/staging/dune-typetree.git")
4775 (commit (string-append "v" version))))
4776 (file-name (git-file-name name version))
4779 "0mnv6w2f22lz3j4bdpdjq55vjm8xxfx9v4vvhg9bd36xpsbjpjp9"))))
4780 (build-system cmake-build-system)
4783 (modify-phases %standard-phases
4784 (add-after 'build 'build-tests
4785 (lambda* (#:key make-flags #:allow-other-keys)
4786 (apply invoke "make" "build_tests" make-flags))))))
4788 `(("dune-common" ,dune-common)
4789 ("openmpi" ,openmpi)
4791 ("openblas" ,openblas)
4794 ("superlu" ,superlu)
4797 `(("gfortran" ,gfortran)
4798 ("pkg-config" ,pkg-config)))
4799 (home-page "https://dune-project.org/")
4800 (synopsis "Distributed and Unified Numerics Environment")
4801 (description "TypeTree is a template library for constructing and
4802 operating on statically typed trees of objects.")
4803 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
4804 (license (list license:lgpl3+ license:gpl2))))
4806 (define-public dune-functions
4808 (name "dune-functions")
4814 (url "https://gitlab.dune-project.org/staging/dune-functions.git")
4815 (commit (string-append "v" version))))
4816 (file-name (git-file-name name version))
4819 "1an8gb477n8j0kzpbrv7nr1snh8pxip0gsxq6w63jc83gg3dj200"))))
4820 (build-system cmake-build-system)
4821 (arguments `(#:tests? #f)) ; FIXME: tests require dune-uugrid
4823 `(("dune-common" ,dune-common)
4824 ("dune-istl" ,dune-istl)
4825 ("dune-localfunctions" ,dune-localfunctions)
4826 ("dune-grid" ,dune-grid)
4827 ("dune-geometry" ,dune-geometry)
4828 ("dune-typetree" ,dune-typetree)
4829 ("openmpi" ,openmpi)
4830 ("openblas" ,openblas)
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")
4840 (description "The dune-functions module provides an abstraction layer for
4841 global finite element functions. Its two main concepts are functions
4842 implemented as callable objects, and bases of finite element spaces.")
4843 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
4844 (license (list license:lgpl3+ license:gpl2))))
4846 (define-public dune-pdelab
4848 (name "dune-pdelab")
4849 (version "2.6.0-rc1")
4854 (url "https://gitlab.dune-project.org/pdelab/dune-pdelab")
4855 (commit (string-append "v" version))))
4856 (file-name (git-file-name name version))
4859 "07g0s9448z65vjrq88g5rv3340iifil85k170n8kbqchsvi4ny5v"))))
4860 (build-system cmake-build-system)
4861 (arguments '(#:tests? #f)) ; XXX: the tests cannot be compiled
4863 `(("dune-common" ,dune-common)
4864 ("dune-istl" ,dune-istl)
4865 ("dune-localfunctions" ,dune-localfunctions)
4866 ("dune-geometry" ,dune-geometry)
4867 ("dune-grid" ,dune-grid)
4868 ("dune-typetree" ,dune-typetree)
4869 ("dune-functions" ,dune-functions)
4870 ("openmpi" ,openmpi)
4872 ("openblas" ,openblas)
4876 ("superlu" ,superlu)
4879 `(("gfortran" ,gfortran)
4880 ("pkg-config" ,pkg-config)))
4881 (home-page "https://dune-project.org/")
4882 (synopsis "Differential equations solver toolbox")
4883 (description "PDELab is a partial differential equations solver toolbox
4884 built on top of DUNE, the Distributed and Unified Numerics Environment.")
4885 ;; Either GPL version 2 with "runtime exception" or LGPLv3+.
4886 (license (list license:lgpl3+ license:gpl2))))
4888 (define-public mlucas
4896 "https://mersenneforum.org/mayer/src/C/mlucas_v" version ".txz"))
4898 (base32 "0h4xj6pyyac79ka5ibqjilfa3s9j3yxnzgpwc57b54kfh2bj3447"))))
4899 (build-system gnu-build-system)
4901 `(("python2" ,python-2)))
4903 `(#:tests? #f ; no tests
4905 (modify-phases %standard-phases
4909 (call-with-output-file "Makefile"
4911 (format port "CC = gcc
4912 CFLAGS = -O3 ~a -DUSE_THREADS
4913 LDLIBS = -lm -lpthread -lrt
4914 Mlucas: $(addsuffix .o,$(basename $(wildcard *.c)))
4916 ,(let ((system (or (%current-target-system)
4917 (%current-system))))
4919 ((string-prefix? "x86_64" system) "-DUSE_SSE2")
4923 (lambda* (#:key outputs #:allow-other-keys)
4924 (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
4925 (install-file "Mlucas" bin)
4926 (install-file "primenet.py" bin))
4928 (home-page "https://www.mersenne.org")
4929 (synopsis "Great Internet Mersenne Prime Search (GIMPS) distributed computing client")
4930 (description "Mlucas performs Lucas-Lehmer primality testing of Mersenne
4931 numbers in search of a world-record prime. You may use it to test any
4932 suitable number as you wish, but it is preferable that you do so in a
4933 coordinated fashion, as part of the Great Internet Mersenne Prime
4934 Search (GIMPS). Mlucas also includes a simple Python script for assignment
4935 management via the GIMPS project's Primenet server.")
4936 (license license:gpl2+)))
4938 (define-public nauty
4945 "https://pallini.di.uniroma1.it/"
4946 "nauty" (string-join (string-split version #\.) "")
4950 "05z6mk7c31j70md83396cdjmvzzip1hqb88pfszzc6k4gy8h3m2y"))))
4951 (build-system gnu-build-system)
4952 (outputs '("out" "lib"))
4954 `(#:test-target "checks"
4956 (modify-phases %standard-phases
4957 ;; Default make target does not build all available
4958 ;; executables. Create them now.
4959 (add-after 'build 'build-extra-programs
4961 (for-each (lambda (target) (invoke "make" target))
4962 '("blisstog" "bliss2dre" "checks6" "sumlines"))
4964 ;; Upstream does not provide any install target.
4966 (lambda* (#:key outputs #:allow-other-keys)
4967 (let* ((out (assoc-ref outputs "out"))
4968 (lib-output (assoc-ref outputs "lib"))
4969 (bin (string-append out "/bin"))
4970 (doc (string-append out "/share/doc/nauty/"))
4971 (include (string-append lib-output "/include/nauty"))
4972 (lib (string-append lib-output "/lib/nauty")))
4973 (for-each (lambda (f) (install-file f bin))
4974 '("dreadnaut" "NRswitchg" "addedgeg" "amtog" "biplabg"
4975 "blisstog" "bliss2dre" "catg" "checks6" "complg"
4976 "converseg" "copyg" "countg" "cubhamg" "deledgeg"
4977 "delptg" "directg" "dretodot" "dretog" "genbg"
4978 "genbgL" "geng" "genquarticg" "genrang" "genspecialg"
4979 "gentourng" "gentreeg" "hamheuristic" "labelg"
4980 "linegraphg" "listg" "multig" "newedgeg" "pickg"
4981 "planarg" "ranlabg" "shortg" "showg" "subdivideg"
4982 "sumlines" "twohamg" "vcolg" "watercluster2"))
4983 (for-each (lambda (f) (install-file f include))
4984 (find-files "." "\\.h$"))
4985 (for-each (lambda (f) (install-file f lib))
4986 (find-files "." "\\.a$"))
4987 (for-each (lambda (f) (install-file f doc))
4988 (append '("formats.txt" "README" "schreier.txt")
4989 (find-files "." "\\.pdf$")))))))))
4991 `(("gmp" ,gmp))) ;for sumlines
4992 (home-page "https://pallini.di.uniroma1.it/")
4993 (synopsis "Library for graph automorphisms")
4994 (description "@code{nauty} (No AUTomorphisms, Yes?) is a set of
4995 procedures for computing automorphism groups of graphs and digraphs.
4997 @code{nauty} computes graph information in the form of a set of
4998 generators, the size of the group, and the orbits of the group; it can
4999 also produce a canonical label. The @code{nauty} suite is written in
5000 C and comes with a command-line interface, a collection of
5001 command-line tools, and an Application Programming Interface (API).
5003 This package provides the static libraries required to run programs
5004 compiled against the nauty library.")
5005 (license license:asl2.0)))