1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2014, 2015, 2016 Andreas Enge <andreas@enge.fr>
3 ;;; Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org>
4 ;;; Copyright © 2014, 2016, 2017 John Darrington <jmd@gnu.org>
5 ;;; Copyright © 2014, 2015, 2016 Eric Bavier <bavier@member.fsf.org>
6 ;;; Copyright © 2014 Federico Beffa <beffa@fbengineering.ch>
7 ;;; Copyright © 2014 Mathieu Lirzin <mathieu.lirzin@openmailbox.org>
8 ;;; Copyright © 2015, 2016 Ricardo Wurmus <rekado@elephly.net>
9 ;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com>
10 ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
11 ;;; Copyright © 2015, 2016, 2017 Efraim Flashner <efraim@flashner.co.il>
12 ;;; Copyright © 2015 Fabian Harfert <fhmgufs@web.de>
13 ;;; Copyright © 2016 Roel Janssen <roel@gnu.org>
14 ;;; Copyright © 2016 Kei Kebreau <kei@openmailbox.org>
15 ;;; Copyright © 2016, 2017 Ludovic Courtès <ludo@gnu.org>
16 ;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
17 ;;; Copyright © 2016 Thomas Danckaert <post@thomasdanckaert.be>
18 ;;; Copyright © 2017 Paul Garlick <pgarlick@tourbillion-technology.com>
19 ;;; Copyright © 2017 ng0 <contact.ng0@cryptolab.net>
20 ;;; Copyright © 2017 Ben Woodcroft <donttrustben@gmail.com>
22 ;;; This file is part of GNU Guix.
24 ;;; GNU Guix is free software; you can redistribute it and/or modify it
25 ;;; under the terms of the GNU General Public License as published by
26 ;;; the Free Software Foundation; either version 3 of the License, or (at
27 ;;; your option) any later version.
29 ;;; GNU Guix is distributed in the hope that it will be useful, but
30 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
31 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
32 ;;; GNU General Public License for more details.
34 ;;; You should have received a copy of the GNU General Public License
35 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
37 (define-module (gnu packages maths)
38 #:use-module (ice-9 regex)
39 #:use-module (gnu packages)
40 #:use-module ((guix licenses) #:prefix license:)
41 #:use-module (guix packages)
42 #:use-module (guix download)
43 #:use-module (guix git-download)
44 #:use-module (guix utils)
45 #:use-module (guix build utils)
46 #:use-module (guix build-system cmake)
47 #:use-module (guix build-system gnu)
48 #:use-module (guix build-system ocaml)
49 #:use-module (guix build-system r)
50 #:use-module (gnu packages algebra)
51 #:use-module (gnu packages bison)
52 #:use-module (gnu packages boost)
53 #:use-module (gnu packages check)
54 #:use-module (gnu packages cmake)
55 #:use-module (gnu packages compression)
56 #:use-module (gnu packages curl)
57 #:use-module (gnu packages cyrus-sasl)
58 #:use-module (gnu packages documentation)
59 #:use-module (gnu packages elf)
60 #:use-module (gnu packages flex)
61 #:use-module (gnu packages fltk)
62 #:use-module (gnu packages fontutils)
63 #:use-module (gnu packages gettext)
64 #:use-module (gnu packages gcc)
65 #:use-module (gnu packages gd)
66 #:use-module (gnu packages ghostscript)
67 #:use-module (gnu packages graphviz)
68 #:use-module (gnu packages gtk)
69 #:use-module (gnu packages image)
70 #:use-module (gnu packages less)
71 #:use-module (gnu packages lisp)
72 #:use-module (gnu packages logging)
73 #:use-module (gnu packages lua)
74 #:use-module (gnu packages gnome)
75 #:use-module (gnu packages guile)
76 #:use-module (gnu packages xorg)
77 #:use-module (gnu packages gl)
78 #:use-module (gnu packages imagemagick)
79 #:use-module (gnu packages m4)
80 #:use-module (gnu packages mpi)
81 #:use-module (gnu packages multiprecision)
82 #:use-module (gnu packages netpbm)
83 #:use-module (gnu packages ocaml)
84 #:use-module (gnu packages pcre)
85 #:use-module (gnu packages popt)
86 #:use-module (gnu packages perl)
87 #:use-module (gnu packages pkg-config)
88 #:use-module (gnu packages python)
89 #:use-module (gnu packages readline)
90 #:use-module (gnu packages tbb)
91 #:use-module (gnu packages scheme)
92 #:use-module (gnu packages shells)
93 #:use-module (gnu packages tcl)
94 #:use-module (gnu packages texinfo)
95 #:use-module (gnu packages tex)
96 #:use-module (gnu packages tls)
97 #:use-module (gnu packages wxwidgets)
98 #:use-module (gnu packages xml)
99 #:use-module (gnu packages zip)
100 #:use-module (srfi srfi-1))
108 (uri (string-append "mirror://gnu/" name "/" name "-" version ".tar.gz"))
110 "1q1887ryqdr9sn0522hc7p16kqwlxxyz5dkmma8ar2nxplhgll7q"))))
111 (build-system gnu-build-system)
112 (inputs `(("gtk+" ,gtk+)
113 ("libxml2" ,libxml2)))
114 (native-inputs `(("pkg-config" ,pkg-config)))
115 (synopsis "Natural deduction first-order logic interface")
116 (description "Aris is a program for performing logical proofs. It supports
117 propositional and predicate logic, as well as Boolean algebra and
118 arithmetical logic. In addition to its predefined inference and equivalence
119 rules, Aris also supports references to older proofs. Its use of standard
120 logical symbols and its natural deduction interface make it easy to use for
122 (license license:gpl3+)
123 (home-page "https://www.gnu.org/software/aris/")))
125 (define-public c-graph
131 (uri (string-append "mirror://gnu/c-graph/c-graph-" version
134 "1hlvpzrh7hzzf533diyfiabzskddi8zx92av9hwkjw3l46z7qv01"))))
135 (build-system gnu-build-system)
137 `(("fortran" ,gfortran)))
138 (synopsis "Visualizing and demonstrating convolution")
140 "GNU C-Graph is a tool for demonstrating the theory of convolution.
141 Thus, it can serve as an excellent aid to students of signal and systems
142 theory in visualizing the convolution process. Rather than forcing the
143 student to write code, the program offers an intuitive interface with
144 interactive dialogs to guide them.")
145 (license license:gpl3+)
146 (home-page "https://www.gnu.org/software/c-graph/")))
155 (uri (string-append "https://github.com/stcorp/coda/releases/download/"
156 version "/coda-" version ".tar.gz"))
158 (base32 "11asla1ap8vd73farqjlpb179sfiy0biydcwxjfcakrp9sf8v9bs"))
159 (patches (search-patches "coda-use-system-libs.patch"))
160 (modules '((guix build utils)))
162 ;; Make sure we don't use the bundled software.
163 '(for-each (lambda (d)
164 (delete-file-recursively (string-append "libcoda/" d)))
165 '("zlib" "pcre" "expat")))))
167 `(("fortran" ,gfortran)
169 ("python-numpy" ,python-numpy)))
176 (build-system gnu-build-system)
178 '(#:configure-flags '("--with-hdf4" "--with-hdf5" "--enable-python"
179 "LIBS= -lz -lpcre -lexpat")))
180 (synopsis "A common interface to various earth observation data formats")
182 "The Common Data Access toolbox (CODA) provides a set of interfaces for
183 reading remote sensing data from earth observation data files. It consists of
184 command line applications and interfaces to the C, Fortran, Python, and Java
185 programming languages.")
186 (home-page "https://stcorp.nl/coda")
187 (license license:gpl2+)))
195 (uri (string-append "mirror://gnu/units/units-" version
198 "1s421bxm36akjsy3qzg6da1d1g20gh094ac2slqxipgkh8yqjcwx"))))
199 (build-system gnu-build-system)
200 (synopsis "Conversion between thousands of scales")
202 "GNU Units converts numeric quantities between units of measure. It
203 can handle scale changes through adaptive usage of standard scale
204 prefixes (micro-, kilo-, etc.). It can also handle nonlinear
205 conversions such as Fahrenheit to Celsius. Its interpreter is powerful
206 enough to be used effectively as a scientific calculator.")
207 (license license:gpl3+)
208 (home-page "https://www.gnu.org/software/units/")))
210 (define-public double-conversion
212 (name "double-conversion")
217 "https://github.com/floitsch/double-conversion/archive/v"
219 (file-name (string-append name "-" version ".tar.gz"))
222 "0cnr8xhyjfxijay8ymkqcph3672wp2lj23qhdmr3m4kia5kpdf83"))))
223 (build-system cmake-build-system)
225 '(#:test-target "test"
226 #:configure-flags '("-DBUILD_SHARED_LIBS=ON"
227 "-DBUILD_TESTING=ON")))
228 (home-page "https://github.com/floitsch/double-conversion")
229 (synopsis "Conversion routines for IEEE doubles")
231 "The double-conversion library provides binary-decimal and decimal-binary
232 routines for IEEE doubles. The library consists of efficient conversion
233 routines that have been extracted from the V8 JavaScript engine.")
234 (license license:bsd-3)))
236 (define-public dionysus
242 (uri (string-append "mirror://gnu/dionysus/dionysus-" version
246 "1aqnvw6z33bzqgd1ga571pnx6vq2zrkckm1cz91grv45h4jr9vgs"))))
247 (build-system gnu-build-system)
248 (inputs `(("tcl" ,tcl))) ;for 'tclsh'
249 (synopsis "Local search for universal constants and scientific values")
251 "GNU Dionysus is a convenient system for quickly retrieving the values of
252 mathematical constants used in science and engineering. Values can be
253 searched using a simple command-line tool, choosing from three databases:
254 universal constants, atomic numbers, and constants related to
256 (license license:gpl3+)
257 (home-page "https://www.gnu.org/software/dionysus/")))
265 (uri (string-append "mirror://gnu/gsl/gsl-"
269 "1yxdzqjwmi2aid650fa9zyr8llw069x7lm489wx9nnfdi6vh09an"))
270 (patches (search-patches "gsl-test-i686.patch"))))
271 (build-system gnu-build-system)
273 `(#:parallel-tests? #f
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+)))
321 (uri (string-append "mirror://gnu/glpk/glpk-"
325 "1adbvwiaqrv9pql9ry3lhn2vfsxnff2vh4fs477d90kpfx0xwrlq"))))
326 (build-system gnu-build-system)
330 `(#:configure-flags '("--with-gmp")))
331 (home-page "https://www.gnu.org/software/glpk/")
332 (synopsis "GNU Linear Programming Kit, supporting the MathProg language")
334 "GLPK is a C library for solving large-scale linear programming (LP),
335 mixed integer programming (MIP), and other related problems. It supports the
336 GNU MathProg modeling language, a subset of the AMPL language, and features a
337 translator for the language. In addition to the C library, a stand-alone
338 LP/MIP solver is included in the package.")
339 (license license:gpl3+)))
348 (uri (string-append "http://www.4ti2.de/version_" version
349 "/4ti2-" version ".tar.gz"))
352 "1frix3rnm9ffr93alqzw4cavxbfpf524l8rfbmcpyhwd3n1km0yl"))))
353 (build-system gnu-build-system)
355 `(("which" ,(@ (gnu packages base) which)))) ; for the tests
359 (home-page "http://www.4ti2.de/")
360 (synopsis "Mathematical tool suite for problems on linear spaces")
362 "4ti2 implements algorithms for solving algebraic, geometric and
363 combinatorial problems on linear spaces. Among others, it solves systems
364 of linear equations, computes extreme rays of polyhedral cones, solves
365 integer programming problems and computes Markov bases for statistics.")
366 (license license:gpl2+)))
368 (define-public cddlib
375 (uri (string-append "ftp://ftp.math.ethz.ch/users/fukudak/cdd/cddlib-"
376 (string-delete #\. version) ".tar.gz"))
379 "1dasasscwfg793q8fwzgwf64xwj7w62yfvszpr8x8g38jka08vgy"))))
380 (build-system gnu-build-system)
383 (home-page "https://www.inf.ethz.ch/personal/fukudak/cdd_home/index.html")
384 (synopsis "Library for convex hulls and extreme rays of polyhedra")
386 "The C-library cddlib implements the Double Description Method of
387 Motzkin et al. for generating all vertices (i.e. extreme points) and extreme
388 rays of a general convex polyhedron given by a system of linear inequalities
389 in arbitrary dimension. It can also be used for the converse operation of
390 computing convex hulls.")
391 (license license:gpl2+)))
393 (define-public arpack-ng
400 (uri (string-append "https://github.com/opencollab/arpack-ng/archive/"
402 (file-name (string-append name "-" version ".tar.gz"))
405 "1fwch6vipms1ispzg2djvbzv5wag36f1dmmr3xs3mbp6imfyhvff"))))
406 (build-system gnu-build-system)
407 (home-page "https://github.com/opencollab/arpack-ng")
410 ("fortran" ,gfortran)))
411 (synopsis "Fortran subroutines for solving eigenvalue problems")
413 "ARPACK-NG is a collection of Fortran77 subroutines designed to solve
414 large scale eigenvalue problems.")
415 (license (license:non-copyleft "file://COPYING"
416 "See COPYING in the distribution."))))
418 (define-public arpack-ng-openmpi
419 (package (inherit arpack-ng)
420 (name "arpack-ng-openmpi")
423 ,@(package-inputs arpack-ng)))
424 (arguments `(#:configure-flags '("--enable-mpi")))
425 (synopsis "Fortran subroutines for solving eigenvalue problems with MPI")))
427 (define-public lapack
434 (uri (string-append "http://www.netlib.org/lapack/lapack-"
438 "0lk3f97i9imqascnlf6wr5mjpyxqcdj73pgj97dj2mgvyg9z1n4s"))))
439 (build-system cmake-build-system)
440 (home-page "http://www.netlib.org/lapack/")
441 (inputs `(("fortran" ,gfortran)
442 ("python" ,python-2)))
444 `(#:configure-flags '("-DBUILD_SHARED_LIBS:BOOL=YES"
446 #:phases (alist-cons-before
448 (lambda* (#:key inputs #:allow-other-keys)
449 (let ((python (assoc-ref inputs "python")))
450 (substitute* "lapack_testing.py"
451 (("/usr/bin/env python") python))))
453 (synopsis "Library for numerical linear algebra")
455 "LAPACK is a Fortran 90 library for solving the most commonly occurring
456 problems in numerical linear algebra.")
457 (license (license:non-copyleft "file://LICENSE"
458 "See LICENSE in the distribution."))))
460 (define-public scalapack
467 (uri (string-append "http://www.netlib.org/scalapack/scalapack-"
471 "0p1r61ss1fq0bs8ynnx7xq4wwsdvs32ljvwjnx6yxr8gd6pawx0c"))))
472 (build-system cmake-build-system)
475 ("fortran" ,gfortran)
476 ("lapack" ,lapack))) ;for testing only
478 `(#:configure-flags `("-DBUILD_SHARED_LIBS:BOOL=YES")))
479 (home-page "http://www.netlib.org/scalapack/")
480 (synopsis "Library for scalable numerical linear algebra")
482 "ScaLAPACK is a Fortran 90 library of high-performance linear algebra
483 routines on parallel distributed memory machines. ScaLAPACK solves dense and
484 banded linear systems, least squares problems, eigenvalue problems, and
485 singular value problems.")
486 (license (license:bsd-style "file://LICENSE"
487 "See LICENSE in the distribution."))))
489 (define-public gnuplot
495 (uri (string-append "mirror://sourceforge/gnuplot/gnuplot/"
500 "0lr065qdlgss8lmy31l7hkmnk9fp4lvqq9qgb1f1209f36zy1wr5"))))
501 (build-system gnu-build-system)
502 (inputs `(("readline" ,readline)
507 (native-inputs `(("pkg-config" ,pkg-config)
508 ("texlive" ,texlive-minimal)))
509 (home-page "http://www.gnuplot.info")
510 (synopsis "Command-line driven graphing utility")
511 (description "Gnuplot is a portable command-line driven graphing
512 utility. It was originally created to allow scientists and students to
513 visualize mathematical functions and data interactively, but has grown to
514 support many non-interactive uses such as web scripting. It is also used as a
515 plotting engine by third-party applications like Octave.")
516 ;; X11 Style with the additional restriction that derived works may only be
517 ;; distributed as patches to the original.
518 (license (license:fsf-free
519 "http://gnuplot.cvs.sourceforge.net/gnuplot/gnuplot/Copyright"))))
528 (uri (string-append "https://github.com/OkoSanto/GCTP/archive/v"
530 (file-name (string-append name "-" version ".tar.gz"))
533 "0l9aqnqynh9laicn5dxf3rsb1n14xiks79wbyqccirzmjqd1c1x4"))))
535 `(("fortran" ,gfortran)))
536 (build-system gnu-build-system)
537 (synopsis "General Cartographic Transformation Package (GCTP)")
539 "The General Cartographic Transformation Package (GCTP) is a system of
540 software routines designed to permit the transformation of coordinate pairs
541 from one map projection to another. The GCTP is the standard computer
542 software used by the National Mapping Division for map projection
544 (home-page "https://github.com/OkoSanto/GCTP")
545 (license license:public-domain))) ;https://www2.usgs.gov/laws/info_policies.html
554 (uri (string-append "https://support.hdfgroup.org/ftp/HDF/releases/HDF"
555 version "/src/hdf-" version ".tar.bz2"))
557 (base32 "020jh563sjyxsgml8l809d2i1d4ms9shivwj3gbm7n0ilxbll8id"))
558 (patches (search-patches "hdf4-architectures.patch"
559 "hdf4-reproducibility.patch"
560 "hdf4-shared-fortran.patch"))))
562 (build-system gnu-build-system)
564 `(("gfortran" ,gfortran)
569 ("libjpeg" ,libjpeg)))
571 `(#:parallel-tests? #f
572 #:configure-flags '("--enable-shared")
574 (modify-phases %standard-phases
575 (add-before 'configure 'patchbuild
578 '("mfhdf/hdfimport/testutil.sh.in" "hdf/util/testutil.sh.in")
580 (("/bin/mkdir") "mkdir"))
581 (substitute* (find-files "." "^Makefile\\.in$")
582 (("@HDF_BUILD_XDR_TRUE@XDR_ADD = \
583 -R\\$\\(abs_top_builddir\\)/mfhdf/xdr/\\.libs") "")
584 (("@HDF_BUILD_SHARED_TRUE@AM_LDFLAGS = \
585 -R\\$\\(abs_top_builddir\\)/mfhdf/libsrc/\\.libs \
586 -R\\$\\(abs_top_builddir\\)/hdf/src/\\.libs \\$\\(XDR_ADD\\)") "")))))))
587 (home-page "https://www.hdfgroup.org/products/hdf4/")
589 "Library and multi-object file format for storing and managing data")
590 (description "HDF4 is a library and multi-object file format for storing
591 and managing data between machines. HDF4 is an older hierarchical data format,
592 incompatible with HDF5.")
594 (license:non-copyleft
595 "https://www.hdfgroup.org/ftp/HDF/HDF_Current/src/unpacked/COPYING"))))
597 (define-public hdf4-alt
602 (substitute-keyword-arguments (package-arguments hdf4)
603 ((#:configure-flags flags) `(cons* "--disable-netcdf" ,flags))))
605 "HDF4 without netCDF API, can be combined with the regular netCDF library")))
614 (uri (list (string-append "http://www.hdfgroup.org/ftp/HDF5/releases/"
615 "hdf5-" version "/src/hdf5-"
617 (string-append "https://support.hdfgroup.org/ftp/HDF5/"
620 (take (string-split version #\.) 2))
621 "/src/hdf5-" version ".tar.bz2")))
623 (base32 "13542vrnl1p35n8vbq0wzk40vddmm33q5nh04j98c7r1yjnxxih1"))
624 (patches (list (search-patch "hdf5-config-date.patch")))))
625 (build-system gnu-build-system)
629 `(;; Some of the users, notably Flann, need the C++ interface.
630 #:configure-flags '("--enable-cxx")
633 (modify-phases %standard-phases
634 (add-before 'configure 'patch-configure
636 (substitute* "configure"
639 (add-after 'install 'patch-references
640 (lambda* (#:key inputs outputs #:allow-other-keys)
641 (let ((bin (string-append (assoc-ref outputs "out") "/bin"))
642 (zlib (assoc-ref inputs "zlib")))
643 (substitute* (find-files bin "h5p?cc")
645 (string-append "-L" zlib "/lib " lib)))
647 (home-page "http://www.hdfgroup.org")
648 (synopsis "Management suite for extremely large and complex data")
649 (description "HDF5 is a suite that makes possible the management of
650 extremely large and complex data collections.")
651 (license (license:x11-style
652 "http://www.hdfgroup.org/ftp/HDF5/current/src/unpacked/COPYING"))))
654 (define-public hdf-eos2
661 (uri "ftp://edhs1.gsfc.nasa.gov\
662 /edhs/hdfeos/latest_release/HDF-EOS2.19v1.00.tar.Z")
664 (base32 "0c9fcz25s292ldap12wxmlrvnyz99z24p63d8fwx51bf8s0s1zrz"))
665 (patches (search-patches "hdf-eos2-remove-gctp.patch"
666 "hdf-eos2-build-shared.patch"
667 "hdf-eos2-fortrantests.patch"))))
668 (build-system gnu-build-system)
670 `(("gfortran" ,gfortran)))
672 `(("hdf4" ,hdf4-alt) ; assume most HDF-EOS2 users won't use the HDF4 netCDF API
677 `( #:configure-flags '("--enable-install-include" "--enable-shared"
678 "CC=h4cc -Df2cFortran" "LIBS=-lgctp")
679 #:parallel-tests? #f))
680 (home-page "http://hdfeos.org/software/library.php#HDF-EOS2")
681 (synopsis "HDF4-based data format for NASA's Earth Observing System")
682 (description "HDF-EOS2 is a software library built on HDF4 which supports
683 the construction of data structures used in NASA's Earth Observing
684 System (Grid, Point and Swath).")
686 ;; Source files carry a permissive license header.
687 (license (license:non-copyleft home-page))))
689 (define-public hdf-eos5
695 (uri (string-append "ftp://edhs1.gsfc.nasa.gov\
696 /edhs/hdfeos5/latest_release/HDF-EOS5." version ".tar.Z"))
699 "1p83333nzzy8rn5chxlm0hrkjjnhh2w1ji8ac0f9q4xzg838i58i"))
700 (patches (search-patches "hdf-eos5-build-shared.patch"
701 "hdf-eos5-remove-gctp.patch"
702 "hdf-eos5-fix-szip.patch"
703 "hdf-eos5-fortrantests.patch"))))
705 `(("gfortran" ,gfortran)))
706 (build-system gnu-build-system)
712 `(#:configure-flags '("--enable-install-include" "--enable-shared"
713 "CC=h5cc -Df2cFortran" "LIBS=-lgctp")
714 #:parallel-tests? #f))
715 (synopsis "HDF5-based data format for NASA's Earth Observing System")
717 "HDF-EOS5 is a software library built on HDF5 to support the construction
718 of data structures used in NASA's Earth Observing System (Grid, Point and
720 (home-page "http://www.hdfeos.org/software/library.php#HDF-EOS5")
722 ;; Source files carry a permissive license header.
723 (license (license:non-copyleft home-page))))
725 (define-public hdf5-parallel-openmpi
726 (package (inherit hdf5)
727 (name "hdf5-parallel-openmpi")
730 ,@(package-inputs hdf5)))
732 (substitute-keyword-arguments `(#:configure-flags '("--enable-parallel")
733 ,@(package-arguments hdf5))
735 `(modify-phases ,phases
736 (add-before 'check 'patch-tests
738 ;; OpenMPI's mpirun will exit with non-zero status if it
739 ;; detects an "abnormal termination", i.e. any process not
740 ;; calling MPI_Finalize(). Since the test is explicitely
741 ;; avoiding MPI_Finalize so as not to have at_exit and thus
742 ;; H5C_flush_cache from being called, mpirun will always
743 ;; complain, so turn this test off.
744 (substitute* "testpar/Makefile"
745 (("(^TEST_PROG_PARA.*)t_pflush1(.*)" front back)
746 (string-append front back "\n")))
747 (substitute* "tools/h5diff/testph5diff.sh"
748 (("/bin/sh") (which "sh")))
750 (synopsis "Management suite for data with parallel IO support")))
752 (define-public h5check
759 (uri (string-append "http://www.hdfgroup.org/ftp/HDF5/tools/"
760 "h5check/src/h5check-" version ".tar.gz"))
763 "1gm76jbwhz9adbxgn14zx8cj33dmjdr2g5xcy0m9c2gakp8w59kj"))))
764 (build-system gnu-build-system)
765 (inputs `(("hdf5" ,hdf5))) ;h5cc for tests
766 (home-page "https://www.hdfgroup.org/products/hdf5_tools/h5check.html")
767 (synopsis "HDF5 format checker")
768 (description "@code{h5check} is a validation tool for verifying that an
769 HDF5 file is encoded according to the HDF File Format Specification.")
770 (license (license:x11-style "file://COPYING"))))
778 (uri (string-append "mirror://sourceforge/itpp/itpp/"
783 "14ddy2xnb6sgp4hiax9v5sv4pr4l4dd4ps76nfha3nrpr1ikhcqm"))))
784 (build-system cmake-build-system)
785 (arguments `(#:tests? #f)) ; Tests require googletest *sources*
786 (inputs `(("lapack" ,lapack)
788 (native-inputs `(("texlive-minimal" ,texlive-minimal)
789 ("doxygen" ,doxygen)))
790 (home-page "http://itpp.sourceforge.net")
791 (synopsis "C++ library of maths, signal processing and communication classes")
792 (description "IT++ is a C++ library of mathematical, signal processing and
793 communication classes and functions. Its main use is in simulation of
794 communication systems and for performing research in the area of
795 communications. The kernel of the library consists of generic vector and
796 matrix classes, and a set of accompanying routines. Such a kernel makes IT++
797 similar to MATLAB, GNU Octave or SciPy.")
798 (license license:gpl3+)))
800 (define-public netcdf
807 (uri (string-append "ftp://ftp.unidata.ucar.edu/pub/netcdf/"
808 "netcdf-" version ".tar.gz"))
811 "1blc7ik5yin7i0ls2kag0a9xjk12m0dzx6v1x88az3ras3scci2d"))
812 (patches (search-patches "netcdf-date-time.patch"
813 "netcdf-tst_h_par.patch"))))
814 (build-system gnu-build-system)
818 ("graphviz" ,graphviz)))
823 ("libjpeg" ,libjpeg)))
825 `(#:configure-flags '("--enable-doxygen" "--enable-dot" "--enable-hdf4")
826 #:parallel-tests? #f)) ;various race conditions
827 (home-page "http://www.unidata.ucar.edu/software/netcdf/")
828 (synopsis "Library for scientific data")
829 (description "NetCDF is an interface for scientific data access and a
830 software library that provides an implementation of the interface. The netCDF
831 library defines a machine-independent format for representing scientific data.
832 Together, the interface, library, and format support the creation, access, and
833 sharing of scientific data.")
834 (license (license:x11-style "file://COPYRIGHT"))))
836 (define-public netcdf-parallel-openmpi
837 (package (inherit netcdf)
838 (name "netcdf-parallel-openmpi")
841 ,@(alist-replace "hdf5" (list hdf5-parallel-openmpi)
842 (package-inputs netcdf))))
843 ;; TODO: Replace pkg-config references in nc-config with absolute references
845 (substitute-keyword-arguments (package-arguments netcdf)
846 ((#:configure-flags flags)
847 `(cons* "CC=mpicc" "CXX=mpicxx"
848 "--enable-parallel-tests"
849 ;; Shared libraries not supported with parallel IO.
850 "--disable-shared" "--with-pic"
859 (uri (string-append "http://ab-initio.mit.edu/nlopt/nlopt-"
862 (base32 "12cfkkhcdf4zmb6h7y6qvvdvqjs2xf9sjpa3rl3bq76px4yn76c0"))))
863 (build-system gnu-build-system)
865 `(;; Shared libraries are not built by default. They are required to
866 ;; build the Guile, Octave, and Python bindings.
867 #:configure-flags '("--enable-shared")
870 (modify-phases %standard-phases
871 (add-before 'configure 'set-libnlopt-file-name
872 (lambda* (#:key outputs #:allow-other-keys)
873 ;; Make sure the Scheme module refers to the library by its
874 ;; absolute file name (we cannot do that from a snippet
875 ;; because the expansion of @libdir@ contains
877 (let ((out (assoc-ref outputs "out")))
878 (substitute* "swig/nlopt.scm.in"
880 (string-append out "/lib/libnlopt")))
882 (inputs `(("guile" ,guile-2.0)))
883 (native-inputs `(("pkg-config" ,pkg-config)))
884 (home-page "http://ab-initio.mit.edu/wiki/")
885 (synopsis "Library for nonlinear optimization")
886 (description "NLopt is a library for nonlinear optimization, providing a
887 common interface for a number of different free optimization routines available
888 online as well as original implementations of various other algorithms.")
889 (license license:lgpl2.1+)))
898 "http://www.coin-or.org/download/source/Ipopt/Ipopt-"
902 "09bk2hqy2vgi4yi76xng9zxakddwqy3wij9nx7wf2vfbxxpazrsk"))
903 (modules '((guix build utils)))
905 ;; Make sure we don't use the bundled software.
906 '(delete-file-recursively "ThirdParty"))))
907 (build-system gnu-build-system)
909 '(#:phases (modify-phases %standard-phases
910 (add-after 'install 'add--L-flags-in-ipopt.pc
911 (lambda* (#:key inputs outputs #:allow-other-keys)
912 ;; The '.pc' file lists '-llapack -lblas' in "Libs";
913 ;; move it to "Libs.private" where it belongs, and add a
914 ;; '-L' flag for LAPACK.
915 (let ((out (assoc-ref outputs "out"))
916 (lapack (assoc-ref inputs "lapack")))
917 (substitute* (string-append out "/lib/pkgconfig/"
919 (("Libs: (.*)-llapack -lblas(.*)$" _ before after)
920 (string-append "Libs: " before " " after "\n"
921 "Libs.private: " before
922 "-L" lapack "/lib -llapack -lblas "
926 `(("gfortran" ,gfortran)))
928 ;; TODO: Maybe add dependency on COIN-MUMPS, ASL, and HSL.
929 `(("lapack" ,lapack))) ;for both libblas and liblapack
930 (home-page "http://www.coin-or.org")
931 (synopsis "Large-scale nonlinear optimizer")
933 "The Interior Point Optimizer (IPOPT) is a software package for
934 large-scale nonlinear optimization. It provides C++, C, and Fortran
936 (license license:epl1.0)))
940 (name "ceres-solver")
942 (home-page "http://ceres-solver.org/")
945 (uri (string-append home-page "ceres-solver-"
949 "0i7qkbf8g6pd8arxzldppga26ckv93y8zldsfz6wbd4n6b1nqrjd"))))
950 (build-system cmake-build-system)
952 ;; TODO: Build HTML user documentation and install separately.
953 '(#:configure-flags '("-DBUILD_EXAMPLES=OFF"
954 "-DBUILD_SHARED_LIBS=ON")
956 #:phases (modify-phases %standard-phases
957 (add-before 'configure 'set-library-directory
959 ;; Install libraries to lib/, not lib64/.
960 (substitute* "internal/ceres/CMakeLists.txt"
961 (("set\\(LIB_SUFFIX \"64\"\\)")
962 "set(LIB_SUFFIX \"\")"))
965 `(("pkg-config" ,pkg-config)))
967 `(("glog" ,glog))) ;for #include <glog/glog.h>
972 ("suitesparse" ,suitesparse)
974 (synopsis "C++ library for solving large optimization problems")
976 "Ceres Solver is a C++ library for modeling and solving large,
977 complicated optimization problems. It is a feature rich, mature and
978 performant library which has been used in production since 2010. Ceres Solver
979 can solve two kinds of problems:
981 @item non-linear least squares problems with bounds constraints;
982 @item general unconstrained optimization problems.
984 (license license:bsd-3)))
986 ;; For a fully featured Octave, users are strongly recommended also to install
987 ;; the following packages: texinfo, less, ghostscript, gnuplot.
988 (define-public octave
995 (uri (string-append "mirror://gnu/octave/octave-"
999 "09zhhch79jw3ynw39vizx0i2cbd2bjz3sp38pjdzraqrbivpwp92"))))
1000 (build-system gnu-build-system)
1002 `(("lapack" ,lapack)
1003 ("readline" ,readline)
1007 ("arpack" ,arpack-ng)
1010 ("fontconfig" ,fontconfig)
1011 ("freetype" ,freetype)
1018 ("graphicsmagick" ,graphicsmagick)))
1021 ("gfortran" ,gfortran)
1022 ("pkg-config" ,pkg-config)
1024 ;; The following inputs are not actually used in the build process.
1025 ;; However, the ./configure gratuitously tests for their existence and
1026 ;; assumes that programs not present at build time are also not, and
1027 ;; can never be, available at run time! If these inputs are therefore
1028 ;; not present, support for them will be built out. However, Octave
1029 ;; will still run without them, albeit without the features they
1032 ("texinfo" ,texinfo)
1033 ("ghostscript" ,ghostscript)
1034 ("gnuplot" ,gnuplot)))
1037 (list (string-append "--with-shell="
1038 (assoc-ref %build-inputs "bash")
1040 (home-page "https://www.gnu.org/software/octave/")
1041 (synopsis "High-level language for numerical computation")
1042 (description "GNU Octave is a high-level interpreted language that is
1043 specialized for numerical computations. It can be used for both linear and
1044 non-linear applications and it provides great support for visualizing results.
1045 Work may be performed both at the interactive command-line as well as via
1047 (license license:gpl3+)))
1049 (define-public opencascade-oce
1051 (name "opencascade-oce")
1057 "https://github.com/tpaviot/oce/archive/OCE-"
1062 "0vpmnb0k5y2f7lpmwx9pg9yfq24zjvnsak5alzacncfm1hv9b6cd"))))
1063 (build-system cmake-build-system)
1066 (list "-DOCE_TESTING:BOOL=ON"
1067 "-DOCE_USE_TCL_TEST_FRAMEWORK:BOOL=ON"
1068 "-DOCE_DRAW:BOOL=ON"
1069 (string-append "-DOCE_INSTALL_PREFIX:PATH="
1070 (assoc-ref %outputs "out"))
1071 "-UCMAKE_INSTALL_RPATH")))
1073 `(("freetype" ,freetype)
1080 `(("python" ,python-wrapper)))
1081 (home-page "https://github.com/tpaviot/oce")
1082 (synopsis "Libraries for 3D modeling and numerical simulation")
1084 "Open CASCADE is a set of libraries for the development of applications
1085 dealing with 3D CAD data or requiring industrial 3D capabilities. It includes
1086 C++ class libraries providing services for 3D surface and solid modeling, CAD
1087 data exchange, and visualization. It is used for development of specialized
1088 software dealing with 3D models in design (CAD), manufacturing (CAM),
1089 numerical simulation (CAE), measurement equipment (CMM), and quality
1090 control (CAQ) domains.
1092 This is the ``Community Edition'' (OCE) of Open CASCADE, which gathers
1093 patches, improvements, and experiments contributed by users over the official
1094 Open CASCADE library.")
1095 (license (list license:lgpl2.1; OCE libraries, with an exception for the
1096 ; use of header files; see
1097 ; OCCT_LGPL_EXCEPTION.txt
1098 license:public-domain; files
1099 ; src/Standard/Standard_StdAllocator.hxx and
1100 ; src/NCollection/NCollection_StdAllocator.hxx
1101 license:expat; file src/OpenGl/OpenGl_glext.h
1102 license:bsd-3)))); test framework gtest
1111 (uri (string-append "http://gmsh.info/src/gmsh-"
1112 version "-source.tgz"))
1114 (base32 "1slf0bfkwrcgn6296wb4qhbk4ahz6i4wfb10hnim08x05vrylag8"))
1115 (modules '((guix build utils)))
1117 ;; Remove non-free METIS code
1118 '(delete-file-recursively "contrib/Metis"))))
1119 (build-system cmake-build-system)
1122 ("gfortran" ,gfortran)
1128 ("opencascade-oce" ,opencascade-oce)
1130 ("libxext" ,libxext)))
1132 `(("fontconfig" ,fontconfig)
1133 ("libxft" ,libxft)))
1135 `(#:configure-flags `("-DENABLE_METIS:BOOL=OFF"
1136 "-DENABLE_BUILD_SHARED:BOOL=ON"
1137 "-DENABLE_BUILD_DYNAMIC:BOOL=ON")))
1138 (home-page "http://www.geuz.org/gmsh/")
1139 (synopsis "3D finite element grid generator")
1140 (description "Gmsh is a 3D finite element grid generator with a built-in
1141 CAD engine and post-processor. Its design goal is to provide a fast, light
1142 and user-friendly meshing tool with parametric input and advanced
1143 visualization capabilities. Gmsh is built around four modules: geometry,
1144 mesh, solver and post-processing. The specification of any input to these
1145 modules is done either interactively using the graphical user interface or in
1146 ASCII text files using Gmsh's own scripting language.")
1147 (license license:gpl2+)))
1149 (define-public maxflow
1156 (url "https://github.com/gerddie/maxflow.git")
1157 (commit "42401fa54823d16b9da47716f04e5d9ef1605875")))
1158 (file-name (string-append name "-" version "-checkout"))
1161 "0rll38whw55h0vcjrrwdnh9ascvxby0ph7n1l0d12z17cg215kkb"))))
1162 (build-system cmake-build-system)
1163 (home-page "http://pub.ist.ac.at/~vnk/software.html")
1164 (synopsis "Library implementing Maxflow algorithm")
1165 (description "An implementation of the maxflow algorithm described in
1166 @cite{An Experimental Comparison of Min-Cut/Max-Flow Algorithms for
1167 Energy Minimization in Computer Vision.\n
1168 Yuri Boykov and Vladimir Kolmogorov.\n
1169 In IEEE Transactions on Pattern Analysis and Machine Intelligence,\n
1171 (license license:gpl3+)))
1173 (define-public petsc
1180 ;; The *-lite-* tarball does not contain the *large* documentation
1181 (uri (string-append "http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/"
1182 "petsc-lite-" version ".tar.gz"))
1184 (base32 "0jfrq6rd4zagw1iimz05m2w91k0jvz3qbik1lk8pqcxw3rvdqk5d"))))
1185 (build-system gnu-build-system)
1187 `(("python" ,python-2)
1190 `(("gfortran" ,gfortran)
1192 ("superlu" ,superlu)
1193 ;; leaving out hdf5 and fftw, as petsc expects them to be built with mpi
1194 ;; leaving out opengl, as configuration seems to only be for mac
1197 `(#:test-target "test"
1198 #:parallel-build? #f ;build is parallel by default
1203 ,(string-append "--with-superlu-include="
1204 (assoc-ref %build-inputs "superlu") "/include")
1205 ,(string-append "--with-superlu-lib="
1206 (assoc-ref %build-inputs "superlu") "/lib/libsuperlu.a"))
1208 (modify-phases %standard-phases
1210 ;; PETSc's configure script is actually a python script, so we can't
1211 ;; run it with bash.
1212 (lambda* (#:key outputs (configure-flags '())
1214 (let* ((prefix (assoc-ref outputs "out"))
1215 (flags `(,(string-append "--prefix=" prefix)
1216 ,@configure-flags)))
1217 (format #t "build directory: ~s~%" (getcwd))
1218 (format #t "configure flags: ~s~%" flags)
1219 (zero? (apply system* "./configure" flags)))))
1220 (add-after 'configure 'clean-local-references
1221 (lambda* (#:key inputs outputs #:allow-other-keys)
1222 (let ((out (assoc-ref outputs "out")))
1223 (substitute* (find-files "." "^petsc(conf|machineinfo).h$")
1224 ;; Prevent build directory from leaking into compiled code
1226 ;; Scrub timestamp for reproducibility
1227 ((".*Libraries compiled on.*") ""))
1229 (add-after 'install 'clean-install
1230 ;; Try to keep installed files from leaking build directory names.
1231 (lambda* (#:key inputs outputs #:allow-other-keys)
1232 (let ((out (assoc-ref outputs "out")))
1233 (substitute* (map (lambda (file)
1234 (string-append out "/lib/petsc/conf/" file))
1235 '("petscvariables"))
1237 ;; Make compiler references point to the store
1238 (substitute* (string-append out "/lib/petsc/conf/petscvariables")
1239 (("= (gcc|g\\+\\+|gfortran)" _ compiler)
1240 (string-append "= " (which compiler))))
1241 ;; PETSc installs some build logs, which aren't necessary.
1242 (for-each (lambda (file)
1243 (let ((f (string-append out "/lib/petsc/conf/" file)))
1244 (when (file-exists? f)
1246 '("configure.log" "make.log" "gmake.log"
1247 "test.log" "error.log" "RDict.db"
1248 "PETScBuildInternal.cmake"
1249 ;; Once installed, should uninstall with Guix
1252 (home-page "http://www.mcs.anl.gov/petsc")
1253 (synopsis "Library to solve PDEs")
1254 (description "PETSc, pronounced PET-see (the S is silent), is a suite of
1255 data structures and routines for the scalable (parallel) solution of
1256 scientific applications modeled by partial differential equations.")
1257 (license (license:non-copyleft
1258 "http://www.mcs.anl.gov/petsc/documentation/copyright.html"))))
1260 (define-public petsc-complex
1261 (package (inherit petsc)
1262 (name "petsc-complex")
1264 (substitute-keyword-arguments (package-arguments petsc)
1265 ((#:configure-flags cf)
1266 `(cons "--with-scalar-type=complex" ,cf))))
1267 (synopsis "Library to solve PDEs (with complex scalars)")))
1269 (define-public petsc-openmpi
1270 (package (inherit petsc)
1271 (name "petsc-openmpi")
1273 `(("openmpi" ,openmpi)
1274 ,@(package-inputs petsc)))
1276 (substitute-keyword-arguments (package-arguments petsc)
1277 ((#:configure-flags cf)
1278 ``("--with-mpiexec=mpirun"
1279 ,(string-append "--with-mpi-dir="
1280 (assoc-ref %build-inputs "openmpi"))
1281 ,@(delete "--with-mpi=0" ,cf)))))
1282 (synopsis "Library to solve PDEs (with MPI support)")))
1284 (define-public petsc-complex-openmpi
1285 (package (inherit petsc-complex)
1286 (name "petsc-complex-openmpi")
1288 `(("openmpi" ,openmpi)
1289 ,@(package-inputs petsc-complex)))
1291 (substitute-keyword-arguments (package-arguments petsc-complex)
1292 ((#:configure-flags cf)
1293 ``("--with-mpiexec=mpirun"
1294 ,(string-append "--with-mpi-dir="
1295 (assoc-ref %build-inputs "openmpi"))
1296 ,@(delete "--with-mpi=0" ,cf)))))
1297 (synopsis "Library to solve PDEs (with complex scalars and MPI support)")))
1299 (define-public slepc
1306 (uri (string-append "http://slepc.upv.es/download/download.php?"
1307 "filename=slepc-" version ".tar.gz"))
1308 (file-name (string-append name "-" version ".tar.gz"))
1311 "1hijlmrvxvfqslnx8yydzw5xqbsn1yy02g32w0hln1z3cgr1c0k7"))))
1312 (build-system gnu-build-system)
1314 `(("python" ,python-2)))
1316 `(("arpack" ,arpack-ng)
1317 ("gfortran" ,gfortran)))
1319 `(("petsc" ,petsc)))
1321 `(#:parallel-build? #f ;build is parallel by default
1323 `(,(string-append "--with-arpack-dir="
1324 (assoc-ref %build-inputs "arpack") "/lib"))
1326 (modify-phases %standard-phases
1328 ;; configure is a python script, so we can't run it with bash.
1329 (lambda* (#:key inputs outputs (configure-flags '())
1331 (let* ((prefix (assoc-ref outputs "out"))
1332 (flags `(,(string-append "--prefix=" prefix)
1333 ,@configure-flags)))
1334 (format #t "build directory: ~s~%" (getcwd))
1335 (format #t "configure flags: ~s~%" flags)
1336 (setenv "SLEPC_DIR" (getcwd))
1337 (setenv "PETSC_DIR" (assoc-ref inputs "petsc"))
1338 (zero? (apply system* "./configure" flags)))))
1339 (add-after 'install 'delete-doc
1340 ;; TODO: SLEPc installs HTML documentation alongside headers in
1341 ;; $out/include. We'd like to move them to share/doc, but delete
1342 ;; them for now, as they are incomplete and installing the complete
1343 ;; documentation is difficult.
1344 (lambda* (#:key outputs #:allow-other-keys)
1345 (let* ((out (assoc-ref outputs "out")))
1346 (for-each delete-file (find-files out "\\.html$")))))
1347 (add-after 'install 'clean-install
1348 ;; Clean up unnecessary build logs from installation.
1349 (lambda* (#:key outputs #:allow-other-keys)
1350 (let ((out (assoc-ref outputs "out")))
1351 (for-each (lambda (file)
1352 (let ((f (string-append out "/lib/slepc/conf/" file)))
1353 (when (file-exists? f)
1355 '("configure.log" "make.log" "gmake.log"
1356 "test.log" "error.log" "RDict.db"
1357 "uninstall.py"))))))))
1358 (home-page "http://slepc.upv.es")
1359 (synopsis "Scalable library for eigenproblems")
1360 (description "SLEPc is a software library for the solution of large sparse
1361 eigenproblems on parallel computers. It can be used for the solution of
1362 linear eigenvalue problems formulated in either standard or generalized form,
1363 as well as other related problems such as the singular value decomposition.
1364 The emphasis of the software is on methods and techniques appropriate for
1365 problems in which the associated matrices are sparse, for example, those
1366 arising after the discretization of partial differential equations.")
1367 (license license:lgpl3)))
1369 (define-public slepc-complex
1370 (package (inherit slepc)
1371 (name "slepc-complex")
1373 `(("petsc" ,petsc-complex)
1374 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
1375 (synopsis "Scalable library for eigenproblems (with complex scalars)")))
1377 (define-public slepc-openmpi
1378 (package (inherit slepc)
1379 (name "slepc-openmpi")
1382 ("arpack" ,arpack-ng-openmpi)
1383 ,@(alist-delete "arpack" (package-inputs slepc))))
1385 `(("petsc" ,petsc-openmpi)
1386 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
1387 (synopsis "Scalable library for eigenproblems (with MPI support)")))
1389 (define-public slepc-complex-openmpi
1390 (package (inherit slepc-openmpi)
1391 (name "slepc-complex-openmpi")
1393 `(("petsc" ,petsc-complex-openmpi)
1394 ,@(alist-delete "petsc" (package-propagated-inputs slepc-openmpi))))
1395 (synopsis "Scalable library for eigenproblems (with complex scalars and MPI support)")))
1397 (define-public mumps
1404 (uri (string-append "http://mumps.enseeiht.fr/MUMPS_"
1408 "0igyc1pfzxdhpbad3v3lb86ixkdbqa1a8gbs15b04r2294h2nabp"))
1409 (patches (search-patches "mumps-build-parallelism.patch"))))
1410 (build-system gnu-build-system)
1412 `(("fortran" ,gfortran)
1413 ;; These are required for linking against mumps, but we let the user
1414 ;; declare the dependency.
1417 ("scotch" ,scotch)))
1419 `(#:modules ((ice-9 match)
1422 ,@%gnu-build-system-modules)
1424 (modify-phases %standard-phases
1426 (lambda* (#:key inputs #:allow-other-keys)
1427 (call-with-output-file "Makefile.inc"
1438 INCSEQ = -I$(topdir)/libseq
1439 LIBSEQ = -L$(topdir)/libseq -lmpiseq
1440 LIBSEQNEEDED = libseqneeded~;
1444 AR = ar vr # rules require trailing space, ugh...
1446 LIBBLAS = -L~a -lopenblas~@[
1447 SCALAP = -L~a -lscalapack~]
1448 LIBOTHERS = -pthread
1451 OPTF = -O2 -DALLOW_NON_INIT $(PIC)
1455 LIBS = $(SCALAP) $(LIBSEQ)
1456 LPORDDIR = $(topdir)/PORD/lib
1457 IPORD = -I$(topdir)/PORD/include
1458 LPORD = -L$(LPORDDIR) -lpord
1459 ORDERINGSF = -Dpord~@[
1461 IMETIS = -I$(METISDIR)/include
1462 LMETIS = -L$(METISDIR)/lib -lmetis
1463 ORDERINGSF += -Dmetis~]~@[~:{
1465 ISCOTCH = -I$(SCOTCHDIR)/include
1466 LSCOTCH = -L$(SCOTCHDIR)/lib ~a-lesmumps -lscotch -lscotcherr
1467 ORDERINGSF += ~a~}~]
1468 ORDERINGSC = $(ORDERINGSF)
1469 LORDERINGS = $(LPORD) $(LMETIS) $(LSCOTCH)
1470 IORDERINGSF = $(ISCOTCH)
1471 IORDERINGSC = $(IPORD) $(IMETIS) $(ISCOTCH)"
1472 (assoc-ref inputs "mpi")
1473 (assoc-ref inputs "blas")
1474 (assoc-ref inputs "scalapack")
1475 (assoc-ref inputs "metis")
1476 (match (list (assoc-ref inputs "pt-scotch")
1477 (assoc-ref inputs "scotch"))
1481 `((,scotch "" "-Dscotch")))
1484 "-lptesmumps -lptscotch -lptscotcherr "
1485 "-Dptscotch")))))))))
1487 ;; By default only the d-precision library is built. Make with "all"
1488 ;; target so that all precision libraries and examples are built.
1490 (zero? (system* "make" "all"
1491 (format #f "-j~a" (parallel-job-count))))))
1493 ;; Run the simple test drivers, which read test input from stdin:
1494 ;; from the "real" input for the single- and double-precision
1495 ;; testers, and from the "cmplx" input for complex-precision
1496 ;; testers. The EXEC-PREFIX key is used by the mumps-openmpi
1497 ;; package to prefix execution with "mpirun".
1498 (lambda* (#:key (exec-prefix '()) #:allow-other-keys)
1499 (with-directory-excursion "examples"
1502 (let ((tester (apply open-pipe*
1505 ,(string-append "./" prec
1507 (input (open-input-file
1508 (string-append "input_simpletest_" type))))
1510 (dump-port input tester)
1512 (zero? (close-pipe tester)))))
1514 '("real" "real" "cmplx" "cmplx")))))
1516 (lambda* (#:key outputs #:allow-other-keys)
1517 (let* ((out (assoc-ref outputs "out"))
1518 (libdir (string-append out "/lib")))
1519 (copy-recursively "lib" libdir)
1520 (copy-recursively "include" (string-append out "/include"))
1521 (when (file-exists? "libseq/libmpiseq.a")
1522 (install-file "libseq/libmpiseq.a" libdir))
1524 (home-page "http://mumps.enseeiht.fr")
1525 (synopsis "Multifrontal sparse direct solver")
1527 "MUMPS (MUltifrontal Massively Parallel sparse direct Solver) solves a
1528 sparse system of linear equations A x = b using Guassian elimination.")
1529 (license license:cecill-c)))
1531 (define-public mumps-metis
1532 (package (inherit mumps)
1533 (name "mumps-metis")
1535 (alist-delete "scotch" (package-inputs mumps)))))
1537 (define-public mumps-openmpi
1538 (package (inherit mumps)
1539 (name "mumps-openmpi")
1542 ("scalapack" ,scalapack)
1543 ("pt-scotch" ,pt-scotch)
1544 ,@(alist-delete "scotch" (package-inputs mumps))))
1546 (substitute-keyword-arguments (package-arguments mumps)
1548 `(modify-phases ,phases
1552 ((assoc-ref ,phases 'check)
1553 #:exec-prefix '("mpirun" "-n" "2"))))))))
1554 (synopsis "Multifrontal sparse direct solver (with MPI)")))
1556 (define-public mumps-metis-openmpi
1557 (package (inherit mumps-openmpi)
1558 (name "mumps-metis-openmpi")
1560 (alist-delete "pt-scotch" (package-inputs mumps-openmpi)))))
1562 (define-public r-quadprog
1569 (uri (cran-uri "quadprog" version))
1572 "0jg3r6abmhp8r9vkbhpx9ldjfw6vyl1m4c5vwlyjhk1mi03656fr"))))
1573 (build-system r-build-system)
1575 `(("gfortran" ,gfortran)))
1576 (home-page "http://cran.r-project.org/web/packages/quadprog")
1577 (synopsis "Functions to solve quadratic programming problems")
1579 "This package contains routines and documentation for solving quadratic
1580 programming problems.")
1581 (license license:gpl3+)))
1583 (define-public r-pracma
1589 (uri (cran-uri "pracma" version))
1591 (base32 "1z3i90mkzwvp9di17caf4934z2xlb2imm3hwxllcrbwvmnmhrwyc"))))
1592 (build-system r-build-system)
1594 `(("r-quadprog" ,r-quadprog)))
1595 (home-page "http://cran.r-project.org/web/packages/pracma")
1596 (synopsis "Practical numerical math functions")
1597 (description "This package provides functions for numerical analysis and
1598 linear algebra, numerical optimization, differential equations, plus some
1599 special functions. It uses Matlab function names where appropriate to simplify
1601 (license license:gpl3+)))
1603 (define-public superlu
1610 (uri (string-append "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/"
1611 "superlu_" version ".tar.gz"))
1613 (base32 "0qzlb7cd608q62kyppd0a8c65l03vrwqql6gsm465rky23b6dyr8"))
1614 (modules '((guix build utils)))
1616 ;; Replace the non-free implementation of MC64 with a stub adapted
1619 (use-modules (ice-9 regex)
1621 (call-with-output-file "SRC/mc64ad.c"
1626 void mc64id_(int *a) {
1627 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
1630 void mc64ad_ (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
1631 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
1632 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
1635 ;; Remove the corresponding license verbiage. MC64 license follows
1636 ;; a "------" line separator.
1637 (with-atomic-file-replacement "License.txt"
1638 (let ((rx (make-regexp "-{8}")))
1641 (let ((line (read-line in 'concat)))
1642 (unless (regexp-exec rx line)
1645 (build-system cmake-build-system)
1649 `(("blas" ,openblas)
1650 ("gfortran" ,gfortran)))
1652 `(#:configure-flags '("-Denable_blaslib:BOOL=NO" ;do not use internal cblas
1653 "-DTPL_BLAS_LIBRARIES=openblas"
1654 "-DBUILD_SHARED_LIBS:BOOL=YES"
1655 "-DCMAKE_INSTALL_LIBDIR=lib")))
1656 (home-page "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/")
1657 (synopsis "Supernodal direct solver for sparse linear systems")
1659 "SuperLU is a general purpose library for the direct solution of large,
1660 sparse, nonsymmetric systems of linear equations on high performance machines.
1661 The library is written in C and is callable from either C or Fortran. The
1662 library routines perform an LU decomposition with partial pivoting and
1663 triangular system solves through forward and back substitution. The library
1664 also provides threshold-based ILU factorization preconditioners.")
1665 (license (list license:bsd-3
1666 license:gpl2+ ;EXAMPLE/*fgmr.c
1667 (license:fsf-free "file://SRC/colamd.h")))))
1669 (define-public superlu-dist
1671 (name "superlu-dist")
1676 (uri (string-append "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/"
1677 "superlu_dist_" version ".tar.gz"))
1679 (base32 "1hnak09yxxp026blq8zhrl7685yip16svwngh1wysqxf8z48vzfj"))
1680 (modules '((guix build utils)))
1682 ;; Replace the non-free implementation of MC64 with a stub
1684 (use-modules (ice-9 regex)
1686 (call-with-output-file "SRC/mc64ad.c"
1691 void mc64id_(int *a) {
1692 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
1695 void mc64ad_ (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
1696 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
1697 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
1700 (delete-file "SRC/mc64ad.f.bak")
1701 (substitute* "SRC/util.c" ;adjust default algorithm
1702 (("RowPerm[[:blank:]]*=[[:blank:]]*LargeDiag")
1703 "RowPerm = NOROWPERM"))))
1704 (patches (search-patches "superlu-dist-scotchmetis.patch"))))
1705 (build-system gnu-build-system)
1709 `(("gfortran" ,gfortran)))
1711 `(("openmpi" ,openmpi) ;headers include MPI heades
1712 ("lapack" ,lapack) ;required to link with output library
1713 ("pt-scotch" ,pt-scotch))) ;same
1715 `(#:parallel-build? #f ;race conditions using ar
1719 (lambda* (#:key inputs outputs #:allow-other-keys)
1720 (call-with-output-file "make.inc"
1725 DSUPERLULIB = ~a/lib/libsuperlu_dist.a
1726 BLASDEF = -DUSE_VENDOR_BLAS
1727 BLASLIB = -L~a/lib -lblas
1728 PARMETISLIB = -L~a/lib \
1729 -lptscotchparmetis -lptscotch -lptscotcherr -lptscotcherrexit \
1730 -lscotch -lscotcherr -lscotcherrexit
1731 METISLIB = -L~:*~a/lib \
1732 -lscotchmetis -lscotch -lscotcherr -lscotcherrexit
1733 LIBS = $(DSUPERLULIB) $(PARMETISLIB) $(METISLIB) $(BLASLIB)
1739 CFLAGS = -O3 -g -DPRNTlevel=0 $(PIC)
1740 NOOPTS = -O0 -g $(PIC)
1742 FFLAGS = -O2 -g $(PIC)
1746 (assoc-ref outputs "out")
1747 (assoc-ref inputs "lapack")
1748 (assoc-ref inputs "pt-scotch")))))
1750 'unpack 'remove-broken-symlinks
1752 (for-each delete-file
1753 (find-files "MAKE_INC" "\\.#make\\..*")))
1755 'build 'create-install-directories
1756 (lambda* (#:key outputs #:allow-other-keys)
1759 (mkdir-p (string-append (assoc-ref outputs "out")
1761 '("lib" "include")))
1765 (with-directory-excursion "EXAMPLE"
1767 (zero? (system* "mpirun" "-n" "2"
1768 "./pddrive" "-r" "1" "-c" "2" "g20.rua"))
1769 (zero? (system* "mpirun" "-n" "2"
1770 "./pzdrive" "-r" "1" "-c" "2" "cg20.cua")))))
1773 (lambda* (#:key outputs #:allow-other-keys)
1774 ;; Library is placed in lib during the build phase. Copy over
1775 ;; headers to include.
1776 (let* ((out (assoc-ref outputs "out"))
1777 (incdir (string-append out "/include")))
1778 (for-each (lambda (file)
1779 (let ((base (basename file)))
1780 (format #t "installing `~a' to `~a'~%"
1783 (string-append incdir "/" base))))
1784 (find-files "SRC" ".*\\.h$"))))
1785 %standard-phases)))))))
1786 (home-page (package-home-page superlu))
1787 (synopsis "Parallel supernodal direct solver")
1789 "SuperLU_DIST is a parallel extension to the serial SuperLU library.
1790 It is targeted for distributed memory parallel machines. SuperLU_DIST is
1791 implemented in ANSI C, and MPI for communications.")
1792 (license license:bsd-3)))
1794 (define-public scotch
1801 (uri (string-append "https://gforge.inria.fr/frs/download.php/34618/"
1802 "scotch_" version ".tar.gz"))
1804 (base32 "1ir088mvrqggyqdkx9qfynmiaffqbyih5qfl5mga2nrlm1qlsgzm"))
1805 (patches (search-patches "scotch-test-threading.patch"
1806 "pt-scotch-build-parallelism.patch"))))
1807 (build-system gnu-build-system)
1810 ("flex" ,flex-2.6.1) ; A bug in flex prevents building with flex-2.6.3.
1814 (modify-phases %standard-phases
1816 'unpack 'chdir-to-src
1817 (lambda _ (chdir "src")))
1821 (call-with-output-file "Makefile.inc"
1835 CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
1836 LDFLAGS = -lz -lm -lrt -lpthread
1838 LEX = flex -Pscotchyy -olex.yy.c
1843 YACC = bison -pscotchyy -y -b y
1845 '("COMMON_FILE_COMPRESS_GZ"
1847 "COMMON_RANDOM_FIXED_SEED"
1848 ;; Prevents symbolc clashes with libesmumps
1850 ;; XXX: Causes invalid frees in superlu-dist tests
1852 ;; "SCOTCH_PTHREAD_NUMBER=2"
1853 "restrict=__restrict"))))))
1855 'build 'build-esmumps
1857 (zero? (system* "make"
1858 (format #f "-j~a" (parallel-job-count))
1862 (lambda* (#:key outputs #:allow-other-keys)
1863 (let ((out (assoc-ref outputs "out")))
1865 (zero? (system* "make"
1866 (string-append "prefix=" out)
1868 ;; esmumps files are not installed with the above
1869 (for-each (lambda (f)
1870 (copy-file f (string-append out "/include/" f)))
1871 (find-files "../include" ".*esmumps.h$"))
1872 (for-each (lambda (f)
1873 (copy-file f (string-append out "/lib/" f)))
1874 (find-files "../lib" "^lib.*esmumps.*"))))))))
1875 (home-page "http://www.labri.fr/perso/pelegrin/scotch/")
1876 (synopsis "Programs and libraries for graph algorithms")
1877 (description "SCOTCH is a set of programs and libraries which implement
1878 the static mapping and sparse matrix reordering algorithms developed within
1879 the SCOTCH project. Its purpose is to apply graph theory, with a divide and
1880 conquer approach, to scientific computing problems such as graph and mesh
1881 partitioning, static mapping, and sparse matrix ordering, in application
1882 domains ranging from structural mechanics to operating systems or
1884 ;; See LICENSE_en.txt
1885 (license license:cecill-c)))
1887 (define-public pt-scotch
1888 (package (inherit scotch)
1891 `(("openmpi" ,openmpi))) ;Headers include MPI headers
1893 (substitute-keyword-arguments (package-arguments scotch)
1894 ((#:phases scotch-phases)
1895 `(modify-phases ,scotch-phases
1900 (zero? (system* "make"
1901 (format #f "-j~a" (parallel-job-count))
1902 "ptscotch" "ptesmumps"))
1903 ;; Install the serial metis compatibility library
1904 (zero? (system* "make" "-C" "libscotchmetis" "install")))))
1907 (lambda _ (zero? (system* "make" "ptcheck"))))))))
1908 (synopsis "Programs and libraries for graph algorithms (with MPI)")))
1910 (define-public metis
1917 (uri (string-append "http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/"
1918 "metis-" version ".tar.gz"))
1921 "1cjxgh41r8k6j029yxs8msp3z6lcnpm16g5pvckk35kc7zhfpykn"))))
1922 (build-system cmake-build-system)
1924 `(("blas" ,openblas)))
1926 `(#:tests? #f ;no tests
1927 #:configure-flags `("-DSHARED=ON"
1928 ,(string-append "-DGKLIB_PATH=" (getcwd)
1929 "/metis-" ,version "/GKlib"))))
1930 (home-page "http://glaros.dtc.umn.edu/gkhome/metis/metis/overview")
1931 (synopsis "Graph partitioning and fill-reducing matrix ordering library")
1933 "METIS is a set of serial programs for partitioning graphs, partitioning
1934 finite element meshes, and producing fill-reducing orderings for sparse
1935 matrices. The algorithms implemented in METIS are based on the multilevel
1936 recursive-bisection, multilevel k-way, and multi-constraint partitioning
1938 (license license:asl2.0))) ;As of version 5.0.3
1940 (define-public p4est
1947 (uri (string-append "http://p4est.github.io/release/p4est-"
1951 "0faina2h5qsx3m2izbzaj9bbakma1krbbjmq43wrp1hcbyijflqb"))))
1952 (build-system gnu-build-system)
1954 `(("fortran" ,gfortran)
1959 `(#:configure-flags `(,(string-append "BLAS_LIBS=-L"
1960 (assoc-ref %build-inputs "blas")
1962 ,(string-append "LAPACK_LIBS=-L"
1963 (assoc-ref %build-inputs "lapack")
1965 (home-page "http://www.p4est.org")
1966 (synopsis "Adaptive mesh refinement on forests of octrees")
1968 "The p4est software library enables the dynamic management of a
1969 collection of adaptive octrees, conveniently called a forest of octrees.
1970 p4est is designed to work in parallel and scales to hundreds of thousands of
1972 (license license:gpl2+)))
1974 (define-public p4est-openmpi
1975 (package (inherit p4est)
1976 (name "p4est-openmpi")
1979 ,@(package-inputs p4est)))
1981 (substitute-keyword-arguments (package-arguments p4est)
1982 ((#:configure-flags cf)
1983 ``("--enable-mpi" ,@,cf))))
1984 (synopsis "Parallel adaptive mesh refinement on forests of octrees")))
1986 (define-public gsegrafix
1993 (uri (string-append "mirror://gnu/" name "/" name "-"
1997 "1b13hvx063zv970y750bx41wpx6hwd5ngjhbdrna8w8yy5kmxcda"))))
1998 (build-system gnu-build-system)
2000 `(#:configure-flags '("LDFLAGS=-lm")))
2002 `(("libgnomecanvas" ,libgnomecanvas)
2003 ("libbonoboui" ,libbonoboui)
2004 ("libgnomeui" ,libgnomeui)
2005 ("libgnomeprintui" ,libgnomeprintui)
2008 `(("pkg-config" ,pkg-config)))
2009 (home-page "https://www.gnu.org/software/gsegrafix/")
2010 (synopsis "GNOME application to create scientific and engineering plots")
2011 (description "GSEGrafix is an application which produces high-quality graphical
2012 plots for science and engineering. Plots are specified via simple ASCII
2013 parameter files and data files and are presented in an anti-aliased GNOME
2014 canvas. The program supports rectangular two-dimensional plots, histograms,
2015 polar-axis plots and three-dimensional plots. Plots can be printed or saved
2016 to BMP, JPEG or PNG image formats.")
2017 (license license:gpl3+)))
2019 (define-public maxima
2026 (uri (string-append "mirror://sourceforge/maxima/Maxima-source/"
2027 version "-source/" name "-" version ".tar.gz"))
2030 "1cvignn5y6qzrby6qb885yc8zdcdqdr1d50vcvc3gapw2f0gk3zm"))
2031 (patches (search-patches "maxima-defsystem-mkdir.patch"))))
2032 (build-system gnu-build-system)
2035 ("gnuplot" ,gnuplot) ;for plots
2036 ("tk" ,tk))) ;Tcl/Tk is used by 'xmaxima'
2038 `(("texinfo" ,texinfo)
2040 ("python" ,python)))
2043 (list "--enable-gcl"
2044 (string-append "--with-posix-shell="
2045 (assoc-ref %build-inputs "bash")
2047 (string-append "--with-wish="
2048 (assoc-ref %build-inputs "tk")
2050 (let ((v ,(package-version tk)))
2051 (string-take v (string-index-right v #\.)))))
2052 ;; By default Maxima attempts to write temporary files to
2053 ;; '/tmp/nix-build-maxima-*', which won't exist at run time.
2054 ;; Work around that.
2055 #:make-flags (list "TMPDIR=/tmp")
2056 #:phases (alist-cons-before
2059 (chmod "src/maxima" #o555))
2060 ;; Make sure the doc and emacs files are found in the
2061 ;; standard location. Also configure maxima to find gnuplot
2062 ;; without having it on the PATH.
2064 'install 'post-install
2065 (lambda* (#:key outputs inputs #:allow-other-keys)
2066 (let* ((gnuplot (assoc-ref inputs "gnuplot"))
2067 (out (assoc-ref outputs "out"))
2068 (datadir (string-append out "/share/maxima/" ,version)))
2069 (with-directory-excursion out
2070 (mkdir-p "share/emacs")
2071 (mkdir-p "share/doc")
2073 (string-append datadir "/emacs/")
2074 (string-append out "/share/emacs/site-lisp"))
2076 (string-append datadir "/doc/")
2077 (string-append out "/share/doc/maxima"))
2078 (with-atomic-file-replacement
2079 (string-append datadir "/share/maxima-init.lisp")
2081 (format out "~a ~s~a~%"
2082 "(setf $gnuplot_command "
2083 (string-append gnuplot "/bin/gnuplot") ")")
2084 (dump-port in out))))))
2085 %standard-phases))))
2086 (home-page "http://maxima.sourceforge.net")
2087 (synopsis "Numeric and symbolic expression manipulation")
2088 (description "Maxima is a system for the manipulation of symbolic and
2089 numerical expressions. It yields high precision numeric results by using
2090 exact fractions, arbitrary precision integers, and variable precision floating
2092 ;; Some files are lgpl2.1+. Some are gpl2+. Some explicitly state gpl1+.
2093 ;; Others simply say "GNU General Public License" without stating a
2094 ;; version (which implicitly means gpl1+).
2095 ;; At least one file (src/maxima.asd) says "version 2."
2096 ;; GPLv2 only is therefore the smallest subset.
2097 (license license:gpl2)))
2099 (define-public wxmaxima
2102 ;; Versions 16.12.0 to 16.12.2 have a bug which causes output lines to
2103 ;; overlap. See <https://debbugs.gnu.org/25793>
2108 (uri (string-append "mirror://sourceforge/wxmaxima/wxMaxima/"
2109 version "/" name "-" version ".tar.gz"))
2112 "1fpqzk1921isiqrpgpf433ldq41924qs9sy99fl1zn5661b2l73n"))))
2113 (build-system gnu-build-system)
2115 `(("wxwidgets" ,wxwidgets)
2118 ("adwaita-icon-theme" ,adwaita-icon-theme)
2120 ("shared-mime-info" ,shared-mime-info)))
2122 `(#:phases (modify-phases %standard-phases
2124 'install 'wrap-program
2125 (lambda* (#:key inputs outputs #:allow-other-keys)
2126 (wrap-program (string-append (assoc-ref outputs "out")
2129 (,(string-append (assoc-ref inputs "maxima")
2131 ;; For GtkFileChooserDialog.
2132 `("GSETTINGS_SCHEMA_DIR" =
2133 (,(string-append (assoc-ref inputs "gtk+")
2134 "/share/glib-2.0/schemas")))
2135 `("XDG_DATA_DIRS" ":" prefix
2136 (;; Needed by gdk-pixbuf to know supported icon formats.
2138 (assoc-ref inputs "shared-mime-info") "/share")
2139 ;; The default icon theme of GTK+.
2141 (assoc-ref inputs "adwaita-icon-theme") "/share"))))
2143 (home-page "https://andrejv.github.io/wxmaxima/")
2144 (synopsis "Graphical user interface for the Maxima computer algebra system")
2146 "wxMaxima is a graphical user interface for the Maxima computer algebra
2147 system. It eases the use of Maxima by making most of its commands available
2148 through a menu system and by providing input dialogs for commands that require
2149 more than one argument. It also implements its own display engine that
2150 outputs mathematical symbols directly instead of depicting them with ASCII
2153 wxMaxima also features 2D and 3D inline plots, simple animations, mixing of
2154 text and mathematical calculations to create documents, exporting of input and
2155 output to TeX, and a browser for Maxima's manual including command index and
2156 full text searching.")
2157 (license license:gpl2+)))
2159 (define-public armadillo
2165 (uri (string-append "mirror://sourceforge/arma/armadillo-"
2169 "1qqzy7dp891j9v7062mv1599hdwr97vqzrd3j2fl8c3gmc00dmzg"))))
2170 (build-system cmake-build-system)
2171 (arguments `(#:tests? #f)) ;no test target
2173 `(("openblas" ,openblas)
2175 ("arpack" ,arpack-ng)))
2176 (home-page "http://arma.sourceforge.net/")
2177 (synopsis "C++ linear algebra library")
2179 "Armadillo is a C++ linear algebra library, aiming towards a good balance
2180 between speed and ease of use. It is useful for algorithm development
2181 directly in C++, or quick conversion of research code into production
2182 environments. It can be used for machine learning, pattern recognition,
2183 signal processing, bioinformatics, statistics, econometrics, etc. The library
2184 provides efficient classes for vectors, matrices and cubes, as well as 150+
2185 associated functions (eg. contiguous and non-contiguous submatrix views).")
2186 (license license:mpl2.0)))
2188 (define-public armadillo-for-rcpparmadillo
2189 (package (inherit armadillo)
2193 (uri (string-append "mirror://sourceforge/arma/armadillo-"
2197 "1dxgfd2r9lbh24nszvqm2lag439s0srxaf1l86f6ww6waqm5r8zk"))))))
2199 (define-public muparser
2200 ;; When switching download sites, muparser re-issued a 2.2.5 release with a
2201 ;; different hash. In order to make `guix package --upgrade` work correctly,
2202 ;; we set a Guix packaging revision.
2203 ;; When the next version of muparser is released, we can remove
2204 ;; UPSTREAM-VERSION and REVISION and use the plain VERSION.
2205 (let ((upstream-version "2.2.5")
2209 (version (string-append upstream-version "-" revision))
2213 (uri (string-append "https://github.com/beltoforion/muparser/archive/v"
2214 upstream-version ".tar.gz"))
2215 (file-name (string-append name "-" version ".tar.gz"))
2218 "0277qsi5l23jsck1vhn383bmvc2n9l4a1dl5r9bf7hvjv9ayyrh6"))))
2219 (build-system gnu-build-system)
2221 `(#:configure-flags '("--enable-samples=no")
2222 #:tests? #f)) ;no "check" target
2223 (home-page "http://muparser.beltoforion.de/")
2224 (synopsis "Fast parser library for mathematical expressions")
2226 "muParser is an extensible high performance math parser library. It is
2227 based on transforming an expression into a bytecode and precalculating constant
2229 (license license:expat))))
2231 (define-public openblas
2238 (uri (string-append "https://github.com/xianyi/OpenBLAS/tarball/v"
2240 (file-name (string-append name "-" version ".tar.gz"))
2243 "071zqnmnxhh0c9phzyn3f198yxa0hjxda7016azdbq2056sm70w7"))))
2244 (build-system gnu-build-system)
2246 `(#:tests? #f ;no "check" target
2247 ;; DYNAMIC_ARCH is only supported on x86. When it is disabled and no
2248 ;; TARGET is specified, OpenBLAS will tune itself to the build host, so
2249 ;; we need to disable substitutions.
2251 ,(let ((system (or (%current-target-system) (%current-system))))
2252 (or (string-prefix? "x86_64" system)
2253 (string-prefix? "i686" system)
2254 (string-prefix? "mips" system)
2255 (string-prefix? "aarch64" system)))
2257 (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
2260 ;; Build the library for all supported CPUs. This allows
2261 ;; switching CPU targets at runtime with the environment variable
2262 ;; OPENBLAS_CORETYPE=<type>, where "type" is a supported CPU type.
2263 ;; Unfortunately, this is not supported on non-x86 architectures,
2264 ;; where it leads to failed builds.
2265 ,@(let ((system (or (%current-target-system) (%current-system))))
2267 ((or (string-prefix? "x86_64" system)
2268 (string-prefix? "i686" system))
2269 '("DYNAMIC_ARCH=1"))
2270 ;; On MIPS we force the "SICORTEX" TARGET, as for the other
2271 ;; two available MIPS targets special extended instructions
2272 ;; for Loongson cores are used.
2273 ((string-prefix? "mips" system)
2274 '("TARGET=SICORTEX"))
2275 ;; On aarch64 force the generic 'armv8-a' target
2276 ((string-prefix? "aarch64" system)
2279 ;; no configure script
2280 #:phases (alist-delete 'configure %standard-phases)))
2282 `(("fortran" ,gfortran)))
2286 (home-page "http://www.openblas.net/")
2287 (synopsis "Optimized BLAS library based on GotoBLAS")
2289 "OpenBLAS is a BLAS library forked from the GotoBLAS2-1.13 BSD version.")
2290 (license license:bsd-3)))
2292 (define-public openlibm
2299 (uri (string-append "https://github.com/JuliaLang/openlibm/archive/v"
2301 (file-name (string-append name "-" version ".tar.gz"))
2304 "11czx2z7nh6dfpz45s3xl7v38hw36jxzxfvny454bk3if14pfakq"))))
2305 (build-system gnu-build-system)
2308 (list (string-append "prefix=" (assoc-ref %outputs "out")))
2310 ;; no configure script
2311 (alist-delete 'configure %standard-phases)
2312 #:tests? #f)) ;the tests are part of the default target
2313 (home-page "http://openlibm.org/")
2314 (synopsis "Portable C mathematical library (libm)")
2316 "OpenLibm is an effort to have a high quality, portable, standalone C
2317 mathematical library (libm). It can be used standalone in applications and
2318 programming language implementations. The project was born out of a need to
2319 have a good libm for the Julia programming language that worked consistently
2320 across compilers and operating systems, and in 32-bit and 64-bit
2322 ;; Each architecture has its own make target, and there is none for mips.
2323 (supported-systems (delete "mips64el-linux" %supported-systems))
2324 ;; See LICENSE.md for details.
2325 (license (list license:expat
2328 license:public-domain
2329 license:lgpl2.1+))))
2331 (define-public openspecfun
2333 (name "openspecfun")
2338 (uri (string-append "https://github.com/JuliaLang/openspecfun/archive/v"
2340 (file-name (string-append name "-" version ".tar.gz"))
2343 "1y5b2h6f2k72536kym3vzy3li3bhpd23x463g7hdmjdi3cncavz1"))))
2344 (build-system gnu-build-system)
2346 '(#:tests? #f ;no "check" target
2348 (list (string-append "prefix=" (assoc-ref %outputs "out")))
2349 ;; no configure script
2350 #:phases (alist-delete 'configure %standard-phases)))
2352 `(("fortran" ,gfortran)))
2353 (home-page "https://github.com/JuliaLang/openspecfun")
2354 (synopsis "Collection of special mathematical functions")
2356 "Openspecfun provides AMOS and Faddeeva. AMOS (from Netlib) is a
2357 portable package for Bessel Functions of a Complex Argument and Nonnegative
2358 Order; it contains subroutines for computing Bessel functions and Airy
2359 functions. Faddeeva allows computing the various error functions of arbitrary
2360 complex arguments (Faddeeva function, error function, complementary error
2361 function, scaled complementary error function, imaginary error function, and
2362 Dawson function); given these, one can also easily compute Voigt functions,
2363 Fresnel integrals, and similar related functions as well.")
2364 ;; Faddeeva is released under the Expat license; AMOS is included as
2365 ;; public domain software.
2366 (license (list license:expat license:public-domain))))
2368 (define-public suitesparse
2370 (name "suitesparse")
2376 "http://faculty.cse.tamu.edu/davis/SuiteSparse/SuiteSparse-"
2380 "100hdzr0mf4mzlwnqpmwpfw4pymgsf9n3g0ywb1yps2nk1zbkdy5"))))
2381 (build-system gnu-build-system)
2383 '(#:parallel-build? #f ;cholmod build fails otherwise
2384 #:tests? #f ;no "check" target
2389 "CHOLMOD_CONFIG=-DNPARTITION" ;required when METIS is not used
2390 (string-append "INSTALL_LIB="
2391 (assoc-ref %outputs "out") "/lib")
2392 (string-append "INSTALL_INCLUDE="
2393 (assoc-ref %outputs "out") "/include"))
2396 'install 'prepare-out
2397 ;; README.txt states that the target directories must exist prior to
2398 ;; running "make install".
2400 (mkdir-p (string-append (assoc-ref %outputs "out") "/lib"))
2401 (mkdir-p (string-append (assoc-ref %outputs "out") "/include")))
2402 ;; no configure script
2403 (alist-delete 'configure %standard-phases))))
2406 ("lapack" ,lapack)))
2407 (home-page "http://faculty.cse.tamu.edu/davis/suitesparse.html")
2408 (synopsis "Suite of sparse matrix software")
2410 "SuiteSparse is a suite of sparse matrix algorithms, including: UMFPACK,
2411 multifrontal LU factorization; CHOLMOD, supernodal Cholesky; SPQR,
2412 multifrontal QR; KLU and BTF, sparse LU factorization, well-suited for circuit
2413 simulation; ordering methods (AMD, CAMD, COLAMD, and CCOLAMD); CSparse and
2414 CXSparse, a concise sparse Cholesky factorization package; and many other
2417 ;; AMD, CAMD, BTF, COLAMD, CCOLAMD, CSparse, CXSparse, KLU, LDL
2419 ;; GPUQREngine, RBio, SuiteSparse_GPURuntime, SuiteSparseQR, UMFPACK
2420 (license (list license:gpl2+ license:lgpl2.1+))))
2422 (define-public atlas
2428 (uri (string-append "mirror://sourceforge/math-atlas/Stable/"
2429 version "/atlas" version ".tar.bz2"))
2432 "1dyjlq3fiparvm8ypwk6rsmjzmnwk81l88gkishphpvc79ryp216"))))
2433 (build-system gnu-build-system)
2434 (home-page "http://math-atlas.sourceforge.net/")
2435 (inputs `(("gfortran" ,gfortran)
2436 ("lapack-tar" ,(package-source lapack))))
2437 (outputs '("out" "doc"))
2438 ;; For the moment we drop support for MIPS at it fails to compile. See
2439 ;; https://lists.gnu.org/archive/html/guix-devel/2014-11/msg00516.html
2440 (supported-systems (delete "mips64el-linux" %supported-systems))
2442 `(#:parallel-build? #f
2443 #:parallel-tests? #f
2445 ;; ATLAS tunes itself for the machine it is built on, as explained at
2446 ;; <http://lists.gnu.org/archive/html/guix-devel/2014-10/msg00305.html>.
2447 ;; For this reason, we want users to build it locally instead of using
2451 #:modules ((srfi srfi-26)
2453 (guix build gnu-build-system)
2456 `(;; Generate position independent code suitable for dynamic libraries
2457 ;; and use WALL timer to get more accurate timing.
2458 "-Fa" "alg" "-fPIC" "-D" "c" "-DWALL"
2461 ,,(if (string-match "64" (%current-system))
2464 ;; Disable parallel build as it gives errors: atlas_pthread.h is
2465 ;; needed to compile C files before it is generated.
2466 "-Ss" "pmake" "make -j 1"
2467 ;; Probe is failing for MIPS. We therefore define the system
2468 ;; architecture explicitly by setting (-A) MACHINETYPE = 49
2469 ;; 'MIPSR1xK' and (-V) ISA = 1 'none'.
2470 ,,@(if (string-prefix? "mips" (%current-system))
2471 (list "-A" "49" "-V" "1")
2473 ;; Generate shared libraries.
2475 ;; Build a full LAPACK library.
2476 ,(string-append "--with-netlib-lapack-tarfile="
2477 (assoc-ref %build-inputs "lapack-tar")))
2479 (modify-phases %standard-phases
2480 (add-after 'install 'install-doc
2481 (lambda* (#:key outputs inputs #:allow-other-keys)
2482 (let ((doc (string-append (assoc-ref outputs "doc")
2483 "/share/doc/atlas")))
2485 (fold (lambda (file previous)
2486 (and previous (zero? (system* "cp" file doc))))
2487 #t (find-files "../ATLAS/doc" ".*")))))
2488 (add-after 'check 'check-pt
2489 (lambda _ (zero? (system* "make" "ptcheck"))))
2490 ;; Fix files required to run configure.
2491 (add-before 'configure 'fix-/bin/sh
2493 ;; Use `sh', not `/bin/sh'.
2494 (substitute* (find-files "." "Makefile|configure|SpewMakeInc\\.c")
2497 ;; Fix /bin/sh in generated make files.
2498 (add-after 'configure 'fix-/bin/sh-in-generated-files
2500 (substitute* (find-files "." "^[Mm]ake\\.inc.*")
2503 ;; ATLAS configure program does not accepts the default flags
2504 ;; passed by the 'gnu-build-system'.
2506 (lambda* (#:key native-inputs inputs outputs
2507 (configure-flags '())
2508 #:allow-other-keys #:rest args)
2509 (let* ((prefix (assoc-ref outputs "out"))
2510 (bash (or (and=> (assoc-ref
2511 (or native-inputs inputs) "bash")
2512 (cut string-append <> "/bin/bash"))
2514 (flags `(,(string-append "--prefix=" prefix)
2516 (abs-srcdir (getcwd))
2517 (srcdir (string-append "../" (basename abs-srcdir))))
2518 (format #t "source directory: ~s (relative from build: ~s)~%"
2522 (format #t "build directory: ~s~%" (getcwd))
2523 (format #t "configure flags: ~s~%" flags)
2524 (zero? (apply system* bash
2525 (string-append srcdir "/configure")
2527 (synopsis "Automatically Tuned Linear Algebra Software")
2529 "ATLAS is an automatically tuned linear algebra software library
2530 providing C and Fortran77 interfaces to a portably efficient BLAS
2531 implementation, as well as a few routines from LAPACK.
2533 Optimization occurs at build time. For this reason, the library is built on
2534 the machine where it is installed, without resorting to pre-built substitutes.
2536 Before building the library, CPU throttling should be disabled. This can be
2537 done in the BIOS, or, on GNU/Linux, with the following command:
2540 # cpupower --governor performance
2543 Failure to do so will result in a library with poor performance.")
2544 (license license:bsd-3)))
2553 (uri (string-append "mirror://sourceforge/ogl-math/glm-" version
2554 "/glm-" version ".zip"))
2557 "1cnjmi033a16a95v6xfkr1bvfmkd26hzdjka8j1819hgn5b1nr8l"))))
2558 (build-system cmake-build-system)
2560 `(("unzip" ,unzip)))
2561 (home-page "http://glm.g-truc.net")
2562 (synopsis "OpenGL Mathematics library")
2563 (description "OpenGL Mathematics (GLM) is a header-only C++ mathematics
2564 library for graphics software based on the OpenGL Shading Language (GLSL)
2566 (license license:expat)))
2568 (define-public lpsolve
2575 (uri (string-append "mirror://sourceforge/lpsolve/lpsolve/" version
2576 "/lp_solve_" version "_source.tar.gz"))
2579 "176c7f023mb6b8bfmv4rfqnrlw88lsg422ca74zjh19i2h5s69sq"))
2580 (modules '((guix build utils)))
2582 '(substitute* (list "lp_solve/ccc" "lpsolve55/ccc")
2584 ;; Pretend to be on a 64 bit platform to obtain a common directory
2585 ;; name for the build results on all architectures; nothing else
2586 ;; seems to depend on it.
2587 (("^PLATFORM=.*$") "PLATFORM=ux64\n")
2589 ;; The check for 'isnan' as it is written fails with
2590 ;; "non-floating-point argument in call to function
2591 ;; ‘__builtin_isnan’", which leads to the 'NOISNAN' cpp macro
2592 ;; definition, which in turn leads to bad things. Fix the feature
2594 (("isnan\\(0\\)") "isnan(0.)")))))
2595 (build-system gnu-build-system)
2597 `(#:tests? #f ; no check target
2599 (modify-phases %standard-phases
2603 (and (with-directory-excursion "lpsolve55"
2604 (zero? (system* "bash" "ccc")))
2605 (with-directory-excursion "lp_solve"
2606 (zero? (system* "bash" "ccc"))))))
2608 (lambda* (#:key outputs #:allow-other-keys)
2609 (let* ((out (assoc-ref outputs "out"))
2610 (bin (string-append out "/bin"))
2611 (lib (string-append out "/lib"))
2612 ;; This is where LibreOffice expects to find the header
2613 ;; files, and where they are installed by Debian.
2614 (include (string-append out "/include/lpsolve")))
2616 (copy-file "lpsolve55/bin/ux64/liblpsolve55.a"
2617 (string-append lib "/liblpsolve55.a"))
2618 (copy-file "lpsolve55/bin/ux64/liblpsolve55.so"
2619 (string-append lib "/liblpsolve55.so"))
2620 (install-file "lp_solve/bin/ux64/lp_solve" bin)
2622 ;; Install a subset of the header files as on Debian
2623 ;; (plus lp_bit.h, which matches the regular expression).
2624 (for-each (lambda (name)
2625 (install-file name include))
2626 (find-files "." "lp_[HMSa-z].*\\.h$"))
2627 (with-directory-excursion "shared"
2628 (for-each (lambda (name)
2629 (install-file name include))
2630 (find-files "." "\\.h$")))
2632 (home-page "http://lpsolve.sourceforge.net/")
2633 (synopsis "Mixed integer linear programming (MILP) solver")
2635 "lp_solve is a mixed integer linear programming solver based on the
2636 revised simplex and the branch-and-bound methods.")
2637 (license license:lgpl2.1+)))
2639 (define-public dealii
2646 (uri (string-append "https://github.com/dealii/dealii/releases/"
2647 "download/v" version "/dealii-" version ".tar.gz"))
2650 "1bdksvvyp1rj37df1ndh8j3x9nzpc3sazw8nd0hzvnlw0qnyk800"))
2651 (modules '((guix build utils)))
2653 ;; Remove bundled sources: UMFPACK, TBB, muParser, and boost
2654 '(delete-file-recursively "bundled"))))
2655 (build-system cmake-build-system)
2663 ("arpack" ,arpack-ng)
2664 ("muparser" ,muparser)
2665 ("gfortran" ,gfortran)
2666 ("suitesparse" ,suitesparse))) ;for UMFPACK
2668 `(#:build-type "DebugRelease" ;only supports Release, Debug, or DebugRelease
2669 #:configure-flags '("-DCOMPAT_FILES=OFF") ;Follow new directory structure
2670 #:phases (modify-phases %standard-phases
2672 'install 'hint-example-prefix
2673 ;; Set Cmake hints in examples so that they can find this
2674 ;; deal.II when configuring.
2675 (lambda* (#:key outputs #:allow-other-keys)
2676 (let* ((out (assoc-ref %outputs "out"))
2677 (exmpl (string-append out "/share/doc"
2678 "/dealii/examples")))
2679 (substitute* (find-files exmpl "CMakeLists.txt")
2680 (("([[:space:]]*HINTS.*)\n" _ line)
2681 (string-append line " $ENV{HOME}/.guix-profile "
2684 (home-page "https://www.dealii.org")
2685 (synopsis "Finite element library")
2687 "Deal.II is a C++ program library targeted at the computational solution
2688 of partial differential equations using adaptive finite elements. The main
2689 aim of deal.II is to enable rapid development of modern finite element codes,
2690 using among other aspects adaptive meshes and a wide array of tools often used
2691 in finite element programs.")
2692 (license license:lgpl2.1+)))
2694 (define-public dealii-openmpi
2695 (package (inherit dealii)
2696 (name "dealii-openmpi")
2699 ;;Supported only with MPI:
2700 ("p4est" ,p4est-openmpi)
2701 ("petsc" ,petsc-openmpi)
2702 ("slepc" ,slepc-openmpi)
2703 ("metis" ,metis) ;for MUMPS
2704 ("scalapack" ,scalapack) ;for MUMPS
2705 ("mumps" ,mumps-metis-openmpi) ;configure supports only metis orderings
2706 ("arpack" ,arpack-ng-openmpi)
2707 ,@(fold alist-delete (package-inputs dealii)
2708 '("p4est" "arpack"))))
2710 (substitute-keyword-arguments (package-arguments dealii)
2711 ((#:configure-flags cf)
2712 ``("-DMPI_C_COMPILER=mpicc"
2713 "-DMPI_CXX_COMPILER=mpicxx"
2714 "-DMPI_Fortran_COMPILER=mpifort"
2716 (synopsis "Finite element library (with MPI support)")))
2718 (define-public flann
2727 "http://www.cs.ubc.ca/research/flann/uploads/FLANN/flann-"
2728 version "-src.zip"))
2731 "022w8hph7bli5zbpnk3z1qh1c2sl5hm8fw2ccim651ynn0hr7fyz"))))
2732 (build-system cmake-build-system)
2734 `(("unzip" ,unzip)))
2738 ("python" ,python-2) ; print syntax
2739 ;; ("python2-numpy" ,python2-numpy) ; only required for the tests
2742 `(;; The 'share/flann/octave' contains a .mex file, which is an ELF file
2743 ;; taken 46 MiB unstripped, and 6 MiB stripped.
2744 #:strip-directories '("lib" "lib64" "libexec"
2745 "bin" "sbin" "share/flann/octave")
2747 ;; Save 12 MiB by not installing .a files. Passing
2748 ;; '-DBUILD_STATIC_LIBS=OFF' has no effect.
2749 #:phases (modify-phases %standard-phases
2750 (add-after 'install 'remove-static-libraries
2751 (lambda* (#:key outputs #:allow-other-keys)
2752 (let* ((out (assoc-ref outputs "out"))
2753 (lib (string-append out "/lib")))
2754 (for-each delete-file
2755 (find-files lib "\\.a$"))
2758 #:tests? #f)) ; The test data are downloaded from the Internet.
2759 (home-page "http://www.cs.ubc.ca/research/flann/")
2760 (synopsis "Library for approximate nearest neighbors computation")
2761 (description "FLANN is a library for performing fast approximate
2762 nearest neighbor searches in high dimensional spaces. It implements a
2763 collection of algorithms and a system for automatically choosing the best
2764 algorithm and optimum parameters depending on the dataset.
2766 FLANN is written in C++ and contains bindings for C, Octave and Python.")
2767 (license (license:non-copyleft "file://COPYING"
2768 "See COPYING in the distribution."))))
2770 (define-public wcalc
2777 (uri (string-append "mirror://sourceforge/w-calc/Wcalc/" version "/"
2778 "wcalc-" version ".tar.bz2"))
2781 "1vi8dl6rccqiq1apmpwawyg2ywx6a1ic1d3cvkf2hlwk1z11fb0f"))))
2782 (build-system gnu-build-system)
2785 ("readline" ,readline)))
2786 (home-page "http://w-calc.sourceforge.net/index.php")
2787 (synopsis "Flexible command-line scientific calculator")
2788 (description "Wcalc is a very capable calculator. It has standard functions
2789 (sin, asin, and sinh for example, in either radians or degrees), many
2790 pre-defined constants (pi, e, c, etc.), support for using variables, \"active\"
2791 variables, a command history, hex/octal/binary input and output, unit
2792 conversions, embedded comments, and an expandable expression entry field. It
2793 evaluates expressions using the standard order of operations.")
2794 (license license:gpl2+)))
2802 (uri (string-append "mirror://sourceforge/xaos/XaoS/" version
2803 "/xaos-" version ".tar.gz"))
2806 "15cd1cx1dyygw6g2nhjqq3bsfdj8sj8m4va9n75i0f3ryww3x7wq"))))
2807 (build-system gnu-build-system)
2808 (native-inputs `(("gettext" ,gettext-minimal)))
2809 (inputs `(("libx11" ,libx11)
2814 `(#:tests? #f ;no "check" target
2815 #:make-flags '("LOCALEDIR=$DATAROOTDIR/locale")))
2816 (synopsis "Real-time fractal zoomer")
2817 (description "GNU XaoS is a graphical program that generates fractal
2818 patterns and allows you to zoom in and out of them infinitely in a fluid,
2819 continuous manner. It also includes tutorials that help to explain how fractals
2820 are built. It can generate many different fractal types such as the Mandelbrot
2822 (home-page "https://www.gnu.org/software/xaos/")
2823 (license license:gpl2+)))
2825 (define-public hypre
2831 (uri (string-append "https://github.com/LLNL/hypre/archive/"
2832 "v" version ".tar.gz"))
2833 (file-name (string-append name "-" version ".tar.gz"))
2836 "0q69ia0jivzcr8p049dn3mg8yjpn6nwq4sw9iqac8vr63vi54l6m"))
2837 (modules '((guix build utils)))
2840 ;; Remove use of __DATE__ and __TIME__ for reproducibility;
2841 ;; substitute the tarball creation time.
2842 (substitute* "src/utilities/HYPRE_utilities.h"
2843 (("Date Compiled: .*$")
2844 "Date Compiled: Mar 28 2016 20:19:59 +0000\"\n"))
2846 (build-system gnu-build-system)
2847 (outputs '("out" ;6.1 MiB of headers and libraries
2848 "doc")) ;4.8 MiB of documentation
2852 ("texlive" ,texlive) ;full package required for fonts
2853 ("ghostscript" ,ghostscript)))
2855 `(("blas" ,openblas)
2856 ("lapack" ,lapack)))
2858 `(#:modules ((srfi srfi-1)
2859 ,@%gnu-build-system-modules)
2860 #:configure-flags '("--enable-shared"
2868 (modify-phases %standard-phases
2869 (add-before 'configure 'chdir-src
2870 (lambda _ (chdir "src")))
2872 (lambda* (#:key build target configure-flags
2873 #:allow-other-keys #:rest args)
2874 (let* ((configure (assoc-ref %standard-phases 'configure)))
2877 (list #:configure-flags
2878 (cons (string-append
2879 "--host=" (or target build))
2880 configure-flags)))))))
2881 (add-after 'build 'build-docs
2883 (zero? (system* "make" "-Cdocs" "pdf" "html"))))
2886 (setenv "LD_LIBRARY_PATH" (string-append (getcwd) "/hypre/lib"))
2887 (setenv "PATH" (string-append "." ":" (getenv "PATH")))
2888 (and (system* "make" "check" "CHECKRUN=")
2889 (fold (lambda (filename result)
2891 (let ((size (stat:size (stat filename))))
2892 (when (not (zero? size))
2893 (format #t "~a size ~d; error indication~%"
2897 (find-files "test" ".*\\.err$")))))
2898 (add-after 'install 'install-docs
2899 (lambda* (#:key outputs #:allow-other-keys)
2900 ;; Custom install because docs/Makefile doesn't honor ${docdir}.
2901 (let* ((doc (assoc-ref outputs "doc"))
2902 (docdir (string-append doc "/share/doc/hypre-" ,version)))
2903 (with-directory-excursion "docs"
2904 (for-each (lambda (base)
2905 (install-file (string-append base ".pdf") docdir)
2906 (copy-recursively base docdir)) ;html docs
2907 '("HYPRE_usr_manual"
2908 "HYPRE_ref_manual")))
2910 (home-page "http://www.llnl.gov/casc/hypre/")
2911 (synopsis "Library of solvers and preconditioners for linear equations")
2913 "HYPRE is a software library of high performance preconditioners and
2914 solvers for the solution of large, sparse linear systems of equations. It
2915 features multigrid solvers for both structured and unstructured grid
2917 (license license:lgpl2.1)))
2919 (define-public hypre-openmpi
2920 (package (inherit hypre)
2921 (name "hypre-openmpi")
2924 ,@(package-inputs hypre)))
2926 (substitute-keyword-arguments (package-arguments hypre)
2927 ((#:configure-flags flags)
2929 ,@(delete "--without-MPI" ,flags)))))
2930 (synopsis "Parallel solvers and preconditioners for linear equations")
2932 "HYPRE is a software library of high performance preconditioners and
2933 solvers for the solution of large, sparse linear systems of equations on
2934 parallel computers. It features parallel multigrid solvers for both
2935 structured and unstructured grid problems.")))
2937 (define-public matio
2944 (uri (string-append "mirror://sourceforge/matio/matio/" version "/"
2945 "matio-" version ".tar.gz"))
2948 "0y2qymgxank8wdiwc68ap8bxdzrhvyw86i29yh3xgn4z1njfd9ir"))))
2949 (build-system gnu-build-system)
2953 (home-page "http://matio.sourceforge.net/")
2954 (synopsis "Library for reading and writing MAT files")
2955 (description "Matio is a library for reading and writing MAT files. It
2956 supports compressed MAT files, as well as newer (version 7.3) MAT files.")
2957 (license license:bsd-2)))
2959 (define-public libhilbert
2966 (uri (string-append "http://web.cs.dal.ca/~chamilto/hilbert/"
2967 "libhilbert-" version ".tar.gz"))
2970 "0v48x8405dj95gjn2saja4bzhw86d6zl6d3dg8h7dzac2qr97s34"))))
2971 (build-system gnu-build-system)
2972 (home-page "http://web.cs.dal.ca/~chamilto/hilbert")
2973 (synopsis "Hilbert indices for multidimensional data")
2974 (description "The libhilbert library can efficiently calculate Hilbert
2975 curves and order-preserving representations of Hilbert curve indices that use
2976 the same amount of space as the original point representation. This is useful
2977 when using the Gilbert curve as a space filling curve through a
2978 high-dimensional space where not all demensions have the same cardinality.")
2979 (license license:lgpl2.1+)))
2986 (origin (method url-fetch)
2987 (uri (string-append "https://github.com/VcDevel/Vc/releases/"
2988 "download/" version "/Vc-" version ".tar.gz"))
2991 "1rh6dhqar3y07n4xqyml0sa0v48qv3ch9dc3yc2in855hlh4vnqi"))))
2992 (build-system cmake-build-system)
2995 '("-DBUILD_TESTING=ON")))
2996 (synopsis "SIMD vector classes for C++")
2997 (description "Vc provides portable, zero-overhead C++ types for explicitly
2998 data-parallel programming. It is a library designed to ease explicit
2999 vectorization of C++ code. Its types enable explicitly stating data-parallel
3000 operations on multiple values. The parallelism is therefore added via the type
3001 system. Vc has an intuitive API and provides portability between different
3002 compilers and compiler versions as well as portability between different vector
3003 instruction sets. Thus, an application written with Vc can be compiled for:
3006 @item SSE2 upto SSE4.2 or SSE4a
3009 @item NEON (in development)
3010 @item NVIDIA GPUs / CUDA (in development)
3012 (home-page "https://github.com/VcDevel/Vc")
3013 (license license:bsd-3)))
3015 (define-public reducelcs
3016 ;; This is the last commit which is available upstream, no
3017 ;; release happened since 2010.
3018 (let ((commit "474f88deb968061abe8cf11c959e02319b8ae5c0")
3022 (version (string-append "1.0-" revision "." (string-take commit 7)))
3027 (url "https://github.com/gdv/Reduce-Expand-for-LCS")
3029 (file-name (string-append name "-" version "-checkout"))
3032 "1rllzcfwc042c336mhq262a8ha90x6afq30kvk60r7i4761j4yjm"))))
3033 (build-system gnu-build-system)
3035 `(("openlibm" ,openlibm)))
3037 `(#:tests? #f ; no tests
3039 (modify-phases %standard-phases
3040 (delete 'configure) ; No configure script exists.
3041 (replace 'install ; No install phase exists.
3042 (lambda* (#:key outputs #:allow-other-keys)
3043 (let* ((out (assoc-ref outputs "out"))
3044 (bin (string-append out "/bin")))
3045 (install-file "Approximation" bin)
3046 (install-file "CollectResults" bin)
3047 (install-file "GenerateInstances" bin)
3049 (synopsis "Approximate Longest Commons Subsequence computation tool")
3051 "@code{reduceLCS} is an implementation of the Reduce-Expand
3052 algorithm for LCS. It is a fast program to compute the approximate
3053 Longest Commons Subsequence of a set of strings.")
3054 (home-page "https://github.com/gdv/Reduce-Expand-for-LCS")
3055 (license license:gpl3+))))
3057 (define-public jacal
3064 "http://groups.csail.mit.edu/mac/ftpdir/scm/jacal-"
3067 "055zrn12a1dmy0dqkwrkq3fklbhg3yir6vn0lacp4mvbg8573a3q"))
3068 (patches (search-patches "jacal-fix-texinfo.patch"))))
3069 (build-system gnu-build-system)
3072 (modify-phases %standard-phases
3073 (add-before 'build 'pre-build
3074 ;; Don't use upstream's script - it really doesn't fit into
3075 ;; Guix's functional paradigm.
3076 (lambda* (#:key inputs outputs #:allow-other-keys)
3077 (substitute* "Makefile"
3078 (("^install: install-script") "install: "))))
3079 (add-after 'install 'post-install
3080 ;; Instead, we provide our own simplified script.
3081 (lambda* (#:key inputs outputs #:allow-other-keys)
3082 (let ((wrapper (string-append (assoc-ref outputs "out")
3084 (format (open wrapper (logior O_WRONLY O_CREAT))
3085 (string-append "#!~a\nexec ~a/bin/scm -ip1 "
3086 "-e '(slib:load \"~a/lib/jacal/math\") "
3089 (assoc-ref inputs "scm")
3090 (assoc-ref outputs "out"))
3091 (chmod wrapper #o555))))
3093 (lambda* (#:key inputs outputs #:allow-other-keys)
3094 (zero? (system* "./configure"
3095 (string-append "--prefix="
3096 (assoc-ref outputs "out")))))))))
3097 (inputs `(("scm" ,scm)))
3098 (native-inputs `(("unzip" ,unzip)
3099 ("texinfo" ,texinfo)))
3100 (synopsis "Symbolic mathematics system")
3101 (description "GNU JACAL is an interactive symbolic mathematics program based on
3102 Scheme. It manipulate and simplify a range of mathematical expressions such
3103 as equations, scalars, vectors, and matrices.")
3104 (home-page "https://www.gnu.org/software/jacal/")
3105 (license license:gpl3+)))