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 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 Ricardo Wurmus <rekado@elephly.net>
9 ;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com>
10 ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
11 ;;; Copyright © 2015, 2016, 2017 Efraim Flashner <efraim@flashner.co.il>
12 ;;; Copyright © 2015 Fabian Harfert <fhmgufs@web.de>
13 ;;; Copyright © 2016 Roel Janssen <roel@gnu.org>
14 ;;; Copyright © 2016 Kei Kebreau <kei@openmailbox.org>
15 ;;; Copyright © 2016, 2017 Ludovic Courtès <ludo@gnu.org>
16 ;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
17 ;;; Copyright © 2016 Thomas Danckaert <post@thomasdanckaert.be>
18 ;;; Copyright © 2017 Paul Garlick <pgarlick@tourbillion-technology.com>
19 ;;; Copyright © 2017 ng0 <contact.ng0@cryptolab.net>
20 ;;; Copyright © 2017 Ben Woodcroft <donttrustben@gmail.com>
21 ;;; Copyright © 2017 Theodoros Foradis <theodoros.for@openmailbox.org>
23 ;;; This file is part of GNU Guix.
25 ;;; GNU Guix is free software; you can redistribute it and/or modify it
26 ;;; under the terms of the GNU General Public License as published by
27 ;;; the Free Software Foundation; either version 3 of the License, or (at
28 ;;; your option) any later version.
30 ;;; GNU Guix is distributed in the hope that it will be useful, but
31 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
32 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
33 ;;; GNU General Public License for more details.
35 ;;; You should have received a copy of the GNU General Public License
36 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
38 (define-module (gnu packages maths)
39 #:use-module (ice-9 regex)
40 #:use-module (gnu packages)
41 #:use-module ((guix licenses) #:prefix license:)
42 #:use-module (guix packages)
43 #:use-module (guix download)
44 #:use-module (guix git-download)
45 #:use-module (guix utils)
46 #:use-module (guix build utils)
47 #:use-module (guix build-system cmake)
48 #:use-module (guix build-system gnu)
49 #:use-module (guix build-system ocaml)
50 #:use-module (guix build-system r)
51 #:use-module (gnu packages algebra)
52 #:use-module (gnu packages autotools)
53 #:use-module (gnu packages bison)
54 #:use-module (gnu packages boost)
55 #:use-module (gnu packages check)
56 #:use-module (gnu packages cmake)
57 #:use-module (gnu packages compression)
58 #:use-module (gnu packages curl)
59 #:use-module (gnu packages cyrus-sasl)
60 #:use-module (gnu packages documentation)
61 #:use-module (gnu packages elf)
62 #:use-module (gnu packages flex)
63 #:use-module (gnu packages fltk)
64 #:use-module (gnu packages fontutils)
65 #:use-module (gnu packages gettext)
66 #:use-module (gnu packages gcc)
67 #:use-module (gnu packages gd)
68 #:use-module (gnu packages ghostscript)
69 #:use-module (gnu packages graphviz)
70 #:use-module (gnu packages gtk)
71 #:use-module (gnu packages image)
72 #:use-module (gnu packages less)
73 #:use-module (gnu packages lisp)
74 #:use-module (gnu packages logging)
75 #:use-module (gnu packages lua)
76 #:use-module (gnu packages gnome)
77 #:use-module (gnu packages guile)
78 #:use-module (gnu packages xorg)
79 #:use-module (gnu packages gl)
80 #:use-module (gnu packages imagemagick)
81 #:use-module (gnu packages m4)
82 #:use-module (gnu packages mpi)
83 #:use-module (gnu packages multiprecision)
84 #:use-module (gnu packages netpbm)
85 #:use-module (gnu packages ocaml)
86 #:use-module (gnu packages pcre)
87 #:use-module (gnu packages popt)
88 #:use-module (gnu packages perl)
89 #:use-module (gnu packages pkg-config)
90 #:use-module (gnu packages python)
91 #:use-module (gnu packages readline)
92 #:use-module (gnu packages tbb)
93 #:use-module (gnu packages scheme)
94 #:use-module (gnu packages shells)
95 #:use-module (gnu packages tcl)
96 #:use-module (gnu packages texinfo)
97 #:use-module (gnu packages tex)
98 #:use-module (gnu packages tls)
99 #:use-module (gnu packages wxwidgets)
100 #:use-module (gnu packages xml)
101 #:use-module (srfi srfi-1))
109 (uri (string-append "mirror://gnu/" name "/" name "-" version ".tar.gz"))
111 "1q1887ryqdr9sn0522hc7p16kqwlxxyz5dkmma8ar2nxplhgll7q"))))
112 (build-system gnu-build-system)
113 (inputs `(("gtk+" ,gtk+)
114 ("libxml2" ,libxml2)))
115 (native-inputs `(("pkg-config" ,pkg-config)))
116 (synopsis "Natural deduction first-order logic interface")
117 (description "Aris is a program for performing logical proofs. It supports
118 propositional and predicate logic, as well as Boolean algebra and
119 arithmetical logic. In addition to its predefined inference and equivalence
120 rules, Aris also supports references to older proofs. Its use of standard
121 logical symbols and its natural deduction interface make it easy to use for
123 (license license:gpl3+)
124 (home-page "https://www.gnu.org/software/aris/")))
126 (define-public c-graph
132 (uri (string-append "mirror://gnu/c-graph/c-graph-" version
135 "1hlvpzrh7hzzf533diyfiabzskddi8zx92av9hwkjw3l46z7qv01"))))
136 (build-system gnu-build-system)
138 `(("fortran" ,gfortran)))
139 (synopsis "Visualizing and demonstrating convolution")
141 "GNU C-Graph is a tool for demonstrating the theory of convolution.
142 Thus, it can serve as an excellent aid to students of signal and systems
143 theory in visualizing the convolution process. Rather than forcing the
144 student to write code, the program offers an intuitive interface with
145 interactive dialogs to guide them.")
146 (license license:gpl3+)
147 (home-page "https://www.gnu.org/software/c-graph/")))
156 (uri (string-append "https://github.com/stcorp/coda/releases/download/"
157 version "/coda-" version ".tar.gz"))
159 (base32 "11asla1ap8vd73farqjlpb179sfiy0biydcwxjfcakrp9sf8v9bs"))
160 (patches (search-patches "coda-use-system-libs.patch"))
161 (modules '((guix build utils)))
163 ;; Make sure we don't use the bundled software.
164 '(for-each (lambda (d)
165 (delete-file-recursively (string-append "libcoda/" d)))
166 '("zlib" "pcre" "expat")))))
168 `(("fortran" ,gfortran)
170 ("python-numpy" ,python-numpy)))
177 (build-system gnu-build-system)
179 '(#:configure-flags '("--with-hdf4" "--with-hdf5" "--enable-python"
180 "LIBS= -lz -lpcre -lexpat")))
181 (synopsis "A common interface to various earth observation data formats")
183 "The Common Data Access toolbox (CODA) provides a set of interfaces for
184 reading remote sensing data from earth observation data files. It consists of
185 command line applications and interfaces to the C, Fortran, Python, and Java
186 programming languages.")
187 (home-page "https://stcorp.nl/coda")
188 (license license:gpl2+)))
196 (uri (string-append "mirror://gnu/units/units-" version
199 "1s421bxm36akjsy3qzg6da1d1g20gh094ac2slqxipgkh8yqjcwx"))))
200 (build-system gnu-build-system)
201 (synopsis "Conversion between thousands of scales")
203 "GNU Units converts numeric quantities between units of measure. It
204 can handle scale changes through adaptive usage of standard scale
205 prefixes (micro-, kilo-, etc.). It can also handle nonlinear
206 conversions such as Fahrenheit to Celsius. Its interpreter is powerful
207 enough to be used effectively as a scientific calculator.")
208 (license license:gpl3+)
209 (home-page "https://www.gnu.org/software/units/")))
211 (define-public double-conversion
213 (name "double-conversion")
218 "https://github.com/floitsch/double-conversion/archive/v"
220 (file-name (string-append name "-" version ".tar.gz"))
223 "0cnr8xhyjfxijay8ymkqcph3672wp2lj23qhdmr3m4kia5kpdf83"))))
224 (build-system cmake-build-system)
226 '(#:test-target "test"
227 #:configure-flags '("-DBUILD_SHARED_LIBS=ON"
228 "-DBUILD_TESTING=ON")))
229 (home-page "https://github.com/floitsch/double-conversion")
230 (synopsis "Conversion routines for IEEE doubles")
232 "The double-conversion library provides binary-decimal and decimal-binary
233 routines for IEEE doubles. The library consists of efficient conversion
234 routines that have been extracted from the V8 JavaScript engine.")
235 (license license:bsd-3)))
237 (define-public dionysus
243 (uri (string-append "mirror://gnu/dionysus/dionysus-" version
247 "1aqnvw6z33bzqgd1ga571pnx6vq2zrkckm1cz91grv45h4jr9vgs"))))
248 (build-system gnu-build-system)
249 (inputs `(("tcl" ,tcl))) ;for 'tclsh'
250 (synopsis "Local search for universal constants and scientific values")
252 "GNU Dionysus is a convenient system for quickly retrieving the values of
253 mathematical constants used in science and engineering. Values can be
254 searched using a simple command-line tool, choosing from three databases:
255 universal constants, atomic numbers, and constants related to
257 (license license:gpl3+)
258 (home-page "https://www.gnu.org/software/dionysus/")))
266 (uri (string-append "mirror://gnu/gsl/gsl-"
270 "16yfs5n444s03np1naj6yp1fsysd42kdscxzkg0k2yvfjixx0ijd"))
271 (patches (search-patches "gsl-test-i686.patch"))))
272 (build-system gnu-build-system)
274 `(;; Currently there are numerous tests that fail on "exotic"
275 ;; architectures such as aarch64 and ppc64le.
276 ,@(if (string-prefix? "aarch64-linux"
277 (or (%current-target-system) (%current-system)))
280 (home-page "https://www.gnu.org/software/gsl/")
281 (synopsis "Numerical library for C and C++")
283 "The GNU Scientific Library is a library for numerical analysis in C
284 and C++. It includes a wide range of mathematical routines, with over 1000
285 functions in total. Subject areas covered by the library include:
286 differential equations, linear algebra, Fast Fourier Transforms and random
288 (license license:gpl3+)))
290 (define-public ocaml-gsl
299 "https://github.com/mmottl/gsl-ocaml/releases/download/v"
300 version"/gsl-ocaml-" version ".tar.gz"))
303 "0nzp43hp8pbjqkrxnwp5lgjrabxayf61h18fjaydi0s5faq6f3xh"))))
304 (build-system ocaml-build-system)
307 (home-page "https://mmottl.github.io/gsl-ocaml")
308 (synopsis "Bindings to the GNU Scientific Library")
310 "GSL-OCaml is an interface to the @dfn{GNU scientific library} (GSL) for
311 the OCaml language.")
312 (license license:gpl3+)))
314 (define-public ocaml4.01-gsl
315 (package-with-ocaml4.01 ocaml-gsl))
324 (uri (string-append "mirror://gnu/glpk/glpk-"
328 "1xp7nclmp8inp20968bvvfcwmz3mz03sbm0v3yjz8aqwlpqjfkci"))))
329 (build-system gnu-build-system)
333 `(#:configure-flags '("--with-gmp")))
334 (home-page "https://www.gnu.org/software/glpk/")
335 (synopsis "GNU Linear Programming Kit, supporting the MathProg language")
337 "GLPK is a C library for solving large-scale linear programming (LP),
338 mixed integer programming (MIP), and other related problems. It supports the
339 GNU MathProg modeling language, a subset of the AMPL language, and features a
340 translator for the language. In addition to the C library, a stand-alone
341 LP/MIP solver is included in the package.")
342 (license license:gpl3+)))
351 (uri (string-append "http://www.4ti2.de/version_" version
352 "/4ti2-" version ".tar.gz"))
355 "1frix3rnm9ffr93alqzw4cavxbfpf524l8rfbmcpyhwd3n1km0yl"))))
356 (build-system gnu-build-system)
358 `(("which" ,(@ (gnu packages base) which)))) ; for the tests
362 (home-page "http://www.4ti2.de/")
363 (synopsis "Mathematical tool suite for problems on linear spaces")
365 "4ti2 implements algorithms for solving algebraic, geometric and
366 combinatorial problems on linear spaces. Among others, it solves systems
367 of linear equations, computes extreme rays of polyhedral cones, solves
368 integer programming problems and computes Markov bases for statistics.")
369 (license license:gpl2+)))
371 (define-public cddlib
378 (uri (string-append "ftp://ftp.math.ethz.ch/users/fukudak/cdd/cddlib-"
379 (string-delete #\. version) ".tar.gz"))
382 "1dasasscwfg793q8fwzgwf64xwj7w62yfvszpr8x8g38jka08vgy"))))
383 (build-system gnu-build-system)
386 (home-page "https://www.inf.ethz.ch/personal/fukudak/cdd_home/index.html")
387 (synopsis "Library for convex hulls and extreme rays of polyhedra")
389 "The C-library cddlib implements the Double Description Method of
390 Motzkin et al. for generating all vertices (i.e. extreme points) and extreme
391 rays of a general convex polyhedron given by a system of linear inequalities
392 in arbitrary dimension. It can also be used for the converse operation of
393 computing convex hulls.")
394 (license license:gpl2+)))
396 (define-public arpack-ng
403 (uri (string-append "https://github.com/opencollab/arpack-ng/archive/"
405 (file-name (string-append name "-" version ".tar.gz"))
408 "1fwch6vipms1ispzg2djvbzv5wag36f1dmmr3xs3mbp6imfyhvff"))))
409 (build-system gnu-build-system)
410 (home-page "https://github.com/opencollab/arpack-ng")
413 ("fortran" ,gfortran)))
414 (synopsis "Fortran subroutines for solving eigenvalue problems")
416 "ARPACK-NG is a collection of Fortran77 subroutines designed to solve
417 large scale eigenvalue problems.")
418 (license (license:non-copyleft "file://COPYING"
419 "See COPYING in the distribution."))))
421 (define-public arpack-ng-openmpi
422 (package (inherit arpack-ng)
423 (name "arpack-ng-openmpi")
426 ,@(package-inputs arpack-ng)))
427 (arguments `(#:configure-flags '("--enable-mpi")))
428 (synopsis "Fortran subroutines for solving eigenvalue problems with MPI")))
430 (define-public lapack
437 (uri (string-append "http://www.netlib.org/lapack/lapack-"
441 "1j51r7n5w4k7r3lrvy7710xrpkg40wf4rqnmngfz6ck9ypckzign"))))
442 (build-system cmake-build-system)
443 (home-page "http://www.netlib.org/lapack/")
444 (inputs `(("fortran" ,gfortran)
445 ("python" ,python-2)))
447 `(#:configure-flags (list
448 ;; Install to PREFIX/lib (the default is
450 (string-append "-DCMAKE_INSTALL_LIBDIR="
451 (assoc-ref %outputs "out")
454 "-DBUILD_SHARED_LIBS:BOOL=YES"
457 ;; Build the 'LAPACKE_clatms' functions.
458 "-DLAPACKE_WITH_TMG=ON")
459 #:phases (alist-cons-before
461 (lambda* (#:key inputs #:allow-other-keys)
462 (let ((python (assoc-ref inputs "python")))
463 (substitute* "lapack_testing.py"
464 (("/usr/bin/env python") python))))
466 (synopsis "Library for numerical linear algebra")
468 "LAPACK is a Fortran 90 library for solving the most commonly occurring
469 problems in numerical linear algebra.")
470 (license (license:non-copyleft "file://LICENSE"
471 "See LICENSE in the distribution."))))
473 (define-public scalapack
480 (uri (string-append "http://www.netlib.org/scalapack/scalapack-"
484 "0p1r61ss1fq0bs8ynnx7xq4wwsdvs32ljvwjnx6yxr8gd6pawx0c"))))
485 (build-system cmake-build-system)
488 ("fortran" ,gfortran)
489 ("lapack" ,lapack))) ;for testing only
491 `(#:configure-flags `("-DBUILD_SHARED_LIBS:BOOL=YES")))
492 (home-page "http://www.netlib.org/scalapack/")
493 (synopsis "Library for scalable numerical linear algebra")
495 "ScaLAPACK is a Fortran 90 library of high-performance linear algebra
496 routines on parallel distributed memory machines. ScaLAPACK solves dense and
497 banded linear systems, least squares problems, eigenvalue problems, and
498 singular value problems.")
499 (license (license:bsd-style "file://LICENSE"
500 "See LICENSE in the distribution."))))
502 (define-public gnuplot
508 (uri (string-append "mirror://sourceforge/gnuplot/gnuplot/"
513 "0q5lr6nala3ln6f3yp6g17ziymb9r9gx9zylnw1y3hjmwl9lggjv"))))
514 (build-system gnu-build-system)
515 (inputs `(("readline" ,readline)
521 `(("pkg-config" ,pkg-config)
522 ("texlive" ,texlive-tiny)))
523 (home-page "http://www.gnuplot.info")
524 (synopsis "Command-line driven graphing utility")
525 (description "Gnuplot is a portable command-line driven graphing
526 utility. It was originally created to allow scientists and students to
527 visualize mathematical functions and data interactively, but has grown to
528 support many non-interactive uses such as web scripting. It is also used as a
529 plotting engine by third-party applications like Octave.")
530 ;; X11 Style with the additional restriction that derived works may only be
531 ;; distributed as patches to the original.
532 (license (license:fsf-free
533 "http://gnuplot.cvs.sourceforge.net/gnuplot/gnuplot/Copyright"))))
542 (uri (string-append "https://github.com/OkoSanto/GCTP/archive/v"
544 (file-name (string-append name "-" version ".tar.gz"))
547 "0l9aqnqynh9laicn5dxf3rsb1n14xiks79wbyqccirzmjqd1c1x4"))))
549 `(("fortran" ,gfortran)))
550 (build-system gnu-build-system)
551 (synopsis "General Cartographic Transformation Package (GCTP)")
553 "The General Cartographic Transformation Package (GCTP) is a system of
554 software routines designed to permit the transformation of coordinate pairs
555 from one map projection to another. The GCTP is the standard computer
556 software used by the National Mapping Division for map projection
558 (home-page "https://github.com/OkoSanto/GCTP")
559 (license license:public-domain))) ;https://www2.usgs.gov/laws/info_policies.html
568 (uri (string-append "https://support.hdfgroup.org/ftp/HDF/releases/HDF"
569 version "/src/hdf-" version ".tar.bz2"))
571 (base32 "1wz0586zh91pqb95wvr0pbh71a8rz358fdj6n2ksp85x2cis9lsm"))
572 (patches (search-patches "hdf4-architectures.patch"
573 "hdf4-reproducibility.patch"
574 "hdf4-shared-fortran.patch"))))
575 (build-system gnu-build-system)
577 `(("gfortran" ,gfortran)
582 ("libjpeg" ,libjpeg)))
584 `(#:parallel-tests? #f
585 #:configure-flags '("--enable-shared")
587 (modify-phases %standard-phases
588 ;; This is inspired by two of Debian's patches.
589 (add-before 'configure 'add-more-aarch64-support
591 (substitute* '("mfhdf/ncgen/ncgen.l"
592 "mfhdf/ncgen/ncgenyy.c"
593 "mfhdf/libsrc/netcdf.h.in")
594 (("AIX5L64") "__aarch64__"))
596 (add-before 'configure 'patchbuild
599 '("mfhdf/hdfimport/testutil.sh.in" "hdf/util/testutil.sh.in")
601 (("/bin/mkdir") "mkdir"))
602 (substitute* (find-files "." "^Makefile\\.in$")
603 (("@HDF_BUILD_XDR_TRUE@XDR_ADD = \
604 -R\\$\\(abs_top_builddir\\)/mfhdf/xdr/\\.libs") "")
605 (("@HDF_BUILD_SHARED_TRUE@AM_LDFLAGS = \
606 -R\\$\\(abs_top_builddir\\)/mfhdf/libsrc/\\.libs \
607 -R\\$\\(abs_top_builddir\\)/hdf/src/\\.libs \\$\\(XDR_ADD\\)") ""))
609 (home-page "https://www.hdfgroup.org/products/hdf4/")
611 "Library and multi-object file format for storing and managing data")
612 (description "HDF4 is a library and multi-object file format for storing
613 and managing data between machines. HDF4 is an older hierarchical data format,
614 incompatible with HDF5.")
616 (license:non-copyleft
617 "https://www.hdfgroup.org/ftp/HDF/HDF_Current/src/unpacked/COPYING"))))
619 (define-public hdf4-alt
624 (substitute-keyword-arguments (package-arguments hdf4)
625 ((#:configure-flags flags) `(cons* "--disable-netcdf" ,flags))))
627 "HDF4 without netCDF API, can be combined with the regular netCDF library")))
636 (uri (list (string-append "https://support.hdfgroup.org/ftp/HDF5/releases/"
637 "hdf5-" (version-major+minor version)
638 "/hdf5-" version "/src/hdf5-"
640 (string-append "https://support.hdfgroup.org/ftp/HDF5/"
643 (take (string-split version #\.) 2))
644 "/src/hdf5-" version ".tar.bz2")))
646 (base32 "0f3jfbqpaaq21ighi40qzs52nb52kc2d2yjk541rjmsx20b3ih2r"))
647 (patches (list (search-patch "hdf5-config-date.patch")))))
648 (build-system gnu-build-system)
652 `(;; Some of the users, notably Flann, need the C++ interface.
653 #:configure-flags '("--enable-cxx")
656 (modify-phases %standard-phases
657 (add-before 'configure 'patch-configure
659 (substitute* "configure"
662 (add-after 'install 'patch-references
663 (lambda* (#:key inputs outputs #:allow-other-keys)
664 (let ((bin (string-append (assoc-ref outputs "out") "/bin"))
665 (zlib (assoc-ref inputs "zlib")))
666 (substitute* (find-files bin "h5p?cc")
668 (string-append "-L" zlib "/lib " lib)))
670 (home-page "http://www.hdfgroup.org")
671 (synopsis "Management suite for extremely large and complex data")
672 (description "HDF5 is a suite that makes possible the management of
673 extremely large and complex data collections.")
674 (license (license:x11-style
675 "http://www.hdfgroup.org/ftp/HDF5/current/src/unpacked/COPYING"))))
677 (define-public hdf-eos2
684 (uri "ftp://edhs1.gsfc.nasa.gov\
685 /edhs/hdfeos/latest_release/HDF-EOS2.19v1.00.tar.Z")
687 (base32 "0c9fcz25s292ldap12wxmlrvnyz99z24p63d8fwx51bf8s0s1zrz"))
688 (patches (search-patches "hdf-eos2-remove-gctp.patch"
689 "hdf-eos2-build-shared.patch"
690 "hdf-eos2-fortrantests.patch"))))
691 (build-system gnu-build-system)
693 `(("gfortran" ,gfortran)))
695 `(("hdf4" ,hdf4-alt) ; assume most HDF-EOS2 users won't use the HDF4 netCDF API
700 `( #:configure-flags '("--enable-install-include" "--enable-shared"
701 "CC=h4cc -Df2cFortran" "LIBS=-lgctp")
702 #:parallel-tests? #f))
703 (home-page "http://hdfeos.org/software/library.php#HDF-EOS2")
704 (synopsis "HDF4-based data format for NASA's Earth Observing System")
705 (description "HDF-EOS2 is a software library built on HDF4 which supports
706 the construction of data structures used in NASA's Earth Observing
707 System (Grid, Point and Swath).")
709 ;; Source files carry a permissive license header.
710 (license (license:non-copyleft home-page))))
712 (define-public hdf-eos5
718 (uri (string-append "ftp://edhs1.gsfc.nasa.gov\
719 /edhs/hdfeos5/latest_release/HDF-EOS5." version ".tar.Z"))
722 "1p83333nzzy8rn5chxlm0hrkjjnhh2w1ji8ac0f9q4xzg838i58i"))
723 (patches (search-patches "hdf-eos5-build-shared.patch"
724 "hdf-eos5-remove-gctp.patch"
725 "hdf-eos5-fix-szip.patch"
726 "hdf-eos5-fortrantests.patch"))))
728 `(("gfortran" ,gfortran)))
729 (build-system gnu-build-system)
735 `(#:configure-flags '("--enable-install-include" "--enable-shared"
736 "CC=h5cc -Df2cFortran" "LIBS=-lgctp")
737 #:parallel-tests? #f))
738 (synopsis "HDF5-based data format for NASA's Earth Observing System")
740 "HDF-EOS5 is a software library built on HDF5 to support the construction
741 of data structures used in NASA's Earth Observing System (Grid, Point and
743 (home-page "http://www.hdfeos.org/software/library.php#HDF-EOS5")
745 ;; Source files carry a permissive license header.
746 (license (license:non-copyleft home-page))))
748 (define-public hdf5-parallel-openmpi
749 (package (inherit hdf5)
750 (name "hdf5-parallel-openmpi")
753 ,@(package-inputs hdf5)))
755 (substitute-keyword-arguments `(#:configure-flags '("--enable-parallel")
756 ,@(package-arguments hdf5))
758 `(modify-phases ,phases
759 (add-before 'check 'patch-tests
761 ;; OpenMPI's mpirun will exit with non-zero status if it
762 ;; detects an "abnormal termination", i.e. any process not
763 ;; calling MPI_Finalize(). Since the test is explicitely
764 ;; avoiding MPI_Finalize so as not to have at_exit and thus
765 ;; H5C_flush_cache from being called, mpirun will always
766 ;; complain, so turn this test off.
767 (substitute* "testpar/Makefile"
768 (("(^TEST_PROG_PARA.*)t_pflush1(.*)" front back)
769 (string-append front back "\n")))
770 (substitute* "tools/h5diff/testph5diff.sh"
771 (("/bin/sh") (which "sh")))
773 (synopsis "Management suite for data with parallel IO support")))
775 (define-public h5check
782 (uri (string-append "http://www.hdfgroup.org/ftp/HDF5/tools/"
783 "h5check/src/h5check-" version ".tar.gz"))
786 "1gm76jbwhz9adbxgn14zx8cj33dmjdr2g5xcy0m9c2gakp8w59kj"))))
787 (build-system gnu-build-system)
788 (inputs `(("hdf5" ,hdf5))) ;h5cc for tests
789 (home-page "https://www.hdfgroup.org/products/hdf5_tools/h5check.html")
790 (synopsis "HDF5 format checker")
791 (description "@code{h5check} is a validation tool for verifying that an
792 HDF5 file is encoded according to the HDF File Format Specification.")
793 (license (license:x11-style "file://COPYING"))))
801 (uri (string-append "mirror://sourceforge/itpp/itpp/"
806 "14ddy2xnb6sgp4hiax9v5sv4pr4l4dd4ps76nfha3nrpr1ikhcqm"))))
807 (build-system cmake-build-system)
808 (arguments `(#:tests? #f)) ; Tests require googletest *sources*
809 (inputs `(("lapack" ,lapack)
811 ;; FIXME: Even though the fonts are available dvips complains:
812 ;; "Font cmmi10 not found; characters will be left blank."
814 `(("texlive" ,texlive-tiny)
815 ("ghostscript" ,ghostscript)
816 ("doxygen" ,doxygen)))
817 (home-page "http://itpp.sourceforge.net")
818 (synopsis "C++ library of maths, signal processing and communication classes")
819 (description "IT++ is a C++ library of mathematical, signal processing and
820 communication classes and functions. Its main use is in simulation of
821 communication systems and for performing research in the area of
822 communications. The kernel of the library consists of generic vector and
823 matrix classes, and a set of accompanying routines. Such a kernel makes IT++
824 similar to MATLAB, GNU Octave or SciPy.")
825 (license license:gpl3+)))
827 (define-public netcdf
834 (uri (string-append "ftp://ftp.unidata.ucar.edu/pub/netcdf/"
835 "netcdf-" version ".tar.gz"))
838 "1blc7ik5yin7i0ls2kag0a9xjk12m0dzx6v1x88az3ras3scci2d"))
839 (patches (search-patches "netcdf-date-time.patch"
840 "netcdf-tst_h_par.patch"))))
841 (build-system gnu-build-system)
845 ("graphviz" ,graphviz)))
850 ("libjpeg" ,libjpeg)))
852 `(#:configure-flags '("--enable-doxygen" "--enable-dot" "--enable-hdf4")
853 #:parallel-tests? #f)) ;various race conditions
854 (home-page "http://www.unidata.ucar.edu/software/netcdf/")
855 (synopsis "Library for scientific data")
856 (description "NetCDF is an interface for scientific data access and a
857 software library that provides an implementation of the interface. The netCDF
858 library defines a machine-independent format for representing scientific data.
859 Together, the interface, library, and format support the creation, access, and
860 sharing of scientific data.")
861 (license (license:x11-style "file://COPYRIGHT"))))
863 (define-public netcdf-parallel-openmpi
864 (package (inherit netcdf)
865 (name "netcdf-parallel-openmpi")
868 ,@(alist-replace "hdf5" (list hdf5-parallel-openmpi)
869 (package-inputs netcdf))))
870 ;; TODO: Replace pkg-config references in nc-config with absolute references
872 (substitute-keyword-arguments (package-arguments netcdf)
873 ((#:configure-flags flags)
874 `(cons* "CC=mpicc" "CXX=mpicxx"
875 "--enable-parallel-tests"
876 ;; Shared libraries not supported with parallel IO.
877 "--disable-shared" "--with-pic"
880 (define-public netcdf-fortran
882 (name "netcdf-fortran")
887 "ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-fortran-"
891 "0xaxdcg1p83zmypwml3swsnr3ccn38inwldyr1l3wa4dbwbrblxj"))))
892 (build-system gnu-build-system)
894 `(#:parallel-tests? #f))
896 `(("netcdf" ,netcdf)))
898 `(("gfortran" ,gfortran)))
899 (synopsis "Fortran interface for the netCDF library")
900 (description (package-description netcdf))
901 (home-page (package-home-page netcdf))
902 (license (package-license netcdf))))
910 (uri (string-append "http://ab-initio.mit.edu/nlopt/nlopt-"
913 (base32 "12cfkkhcdf4zmb6h7y6qvvdvqjs2xf9sjpa3rl3bq76px4yn76c0"))))
914 (build-system gnu-build-system)
916 `(;; Shared libraries are not built by default. They are required to
917 ;; build the Guile, Octave, and Python bindings.
918 #:configure-flags '("--enable-shared")
921 (modify-phases %standard-phases
922 (add-before 'configure 'set-libnlopt-file-name
923 (lambda* (#:key outputs #:allow-other-keys)
924 ;; Make sure the Scheme module refers to the library by its
925 ;; absolute file name (we cannot do that from a snippet
926 ;; because the expansion of @libdir@ contains
928 (let ((out (assoc-ref outputs "out")))
929 (substitute* "swig/nlopt.scm.in"
931 (string-append out "/lib/libnlopt")))
933 (inputs `(("guile" ,guile-2.0)))
934 (native-inputs `(("pkg-config" ,pkg-config)))
935 (home-page "http://ab-initio.mit.edu/wiki/")
936 (synopsis "Library for nonlinear optimization")
937 (description "NLopt is a library for nonlinear optimization, providing a
938 common interface for a number of different free optimization routines available
939 online as well as original implementations of various other algorithms.")
940 (license license:lgpl2.1+)))
949 "http://www.coin-or.org/download/source/Ipopt/Ipopt-"
953 "09bk2hqy2vgi4yi76xng9zxakddwqy3wij9nx7wf2vfbxxpazrsk"))
954 (modules '((guix build utils)))
956 ;; Make sure we don't use the bundled software.
957 '(delete-file-recursively "ThirdParty"))))
958 (build-system gnu-build-system)
960 '(#:phases (modify-phases %standard-phases
961 (add-after 'install 'add--L-flags-in-ipopt.pc
962 (lambda* (#:key inputs outputs #:allow-other-keys)
963 ;; The '.pc' file lists '-llapack -lblas' in "Libs";
964 ;; move it to "Libs.private" where it belongs, and add a
965 ;; '-L' flag for LAPACK.
966 (let ((out (assoc-ref outputs "out"))
967 (lapack (assoc-ref inputs "lapack")))
968 (substitute* (string-append out "/lib/pkgconfig/"
970 (("Libs: (.*)-llapack -lblas(.*)$" _ before after)
971 (string-append "Libs: " before " " after "\n"
972 "Libs.private: " before
973 "-L" lapack "/lib -llapack -lblas "
977 `(("gfortran" ,gfortran)))
979 ;; TODO: Maybe add dependency on COIN-MUMPS, ASL, and HSL.
980 `(("lapack" ,lapack))) ;for both libblas and liblapack
981 (home-page "http://www.coin-or.org")
982 (synopsis "Large-scale nonlinear optimizer")
984 "The Interior Point Optimizer (IPOPT) is a software package for
985 large-scale nonlinear optimization. It provides C++, C, and Fortran
987 (license license:epl1.0)))
991 (name "ceres-solver")
993 (home-page "http://ceres-solver.org/")
996 (uri (string-append home-page "ceres-solver-"
1000 "0i7qkbf8g6pd8arxzldppga26ckv93y8zldsfz6wbd4n6b1nqrjd"))))
1001 (build-system cmake-build-system)
1003 ;; TODO: Build HTML user documentation and install separately.
1004 '(#:configure-flags '("-DBUILD_EXAMPLES=OFF"
1005 "-DBUILD_SHARED_LIBS=ON")
1007 #:phases (modify-phases %standard-phases
1008 (add-before 'configure 'set-library-directory
1010 ;; Install libraries to lib/, not lib64/.
1011 (substitute* "internal/ceres/CMakeLists.txt"
1012 (("set\\(LIB_SUFFIX \"64\"\\)")
1013 "set(LIB_SUFFIX \"\")"))
1016 `(("pkg-config" ,pkg-config)))
1018 `(("glog" ,glog))) ;for #include <glog/glog.h>
1023 ("suitesparse" ,suitesparse)
1024 ("gflags" ,gflags)))
1025 (synopsis "C++ library for solving large optimization problems")
1027 "Ceres Solver is a C++ library for modeling and solving large,
1028 complicated optimization problems. It is a feature rich, mature and
1029 performant library which has been used in production since 2010. Ceres Solver
1030 can solve two kinds of problems:
1032 @item non-linear least squares problems with bounds constraints;
1033 @item general unconstrained optimization problems.
1035 (license license:bsd-3)))
1037 ;; For a fully featured Octave, users are strongly recommended also to install
1038 ;; the following packages: texinfo, less, ghostscript, gnuplot.
1039 (define-public octave
1046 (uri (string-append "mirror://gnu/octave/octave-"
1050 "09zhhch79jw3ynw39vizx0i2cbd2bjz3sp38pjdzraqrbivpwp92"))))
1051 (build-system gnu-build-system)
1053 `(("lapack" ,lapack)
1054 ("readline" ,readline)
1059 ("arpack" ,arpack-ng)
1062 ("fontconfig" ,fontconfig)
1063 ("freetype" ,freetype)
1070 ("graphicsmagick" ,graphicsmagick)))
1073 ("gfortran" ,gfortran)
1074 ("pkg-config" ,pkg-config)
1076 ;; The following inputs are not actually used in the build process.
1077 ;; However, the ./configure gratuitously tests for their existence and
1078 ;; assumes that programs not present at build time are also not, and
1079 ;; can never be, available at run time! If these inputs are therefore
1080 ;; not present, support for them will be built out. However, Octave
1081 ;; will still run without them, albeit without the features they
1084 ("texinfo" ,texinfo)
1085 ("ghostscript" ,ghostscript)
1086 ("gnuplot" ,gnuplot)))
1089 (list (string-append "--with-shell="
1090 (assoc-ref %build-inputs "bash")
1092 (home-page "https://www.gnu.org/software/octave/")
1093 (synopsis "High-level language for numerical computation")
1094 (description "GNU Octave is a high-level interpreted language that is
1095 specialized for numerical computations. It can be used for both linear and
1096 non-linear applications and it provides great support for visualizing results.
1097 Work may be performed both at the interactive command-line as well as via
1099 (license license:gpl3+)))
1101 (define-public opencascade-oce
1103 (name "opencascade-oce")
1109 "https://github.com/tpaviot/oce/archive/OCE-"
1114 "0vpmnb0k5y2f7lpmwx9pg9yfq24zjvnsak5alzacncfm1hv9b6cd"))))
1115 (build-system cmake-build-system)
1118 (list "-DOCE_TESTING:BOOL=ON"
1119 "-DOCE_USE_TCL_TEST_FRAMEWORK:BOOL=ON"
1120 "-DOCE_DRAW:BOOL=ON"
1121 (string-append "-DOCE_INSTALL_PREFIX:PATH="
1122 (assoc-ref %outputs "out"))
1123 "-UCMAKE_INSTALL_RPATH")))
1125 `(("freetype" ,freetype)
1132 `(("python" ,python-wrapper)))
1133 (home-page "https://github.com/tpaviot/oce")
1134 (synopsis "Libraries for 3D modeling and numerical simulation")
1136 "Open CASCADE is a set of libraries for the development of applications
1137 dealing with 3D CAD data or requiring industrial 3D capabilities. It includes
1138 C++ class libraries providing services for 3D surface and solid modeling, CAD
1139 data exchange, and visualization. It is used for development of specialized
1140 software dealing with 3D models in design (CAD), manufacturing (CAM),
1141 numerical simulation (CAE), measurement equipment (CMM), and quality
1142 control (CAQ) domains.
1144 This is the ``Community Edition'' (OCE) of Open CASCADE, which gathers
1145 patches, improvements, and experiments contributed by users over the official
1146 Open CASCADE library.")
1147 (license (list license:lgpl2.1; OCE libraries, with an exception for the
1148 ; use of header files; see
1149 ; OCCT_LGPL_EXCEPTION.txt
1150 license:public-domain; files
1151 ; src/Standard/Standard_StdAllocator.hxx and
1152 ; src/NCollection/NCollection_StdAllocator.hxx
1153 license:expat; file src/OpenGl/OpenGl_glext.h
1154 license:bsd-3)))); test framework gtest
1163 (uri (string-append "http://gmsh.info/src/gmsh-"
1164 version "-source.tgz"))
1166 (base32 "1slf0bfkwrcgn6296wb4qhbk4ahz6i4wfb10hnim08x05vrylag8"))
1167 (modules '((guix build utils)))
1169 ;; Remove non-free METIS code
1170 '(delete-file-recursively "contrib/Metis"))))
1171 (build-system cmake-build-system)
1174 ("gfortran" ,gfortran)
1180 ("opencascade-oce" ,opencascade-oce)
1182 ("libxext" ,libxext)))
1184 `(("fontconfig" ,fontconfig)
1185 ("libxft" ,libxft)))
1187 `(#:configure-flags `("-DENABLE_METIS:BOOL=OFF"
1188 "-DENABLE_BUILD_SHARED:BOOL=ON"
1189 "-DENABLE_BUILD_DYNAMIC:BOOL=ON")))
1190 (home-page "http://www.geuz.org/gmsh/")
1191 (synopsis "3D finite element grid generator")
1192 (description "Gmsh is a 3D finite element grid generator with a built-in
1193 CAD engine and post-processor. Its design goal is to provide a fast, light
1194 and user-friendly meshing tool with parametric input and advanced
1195 visualization capabilities. Gmsh is built around four modules: geometry,
1196 mesh, solver and post-processing. The specification of any input to these
1197 modules is done either interactively using the graphical user interface or in
1198 ASCII text files using Gmsh's own scripting language.")
1199 (license license:gpl2+)))
1201 (define-public maxflow
1208 (url "https://github.com/gerddie/maxflow.git")
1209 (commit "42401fa54823d16b9da47716f04e5d9ef1605875")))
1210 (file-name (string-append name "-" version "-checkout"))
1213 "0rll38whw55h0vcjrrwdnh9ascvxby0ph7n1l0d12z17cg215kkb"))))
1214 (build-system cmake-build-system)
1215 (home-page "http://pub.ist.ac.at/~vnk/software.html")
1216 (synopsis "Library implementing Maxflow algorithm")
1217 (description "An implementation of the maxflow algorithm described in
1218 @cite{An Experimental Comparison of Min-Cut/Max-Flow Algorithms for
1219 Energy Minimization in Computer Vision.\n
1220 Yuri Boykov and Vladimir Kolmogorov.\n
1221 In IEEE Transactions on Pattern Analysis and Machine Intelligence,\n
1223 (license license:gpl3+)))
1225 (define-public petsc
1232 ;; The *-lite-* tarball does not contain the *large* documentation
1233 (uri (string-append "http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/"
1234 "petsc-lite-" version ".tar.gz"))
1236 (base32 "1y3f5jjq0v5b62i3sabp4kp5mgfyp3vnk0dxhwkrhpypax77nzxh"))))
1237 (build-system gnu-build-system)
1239 `(("python" ,python-2)
1242 `(("gfortran" ,gfortran)
1244 ("superlu" ,superlu)
1245 ;; leaving out hdf5 and fftw, as petsc expects them to be built with mpi
1246 ;; leaving out opengl, as configuration seems to only be for mac
1249 `(#:test-target "test"
1250 #:parallel-build? #f ;build is parallel by default
1255 ,(string-append "--with-superlu-include="
1256 (assoc-ref %build-inputs "superlu") "/include")
1257 ,(string-append "--with-superlu-lib="
1258 (assoc-ref %build-inputs "superlu") "/lib/libsuperlu.a"))
1260 ;; Honor (parallel-job-count) for build. Do not use --with-make-np,
1261 ;; whose value is dumped to $out/lib/petsc/conf/petscvariables.
1262 (list (format #f "MAKE_NP=~a" (parallel-job-count)))
1264 (modify-phases %standard-phases
1266 ;; PETSc's configure script is actually a python script, so we can't
1267 ;; run it with bash.
1268 (lambda* (#:key outputs (configure-flags '())
1270 (let* ((prefix (assoc-ref outputs "out"))
1271 (flags `(,(string-append "--prefix=" prefix)
1272 ,@configure-flags)))
1273 (format #t "build directory: ~s~%" (getcwd))
1274 (format #t "configure flags: ~s~%" flags)
1275 (zero? (apply system* "./configure" flags)))))
1276 (add-after 'configure 'clean-local-references
1277 (lambda* (#:key outputs #:allow-other-keys)
1278 (let ((out (assoc-ref outputs "out")))
1279 (substitute* (find-files "." "^petsc(conf|machineinfo).h$")
1280 ;; Prevent build directory from leaking into compiled code
1282 ;; Scrub timestamp for reproducibility
1283 ((".*Libraries compiled on.*") ""))
1284 (substitute* (find-files "." "petscvariables")
1285 ;; Do not expose build machine characteristics, set to defaults.
1286 (("MAKE_NP = [:digit:]+") "MAKE_NP = 2")
1287 (("NPMAX = [:digit:]+") "NPMAX = 2"))
1289 (add-after 'install 'clean-install
1290 ;; Try to keep installed files from leaking build directory names.
1291 (lambda* (#:key inputs outputs #:allow-other-keys)
1292 (let ((out (assoc-ref outputs "out")))
1293 (substitute* (map (lambda (file)
1294 (string-append out "/lib/petsc/conf/" file))
1295 '("petscvariables"))
1297 ;; Make compiler references point to the store
1298 (substitute* (string-append out "/lib/petsc/conf/petscvariables")
1299 (("= (gcc|g\\+\\+|gfortran)" _ compiler)
1300 (string-append "= " (which compiler))))
1301 ;; PETSc installs some build logs, which aren't necessary.
1302 (for-each (lambda (file)
1303 (let ((f (string-append out "/lib/petsc/conf/" file)))
1304 (when (file-exists? f)
1306 '("configure.log" "make.log" "gmake.log"
1307 "test.log" "error.log" "RDict.db"
1308 "PETScBuildInternal.cmake"
1309 ;; Once installed, should uninstall with Guix
1312 (home-page "http://www.mcs.anl.gov/petsc")
1313 (synopsis "Library to solve PDEs")
1314 (description "PETSc, pronounced PET-see (the S is silent), is a suite of
1315 data structures and routines for the scalable (parallel) solution of
1316 scientific applications modeled by partial differential equations.")
1317 (license (license:non-copyleft
1318 "http://www.mcs.anl.gov/petsc/documentation/copyright.html"))))
1320 (define-public petsc-complex
1321 (package (inherit petsc)
1322 (name "petsc-complex")
1324 (substitute-keyword-arguments (package-arguments petsc)
1325 ((#:configure-flags cf)
1326 `(cons "--with-scalar-type=complex" ,cf))))
1327 (synopsis "Library to solve PDEs (with complex scalars)")))
1329 (define-public petsc-openmpi
1330 (package (inherit petsc)
1331 (name "petsc-openmpi")
1333 `(("openmpi" ,openmpi)
1334 ,@(package-inputs petsc)))
1336 (substitute-keyword-arguments (package-arguments petsc)
1337 ((#:configure-flags cf)
1338 ``("--with-mpiexec=mpirun"
1339 ,(string-append "--with-mpi-dir="
1340 (assoc-ref %build-inputs "openmpi"))
1341 ,@(delete "--with-mpi=0" ,cf)))))
1342 (synopsis "Library to solve PDEs (with MPI support)")))
1344 (define-public petsc-complex-openmpi
1345 (package (inherit petsc-complex)
1346 (name "petsc-complex-openmpi")
1348 `(("openmpi" ,openmpi)
1349 ,@(package-inputs petsc-complex)))
1351 (substitute-keyword-arguments (package-arguments petsc-complex)
1352 ((#:configure-flags cf)
1353 ``("--with-mpiexec=mpirun"
1354 ,(string-append "--with-mpi-dir="
1355 (assoc-ref %build-inputs "openmpi"))
1356 ,@(delete "--with-mpi=0" ,cf)))))
1357 (synopsis "Library to solve PDEs (with complex scalars and MPI support)")))
1359 (define-public slepc
1366 (uri (string-append "http://slepc.upv.es/download/distrib/slepc-"
1370 "12pbl8yd6r8k9xjlr1qw25rs0k1acgic7hw1s6l6bhiv9s285drg"))))
1371 (build-system gnu-build-system)
1373 `(("python" ,python-2)))
1375 `(("arpack" ,arpack-ng)
1376 ("gfortran" ,gfortran)))
1378 `(("petsc" ,petsc)))
1380 `(#:parallel-build? #f ;build is parallel by default
1382 `(,(string-append "--with-arpack-dir="
1383 (assoc-ref %build-inputs "arpack") "/lib"))
1384 #:make-flags ;honor (parallel-job-count)
1385 `(,(format #f "MAKE_NP=~a" (parallel-job-count)))
1387 (modify-phases %standard-phases
1389 ;; configure is a python script, so we can't run it with bash.
1390 (lambda* (#:key inputs outputs (configure-flags '())
1392 (let* ((prefix (assoc-ref outputs "out"))
1393 (flags `(,(string-append "--prefix=" prefix)
1394 ,@configure-flags)))
1395 (format #t "build directory: ~s~%" (getcwd))
1396 (format #t "configure flags: ~s~%" flags)
1397 (setenv "SLEPC_DIR" (getcwd))
1398 (setenv "PETSC_DIR" (assoc-ref inputs "petsc"))
1399 (zero? (apply system* "./configure" flags)))))
1400 (add-after 'install 'delete-doc
1401 ;; TODO: SLEPc installs HTML documentation alongside headers in
1402 ;; $out/include. We'd like to move them to share/doc, but delete
1403 ;; them for now, as they are incomplete and installing the complete
1404 ;; documentation is difficult.
1405 (lambda* (#:key outputs #:allow-other-keys)
1406 (let* ((out (assoc-ref outputs "out")))
1407 (for-each delete-file (find-files out "\\.html$")))))
1408 (add-after 'install 'clean-install
1409 ;; Clean up unnecessary build logs from installation.
1410 (lambda* (#:key outputs #:allow-other-keys)
1411 (let ((out (assoc-ref outputs "out")))
1412 (for-each (lambda (file)
1413 (let ((f (string-append out "/lib/slepc/conf/" file)))
1414 (when (file-exists? f)
1416 '("configure.log" "make.log" "gmake.log"
1417 "test.log" "error.log" "RDict.db"
1418 "uninstall.py"))))))))
1419 (home-page "http://slepc.upv.es")
1420 (synopsis "Scalable library for eigenproblems")
1421 (description "SLEPc is a software library for the solution of large sparse
1422 eigenproblems on parallel computers. It can be used for the solution of
1423 linear eigenvalue problems formulated in either standard or generalized form,
1424 as well as other related problems such as the singular value decomposition.
1425 The emphasis of the software is on methods and techniques appropriate for
1426 problems in which the associated matrices are sparse, for example, those
1427 arising after the discretization of partial differential equations.")
1428 (license license:lgpl3)))
1430 (define-public slepc-complex
1431 (package (inherit slepc)
1432 (name "slepc-complex")
1434 `(("petsc" ,petsc-complex)
1435 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
1436 (synopsis "Scalable library for eigenproblems (with complex scalars)")))
1438 (define-public slepc-openmpi
1439 (package (inherit slepc)
1440 (name "slepc-openmpi")
1443 ("arpack" ,arpack-ng-openmpi)
1444 ,@(alist-delete "arpack" (package-inputs slepc))))
1446 `(("petsc" ,petsc-openmpi)
1447 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
1448 (synopsis "Scalable library for eigenproblems (with MPI support)")))
1450 (define-public slepc-complex-openmpi
1451 (package (inherit slepc-openmpi)
1452 (name "slepc-complex-openmpi")
1454 `(("petsc" ,petsc-complex-openmpi)
1455 ,@(alist-delete "petsc" (package-propagated-inputs slepc-openmpi))))
1456 (synopsis "Scalable library for eigenproblems (with complex scalars and MPI support)")))
1458 (define-public mumps
1465 (uri (string-append "http://mumps.enseeiht.fr/MUMPS_"
1469 "0igyc1pfzxdhpbad3v3lb86ixkdbqa1a8gbs15b04r2294h2nabp"))
1470 (patches (search-patches "mumps-build-parallelism.patch"))))
1471 (build-system gnu-build-system)
1473 `(("fortran" ,gfortran)
1474 ;; These are required for linking against mumps, but we let the user
1475 ;; declare the dependency.
1478 ("scotch" ,scotch)))
1480 `(#:modules ((ice-9 match)
1483 ,@%gnu-build-system-modules)
1485 (modify-phases %standard-phases
1487 (lambda* (#:key inputs #:allow-other-keys)
1488 (call-with-output-file "Makefile.inc"
1499 INCSEQ = -I$(topdir)/libseq
1500 LIBSEQ = -L$(topdir)/libseq -lmpiseq
1501 LIBSEQNEEDED = libseqneeded~;
1505 AR = ar vr # rules require trailing space, ugh...
1507 LIBBLAS = -L~a -lopenblas~@[
1508 SCALAP = -L~a -lscalapack~]
1509 LIBOTHERS = -pthread
1512 OPTF = -O2 -DALLOW_NON_INIT $(PIC)
1516 LIBS = $(SCALAP) $(LIBSEQ)
1517 LPORDDIR = $(topdir)/PORD/lib
1518 IPORD = -I$(topdir)/PORD/include
1519 LPORD = -L$(LPORDDIR) -lpord
1520 ORDERINGSF = -Dpord~@[
1522 IMETIS = -I$(METISDIR)/include
1523 LMETIS = -L$(METISDIR)/lib -lmetis
1524 ORDERINGSF += -Dmetis~]~@[~:{
1526 ISCOTCH = -I$(SCOTCHDIR)/include
1527 LSCOTCH = -L$(SCOTCHDIR)/lib ~a-lesmumps -lscotch -lscotcherr
1528 ORDERINGSF += ~a~}~]
1529 ORDERINGSC = $(ORDERINGSF)
1530 LORDERINGS = $(LPORD) $(LMETIS) $(LSCOTCH)
1531 IORDERINGSF = $(ISCOTCH)
1532 IORDERINGSC = $(IPORD) $(IMETIS) $(ISCOTCH)"
1533 (assoc-ref inputs "mpi")
1534 (assoc-ref inputs "blas")
1535 (assoc-ref inputs "scalapack")
1536 (assoc-ref inputs "metis")
1537 (match (list (assoc-ref inputs "pt-scotch")
1538 (assoc-ref inputs "scotch"))
1542 `((,scotch "" "-Dscotch")))
1545 "-lptesmumps -lptscotch -lptscotcherr "
1546 "-Dptscotch")))))))))
1548 ;; By default only the d-precision library is built. Make with "all"
1549 ;; target so that all precision libraries and examples are built.
1551 (zero? (system* "make" "all"
1552 (format #f "-j~a" (parallel-job-count))))))
1554 ;; Run the simple test drivers, which read test input from stdin:
1555 ;; from the "real" input for the single- and double-precision
1556 ;; testers, and from the "cmplx" input for complex-precision
1557 ;; testers. The EXEC-PREFIX key is used by the mumps-openmpi
1558 ;; package to prefix execution with "mpirun".
1559 (lambda* (#:key (exec-prefix '()) #:allow-other-keys)
1560 (with-directory-excursion "examples"
1563 (let ((tester (apply open-pipe*
1566 ,(string-append "./" prec
1568 (input (open-input-file
1569 (string-append "input_simpletest_" type))))
1571 (dump-port input tester)
1573 (zero? (close-pipe tester)))))
1575 '("real" "real" "cmplx" "cmplx")))))
1577 (lambda* (#:key outputs #:allow-other-keys)
1578 (let* ((out (assoc-ref outputs "out"))
1579 (libdir (string-append out "/lib")))
1580 (copy-recursively "lib" libdir)
1581 (copy-recursively "include" (string-append out "/include"))
1582 (when (file-exists? "libseq/libmpiseq.a")
1583 (install-file "libseq/libmpiseq.a" libdir))
1585 (home-page "http://mumps.enseeiht.fr")
1586 (synopsis "Multifrontal sparse direct solver")
1588 "MUMPS (MUltifrontal Massively Parallel sparse direct Solver) solves a
1589 sparse system of linear equations A x = b using Guassian elimination.")
1590 (license license:cecill-c)))
1592 (define-public mumps-metis
1593 (package (inherit mumps)
1594 (name "mumps-metis")
1596 (alist-delete "scotch" (package-inputs mumps)))))
1598 (define-public mumps-openmpi
1599 (package (inherit mumps)
1600 (name "mumps-openmpi")
1603 ("scalapack" ,scalapack)
1604 ("pt-scotch" ,pt-scotch)
1605 ,@(alist-delete "scotch" (package-inputs mumps))))
1607 (substitute-keyword-arguments (package-arguments mumps)
1609 `(modify-phases ,phases
1613 ((assoc-ref ,phases 'check)
1614 #:exec-prefix '("mpirun" "-n" "2"))))))))
1615 (synopsis "Multifrontal sparse direct solver (with MPI)")))
1617 (define-public mumps-metis-openmpi
1618 (package (inherit mumps-openmpi)
1619 (name "mumps-metis-openmpi")
1621 (alist-delete "pt-scotch" (package-inputs mumps-openmpi)))))
1623 (define-public r-quadprog
1630 (uri (cran-uri "quadprog" version))
1633 "0jg3r6abmhp8r9vkbhpx9ldjfw6vyl1m4c5vwlyjhk1mi03656fr"))))
1634 (build-system r-build-system)
1636 `(("gfortran" ,gfortran)))
1637 (home-page "http://cran.r-project.org/web/packages/quadprog")
1638 (synopsis "Functions to solve quadratic programming problems")
1640 "This package contains routines and documentation for solving quadratic
1641 programming problems.")
1642 (license license:gpl3+)))
1644 (define-public r-pracma
1650 (uri (cran-uri "pracma" version))
1652 (base32 "0hxa0rbbp54j0c05qj7vfwhqfdmiz5ax8vhqxd09g33x7c0hqbc5"))))
1653 (build-system r-build-system)
1655 `(("r-quadprog" ,r-quadprog)))
1656 (home-page "http://cran.r-project.org/web/packages/pracma")
1657 (synopsis "Practical numerical math functions")
1658 (description "This package provides functions for numerical analysis and
1659 linear algebra, numerical optimization, differential equations, plus some
1660 special functions. It uses Matlab function names where appropriate to simplify
1662 (license license:gpl3+)))
1664 (define-public superlu
1671 (uri (string-append "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/"
1672 "superlu_" version ".tar.gz"))
1674 (base32 "0qzlb7cd608q62kyppd0a8c65l03vrwqql6gsm465rky23b6dyr8"))
1675 (modules '((guix build utils)))
1677 ;; Replace the non-free implementation of MC64 with a stub adapted
1680 (use-modules (ice-9 regex)
1682 (call-with-output-file "SRC/mc64ad.c"
1687 void mc64id_(int *a) {
1688 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
1691 void mc64ad_ (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
1692 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
1693 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
1696 ;; Remove the corresponding license verbiage. MC64 license follows
1697 ;; a "------" line separator.
1698 (with-atomic-file-replacement "License.txt"
1699 (let ((rx (make-regexp "-{8}")))
1702 (let ((line (read-line in 'concat)))
1703 (unless (regexp-exec rx line)
1706 (build-system cmake-build-system)
1710 `(("blas" ,openblas)
1711 ("gfortran" ,gfortran)))
1713 `(#:configure-flags '("-Denable_blaslib:BOOL=NO" ;do not use internal cblas
1714 "-DTPL_BLAS_LIBRARIES=openblas"
1715 "-DBUILD_SHARED_LIBS:BOOL=YES"
1716 "-DCMAKE_INSTALL_LIBDIR=lib")))
1717 (home-page "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/")
1718 (synopsis "Supernodal direct solver for sparse linear systems")
1720 "SuperLU is a general purpose library for the direct solution of large,
1721 sparse, nonsymmetric systems of linear equations on high performance machines.
1722 The library is written in C and is callable from either C or Fortran. The
1723 library routines perform an LU decomposition with partial pivoting and
1724 triangular system solves through forward and back substitution. The library
1725 also provides threshold-based ILU factorization preconditioners.")
1726 (license (list license:bsd-3
1727 license:gpl2+ ;EXAMPLE/*fgmr.c
1728 (license:fsf-free "file://SRC/colamd.h")))))
1730 (define-public superlu-dist
1732 (name "superlu-dist")
1737 (uri (string-append "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/"
1738 "superlu_dist_" version ".tar.gz"))
1740 (base32 "1hnak09yxxp026blq8zhrl7685yip16svwngh1wysqxf8z48vzfj"))
1741 (modules '((guix build utils)))
1743 ;; Replace the non-free implementation of MC64 with a stub
1745 (use-modules (ice-9 regex)
1747 (call-with-output-file "SRC/mc64ad.c"
1752 void mc64id_(int *a) {
1753 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
1756 void mc64ad_ (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
1757 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
1758 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
1761 (delete-file "SRC/mc64ad.f.bak")
1762 (substitute* "SRC/util.c" ;adjust default algorithm
1763 (("RowPerm[[:blank:]]*=[[:blank:]]*LargeDiag")
1764 "RowPerm = NOROWPERM"))))
1765 (patches (search-patches "superlu-dist-scotchmetis.patch"))))
1766 (build-system gnu-build-system)
1770 `(("gfortran" ,gfortran)))
1772 `(("openmpi" ,openmpi) ;headers include MPI heades
1773 ("lapack" ,lapack) ;required to link with output library
1774 ("pt-scotch" ,pt-scotch))) ;same
1776 `(#:parallel-build? #f ;race conditions using ar
1780 (lambda* (#:key inputs outputs #:allow-other-keys)
1781 (call-with-output-file "make.inc"
1786 DSUPERLULIB = ~a/lib/libsuperlu_dist.a
1787 BLASDEF = -DUSE_VENDOR_BLAS
1788 BLASLIB = -L~a/lib -lblas
1789 PARMETISLIB = -L~a/lib \
1790 -lptscotchparmetis -lptscotch -lptscotcherr -lptscotcherrexit \
1791 -lscotch -lscotcherr -lscotcherrexit
1792 METISLIB = -L~:*~a/lib \
1793 -lscotchmetis -lscotch -lscotcherr -lscotcherrexit
1794 LIBS = $(DSUPERLULIB) $(PARMETISLIB) $(METISLIB) $(BLASLIB)
1800 CFLAGS = -O3 -g -DPRNTlevel=0 $(PIC)
1801 NOOPTS = -O0 -g $(PIC)
1803 FFLAGS = -O2 -g $(PIC)
1807 (assoc-ref outputs "out")
1808 (assoc-ref inputs "lapack")
1809 (assoc-ref inputs "pt-scotch")))))
1811 'unpack 'remove-broken-symlinks
1813 (for-each delete-file
1814 (find-files "MAKE_INC" "\\.#make\\..*")))
1816 'build 'create-install-directories
1817 (lambda* (#:key outputs #:allow-other-keys)
1820 (mkdir-p (string-append (assoc-ref outputs "out")
1822 '("lib" "include")))
1826 (with-directory-excursion "EXAMPLE"
1828 (zero? (system* "mpirun" "-n" "2"
1829 "./pddrive" "-r" "1" "-c" "2" "g20.rua"))
1830 (zero? (system* "mpirun" "-n" "2"
1831 "./pzdrive" "-r" "1" "-c" "2" "cg20.cua")))))
1834 (lambda* (#:key outputs #:allow-other-keys)
1835 ;; Library is placed in lib during the build phase. Copy over
1836 ;; headers to include.
1837 (let* ((out (assoc-ref outputs "out"))
1838 (incdir (string-append out "/include")))
1839 (for-each (lambda (file)
1840 (let ((base (basename file)))
1841 (format #t "installing `~a' to `~a'~%"
1844 (string-append incdir "/" base))))
1845 (find-files "SRC" ".*\\.h$"))))
1846 %standard-phases)))))))
1847 (home-page (package-home-page superlu))
1848 (synopsis "Parallel supernodal direct solver")
1850 "SuperLU_DIST is a parallel extension to the serial SuperLU library.
1851 It is targeted for distributed memory parallel machines. SuperLU_DIST is
1852 implemented in ANSI C, and MPI for communications.")
1853 (license license:bsd-3)))
1855 (define-public scotch
1862 (uri (string-append "https://gforge.inria.fr/frs/download.php/34618/"
1863 "scotch_" version ".tar.gz"))
1865 (base32 "1ir088mvrqggyqdkx9qfynmiaffqbyih5qfl5mga2nrlm1qlsgzm"))
1866 (patches (search-patches "scotch-test-threading.patch"
1867 "pt-scotch-build-parallelism.patch"))))
1868 (build-system gnu-build-system)
1875 (modify-phases %standard-phases
1877 'unpack 'chdir-to-src
1878 (lambda _ (chdir "src")))
1882 (call-with-output-file "Makefile.inc"
1896 CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
1897 LDFLAGS = -lz -lm -lrt -lpthread
1899 LEX = flex -Pscotchyy -olex.yy.c
1904 YACC = bison -pscotchyy -y -b y
1906 '("COMMON_FILE_COMPRESS_GZ"
1908 "COMMON_RANDOM_FIXED_SEED"
1909 "INTSIZE64" ;use 'long' instead of 'int'
1910 ;; Prevents symbolc clashes with libesmumps
1912 ;; XXX: Causes invalid frees in superlu-dist tests
1914 ;; "SCOTCH_PTHREAD_NUMBER=2"
1915 "restrict=__restrict"))))))
1917 'build 'build-esmumps
1919 (zero? (system* "make"
1920 (format #f "-j~a" (parallel-job-count))
1924 (lambda* (#:key outputs #:allow-other-keys)
1925 (let ((out (assoc-ref outputs "out")))
1927 (zero? (system* "make"
1928 (string-append "prefix=" out)
1930 ;; esmumps files are not installed with the above
1931 (for-each (lambda (f)
1932 (copy-file f (string-append out "/include/" f)))
1933 (find-files "../include" ".*esmumps.h$"))
1934 (for-each (lambda (f)
1935 (copy-file f (string-append out "/lib/" f)))
1936 (find-files "../lib" "^lib.*esmumps.*"))))))))
1937 (home-page "http://www.labri.fr/perso/pelegrin/scotch/")
1938 (synopsis "Programs and libraries for graph algorithms")
1939 (description "SCOTCH is a set of programs and libraries which implement
1940 the static mapping and sparse matrix reordering algorithms developed within
1941 the SCOTCH project. Its purpose is to apply graph theory, with a divide and
1942 conquer approach, to scientific computing problems such as graph and mesh
1943 partitioning, static mapping, and sparse matrix ordering, in application
1944 domains ranging from structural mechanics to operating systems or
1946 ;; See LICENSE_en.txt
1947 (license license:cecill-c)))
1949 (define-public pt-scotch
1950 (package (inherit scotch)
1953 `(("openmpi" ,openmpi))) ;Headers include MPI headers
1955 (substitute-keyword-arguments (package-arguments scotch)
1956 ((#:phases scotch-phases)
1957 `(modify-phases ,scotch-phases
1962 (zero? (system* "make"
1963 (format #f "-j~a" (parallel-job-count))
1964 "ptscotch" "ptesmumps"))
1965 ;; Install the serial metis compatibility library
1966 (zero? (system* "make" "-C" "libscotchmetis" "install")))))
1969 (lambda _ (zero? (system* "make" "ptcheck"))))))))
1970 (synopsis "Programs and libraries for graph algorithms (with MPI)")))
1972 (define-public metis
1979 (uri (string-append "http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/"
1980 "metis-" version ".tar.gz"))
1983 "1cjxgh41r8k6j029yxs8msp3z6lcnpm16g5pvckk35kc7zhfpykn"))))
1984 (build-system cmake-build-system)
1986 `(("blas" ,openblas)))
1988 `(#:tests? #f ;no tests
1989 #:configure-flags `("-DSHARED=ON"
1990 ,(string-append "-DGKLIB_PATH=" (getcwd)
1991 "/metis-" ,version "/GKlib"))))
1992 (home-page "http://glaros.dtc.umn.edu/gkhome/metis/metis/overview")
1993 (synopsis "Graph partitioning and fill-reducing matrix ordering library")
1995 "METIS is a set of serial programs for partitioning graphs, partitioning
1996 finite element meshes, and producing fill-reducing orderings for sparse
1997 matrices. The algorithms implemented in METIS are based on the multilevel
1998 recursive-bisection, multilevel k-way, and multi-constraint partitioning
2000 (license license:asl2.0))) ;As of version 5.0.3
2002 (define-public p4est
2009 (uri (string-append "http://p4est.github.io/release/p4est-"
2013 "0faina2h5qsx3m2izbzaj9bbakma1krbbjmq43wrp1hcbyijflqb"))))
2014 (build-system gnu-build-system)
2016 `(("fortran" ,gfortran)
2021 `(#:configure-flags `(,(string-append "BLAS_LIBS=-L"
2022 (assoc-ref %build-inputs "blas")
2024 ,(string-append "LAPACK_LIBS=-L"
2025 (assoc-ref %build-inputs "lapack")
2027 (home-page "http://www.p4est.org")
2028 (synopsis "Adaptive mesh refinement on forests of octrees")
2030 "The p4est software library enables the dynamic management of a
2031 collection of adaptive octrees, conveniently called a forest of octrees.
2032 p4est is designed to work in parallel and scales to hundreds of thousands of
2034 (license license:gpl2+)))
2036 (define-public p4est-openmpi
2037 (package (inherit p4est)
2038 (name "p4est-openmpi")
2041 ,@(package-inputs p4est)))
2043 (substitute-keyword-arguments (package-arguments p4est)
2044 ((#:configure-flags cf)
2045 ``("--enable-mpi" ,@,cf))))
2046 (synopsis "Parallel adaptive mesh refinement on forests of octrees")))
2048 (define-public gsegrafix
2055 (uri (string-append "mirror://gnu/" name "/" name "-"
2059 "1b13hvx063zv970y750bx41wpx6hwd5ngjhbdrna8w8yy5kmxcda"))))
2060 (build-system gnu-build-system)
2062 `(#:configure-flags '("LDFLAGS=-lm")))
2064 `(("libgnomecanvas" ,libgnomecanvas)
2065 ("libbonoboui" ,libbonoboui)
2066 ("libgnomeui" ,libgnomeui)
2067 ("libgnomeprintui" ,libgnomeprintui)
2070 `(("pkg-config" ,pkg-config)))
2071 (home-page "https://www.gnu.org/software/gsegrafix/")
2072 (synopsis "GNOME application to create scientific and engineering plots")
2073 (description "GSEGrafix is an application which produces high-quality graphical
2074 plots for science and engineering. Plots are specified via simple ASCII
2075 parameter files and data files and are presented in an anti-aliased GNOME
2076 canvas. The program supports rectangular two-dimensional plots, histograms,
2077 polar-axis plots and three-dimensional plots. Plots can be printed or saved
2078 to BMP, JPEG or PNG image formats.")
2079 (license license:gpl3+)))
2081 (define-public maxima
2088 (uri (string-append "mirror://sourceforge/maxima/Maxima-source/"
2089 version "-source/" name "-" version ".tar.gz"))
2092 "15pp35ayglv723bjbqc60gcdv2bm54s6pywsm4i4cwbjsf64dzkl"))
2093 (patches (search-patches "maxima-defsystem-mkdir.patch"))))
2094 (build-system gnu-build-system)
2097 ("gnuplot" ,gnuplot) ;for plots
2098 ("tk" ,tk))) ;Tcl/Tk is used by 'xmaxima'
2100 `(("texinfo" ,texinfo)
2102 ("python" ,python)))
2105 (list "--enable-gcl"
2106 (string-append "--with-posix-shell="
2107 (assoc-ref %build-inputs "bash")
2109 (string-append "--with-wish="
2110 (assoc-ref %build-inputs "tk")
2112 (let ((v ,(package-version tk)))
2113 (string-take v (string-index-right v #\.)))))
2114 ;; By default Maxima attempts to write temporary files to
2115 ;; '/tmp/nix-build-maxima-*', which won't exist at run time.
2116 ;; Work around that.
2117 #:make-flags (list "TMPDIR=/tmp")
2119 (modify-phases %standard-phases
2120 (add-before 'check 'pre-check
2122 (chmod "src/maxima" #o555)
2124 ;; Make sure the doc and emacs files are found in the
2125 ;; standard location. Also configure maxima to find gnuplot
2126 ;; without having it on the PATH.
2127 (add-after 'install 'post-install
2128 (lambda* (#:key outputs inputs #:allow-other-keys)
2129 (let* ((gnuplot (assoc-ref inputs "gnuplot"))
2130 (out (assoc-ref outputs "out"))
2131 (datadir (string-append out "/share/maxima/" ,version))
2132 (binutils (string-append (assoc-ref inputs "binutils")
2134 (with-directory-excursion out
2135 (mkdir-p "share/emacs")
2136 (mkdir-p "share/doc")
2138 (string-append datadir "/emacs/")
2139 (string-append out "/share/emacs/site-lisp"))
2141 (string-append datadir "/doc/")
2142 (string-append out "/share/doc/maxima"))
2143 (with-atomic-file-replacement
2144 (string-append datadir "/share/maxima-init.lisp")
2146 (format out "~a ~s~a~%"
2147 "(setf $gnuplot_command "
2148 (string-append gnuplot "/bin/gnuplot") ")")
2149 (dump-port in out))))
2150 ;; Ensure that Maxima will have access to the GNU binutils
2151 ;; components at runtime.
2152 (wrap-program (string-append out "/bin/maxima")
2153 `("PATH" prefix (,binutils))))
2155 (home-page "http://maxima.sourceforge.net")
2156 (synopsis "Numeric and symbolic expression manipulation")
2157 (description "Maxima is a system for the manipulation of symbolic and
2158 numerical expressions. It yields high precision numeric results by using
2159 exact fractions, arbitrary precision integers, and variable precision floating
2161 ;; Some files are lgpl2.1+. Some are gpl2+. Some explicitly state gpl1+.
2162 ;; Others simply say "GNU General Public License" without stating a
2163 ;; version (which implicitly means gpl1+).
2164 ;; At least one file (src/maxima.asd) says "version 2."
2165 ;; GPLv2 only is therefore the smallest subset.
2166 (license license:gpl2)))
2168 (define-public wxmaxima
2175 (uri (string-append "https://github.com/andrejv/" name "/archive"
2176 "/Version-" version ".tar.gz"))
2177 (file-name (string-append name "-" version ".tar.gz"))
2180 "0dv0cy0cf46v0cbw32izscpkdmpxg1qhwq1f4cz46kkqd8k4yfbj"))))
2181 (build-system gnu-build-system)
2183 `(("autoconf" ,autoconf)
2184 ("automake" ,automake)
2185 ("gettext" ,gettext-minimal)))
2187 `(("wxwidgets" ,wxwidgets)
2190 ("adwaita-icon-theme" ,adwaita-icon-theme)
2192 ("shared-mime-info" ,shared-mime-info)))
2195 (modify-phases %standard-phases
2196 (add-after 'unpack 'autoconf
2198 (zero? (system* "sh" "bootstrap"))))
2199 (add-after 'install 'wrap-program
2200 (lambda* (#:key inputs outputs #:allow-other-keys)
2201 (wrap-program (string-append (assoc-ref outputs "out")
2204 (,(string-append (assoc-ref inputs "maxima")
2206 ;; For GtkFileChooserDialog.
2207 `("GSETTINGS_SCHEMA_DIR" =
2208 (,(string-append (assoc-ref inputs "gtk+")
2209 "/share/glib-2.0/schemas")))
2210 `("XDG_DATA_DIRS" ":" prefix
2211 (;; Needed by gdk-pixbuf to know supported icon formats.
2213 (assoc-ref inputs "shared-mime-info") "/share")
2214 ;; The default icon theme of GTK+.
2216 (assoc-ref inputs "adwaita-icon-theme") "/share"))))
2218 (home-page "https://andrejv.github.io/wxmaxima/")
2219 (synopsis "Graphical user interface for the Maxima computer algebra system")
2221 "wxMaxima is a graphical user interface for the Maxima computer algebra
2222 system. It eases the use of Maxima by making most of its commands available
2223 through a menu system and by providing input dialogs for commands that require
2224 more than one argument. It also implements its own display engine that
2225 outputs mathematical symbols directly instead of depicting them with ASCII
2228 wxMaxima also features 2D and 3D inline plots, simple animations, mixing of
2229 text and mathematical calculations to create documents, exporting of input and
2230 output to TeX, and a browser for Maxima's manual including command index and
2231 full text searching.")
2232 (license license:gpl2+)))
2234 (define-public armadillo
2240 (uri (string-append "mirror://sourceforge/arma/armadillo-"
2244 "1qqzy7dp891j9v7062mv1599hdwr97vqzrd3j2fl8c3gmc00dmzg"))))
2245 (build-system cmake-build-system)
2246 (arguments `(#:tests? #f)) ;no test target
2248 `(("openblas" ,openblas)
2250 ("arpack" ,arpack-ng)))
2251 (home-page "http://arma.sourceforge.net/")
2252 (synopsis "C++ linear algebra library")
2254 "Armadillo is a C++ linear algebra library, aiming towards a good balance
2255 between speed and ease of use. It is useful for algorithm development
2256 directly in C++, or quick conversion of research code into production
2257 environments. It can be used for machine learning, pattern recognition,
2258 signal processing, bioinformatics, statistics, econometrics, etc. The library
2259 provides efficient classes for vectors, matrices and cubes, as well as 150+
2260 associated functions (eg. contiguous and non-contiguous submatrix views).")
2261 (license license:asl2.0)))
2263 (define-public muparser
2264 ;; When switching download sites, muparser re-issued a 2.2.5 release with a
2265 ;; different hash. In order to make `guix package --upgrade` work correctly,
2266 ;; we set a Guix packaging revision.
2267 ;; When the next version of muparser is released, we can remove
2268 ;; UPSTREAM-VERSION and REVISION and use the plain VERSION.
2269 (let ((upstream-version "2.2.5")
2273 (version (string-append upstream-version "-" revision))
2277 (uri (string-append "https://github.com/beltoforion/muparser/archive/v"
2278 upstream-version ".tar.gz"))
2279 (file-name (string-append name "-" version ".tar.gz"))
2282 "0277qsi5l23jsck1vhn383bmvc2n9l4a1dl5r9bf7hvjv9ayyrh6"))))
2283 (build-system gnu-build-system)
2285 `(#:configure-flags '("--enable-samples=no")
2286 #:tests? #f)) ;no "check" target
2287 (home-page "http://muparser.beltoforion.de/")
2288 (synopsis "Fast parser library for mathematical expressions")
2290 "muParser is an extensible high performance math parser library. It is
2291 based on transforming an expression into a bytecode and precalculating constant
2293 (license license:expat))))
2295 (define-public openblas
2302 (uri (string-append "https://github.com/xianyi/OpenBLAS/tarball/v"
2304 (file-name (string-append name "-" version ".tar.gz"))
2307 "071zqnmnxhh0c9phzyn3f198yxa0hjxda7016azdbq2056sm70w7"))))
2308 (build-system gnu-build-system)
2310 `(#:tests? #f ;no "check" target
2311 ;; DYNAMIC_ARCH is only supported on x86. When it is disabled and no
2312 ;; TARGET is specified, OpenBLAS will tune itself to the build host, so
2313 ;; we need to disable substitutions.
2315 ,(let ((system (or (%current-target-system) (%current-system))))
2316 (or (string-prefix? "x86_64" system)
2317 (string-prefix? "i686" system)
2318 (string-prefix? "mips" system)
2319 (string-prefix? "aarch64" system)))
2321 (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
2324 ;; Build the library for all supported CPUs. This allows
2325 ;; switching CPU targets at runtime with the environment variable
2326 ;; OPENBLAS_CORETYPE=<type>, where "type" is a supported CPU type.
2327 ;; Unfortunately, this is not supported on non-x86 architectures,
2328 ;; where it leads to failed builds.
2329 ,@(let ((system (or (%current-target-system) (%current-system))))
2331 ((or (string-prefix? "x86_64" system)
2332 (string-prefix? "i686" system))
2333 '("DYNAMIC_ARCH=1"))
2334 ;; On MIPS we force the "SICORTEX" TARGET, as for the other
2335 ;; two available MIPS targets special extended instructions
2336 ;; for Loongson cores are used.
2337 ((string-prefix? "mips" system)
2338 '("TARGET=SICORTEX"))
2339 ;; On aarch64 force the generic 'armv8-a' target
2340 ((string-prefix? "aarch64" system)
2343 ;; no configure script
2344 #:phases (alist-delete 'configure %standard-phases)))
2346 `(("fortran" ,gfortran)))
2350 (home-page "http://www.openblas.net/")
2351 (synopsis "Optimized BLAS library based on GotoBLAS")
2353 "OpenBLAS is a BLAS library forked from the GotoBLAS2-1.13 BSD version.")
2354 (license license:bsd-3)))
2356 (define-public openlibm
2363 (uri (string-append "https://github.com/JuliaLang/openlibm/archive/v"
2365 (file-name (string-append name "-" version ".tar.gz"))
2368 "11czx2z7nh6dfpz45s3xl7v38hw36jxzxfvny454bk3if14pfakq"))))
2369 (build-system gnu-build-system)
2372 (list (string-append "prefix=" (assoc-ref %outputs "out")))
2374 ;; no configure script
2375 (alist-delete 'configure %standard-phases)
2376 #:tests? #f)) ;the tests are part of the default target
2377 (home-page "http://openlibm.org/")
2378 (synopsis "Portable C mathematical library (libm)")
2380 "OpenLibm is an effort to have a high quality, portable, standalone C
2381 mathematical library (libm). It can be used standalone in applications and
2382 programming language implementations. The project was born out of a need to
2383 have a good libm for the Julia programming language that worked consistently
2384 across compilers and operating systems, and in 32-bit and 64-bit
2386 ;; Each architecture has its own make target, and there is none for mips.
2387 (supported-systems (delete "mips64el-linux" %supported-systems))
2388 ;; See LICENSE.md for details.
2389 (license (list license:expat
2392 license:public-domain
2393 license:lgpl2.1+))))
2395 (define-public openspecfun
2397 (name "openspecfun")
2402 (uri (string-append "https://github.com/JuliaLang/openspecfun/archive/v"
2404 (file-name (string-append name "-" version ".tar.gz"))
2407 "1y5b2h6f2k72536kym3vzy3li3bhpd23x463g7hdmjdi3cncavz1"))))
2408 (build-system gnu-build-system)
2410 '(#:tests? #f ;no "check" target
2412 (list (string-append "prefix=" (assoc-ref %outputs "out")))
2413 ;; no configure script
2414 #:phases (alist-delete 'configure %standard-phases)))
2416 `(("fortran" ,gfortran)))
2417 (home-page "https://github.com/JuliaLang/openspecfun")
2418 (synopsis "Collection of special mathematical functions")
2420 "Openspecfun provides AMOS and Faddeeva. AMOS (from Netlib) is a
2421 portable package for Bessel Functions of a Complex Argument and Nonnegative
2422 Order; it contains subroutines for computing Bessel functions and Airy
2423 functions. Faddeeva allows computing the various error functions of arbitrary
2424 complex arguments (Faddeeva function, error function, complementary error
2425 function, scaled complementary error function, imaginary error function, and
2426 Dawson function); given these, one can also easily compute Voigt functions,
2427 Fresnel integrals, and similar related functions as well.")
2428 ;; Faddeeva is released under the Expat license; AMOS is included as
2429 ;; public domain software.
2430 (license (list license:expat license:public-domain))))
2432 (define-public suitesparse
2434 (name "suitesparse")
2440 "http://faculty.cse.tamu.edu/davis/SuiteSparse/SuiteSparse-"
2444 "1dnr6pmjzc2qmbkmb4shigx1l74ilf6abn7svyd6brxgvph8vadr"))
2445 (modules '((guix build utils)))
2447 ;; Remove bundled metis source
2448 '(delete-file-recursively "metis-5.1.0"))))
2449 (build-system gnu-build-system)
2451 '(#:tests? #f ;no "check" target
2456 "MY_METIS_LIB=-lmetis"
2457 (string-append "INSTALL_LIB="
2458 (assoc-ref %outputs "out") "/lib")
2459 (string-append "INSTALL_INCLUDE="
2460 (assoc-ref %outputs "out") "/include")
2463 (modify-phases %standard-phases
2464 (delete 'configure)))) ;no configure script
2469 (home-page "http://faculty.cse.tamu.edu/davis/suitesparse.html")
2470 (synopsis "Suite of sparse matrix software")
2472 "SuiteSparse is a suite of sparse matrix algorithms, including: UMFPACK,
2473 multifrontal LU factorization; CHOLMOD, supernodal Cholesky; SPQR,
2474 multifrontal QR; KLU and BTF, sparse LU factorization, well-suited for circuit
2475 simulation; ordering methods (AMD, CAMD, COLAMD, and CCOLAMD); CSparse and
2476 CXSparse, a concise sparse Cholesky factorization package; and many other
2479 ;; AMD, CAMD, BTF, COLAMD, CCOLAMD, CSparse, CXSparse, KLU, LDL
2481 ;; GPUQREngine, RBio, SuiteSparse_GPURuntime, SuiteSparseQR, UMFPACK
2482 (license (list license:gpl2+ license:lgpl2.1+))))
2484 (define-public atlas
2490 (uri (string-append "mirror://sourceforge/math-atlas/Stable/"
2491 version "/atlas" version ".tar.bz2"))
2494 "1dyjlq3fiparvm8ypwk6rsmjzmnwk81l88gkishphpvc79ryp216"))))
2495 (build-system gnu-build-system)
2496 (home-page "http://math-atlas.sourceforge.net/")
2497 (inputs `(("gfortran" ,gfortran)
2498 ("lapack-tar" ,(package-source lapack))))
2499 (outputs '("out" "doc"))
2500 ;; For the moment we drop support for MIPS at it fails to compile. See
2501 ;; https://lists.gnu.org/archive/html/guix-devel/2014-11/msg00516.html
2502 (supported-systems (delete "mips64el-linux" %supported-systems))
2504 `(#:parallel-build? #f
2505 #:parallel-tests? #f
2507 ;; ATLAS tunes itself for the machine it is built on, as explained at
2508 ;; <http://lists.gnu.org/archive/html/guix-devel/2014-10/msg00305.html>.
2509 ;; For this reason, we want users to build it locally instead of using
2513 #:modules ((srfi srfi-26)
2515 (guix build gnu-build-system)
2518 `(;; Generate position independent code suitable for dynamic libraries
2519 ;; and use WALL timer to get more accurate timing.
2520 "-Fa" "alg" "-fPIC" "-D" "c" "-DWALL"
2523 ,,(if (string-match "64" (%current-system))
2526 ;; Disable parallel build as it gives errors: atlas_pthread.h is
2527 ;; needed to compile C files before it is generated.
2528 "-Ss" "pmake" "make -j 1"
2529 ;; Probe is failing for MIPS. We therefore define the system
2530 ;; architecture explicitly by setting (-A) MACHINETYPE = 49
2531 ;; 'MIPSR1xK' and (-V) ISA = 1 'none'.
2532 ,,@(if (string-prefix? "mips" (%current-system))
2533 (list "-A" "49" "-V" "1")
2535 ;; Generate shared libraries.
2537 ;; Build a full LAPACK library.
2538 ,(string-append "--with-netlib-lapack-tarfile="
2539 (assoc-ref %build-inputs "lapack-tar")))
2541 (modify-phases %standard-phases
2542 (add-after 'install 'install-doc
2543 (lambda* (#:key outputs inputs #:allow-other-keys)
2544 (let ((doc (string-append (assoc-ref outputs "doc")
2545 "/share/doc/atlas")))
2547 (fold (lambda (file previous)
2548 (and previous (zero? (system* "cp" file doc))))
2549 #t (find-files "../ATLAS/doc" ".*")))))
2550 (add-after 'check 'check-pt
2551 (lambda _ (zero? (system* "make" "ptcheck"))))
2552 ;; Fix files required to run configure.
2553 (add-before 'configure 'fix-/bin/sh
2555 ;; Use `sh', not `/bin/sh'.
2556 (substitute* (find-files "." "Makefile|configure|SpewMakeInc\\.c")
2559 ;; Fix /bin/sh in generated make files.
2560 (add-after 'configure 'fix-/bin/sh-in-generated-files
2562 (substitute* (find-files "." "^[Mm]ake\\.inc.*")
2565 ;; ATLAS configure program does not accepts the default flags
2566 ;; passed by the 'gnu-build-system'.
2568 (lambda* (#:key native-inputs inputs outputs
2569 (configure-flags '())
2570 #:allow-other-keys #:rest args)
2571 (let* ((prefix (assoc-ref outputs "out"))
2572 (bash (or (and=> (assoc-ref
2573 (or native-inputs inputs) "bash")
2574 (cut string-append <> "/bin/bash"))
2576 (flags `(,(string-append "--prefix=" prefix)
2578 (abs-srcdir (getcwd))
2579 (srcdir (string-append "../" (basename abs-srcdir))))
2580 (format #t "source directory: ~s (relative from build: ~s)~%"
2584 (format #t "build directory: ~s~%" (getcwd))
2585 (format #t "configure flags: ~s~%" flags)
2586 (zero? (apply system* bash
2587 (string-append srcdir "/configure")
2589 (synopsis "Automatically Tuned Linear Algebra Software")
2591 "ATLAS is an automatically tuned linear algebra software library
2592 providing C and Fortran77 interfaces to a portably efficient BLAS
2593 implementation, as well as a few routines from LAPACK.
2595 Optimization occurs at build time. For this reason, the library is built on
2596 the machine where it is installed, without resorting to pre-built substitutes.
2598 Before building the library, CPU throttling should be disabled. This can be
2599 done in the BIOS, or, on GNU/Linux, with the following command:
2602 # cpupower --governor performance
2605 Failure to do so will result in a library with poor performance.")
2606 (license license:bsd-3)))
2615 (uri (string-append "mirror://sourceforge/ogl-math/glm-" version
2616 "/glm-" version ".zip"))
2619 "1cnjmi033a16a95v6xfkr1bvfmkd26hzdjka8j1819hgn5b1nr8l"))))
2620 (build-system cmake-build-system)
2622 `(("unzip" ,unzip)))
2623 (home-page "http://glm.g-truc.net")
2624 (synopsis "OpenGL Mathematics library")
2625 (description "OpenGL Mathematics (GLM) is a header-only C++ mathematics
2626 library for graphics software based on the OpenGL Shading Language (GLSL)
2628 (license license:expat)))
2630 (define-public lpsolve
2637 (uri (string-append "mirror://sourceforge/lpsolve/lpsolve/" version
2638 "/lp_solve_" version "_source.tar.gz"))
2641 "176c7f023mb6b8bfmv4rfqnrlw88lsg422ca74zjh19i2h5s69sq"))
2642 (modules '((guix build utils)))
2644 '(substitute* (list "lp_solve/ccc" "lpsolve55/ccc")
2646 ;; Pretend to be on a 64 bit platform to obtain a common directory
2647 ;; name for the build results on all architectures; nothing else
2648 ;; seems to depend on it.
2649 (("^PLATFORM=.*$") "PLATFORM=ux64\n")
2651 ;; The check for 'isnan' as it is written fails with
2652 ;; "non-floating-point argument in call to function
2653 ;; ‘__builtin_isnan’", which leads to the 'NOISNAN' cpp macro
2654 ;; definition, which in turn leads to bad things. Fix the feature
2656 (("isnan\\(0\\)") "isnan(0.)")))))
2657 (build-system gnu-build-system)
2659 `(#:tests? #f ; no check target
2661 (modify-phases %standard-phases
2665 (and (with-directory-excursion "lpsolve55"
2666 (zero? (system* "bash" "ccc")))
2667 (with-directory-excursion "lp_solve"
2668 (zero? (system* "bash" "ccc"))))))
2670 (lambda* (#:key outputs #:allow-other-keys)
2671 (let* ((out (assoc-ref outputs "out"))
2672 (bin (string-append out "/bin"))
2673 (lib (string-append out "/lib"))
2674 ;; This is where LibreOffice expects to find the header
2675 ;; files, and where they are installed by Debian.
2676 (include (string-append out "/include/lpsolve")))
2678 (copy-file "lpsolve55/bin/ux64/liblpsolve55.a"
2679 (string-append lib "/liblpsolve55.a"))
2680 (copy-file "lpsolve55/bin/ux64/liblpsolve55.so"
2681 (string-append lib "/liblpsolve55.so"))
2682 (install-file "lp_solve/bin/ux64/lp_solve" bin)
2684 ;; Install a subset of the header files as on Debian
2685 ;; (plus lp_bit.h, which matches the regular expression).
2686 (for-each (lambda (name)
2687 (install-file name include))
2688 (find-files "." "lp_[HMSa-z].*\\.h$"))
2689 (with-directory-excursion "shared"
2690 (for-each (lambda (name)
2691 (install-file name include))
2692 (find-files "." "\\.h$")))
2694 (home-page "http://lpsolve.sourceforge.net/")
2695 (synopsis "Mixed integer linear programming (MILP) solver")
2697 "lp_solve is a mixed integer linear programming solver based on the
2698 revised simplex and the branch-and-bound methods.")
2699 (license license:lgpl2.1+)))
2701 (define-public dealii
2708 (uri (string-append "https://github.com/dealii/dealii/releases/"
2709 "download/v" version "/dealii-" version ".tar.gz"))
2712 "0yfpy4zh8j7hmqakw17zdlmvfdcmhwgs66wcb716plc4y7v3z4g6"))
2713 (modules '((guix build utils)))
2715 ;; Remove bundled sources: UMFPACK, TBB, muParser, and boost
2716 '(delete-file-recursively "bundled"))))
2717 (build-system cmake-build-system)
2725 ("arpack" ,arpack-ng)
2726 ("muparser" ,muparser)
2727 ("gfortran" ,gfortran)
2728 ("suitesparse" ,suitesparse))) ;for UMFPACK
2730 `(#:build-type "DebugRelease" ;only supports Release, Debug, or DebugRelease
2732 ;; Work around a bug in libsuitesparseconfig linking
2733 ;; see https://github.com/dealii/dealii/issues/4745
2734 '("-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON")))
2735 (home-page "https://www.dealii.org")
2736 (synopsis "Finite element library")
2738 "Deal.II is a C++ program library targeted at the computational solution
2739 of partial differential equations using adaptive finite elements. The main
2740 aim of deal.II is to enable rapid development of modern finite element codes,
2741 using among other aspects adaptive meshes and a wide array of tools often used
2742 in finite element programs.")
2743 (license license:lgpl2.1+)))
2745 (define-public dealii-openmpi
2746 (package (inherit dealii)
2747 (name "dealii-openmpi")
2750 ;;Supported only with MPI:
2751 ("p4est" ,p4est-openmpi)
2752 ("petsc" ,petsc-openmpi)
2753 ("slepc" ,slepc-openmpi)
2754 ("metis" ,metis) ;for MUMPS
2755 ("scalapack" ,scalapack) ;for MUMPS
2756 ("mumps" ,mumps-metis-openmpi) ;configure supports only metis orderings
2757 ("arpack" ,arpack-ng-openmpi)
2758 ,@(fold alist-delete (package-inputs dealii)
2759 '("p4est" "arpack"))))
2761 (substitute-keyword-arguments (package-arguments dealii)
2762 ((#:configure-flags cf)
2763 ``("-DMPI_C_COMPILER=mpicc"
2764 "-DMPI_CXX_COMPILER=mpicxx"
2765 "-DMPI_Fortran_COMPILER=mpifort"
2767 (synopsis "Finite element library (with MPI support)")))
2769 (define-public flann
2778 "http://www.cs.ubc.ca/research/flann/uploads/FLANN/flann-"
2779 version "-src.zip"))
2782 "022w8hph7bli5zbpnk3z1qh1c2sl5hm8fw2ccim651ynn0hr7fyz"))))
2783 (build-system cmake-build-system)
2785 "octave")) ;46 MiB .mex file that pulls Octave
2787 `(("unzip" ,unzip)))
2791 ("python" ,python-2) ; print syntax
2792 ;; ("python2-numpy" ,python2-numpy) ; only required for the tests
2795 `(;; The 'share/flann/octave' contains a .mex file, which is an ELF file
2796 ;; taken 46 MiB unstripped, and 6 MiB stripped.
2797 #:strip-directories '("lib" "lib64" "libexec"
2798 "bin" "sbin" "share/flann/octave")
2800 ;; Save 12 MiB by not installing .a files. Passing
2801 ;; '-DBUILD_STATIC_LIBS=OFF' has no effect.
2802 #:phases (modify-phases %standard-phases
2803 (add-before 'configure 'set-octave-directory
2804 (lambda* (#:key outputs #:allow-other-keys)
2805 ;; Install the .mex file in the "octave" output.
2806 (let ((out (assoc-ref outputs "octave")))
2807 (substitute* "src/matlab/CMakeLists.txt"
2808 (("share/flann/octave")
2809 (string-append out "/share/flann/octave")))
2811 (add-after 'install 'remove-static-libraries
2812 (lambda* (#:key outputs #:allow-other-keys)
2813 (let* ((out (assoc-ref outputs "out"))
2814 (lib (string-append out "/lib")))
2815 (for-each delete-file
2816 (find-files lib "\\.a$"))
2819 #:tests? #f)) ; The test data are downloaded from the Internet.
2820 (home-page "http://www.cs.ubc.ca/research/flann/")
2821 (synopsis "Library for approximate nearest neighbors computation")
2822 (description "FLANN is a library for performing fast approximate
2823 nearest neighbor searches in high dimensional spaces. It implements a
2824 collection of algorithms and a system for automatically choosing the best
2825 algorithm and optimum parameters depending on the dataset.
2827 FLANN is written in C++ and contains bindings for C, Octave and Python.")
2828 (license (license:non-copyleft "file://COPYING"
2829 "See COPYING in the distribution."))))
2831 (define-public wcalc
2838 (uri (string-append "mirror://sourceforge/w-calc/Wcalc/" version "/"
2839 "wcalc-" version ".tar.bz2"))
2842 "1vi8dl6rccqiq1apmpwawyg2ywx6a1ic1d3cvkf2hlwk1z11fb0f"))))
2843 (build-system gnu-build-system)
2846 ("readline" ,readline)))
2847 (home-page "http://w-calc.sourceforge.net/index.php")
2848 (synopsis "Flexible command-line scientific calculator")
2849 (description "Wcalc is a very capable calculator. It has standard functions
2850 (sin, asin, and sinh for example, in either radians or degrees), many
2851 pre-defined constants (pi, e, c, etc.), support for using variables, \"active\"
2852 variables, a command history, hex/octal/binary input and output, unit
2853 conversions, embedded comments, and an expandable expression entry field. It
2854 evaluates expressions using the standard order of operations.")
2855 (license license:gpl2+)))
2863 (uri (string-append "mirror://sourceforge/xaos/XaoS/" version
2864 "/xaos-" version ".tar.gz"))
2867 "15cd1cx1dyygw6g2nhjqq3bsfdj8sj8m4va9n75i0f3ryww3x7wq"))))
2868 (build-system gnu-build-system)
2869 (native-inputs `(("gettext" ,gettext-minimal)))
2870 (inputs `(("libx11" ,libx11)
2875 `(#:tests? #f ;no "check" target
2876 #:make-flags '("LOCALEDIR=$DATAROOTDIR/locale")))
2877 (synopsis "Real-time fractal zoomer")
2878 (description "GNU XaoS is a graphical program that generates fractal
2879 patterns and allows you to zoom in and out of them infinitely in a fluid,
2880 continuous manner. It also includes tutorials that help to explain how fractals
2881 are built. It can generate many different fractal types such as the Mandelbrot
2883 (home-page "https://www.gnu.org/software/xaos/")
2884 (license license:gpl2+)))
2886 (define-public hypre
2892 (uri (string-append "https://github.com/LLNL/hypre/archive/"
2893 "v" version ".tar.gz"))
2894 (file-name (string-append name "-" version ".tar.gz"))
2897 "0q69ia0jivzcr8p049dn3mg8yjpn6nwq4sw9iqac8vr63vi54l6m"))
2898 (modules '((guix build utils)))
2901 ;; Remove use of __DATE__ and __TIME__ for reproducibility;
2902 ;; substitute the tarball creation time.
2903 (substitute* "src/utilities/HYPRE_utilities.h"
2904 (("Date Compiled: .*$")
2905 "Date Compiled: Mar 28 2016 20:19:59 +0000\"\n"))
2907 (build-system gnu-build-system)
2908 (outputs '("out" ;6.1 MiB of headers and libraries
2909 "doc")) ;4.8 MiB of documentation
2913 ("texlive" ,texlive) ;full package required for fonts
2914 ("ghostscript" ,ghostscript)))
2916 `(("blas" ,openblas)
2917 ("lapack" ,lapack)))
2919 `(#:modules ((srfi srfi-1)
2920 ,@%gnu-build-system-modules)
2921 #:configure-flags '("--enable-shared"
2929 (modify-phases %standard-phases
2930 (add-before 'configure 'chdir-src
2931 (lambda _ (chdir "src")))
2933 (lambda* (#:key build target configure-flags
2934 #:allow-other-keys #:rest args)
2935 (let* ((configure (assoc-ref %standard-phases 'configure)))
2938 (list #:configure-flags
2939 (cons (string-append
2940 "--host=" (or target build))
2941 configure-flags)))))))
2942 (add-after 'build 'build-docs
2944 (zero? (system* "make" "-Cdocs" "pdf" "html"))))
2947 (setenv "LD_LIBRARY_PATH" (string-append (getcwd) "/hypre/lib"))
2948 (setenv "PATH" (string-append "." ":" (getenv "PATH")))
2949 (and (system* "make" "check" "CHECKRUN=")
2950 (fold (lambda (filename result)
2952 (let ((size (stat:size (stat filename))))
2953 (when (not (zero? size))
2954 (format #t "~a size ~d; error indication~%"
2958 (find-files "test" ".*\\.err$")))))
2959 (add-after 'install 'install-docs
2960 (lambda* (#:key outputs #:allow-other-keys)
2961 ;; Custom install because docs/Makefile doesn't honor ${docdir}.
2962 (let* ((doc (assoc-ref outputs "doc"))
2963 (docdir (string-append doc "/share/doc/hypre-" ,version)))
2964 (with-directory-excursion "docs"
2965 (for-each (lambda (base)
2966 (install-file (string-append base ".pdf") docdir)
2967 (copy-recursively base docdir)) ;html docs
2968 '("HYPRE_usr_manual"
2969 "HYPRE_ref_manual")))
2971 (home-page "http://www.llnl.gov/casc/hypre/")
2972 (synopsis "Library of solvers and preconditioners for linear equations")
2974 "HYPRE is a software library of high performance preconditioners and
2975 solvers for the solution of large, sparse linear systems of equations. It
2976 features multigrid solvers for both structured and unstructured grid
2978 (license license:lgpl2.1)))
2980 (define-public hypre-openmpi
2981 (package (inherit hypre)
2982 (name "hypre-openmpi")
2985 ,@(package-inputs hypre)))
2987 (substitute-keyword-arguments (package-arguments hypre)
2988 ((#:configure-flags flags)
2990 ,@(delete "--without-MPI" ,flags)))))
2991 (synopsis "Parallel solvers and preconditioners for linear equations")
2993 "HYPRE is a software library of high performance preconditioners and
2994 solvers for the solution of large, sparse linear systems of equations on
2995 parallel computers. It features parallel multigrid solvers for both
2996 structured and unstructured grid problems.")))
2998 (define-public matio
3005 (uri (string-append "mirror://sourceforge/matio/matio/" version "/"
3006 "matio-" version ".tar.gz"))
3009 "0y2qymgxank8wdiwc68ap8bxdzrhvyw86i29yh3xgn4z1njfd9ir"))))
3010 (build-system gnu-build-system)
3014 (home-page "http://matio.sourceforge.net/")
3015 (synopsis "Library for reading and writing MAT files")
3016 (description "Matio is a library for reading and writing MAT files. It
3017 supports compressed MAT files, as well as newer (version 7.3) MAT files.")
3018 (license license:bsd-2)))
3020 (define-public libhilbert
3027 (uri (string-append "http://web.cs.dal.ca/~chamilto/hilbert/"
3028 "libhilbert-" version ".tar.gz"))
3031 "0v48x8405dj95gjn2saja4bzhw86d6zl6d3dg8h7dzac2qr97s34"))))
3032 (build-system gnu-build-system)
3033 (home-page "http://web.cs.dal.ca/~chamilto/hilbert")
3034 (synopsis "Hilbert indices for multidimensional data")
3035 (description "The libhilbert library can efficiently calculate Hilbert
3036 curves and order-preserving representations of Hilbert curve indices that use
3037 the same amount of space as the original point representation. This is useful
3038 when using the Gilbert curve as a space filling curve through a
3039 high-dimensional space where not all demensions have the same cardinality.")
3040 (license license:lgpl2.1+)))
3047 (origin (method url-fetch)
3048 (uri (string-append "https://github.com/VcDevel/Vc/releases/"
3049 "download/" version "/Vc-" version ".tar.gz"))
3052 "1rh6dhqar3y07n4xqyml0sa0v48qv3ch9dc3yc2in855hlh4vnqi"))))
3053 (build-system cmake-build-system)
3056 '("-DBUILD_TESTING=ON")))
3057 (synopsis "SIMD vector classes for C++")
3058 (description "Vc provides portable, zero-overhead C++ types for explicitly
3059 data-parallel programming. It is a library designed to ease explicit
3060 vectorization of C++ code. Its types enable explicitly stating data-parallel
3061 operations on multiple values. The parallelism is therefore added via the type
3062 system. Vc has an intuitive API and provides portability between different
3063 compilers and compiler versions as well as portability between different vector
3064 instruction sets. Thus, an application written with Vc can be compiled for:
3067 @item SSE2 up to SSE4.2 or SSE4a
3070 @item NEON (in development)
3071 @item NVIDIA GPUs / CUDA (in development)
3073 (home-page "https://github.com/VcDevel/Vc")
3074 ;; "No support_???.cpp file exists for this architecture."
3075 (supported-systems '("x86_64-linux" "i686-linux"))
3076 (license license:bsd-3)))
3078 (define-public reducelcs
3079 ;; This is the last commit which is available upstream, no
3080 ;; release happened since 2010.
3081 (let ((commit "474f88deb968061abe8cf11c959e02319b8ae5c0")
3085 (version (string-append "1.0-" revision "." (string-take commit 7)))
3090 (url "https://github.com/gdv/Reduce-Expand-for-LCS")
3092 (file-name (string-append name "-" version "-checkout"))
3095 "1rllzcfwc042c336mhq262a8ha90x6afq30kvk60r7i4761j4yjm"))))
3096 (build-system gnu-build-system)
3098 `(("openlibm" ,openlibm)))
3100 `(#:tests? #f ; no tests
3102 (modify-phases %standard-phases
3103 (delete 'configure) ; No configure script exists.
3104 (replace 'install ; No install phase exists.
3105 (lambda* (#:key outputs #:allow-other-keys)
3106 (let* ((out (assoc-ref outputs "out"))
3107 (bin (string-append out "/bin")))
3108 (install-file "Approximation" bin)
3109 (install-file "CollectResults" bin)
3110 (install-file "GenerateInstances" bin)
3112 (synopsis "Approximate Longest Commons Subsequence computation tool")
3114 "@code{reduceLCS} is an implementation of the Reduce-Expand
3115 algorithm for LCS. It is a fast program to compute the approximate
3116 Longest Commons Subsequence of a set of strings.")
3117 (home-page "https://github.com/gdv/Reduce-Expand-for-LCS")
3118 (license license:gpl3+))))
3120 (define-public jacal
3127 "http://groups.csail.mit.edu/mac/ftpdir/scm/jacal-"
3130 "055zrn12a1dmy0dqkwrkq3fklbhg3yir6vn0lacp4mvbg8573a3q"))
3131 (patches (search-patches "jacal-fix-texinfo.patch"))))
3132 (build-system gnu-build-system)
3135 (modify-phases %standard-phases
3136 (add-before 'build 'pre-build
3137 ;; Don't use upstream's script - it really doesn't fit into
3138 ;; Guix's functional paradigm.
3139 (lambda* (#:key inputs outputs #:allow-other-keys)
3140 (substitute* "Makefile"
3141 (("^install: install-script") "install: "))))
3142 (add-after 'install 'post-install
3143 ;; Instead, we provide our own simplified script.
3144 (lambda* (#:key inputs outputs #:allow-other-keys)
3145 (let ((wrapper (string-append (assoc-ref outputs "out")
3147 (format (open wrapper (logior O_WRONLY O_CREAT))
3148 (string-append "#!~a\nexec ~a/bin/scm -ip1 "
3149 "-e '(slib:load \"~a/lib/jacal/math\") "
3152 (assoc-ref inputs "scm")
3153 (assoc-ref outputs "out"))
3154 (chmod wrapper #o555))))
3156 (lambda* (#:key inputs outputs #:allow-other-keys)
3157 (zero? (system* "./configure"
3158 (string-append "--prefix="
3159 (assoc-ref outputs "out")))))))))
3160 (inputs `(("scm" ,scm)))
3161 (native-inputs `(("unzip" ,unzip)
3162 ("texinfo" ,texinfo)))
3163 (synopsis "Symbolic mathematics system")
3164 (description "GNU JACAL is an interactive symbolic mathematics program based on
3165 Scheme. It manipulate and simplify a range of mathematical expressions such
3166 as equations, scalars, vectors, and matrices.")
3167 (home-page "https://www.gnu.org/software/jacal/")
3168 (license license:gpl3+)))
3177 "https://github.com/Z3Prover/z3/archive/z3-"
3181 "032a5lvji2liwmc25jv52bdrhimqflvqbpg77ccaq1jykhiivbmf"))))
3182 (build-system gnu-build-system)
3184 `(#:test-target "test"
3186 (modify-phases %standard-phases
3188 (lambda* (#:key inputs outputs #:allow-other-keys)
3190 (system* "python" "scripts/mk_make.py"
3191 (string-append "--prefix="
3192 (assoc-ref outputs "out"))))))
3193 (add-after 'configure 'change-dir
3198 `(("python" ,python-2)))
3199 (synopsis "Theorem prover")
3200 (description "Z3 is a theorem prover and @dfn{satisfiability modulo
3201 theories} (SMT) solver. It provides a C/C++ API.")
3202 (home-page "https://github.com/Z3Prover/z3")
3203 (license license:expat)))
3205 (define-public cubicle
3211 (uri (string-append "http://cubicle.lri.fr/cubicle-"
3215 "1sny9c4fm14k014pk62ibpwbrjjirkx8xmhs9jg7q1hk7y7x3q2h"))))
3216 (build-system gnu-build-system)
3219 ("which" ,(@@ (gnu packages base) which))))
3223 `(#:configure-flags (list "--with-z3")
3226 (modify-phases %standard-phases
3227 (add-before 'configure 'configure-for-release
3229 (substitute* "Makefile.in"
3230 (("SVNREV=") "#SVNREV="))))
3231 (add-before 'configure 'fix-/bin/sh
3233 (substitute* "configure"
3234 (("/bin/sh") (which "sh")))))
3235 (add-before 'configure 'fix-smt-z3wrapper.ml
3237 (substitute* "Makefile.in"
3238 (("\\\\n") "")))))))
3239 (home-page "http://cubicle.lri.fr/")
3240 (synopsis "Model checker for array-based systems")
3241 (description "Cubicle is an open source model checker for verifying safety
3242 properties of array-based systems. This is a syntactically restricted class of
3243 parametrized transition systems with states represented as arrays indexed by an
3244 arbitrary number of processes. Cache coherence protocols and mutual exclusion
3245 algorithms are typical examples of such systems.")
3246 (license license:asl2.0)))