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 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 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>
21 ;;; This file is part of GNU Guix.
23 ;;; GNU Guix is free software; you can redistribute it and/or modify it
24 ;;; under the terms of the GNU General Public License as published by
25 ;;; the Free Software Foundation; either version 3 of the License, or (at
26 ;;; your option) any later version.
28 ;;; GNU Guix is distributed in the hope that it will be useful, but
29 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
30 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
31 ;;; GNU General Public License for more details.
33 ;;; You should have received a copy of the GNU General Public License
34 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
36 (define-module (gnu packages maths)
37 #:use-module (ice-9 regex)
38 #:use-module (gnu packages)
39 #:use-module ((guix licenses) #:prefix license:)
40 #:use-module (guix packages)
41 #:use-module (guix download)
42 #:use-module (guix git-download)
43 #:use-module (guix utils)
44 #:use-module (guix build utils)
45 #:use-module (guix build-system cmake)
46 #:use-module (guix build-system gnu)
47 #:use-module (guix build-system r)
48 #:use-module (gnu packages algebra)
49 #:use-module (gnu packages bison)
50 #:use-module (gnu packages boost)
51 #:use-module (gnu packages check)
52 #:use-module (gnu packages cmake)
53 #:use-module (gnu packages compression)
54 #:use-module (gnu packages curl)
55 #:use-module (gnu packages cyrus-sasl)
56 #:use-module (gnu packages documentation)
57 #:use-module (gnu packages elf)
58 #:use-module (gnu packages flex)
59 #:use-module (gnu packages fltk)
60 #:use-module (gnu packages fontutils)
61 #:use-module (gnu packages gettext)
62 #:use-module (gnu packages gcc)
63 #:use-module (gnu packages gd)
64 #:use-module (gnu packages ghostscript)
65 #:use-module (gnu packages graphviz)
66 #:use-module (gnu packages gtk)
67 #:use-module (gnu packages image)
68 #:use-module (gnu packages less)
69 #:use-module (gnu packages lisp)
70 #:use-module (gnu packages logging)
71 #:use-module (gnu packages gnome)
72 #:use-module (gnu packages guile)
73 #:use-module (gnu packages xorg)
74 #:use-module (gnu packages gl)
75 #:use-module (gnu packages m4)
76 #:use-module (gnu packages mpi)
77 #:use-module (gnu packages multiprecision)
78 #:use-module (gnu packages netpbm)
79 #:use-module (gnu packages pcre)
80 #:use-module (gnu packages popt)
81 #:use-module (gnu packages perl)
82 #:use-module (gnu packages pkg-config)
83 #:use-module (gnu packages python)
84 #:use-module (gnu packages readline)
85 #:use-module (gnu packages tbb)
86 #:use-module (gnu packages scheme)
87 #:use-module (gnu packages shells)
88 #:use-module (gnu packages tcl)
89 #:use-module (gnu packages texinfo)
90 #:use-module (gnu packages tex)
91 #:use-module (gnu packages tls)
92 #:use-module (gnu packages wxwidgets)
93 #:use-module (gnu packages xml)
94 #:use-module (gnu packages zip)
95 #:use-module (srfi srfi-1))
103 (uri (string-append "mirror://gnu/" name "/" name "-" version ".tar.gz"))
105 "1q1887ryqdr9sn0522hc7p16kqwlxxyz5dkmma8ar2nxplhgll7q"))))
106 (build-system gnu-build-system)
107 (inputs `(("gtk+" ,gtk+)
108 ("libxml2" ,libxml2)))
109 (native-inputs `(("pkg-config" ,pkg-config)))
110 (synopsis "Natural deduction first-order logic interface")
111 (description "Aris is a program for performing logical proofs. It supports
112 propositional and predicate logic, as well as Boolean algebra and
113 arithmetical logic. In addition to its predefined inference and equivalence
114 rules, Aris also supports references to older proofs. Its use of standard
115 logical symbols and its natural deduction interface make it easy to use for
117 (license license:gpl3+)
118 (home-page "http://www.gnu.org/software/aris/")))
120 (define-public c-graph
126 (uri (string-append "mirror://gnu/c-graph/c-graph-" version
129 "1hlvpzrh7hzzf533diyfiabzskddi8zx92av9hwkjw3l46z7qv01"))))
130 (build-system gnu-build-system)
132 `(("fortran" ,gfortran)))
133 (synopsis "Visualizing and demonstrating convolution")
135 "GNU C-Graph is a tool for demonstrating the theory of convolution.
136 Thus, it can serve as an excellent aid to students of signal and systems
137 theory in visualizing the convolution process. Rather than forcing the
138 student to write code, the program offers an intuitive interface with
139 interactive dialogs to guide them.")
140 (license license:gpl3+)
141 (home-page "http://www.gnu.org/software/c-graph/")))
150 (uri (string-append "https://github.com/stcorp/coda/releases/download/"
151 version "/coda-" version ".tar.gz"))
153 (base32 "11asla1ap8vd73farqjlpb179sfiy0biydcwxjfcakrp9sf8v9bs"))
154 (patches (search-patches "coda-use-system-libs.patch"))
155 (modules '((guix build utils)))
157 ;; Make sure we don't use the bundled software.
158 '(for-each (lambda (d)
159 (delete-file-recursively (string-append "libcoda/" d)))
160 '("zlib" "pcre" "expat")))))
162 `(("fortran" ,gfortran)
164 ("python-numpy" ,python-numpy)))
171 (build-system gnu-build-system)
173 '(#:configure-flags '("--with-hdf4" "--with-hdf5" "--enable-python"
174 "LIBS= -lz -lpcre -lexpat")))
175 (synopsis "A common interface to various earth observation data formats")
177 "The Common Data Access toolbox (CODA) provides a set of interfaces for
178 reading remote sensing data from earth observation data files. It consists of
179 command line applications and interfaces to the C, Fortran, Python, and Java
180 programming languages.")
181 (home-page "https://stcorp.nl/coda")
182 (license license:gpl2+)))
190 (uri (string-append "mirror://gnu/units/units-" version
193 "1awhjw9zjlfb8s5g3yyx63f7ddfcr1sanlbxpqifmrgq24ql198b"))))
194 (build-system gnu-build-system)
195 (synopsis "Conversion between thousands of scales")
197 "GNU Units converts numeric quantities between units of measure. It
198 can handle scale changes through adaptive usage of standard scale
199 prefixes (micro-, kilo-, etc.). It can also handle nonlinear
200 conversions such as Fahrenheit to Celsius. Its interpreter is powerful
201 enough to be used effectively as a scientific calculator.")
202 (license license:gpl3+)
203 (home-page "http://www.gnu.org/software/units/")))
205 (define-public double-conversion
207 (name "double-conversion")
212 "https://github.com/floitsch/double-conversion/archive/v"
214 (file-name (string-append name "-" version ".tar.gz"))
217 "0cnr8xhyjfxijay8ymkqcph3672wp2lj23qhdmr3m4kia5kpdf83"))))
218 (build-system cmake-build-system)
220 '(#:test-target "test"
221 #:configure-flags '("-DBUILD_SHARED_LIBS=ON"
222 "-DBUILD_TESTING=ON")))
223 (home-page "https://github.com/floitsch/double-conversion")
224 (synopsis "Conversion routines for IEEE doubles")
226 "The double-conversion library provides binary-decimal and decimal-binary
227 routines for IEEE doubles. The library consists of efficient conversion
228 routines that have been extracted from the V8 JavaScript engine.")
229 (license license:bsd-3)))
231 (define-public dionysus
237 (uri (string-append "mirror://gnu/dionysus/dionysus-" version
241 "1aqnvw6z33bzqgd1ga571pnx6vq2zrkckm1cz91grv45h4jr9vgs"))))
242 (build-system gnu-build-system)
243 (inputs `(("tcl" ,tcl))) ;for 'tclsh'
244 (synopsis "Local search for universal constants and scientific values")
246 "GNU Dionysus is a convenient system for quickly retrieving the values of
247 mathematical constants used in science and engineering. Values can be
248 searched using a simple command-line tool, choosing from three databases:
249 universal constants, atomic numbers, and constants related to
251 (license license:gpl3+)
252 (home-page "http://www.gnu.org/software/dionysus/")))
260 (uri (string-append "mirror://gnu/gsl/gsl-"
264 "1yxdzqjwmi2aid650fa9zyr8llw069x7lm489wx9nnfdi6vh09an"))
265 (patches (search-patches "gsl-test-i686.patch"))))
266 (build-system gnu-build-system)
268 `(#:parallel-tests? #f))
269 (home-page "http://www.gnu.org/software/gsl/")
270 (synopsis "Numerical library for C and C++")
272 "The GNU Scientific Library is a library for numerical analysis in C
273 and C++. It includes a wide range of mathematical routines, with over 1000
274 functions in total. Subject areas covered by the library include:
275 differential equations, linear algebra, Fast Fourier Transforms and random
277 (license license:gpl3+)))
286 (uri (string-append "mirror://gnu/glpk/glpk-"
290 "1adbvwiaqrv9pql9ry3lhn2vfsxnff2vh4fs477d90kpfx0xwrlq"))))
291 (build-system gnu-build-system)
295 `(#:configure-flags '("--with-gmp")))
296 (home-page "https://www.gnu.org/software/glpk/")
297 (synopsis "GNU Linear Programming Kit, supporting the MathProg language")
299 "GLPK is a C library for solving large-scale linear programming (LP),
300 mixed integer programming (MIP), and other related problems. It supports the
301 GNU MathProg modeling language, a subset of the AMPL language, and features a
302 translator for the language. In addition to the C library, a stand-alone
303 LP/MIP solver is included in the package.")
304 (license license:gpl3+)))
313 (uri (string-append "http://www.4ti2.de/version_" version
314 "/4ti2-" version ".tar.gz"))
317 "1frix3rnm9ffr93alqzw4cavxbfpf524l8rfbmcpyhwd3n1km0yl"))))
318 (build-system gnu-build-system)
320 `(("which" ,(@ (gnu packages base) which)))) ; for the tests
324 (home-page "http://www.4ti2.de/")
325 (synopsis "Mathematical tool suite for problems on linear spaces")
327 "4ti2 implements algorithms for solving algebraic, geometric and
328 combinatorial problems on linear spaces. Among others, it solves systems
329 of linear equations, computes extreme rays of polyhedral cones, solves
330 integer programming problems and computes Markov bases for statistics.")
331 (license license:gpl2+)))
333 (define-public cddlib
340 (uri (string-append "ftp://ftp.math.ethz.ch/users/fukudak/cdd/cddlib-"
341 (string-delete #\. version) ".tar.gz"))
344 "1dasasscwfg793q8fwzgwf64xwj7w62yfvszpr8x8g38jka08vgy"))))
345 (build-system gnu-build-system)
348 (home-page "https://www.inf.ethz.ch/personal/fukudak/cdd_home/index.html")
349 (synopsis "Library for convex hulls and extreme rays of polyhedra")
351 "The C-library cddlib implements the Double Description Method of
352 Motzkin et al. for generating all vertices (i.e. extreme points) and extreme
353 rays of a general convex polyhedron given by a system of linear inequalities
354 in arbitrary dimension. It can also be used for the converse operation of
355 computing convex hulls.")
356 (license license:gpl2+)))
358 (define-public arpack-ng
365 (uri (string-append "https://github.com/opencollab/arpack-ng/archive/"
367 (file-name (string-append name "-" version ".tar.gz"))
370 "1fwch6vipms1ispzg2djvbzv5wag36f1dmmr3xs3mbp6imfyhvff"))))
371 (build-system gnu-build-system)
372 (home-page "https://github.com/opencollab/arpack-ng")
375 ("fortran" ,gfortran)))
376 (synopsis "Fortran subroutines for solving eigenvalue problems")
378 "ARPACK-NG is a collection of Fortran77 subroutines designed to solve
379 large scale eigenvalue problems.")
380 (license (license:non-copyleft "file://COPYING"
381 "See COPYING in the distribution."))))
383 (define-public arpack-ng-openmpi
384 (package (inherit arpack-ng)
385 (name "arpack-ng-openmpi")
388 ,@(package-inputs arpack-ng)))
389 (arguments `(#:configure-flags '("--enable-mpi")))
390 (synopsis "Fortran subroutines for solving eigenvalue problems with MPI")))
392 (define-public lapack
399 (uri (string-append "http://www.netlib.org/lapack/lapack-"
403 "0lk3f97i9imqascnlf6wr5mjpyxqcdj73pgj97dj2mgvyg9z1n4s"))))
404 (build-system cmake-build-system)
405 (home-page "http://www.netlib.org/lapack/")
406 (inputs `(("fortran" ,gfortran)
407 ("python" ,python-2)))
409 `(#:configure-flags '("-DBUILD_SHARED_LIBS:BOOL=YES"
411 #:phases (alist-cons-before
413 (lambda* (#:key inputs #:allow-other-keys)
414 (let ((python (assoc-ref inputs "python")))
415 (substitute* "lapack_testing.py"
416 (("/usr/bin/env python") python))))
418 (synopsis "Library for numerical linear algebra")
420 "LAPACK is a Fortran 90 library for solving the most commonly occurring
421 problems in numerical linear algebra.")
422 (license (license:non-copyleft "file://LICENSE"
423 "See LICENSE in the distribution."))))
425 (define-public scalapack
432 (uri (string-append "http://www.netlib.org/scalapack/scalapack-"
436 "0p1r61ss1fq0bs8ynnx7xq4wwsdvs32ljvwjnx6yxr8gd6pawx0c"))))
437 (build-system cmake-build-system)
440 ("fortran" ,gfortran)
441 ("lapack" ,lapack))) ;for testing only
443 `(#:configure-flags `("-DBUILD_SHARED_LIBS:BOOL=YES")))
444 (home-page "http://www.netlib.org/scalapack/")
445 (synopsis "Library for scalable numerical linear algebra")
447 "ScaLAPACK is a Fortran 90 library of high-performance linear algebra
448 routines on parallel distributed memory machines. ScaLAPACK solves dense and
449 banded linear systems, least squares problems, eigenvalue problems, and
450 singular value problems.")
451 (license (license:bsd-style "file://LICENSE"
452 "See LICENSE in the distribution."))))
454 (define-public gnuplot
460 (uri (string-append "mirror://sourceforge/gnuplot/gnuplot/"
465 "0lr065qdlgss8lmy31l7hkmnk9fp4lvqq9qgb1f1209f36zy1wr5"))))
466 (build-system gnu-build-system)
467 (inputs `(("readline" ,readline)
471 (native-inputs `(("pkg-config" ,pkg-config)
472 ("texlive" ,texlive-minimal)))
473 (home-page "http://www.gnuplot.info")
474 (synopsis "Command-line driven graphing utility")
475 (description "Gnuplot is a portable command-line driven graphing
476 utility. It was originally created to allow scientists and students to
477 visualize mathematical functions and data interactively, but has grown to
478 support many non-interactive uses such as web scripting. It is also used as a
479 plotting engine by third-party applications like Octave.")
480 ;; X11 Style with the additional restriction that derived works may only be
481 ;; distributed as patches to the original.
482 (license (license:fsf-free
483 "http://gnuplot.cvs.sourceforge.net/gnuplot/gnuplot/Copyright"))))
492 (uri (string-append "https://github.com/OkoSanto/GCTP/archive/v"
494 (file-name (string-append name "-" version ".tar.gz"))
497 "0l9aqnqynh9laicn5dxf3rsb1n14xiks79wbyqccirzmjqd1c1x4"))))
499 `(("fortran" ,gfortran)))
500 (build-system gnu-build-system)
501 (synopsis "General Cartographic Transformation Package (GCTP)")
503 "The General Cartographic Transformation Package (GCTP) is a system of
504 software routines designed to permit the transformation of coordinate pairs
505 from one map projection to another. The GCTP is the standard computer
506 software used by the National Mapping Division for map projection
508 (home-page "https://github.com/OkoSanto/GCTP")
509 (license license:public-domain))) ;https://www2.usgs.gov/laws/info_policies.html
518 (uri (string-append "https://support.hdfgroup.org/ftp/HDF/releases/HDF"
519 version "/src/hdf-" version ".tar.bz2"))
521 (base32 "020jh563sjyxsgml8l809d2i1d4ms9shivwj3gbm7n0ilxbll8id"))
522 (patches (search-patches "hdf4-architectures.patch"
523 "hdf4-reproducibility.patch"
524 "hdf4-shared-fortran.patch"))))
526 (build-system gnu-build-system)
528 `(("gfortran" ,gfortran)
533 ("libjpeg" ,libjpeg)))
535 `(#:parallel-tests? #f
536 #:configure-flags '("--enable-shared")
538 (modify-phases %standard-phases
539 (add-before 'configure 'patchbuild
542 '("mfhdf/hdfimport/testutil.sh.in" "hdf/util/testutil.sh.in")
544 (("/bin/mkdir") "mkdir"))
545 (substitute* (find-files "." "^Makefile\\.in$")
546 (("@HDF_BUILD_XDR_TRUE@XDR_ADD = \
547 -R\\$\\(abs_top_builddir\\)/mfhdf/xdr/\\.libs") "")
548 (("@HDF_BUILD_SHARED_TRUE@AM_LDFLAGS = \
549 -R\\$\\(abs_top_builddir\\)/mfhdf/libsrc/\\.libs \
550 -R\\$\\(abs_top_builddir\\)/hdf/src/\\.libs \\$\\(XDR_ADD\\)") "")))))))
551 (home-page "https://www.hdfgroup.org/products/hdf4/")
553 "Library and multi-object file format for storing and managing data")
554 (description "HDF4 is a library and multi-object file format for storing
555 and managing data between machines. HDF4 is an older hierarchical data format,
556 incompatible with HDF5.")
558 (license:non-copyleft
559 "https://www.hdfgroup.org/ftp/HDF/HDF_Current/src/unpacked/COPYING"))))
561 (define-public hdf4-alt
566 (substitute-keyword-arguments (package-arguments hdf4)
567 ((#:configure-flags flags) `(cons* "--disable-netcdf" ,flags))))
569 "HDF4 without netCDF API, can be combined with the regular netCDF library")))
578 (uri (list (string-append "http://www.hdfgroup.org/ftp/HDF5/releases/"
579 "hdf5-" version "/src/hdf5-"
581 (string-append "https://support.hdfgroup.org/ftp/HDF5/"
584 (take (string-split version #\.) 2))
585 "/src/hdf5-" version ".tar.bz2")))
587 (base32 "13542vrnl1p35n8vbq0wzk40vddmm33q5nh04j98c7r1yjnxxih1"))
588 (patches (list (search-patch "hdf5-config-date.patch")))))
589 (build-system gnu-build-system)
593 `(;; Some of the users, notably Flann, need the C++ interface.
594 #:configure-flags '("--enable-cxx")
597 (modify-phases %standard-phases
598 (add-before 'configure 'patch-configure
600 (substitute* "configure"
603 (add-after 'install 'patch-references
604 (lambda* (#:key inputs outputs #:allow-other-keys)
605 (let ((bin (string-append (assoc-ref outputs "out") "/bin"))
606 (zlib (assoc-ref inputs "zlib")))
607 (substitute* (find-files bin "h5p?cc")
609 (string-append "-L" zlib "/lib " lib)))
611 (home-page "http://www.hdfgroup.org")
612 (synopsis "Management suite for extremely large and complex data")
613 (description "HDF5 is a suite that makes possible the management of
614 extremely large and complex data collections.")
615 (license (license:x11-style
616 "http://www.hdfgroup.org/ftp/HDF5/current/src/unpacked/COPYING"))))
618 (define-public hdf-eos2
625 (uri "ftp://edhs1.gsfc.nasa.gov\
626 /edhs/hdfeos/latest_release/HDF-EOS2.19v1.00.tar.Z")
628 (base32 "0c9fcz25s292ldap12wxmlrvnyz99z24p63d8fwx51bf8s0s1zrz"))
629 (patches (search-patches "hdf-eos2-remove-gctp.patch"
630 "hdf-eos2-build-shared.patch"
631 "hdf-eos2-fortrantests.patch"))))
632 (build-system gnu-build-system)
634 `(("gfortran" ,gfortran)))
636 `(("hdf4" ,hdf4-alt) ; assume most HDF-EOS2 users won't use the HDF4 netCDF API
641 `( #:configure-flags '("--enable-install-include" "--enable-shared"
642 "CC=h4cc -Df2cFortran" "LIBS=-lgctp")
643 #:parallel-tests? #f))
644 (home-page "http://hdfeos.org/software/library.php#HDF-EOS2")
645 (synopsis "HDF4-based data format for NASA's Earth Observing System")
646 (description "HDF-EOS2 is a software library built on HDF4 which supports
647 the construction of data structures used in NASA's Earth Observing
648 System (Grid, Point and Swath).")
650 ;; Source files carry a permissive license header.
651 (license (license:non-copyleft home-page))))
653 (define-public hdf-eos5
659 (uri (string-append "ftp://edhs1.gsfc.nasa.gov\
660 /edhs/hdfeos5/latest_release/HDF-EOS5." version ".tar.Z"))
663 "1p83333nzzy8rn5chxlm0hrkjjnhh2w1ji8ac0f9q4xzg838i58i"))
664 (patches (search-patches "hdf-eos5-build-shared.patch"
665 "hdf-eos5-remove-gctp.patch"
666 "hdf-eos5-fix-szip.patch"
667 "hdf-eos5-fortrantests.patch"))))
669 `(("gfortran" ,gfortran)))
670 (build-system gnu-build-system)
676 `(#:configure-flags '("--enable-install-include" "--enable-shared"
677 "CC=h5cc -Df2cFortran" "LIBS=-lgctp")
678 #:parallel-tests? #f))
679 (synopsis "HDF5-based data format for NASA's Earth Observing System")
681 "HDF-EOS5 is a software library built on HDF5 to support the construction
682 of data structures used in NASA's Earth Observing System (Grid, Point and
684 (home-page "http://www.hdfeos.org/software/library.php#HDF-EOS5")
686 ;; Source files carry a permissive license header.
687 (license (license:non-copyleft home-page))))
689 (define-public hdf5-parallel-openmpi
690 (package (inherit hdf5)
691 (name "hdf5-parallel-openmpi")
694 ,@(package-inputs hdf5)))
696 (substitute-keyword-arguments `(#:configure-flags '("--enable-parallel")
697 ,@(package-arguments hdf5))
699 `(modify-phases ,phases
700 (add-before 'check 'patch-tests
702 ;; OpenMPI's mpirun will exit with non-zero status if it
703 ;; detects an "abnormal termination", i.e. any process not
704 ;; calling MPI_Finalize(). Since the test is explicitely
705 ;; avoiding MPI_Finalize so as not to have at_exit and thus
706 ;; H5C_flush_cache from being called, mpirun will always
707 ;; complain, so turn this test off.
708 (substitute* "testpar/Makefile"
709 (("(^TEST_PROG_PARA.*)t_pflush1(.*)" front back)
710 (string-append front back "\n")))
711 (substitute* "tools/h5diff/testph5diff.sh"
712 (("/bin/sh") (which "sh")))
714 (synopsis "Management suite for data with parallel IO support")))
716 (define-public h5check
723 (uri (string-append "http://www.hdfgroup.org/ftp/HDF5/tools/"
724 "h5check/src/h5check-" version ".tar.gz"))
727 "1gm76jbwhz9adbxgn14zx8cj33dmjdr2g5xcy0m9c2gakp8w59kj"))))
728 (build-system gnu-build-system)
729 (inputs `(("hdf5" ,hdf5))) ;h5cc for tests
730 (home-page "https://www.hdfgroup.org/products/hdf5_tools/h5check.html")
731 (synopsis "HDF5 format checker")
732 (description "@code{h5check} is a validation tool for verifying that an
733 HDF5 file is encoded according to the HDF File Format Specification.")
734 (license (license:x11-style "file://COPYING"))))
736 (define-public netcdf
743 (uri (string-append "ftp://ftp.unidata.ucar.edu/pub/netcdf/"
744 "netcdf-" version ".tar.gz"))
747 "1blc7ik5yin7i0ls2kag0a9xjk12m0dzx6v1x88az3ras3scci2d"))
748 (patches (search-patches "netcdf-date-time.patch"
749 "netcdf-tst_h_par.patch"))))
750 (build-system gnu-build-system)
754 ("graphviz" ,graphviz)))
759 ("libjpeg" ,libjpeg)))
761 `(#:configure-flags '("--enable-doxygen" "--enable-dot" "--enable-hdf4")
762 #:parallel-tests? #f)) ;various race conditions
763 (home-page "http://www.unidata.ucar.edu/software/netcdf/")
764 (synopsis "Library for scientific data")
765 (description "NetCDF is an interface for scientific data access and a
766 software library that provides an implementation of the interface. The netCDF
767 library defines a machine-independent format for representing scientific data.
768 Together, the interface, library, and format support the creation, access, and
769 sharing of scientific data.")
770 (license (license:x11-style "file://COPYRIGHT"))))
772 (define-public netcdf-parallel-openmpi
773 (package (inherit netcdf)
774 (name "netcdf-parallel-openmpi")
777 ,@(alist-replace "hdf5" (list hdf5-parallel-openmpi)
778 (package-inputs netcdf))))
779 ;; TODO: Replace pkg-config references in nc-config with absolute references
781 (substitute-keyword-arguments (package-arguments netcdf)
782 ((#:configure-flags flags)
783 `(cons* "CC=mpicc" "CXX=mpicxx"
784 "--enable-parallel-tests"
785 ;; Shared libraries not supported with parallel IO.
786 "--disable-shared" "--with-pic"
795 (uri (string-append "http://ab-initio.mit.edu/nlopt/nlopt-"
798 (base32 "12cfkkhcdf4zmb6h7y6qvvdvqjs2xf9sjpa3rl3bq76px4yn76c0"))))
799 (build-system gnu-build-system)
801 `(;; Shared libraries are not built by default. They are required to
802 ;; build the Guile, Octave, and Python bindings.
803 #:configure-flags '("--enable-shared")
806 (modify-phases %standard-phases
807 (add-before 'configure 'set-libnlopt-file-name
808 (lambda* (#:key outputs #:allow-other-keys)
809 ;; Make sure the Scheme module refers to the library by its
810 ;; absolute file name (we cannot do that from a snippet
811 ;; because the expansion of @libdir@ contains
813 (let ((out (assoc-ref outputs "out")))
814 (substitute* "swig/nlopt.scm.in"
816 (string-append out "/lib/libnlopt")))
818 (inputs `(("guile" ,guile-2.0)))
819 (native-inputs `(("pkg-config" ,pkg-config)))
820 (home-page "http://ab-initio.mit.edu/wiki/")
821 (synopsis "Library for nonlinear optimization")
822 (description "NLopt is a library for nonlinear optimization, providing a
823 common interface for a number of different free optimization routines available
824 online as well as original implementations of various other algorithms.")
825 (license license:lgpl2.1+)))
834 "http://www.coin-or.org/download/source/Ipopt/Ipopt-"
838 "09bk2hqy2vgi4yi76xng9zxakddwqy3wij9nx7wf2vfbxxpazrsk"))
839 (modules '((guix build utils)))
841 ;; Make sure we don't use the bundled software.
842 '(delete-file-recursively "ThirdParty"))))
843 (build-system gnu-build-system)
845 '(#:phases (modify-phases %standard-phases
846 (add-after 'install 'add--L-flags-in-ipopt.pc
847 (lambda* (#:key inputs outputs #:allow-other-keys)
848 ;; The '.pc' file lists '-llapack -lblas' in "Libs";
849 ;; move it to "Libs.private" where it belongs, and add a
850 ;; '-L' flag for LAPACK.
851 (let ((out (assoc-ref outputs "out"))
852 (lapack (assoc-ref inputs "lapack")))
853 (substitute* (string-append out "/lib/pkgconfig/"
855 (("Libs: (.*)-llapack -lblas(.*)$" _ before after)
856 (string-append "Libs: " before " " after "\n"
857 "Libs.private: " before
858 "-L" lapack "/lib -llapack -lblas "
862 `(("gfortran" ,gfortran)))
864 ;; TODO: Maybe add dependency on COIN-MUMPS, ASL, and HSL.
865 `(("lapack" ,lapack))) ;for both libblas and liblapack
866 (home-page "http://www.coin-or.org")
867 (synopsis "Large-scale nonlinear optimizer")
869 "The Interior Point Optimizer (IPOPT) is a software package for
870 large-scale nonlinear optimization. It provides C++, C, and Fortran
872 (license license:epl1.0)))
876 (name "ceres-solver")
878 (home-page "http://ceres-solver.org/")
881 (uri (string-append home-page "ceres-solver-"
885 "0i7qkbf8g6pd8arxzldppga26ckv93y8zldsfz6wbd4n6b1nqrjd"))))
886 (build-system cmake-build-system)
888 ;; TODO: Build HTML user documentation and install separately.
889 '(#:configure-flags '("-DBUILD_EXAMPLES=OFF"
890 "-DBUILD_SHARED_LIBS=ON")
892 #:phases (modify-phases %standard-phases
893 (add-before 'configure 'set-library-directory
895 ;; Install libraries to lib/, not lib64/.
896 (substitute* "internal/ceres/CMakeLists.txt"
897 (("set\\(LIB_SUFFIX \"64\"\\)")
898 "set(LIB_SUFFIX \"\")"))
901 `(("pkg-config" ,pkg-config)))
903 `(("glog" ,glog))) ;for #include <glog/glog.h>
908 ("suitesparse" ,suitesparse)
910 (synopsis "C++ library for solving large optimization problems")
912 "Ceres Solver is a C++ library for modeling and solving large,
913 complicated optimization problems. It is a feature rich, mature and
914 performant library which has been used in production since 2010. Ceres Solver
915 can solve two kinds of problems:
917 @item non-linear least squares problems with bounds constraints;
918 @item general unconstrained optimization problems.
920 (license license:bsd-3)))
922 ;; For a fully featured Octave, users are strongly recommended also to install
923 ;; the following packages: texinfo, less, ghostscript, gnuplot.
924 (define-public octave
931 (uri (string-append "mirror://gnu/octave/octave-"
935 "09zhhch79jw3ynw39vizx0i2cbd2bjz3sp38pjdzraqrbivpwp92"))))
936 (build-system gnu-build-system)
939 ("readline" ,readline)
943 ("arpack" ,arpack-ng)
946 ("fontconfig" ,fontconfig)
947 ("freetype" ,freetype)
955 ("gfortran" ,gfortran)
956 ("pkg-config" ,pkg-config)
958 ;; The following inputs are not actually used in the build process.
959 ;; However, the ./configure gratuitously tests for their existence and
960 ;; assumes that programs not present at build time are also not, and
961 ;; can never be, available at run time! If these inputs are therefore
962 ;; not present, support for them will be built out. However, Octave
963 ;; will still run without them, albeit without the features they
967 ("ghostscript" ,ghostscript)
968 ("gnuplot" ,gnuplot)))
971 (list (string-append "--with-shell="
972 (assoc-ref %build-inputs "bash")
974 (home-page "https://www.gnu.org/software/octave/")
975 (synopsis "High-level language for numerical computation")
976 (description "GNU Octave is a high-level interpreted language that is
977 specialized for numerical computations. It can be used for both linear and
978 non-linear applications and it provides great support for visualizing results.
979 Work may be performed both at the interactive command-line as well as via
981 (license license:gpl3+)))
983 (define-public opencascade-oce
985 (name "opencascade-oce")
991 "https://github.com/tpaviot/oce/archive/OCE-"
996 "0vpmnb0k5y2f7lpmwx9pg9yfq24zjvnsak5alzacncfm1hv9b6cd"))))
997 (build-system cmake-build-system)
1000 (list "-DOCE_TESTING:BOOL=ON"
1001 "-DOCE_USE_TCL_TEST_FRAMEWORK:BOOL=ON"
1002 "-DOCE_DRAW:BOOL=ON"
1003 (string-append "-DOCE_INSTALL_PREFIX:PATH="
1004 (assoc-ref %outputs "out"))
1005 "-UCMAKE_INSTALL_RPATH")))
1007 `(("freetype" ,freetype)
1014 `(("python" ,python-wrapper)))
1015 (home-page "https://github.com/tpaviot/oce")
1016 (synopsis "Libraries for 3D modeling and numerical simulation")
1018 "Open CASCADE is a set of libraries for the development of applications
1019 dealing with 3D CAD data or requiring industrial 3D capabilities. It includes
1020 C++ class libraries providing services for 3D surface and solid modeling, CAD
1021 data exchange, and visualization. It is used for development of specialized
1022 software dealing with 3D models in design (CAD), manufacturing (CAM),
1023 numerical simulation (CAE), measurement equipment (CMM), and quality
1024 control (CAQ) domains.
1026 This is the ``Community Edition'' (OCE) of Open CASCADE, which gathers
1027 patches, improvements, and experiments contributed by users over the official
1028 Open CASCADE library.")
1029 (license (list license:lgpl2.1; OCE libraries, with an exception for the
1030 ; use of header files; see
1031 ; OCCT_LGPL_EXCEPTION.txt
1032 license:public-domain; files
1033 ; src/Standard/Standard_StdAllocator.hxx and
1034 ; src/NCollection/NCollection_StdAllocator.hxx
1035 license:expat; file src/OpenGl/OpenGl_glext.h
1036 license:bsd-3)))); test framework gtest
1045 (uri (string-append "http://gmsh.info/src/gmsh-"
1046 version "-source.tgz"))
1048 (base32 "1slf0bfkwrcgn6296wb4qhbk4ahz6i4wfb10hnim08x05vrylag8"))
1049 (modules '((guix build utils)))
1051 ;; Remove non-free METIS code
1052 '(delete-file-recursively "contrib/Metis"))))
1053 (build-system cmake-build-system)
1056 ("gfortran" ,gfortran)
1062 ("opencascade-oce" ,opencascade-oce)
1064 ("libxext" ,libxext)))
1066 `(("fontconfig" ,fontconfig)
1067 ("libxft" ,libxft)))
1069 `(#:configure-flags `("-DENABLE_METIS:BOOL=OFF"
1070 "-DENABLE_BUILD_SHARED:BOOL=ON"
1071 "-DENABLE_BUILD_DYNAMIC:BOOL=ON")))
1072 (home-page "http://www.geuz.org/gmsh/")
1073 (synopsis "3D finite element grid generator")
1074 (description "Gmsh is a 3D finite element grid generator with a built-in
1075 CAD engine and post-processor. Its design goal is to provide a fast, light
1076 and user-friendly meshing tool with parametric input and advanced
1077 visualization capabilities. Gmsh is built around four modules: geometry,
1078 mesh, solver and post-processing. The specification of any input to these
1079 modules is done either interactively using the graphical user interface or in
1080 ASCII text files using Gmsh's own scripting language.")
1081 (license license:gpl2+)))
1083 (define-public petsc
1090 ;; The *-lite-* tarball does not contain the *large* documentation
1091 (uri (string-append "http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/"
1092 "petsc-lite-" version ".tar.gz"))
1094 (base32 "0jfrq6rd4zagw1iimz05m2w91k0jvz3qbik1lk8pqcxw3rvdqk5d"))))
1095 (build-system gnu-build-system)
1097 `(("python" ,python-2)
1100 `(("gfortran" ,gfortran)
1102 ("superlu" ,superlu)
1103 ;; leaving out hdf5 and fftw, as petsc expects them to be built with mpi
1104 ;; leaving out opengl, as configuration seems to only be for mac
1107 `(#:test-target "test"
1108 #:parallel-build? #f ;build is parallel by default
1113 ,(string-append "--with-superlu-include="
1114 (assoc-ref %build-inputs "superlu") "/include")
1115 ,(string-append "--with-superlu-lib="
1116 (assoc-ref %build-inputs "superlu") "/lib/libsuperlu.a"))
1118 (modify-phases %standard-phases
1120 ;; PETSc's configure script is actually a python script, so we can't
1121 ;; run it with bash.
1122 (lambda* (#:key outputs (configure-flags '())
1124 (let* ((prefix (assoc-ref outputs "out"))
1125 (flags `(,(string-append "--prefix=" prefix)
1126 ,@configure-flags)))
1127 (format #t "build directory: ~s~%" (getcwd))
1128 (format #t "configure flags: ~s~%" flags)
1129 (zero? (apply system* "./configure" flags)))))
1130 (add-after 'configure 'clean-local-references
1131 (lambda* (#:key inputs outputs #:allow-other-keys)
1132 (let ((out (assoc-ref outputs "out")))
1133 (substitute* (find-files "." "^petsc(conf|machineinfo).h$")
1134 ;; Prevent build directory from leaking into compiled code
1136 ;; Scrub timestamp for reproducibility
1137 ((".*Libraries compiled on.*") ""))
1139 (add-after 'install 'clean-install
1140 ;; Try to keep installed files from leaking build directory names.
1141 (lambda* (#:key inputs outputs #:allow-other-keys)
1142 (let ((out (assoc-ref outputs "out")))
1143 (substitute* (map (lambda (file)
1144 (string-append out "/lib/petsc/conf/" file))
1145 '("petscvariables"))
1147 ;; Make compiler references point to the store
1148 (substitute* (string-append out "/lib/petsc/conf/petscvariables")
1149 (("= (gcc|g\\+\\+|gfortran)" _ compiler)
1150 (string-append "= " (which compiler))))
1151 ;; PETSc installs some build logs, which aren't necessary.
1152 (for-each (lambda (file)
1153 (let ((f (string-append out "/lib/petsc/conf/" file)))
1154 (when (file-exists? f)
1156 '("configure.log" "make.log" "gmake.log"
1157 "test.log" "error.log" "RDict.db"
1158 "PETScBuildInternal.cmake"
1159 ;; Once installed, should uninstall with Guix
1162 (home-page "http://www.mcs.anl.gov/petsc")
1163 (synopsis "Library to solve PDEs")
1164 (description "PETSc, pronounced PET-see (the S is silent), is a suite of
1165 data structures and routines for the scalable (parallel) solution of
1166 scientific applications modeled by partial differential equations.")
1167 (license (license:non-copyleft
1168 "http://www.mcs.anl.gov/petsc/documentation/copyright.html"))))
1170 (define-public petsc-complex
1171 (package (inherit petsc)
1172 (name "petsc-complex")
1174 (substitute-keyword-arguments (package-arguments petsc)
1175 ((#:configure-flags cf)
1176 `(cons "--with-scalar-type=complex" ,cf))))
1177 (synopsis "Library to solve PDEs (with complex scalars)")))
1179 (define-public petsc-openmpi
1180 (package (inherit petsc)
1181 (name "petsc-openmpi")
1183 `(("openmpi" ,openmpi)
1184 ,@(package-inputs petsc)))
1186 (substitute-keyword-arguments (package-arguments petsc)
1187 ((#:configure-flags cf)
1188 ``("--with-mpiexec=mpirun"
1189 ,(string-append "--with-mpi-dir="
1190 (assoc-ref %build-inputs "openmpi"))
1191 ,@(delete "--with-mpi=0" ,cf)))))
1192 (synopsis "Library to solve PDEs (with MPI support)")))
1194 (define-public petsc-complex-openmpi
1195 (package (inherit petsc-complex)
1196 (name "petsc-complex-openmpi")
1198 `(("openmpi" ,openmpi)
1199 ,@(package-inputs petsc-complex)))
1201 (substitute-keyword-arguments (package-arguments petsc-complex)
1202 ((#:configure-flags cf)
1203 ``("--with-mpiexec=mpirun"
1204 ,(string-append "--with-mpi-dir="
1205 (assoc-ref %build-inputs "openmpi"))
1206 ,@(delete "--with-mpi=0" ,cf)))))
1207 (synopsis "Library to solve PDEs (with complex scalars and MPI support)")))
1209 (define-public slepc
1216 (uri (string-append "http://slepc.upv.es/download/download.php?"
1217 "filename=slepc-" version ".tar.gz"))
1218 (file-name (string-append name "-" version ".tar.gz"))
1221 "1hijlmrvxvfqslnx8yydzw5xqbsn1yy02g32w0hln1z3cgr1c0k7"))))
1222 (build-system gnu-build-system)
1224 `(("python" ,python-2)))
1226 `(("arpack" ,arpack-ng)
1227 ("gfortran" ,gfortran)))
1229 `(("petsc" ,petsc)))
1231 `(#:parallel-build? #f ;build is parallel by default
1233 `(,(string-append "--with-arpack-dir="
1234 (assoc-ref %build-inputs "arpack") "/lib"))
1236 (modify-phases %standard-phases
1238 ;; configure is a python script, so we can't run it with bash.
1239 (lambda* (#:key inputs outputs (configure-flags '())
1241 (let* ((prefix (assoc-ref outputs "out"))
1242 (flags `(,(string-append "--prefix=" prefix)
1243 ,@configure-flags)))
1244 (format #t "build directory: ~s~%" (getcwd))
1245 (format #t "configure flags: ~s~%" flags)
1246 (setenv "SLEPC_DIR" (getcwd))
1247 (setenv "PETSC_DIR" (assoc-ref inputs "petsc"))
1248 (zero? (apply system* "./configure" flags)))))
1249 (add-after 'install 'delete-doc
1250 ;; TODO: SLEPc installs HTML documentation alongside headers in
1251 ;; $out/include. We'd like to move them to share/doc, but delete
1252 ;; them for now, as they are incomplete and installing the complete
1253 ;; documentation is difficult.
1254 (lambda* (#:key outputs #:allow-other-keys)
1255 (let* ((out (assoc-ref outputs "out")))
1256 (for-each delete-file (find-files out "\\.html$")))))
1257 (add-after 'install 'clean-install
1258 ;; Clean up unnecessary build logs from installation.
1259 (lambda* (#:key outputs #:allow-other-keys)
1260 (let ((out (assoc-ref outputs "out")))
1261 (for-each (lambda (file)
1262 (let ((f (string-append out "/lib/slepc/conf/" file)))
1263 (when (file-exists? f)
1265 '("configure.log" "make.log" "gmake.log"
1266 "test.log" "error.log" "RDict.db"
1267 "uninstall.py"))))))))
1268 (home-page "http://slepc.upv.es")
1269 (synopsis "Scalable library for eigenproblems")
1270 (description "SLEPc is a software library for the solution of large sparse
1271 eigenproblems on parallel computers. It can be used for the solution of
1272 linear eigenvalue problems formulated in either standard or generalized form,
1273 as well as other related problems such as the singular value decomposition.
1274 The emphasis of the software is on methods and techniques appropriate for
1275 problems in which the associated matrices are sparse, for example, those
1276 arising after the discretization of partial differential equations.")
1277 (license license:lgpl3)))
1279 (define-public slepc-complex
1280 (package (inherit slepc)
1281 (name "slepc-complex")
1283 `(("petsc" ,petsc-complex)
1284 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
1285 (synopsis "Scalable library for eigenproblems (with complex scalars)")))
1287 (define-public slepc-openmpi
1288 (package (inherit slepc)
1289 (name "slepc-openmpi")
1292 ("arpack" ,arpack-ng-openmpi)
1293 ,@(alist-delete "arpack" (package-inputs slepc))))
1295 `(("petsc" ,petsc-openmpi)
1296 ,@(alist-delete "petsc" (package-propagated-inputs slepc))))
1297 (synopsis "Scalable library for eigenproblems (with MPI support)")))
1299 (define-public slepc-complex-openmpi
1300 (package (inherit slepc-openmpi)
1301 (name "slepc-complex-openmpi")
1303 `(("petsc" ,petsc-complex-openmpi)
1304 ,@(alist-delete "petsc" (package-propagated-inputs slepc-openmpi))))
1305 (synopsis "Scalable library for eigenproblems (with complex scalars and MPI support)")))
1307 (define-public mumps
1314 (uri (string-append "http://mumps.enseeiht.fr/MUMPS_"
1318 "0igyc1pfzxdhpbad3v3lb86ixkdbqa1a8gbs15b04r2294h2nabp"))
1319 (patches (search-patches "mumps-build-parallelism.patch"))))
1320 (build-system gnu-build-system)
1322 `(("fortran" ,gfortran)
1323 ;; These are required for linking against mumps, but we let the user
1324 ;; declare the dependency.
1327 ("scotch" ,scotch)))
1329 `(#:modules ((ice-9 match)
1332 ,@%gnu-build-system-modules)
1334 (modify-phases %standard-phases
1336 (lambda* (#:key inputs #:allow-other-keys)
1337 (call-with-output-file "Makefile.inc"
1348 INCSEQ = -I$(topdir)/libseq
1349 LIBSEQ = -L$(topdir)/libseq -lmpiseq
1350 LIBSEQNEEDED = libseqneeded~;
1354 AR = ar vr # rules require trailing space, ugh...
1356 LIBBLAS = -L~a -lopenblas~@[
1357 SCALAP = -L~a -lscalapack~]
1358 LIBOTHERS = -pthread
1361 OPTF = -O2 -DALLOW_NON_INIT $(PIC)
1365 LIBS = $(SCALAP) $(LIBSEQ)
1366 LPORDDIR = $(topdir)/PORD/lib
1367 IPORD = -I$(topdir)/PORD/include
1368 LPORD = -L$(LPORDDIR) -lpord
1369 ORDERINGSF = -Dpord~@[
1371 IMETIS = -I$(METISDIR)/include
1372 LMETIS = -L$(METISDIR)/lib -lmetis
1373 ORDERINGSF += -Dmetis~]~@[~:{
1375 ISCOTCH = -I$(SCOTCHDIR)/include
1376 LSCOTCH = -L$(SCOTCHDIR)/lib ~a-lesmumps -lscotch -lscotcherr
1377 ORDERINGSF += ~a~}~]
1378 ORDERINGSC = $(ORDERINGSF)
1379 LORDERINGS = $(LPORD) $(LMETIS) $(LSCOTCH)
1380 IORDERINGSF = $(ISCOTCH)
1381 IORDERINGSC = $(IPORD) $(IMETIS) $(ISCOTCH)"
1382 (assoc-ref inputs "mpi")
1383 (assoc-ref inputs "blas")
1384 (assoc-ref inputs "scalapack")
1385 (assoc-ref inputs "metis")
1386 (match (list (assoc-ref inputs "pt-scotch")
1387 (assoc-ref inputs "scotch"))
1391 `((,scotch "" "-Dscotch")))
1394 "-lptesmumps -lptscotch -lptscotcherr "
1395 "-Dptscotch")))))))))
1397 ;; By default only the d-precision library is built. Make with "all"
1398 ;; target so that all precision libraries and examples are built.
1400 (zero? (system* "make" "all"
1401 (format #f "-j~a" (parallel-job-count))))))
1403 ;; Run the simple test drivers, which read test input from stdin:
1404 ;; from the "real" input for the single- and double-precision
1405 ;; testers, and from the "cmplx" input for complex-precision
1406 ;; testers. The EXEC-PREFIX key is used by the mumps-openmpi
1407 ;; package to prefix execution with "mpirun".
1408 (lambda* (#:key (exec-prefix '()) #:allow-other-keys)
1409 (with-directory-excursion "examples"
1412 (let ((tester (apply open-pipe*
1415 ,(string-append "./" prec
1417 (input (open-input-file
1418 (string-append "input_simpletest_" type))))
1420 (dump-port input tester)
1422 (zero? (close-pipe tester)))))
1424 '("real" "real" "cmplx" "cmplx")))))
1426 (lambda* (#:key outputs #:allow-other-keys)
1427 (let* ((out (assoc-ref outputs "out"))
1428 (libdir (string-append out "/lib")))
1429 (copy-recursively "lib" libdir)
1430 (copy-recursively "include" (string-append out "/include"))
1431 (when (file-exists? "libseq/libmpiseq.a")
1432 (install-file "libseq/libmpiseq.a" libdir))
1434 (home-page "http://mumps.enseeiht.fr")
1435 (synopsis "Multifrontal sparse direct solver")
1437 "MUMPS (MUltifrontal Massively Parallel sparse direct Solver) solves a
1438 sparse system of linear equations A x = b using Guassian elimination.")
1439 (license license:cecill-c)))
1441 (define-public mumps-metis
1442 (package (inherit mumps)
1443 (name "mumps-metis")
1445 (alist-delete "scotch" (package-inputs mumps)))))
1447 (define-public mumps-openmpi
1448 (package (inherit mumps)
1449 (name "mumps-openmpi")
1452 ("scalapack" ,scalapack)
1453 ("pt-scotch" ,pt-scotch)
1454 ,@(alist-delete "scotch" (package-inputs mumps))))
1456 (substitute-keyword-arguments (package-arguments mumps)
1458 `(modify-phases ,phases
1462 ((assoc-ref ,phases 'check)
1463 #:exec-prefix '("mpirun" "-n" "2"))))))))
1464 (synopsis "Multifrontal sparse direct solver (with MPI)")))
1466 (define-public mumps-metis-openmpi
1467 (package (inherit mumps-openmpi)
1468 (name "mumps-metis-openmpi")
1470 (alist-delete "pt-scotch" (package-inputs mumps-openmpi)))))
1472 (define-public r-quadprog
1479 (uri (cran-uri "quadprog" version))
1482 "0jg3r6abmhp8r9vkbhpx9ldjfw6vyl1m4c5vwlyjhk1mi03656fr"))))
1483 (build-system r-build-system)
1485 `(("gfortran" ,gfortran)))
1486 (home-page "http://cran.r-project.org/web/packages/quadprog")
1487 (synopsis "Functions to solve quadratic programming problems")
1489 "This package contains routines and documentation for solving quadratic
1490 programming problems.")
1491 (license license:gpl3+)))
1493 (define-public r-pracma
1499 (uri (cran-uri "pracma" version))
1501 (base32 "19nr2jlkbcdgvw3gx5hry12av565lmvqd5q4h7zlch3q13avwwl2"))))
1502 (build-system r-build-system)
1504 `(("r-quadprog" ,r-quadprog)))
1505 (home-page "http://cran.r-project.org/web/packages/pracma")
1506 (synopsis "Practical numerical math functions")
1507 (description "This package provides functions for numerical analysis and
1508 linear algebra, numerical optimization, differential equations, plus some
1509 special functions. It uses Matlab function names where appropriate to simplify
1511 (license license:gpl3+)))
1513 (define-public superlu
1520 (uri (string-append "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/"
1521 "superlu_" version ".tar.gz"))
1523 (base32 "0qzlb7cd608q62kyppd0a8c65l03vrwqql6gsm465rky23b6dyr8"))
1524 (modules '((guix build utils)))
1526 ;; Replace the non-free implementation of MC64 with a stub adapted
1529 (use-modules (ice-9 regex)
1531 (call-with-output-file "SRC/mc64ad.c"
1536 void mc64id_(int *a) {
1537 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
1540 void mc64ad_ (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
1541 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
1542 fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\");
1545 ;; Remove the corresponding license verbiage. MC64 license follows
1546 ;; a "------" line separator.
1547 (with-atomic-file-replacement "License.txt"
1548 (let ((rx (make-regexp "-{8}")))
1551 (let ((line (read-line in 'concat)))
1552 (unless (regexp-exec rx line)
1555 (build-system cmake-build-system)
1559 `(("blas" ,openblas)
1560 ("gfortran" ,gfortran)))
1562 `(#:configure-flags '("-Denable_blaslib:BOOL=NO" ;do not use internal cblas
1563 "-DTPL_BLAS_LIBRARIES=openblas"
1564 "-DBUILD_SHARED_LIBS:BOOL=YES"
1565 "-DCMAKE_INSTALL_LIBDIR=lib")))
1566 (home-page "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/")
1567 (synopsis "Supernodal direct solver for sparse linear systems")
1569 "SuperLU is a general purpose library for the direct solution of large,
1570 sparse, nonsymmetric systems of linear equations on high performance machines.
1571 The library is written in C and is callable from either C or Fortran. The
1572 library routines perform an LU decomposition with partial pivoting and
1573 triangular system solves through forward and back substitution. The library
1574 also provides threshold-based ILU factorization preconditioners.")
1575 (license (list license:bsd-3
1576 license:gpl2+ ;EXAMPLE/*fgmr.c
1577 (license:fsf-free "file://SRC/colamd.h")))))
1579 (define-public superlu-dist
1581 (name "superlu-dist")
1586 (uri (string-append "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/"
1587 "superlu_dist_" version ".tar.gz"))
1589 (base32 "1hnak09yxxp026blq8zhrl7685yip16svwngh1wysqxf8z48vzfj"))
1590 (modules '((guix build utils)))
1592 ;; Replace the non-free implementation of MC64 with a stub
1594 (use-modules (ice-9 regex)
1596 (call-with-output-file "SRC/mc64ad.c"
1601 void mc64id_(int *a) {
1602 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
1605 void mc64ad_ (int *a, int *b, int *c, int *d, int *e, double *f, int *g,
1606 int *h, int *i, int *j, int *k, double *l, int *m, int *n) {
1607 fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\");
1610 (delete-file "SRC/mc64ad.f.bak")
1611 (substitute* "SRC/util.c" ;adjust default algorithm
1612 (("RowPerm[[:blank:]]*=[[:blank:]]*LargeDiag")
1613 "RowPerm = NOROWPERM"))))
1614 (patches (search-patches "superlu-dist-scotchmetis.patch"))))
1615 (build-system gnu-build-system)
1619 `(("gfortran" ,gfortran)))
1621 `(("openmpi" ,openmpi) ;headers include MPI heades
1622 ("lapack" ,lapack) ;required to link with output library
1623 ("pt-scotch" ,pt-scotch))) ;same
1625 `(#:parallel-build? #f ;race conditions using ar
1629 (lambda* (#:key inputs outputs #:allow-other-keys)
1630 (call-with-output-file "make.inc"
1635 DSUPERLULIB = ~a/lib/libsuperlu_dist.a
1636 BLASDEF = -DUSE_VENDOR_BLAS
1637 BLASLIB = -L~a/lib -lblas
1638 PARMETISLIB = -L~a/lib \
1639 -lptscotchparmetis -lptscotch -lptscotcherr -lptscotcherrexit \
1640 -lscotch -lscotcherr -lscotcherrexit
1641 METISLIB = -L~:*~a/lib \
1642 -lscotchmetis -lscotch -lscotcherr -lscotcherrexit
1643 LIBS = $(DSUPERLULIB) $(PARMETISLIB) $(METISLIB) $(BLASLIB)
1649 CFLAGS = -O3 -g -DPRNTlevel=0 $(PIC)
1650 NOOPTS = -O0 -g $(PIC)
1652 FFLAGS = -O2 -g $(PIC)
1656 (assoc-ref outputs "out")
1657 (assoc-ref inputs "lapack")
1658 (assoc-ref inputs "pt-scotch")))))
1660 'unpack 'remove-broken-symlinks
1662 (for-each delete-file
1663 (find-files "MAKE_INC" "\\.#make\\..*")))
1665 'build 'create-install-directories
1666 (lambda* (#:key outputs #:allow-other-keys)
1669 (mkdir-p (string-append (assoc-ref outputs "out")
1671 '("lib" "include")))
1675 (with-directory-excursion "EXAMPLE"
1677 (zero? (system* "mpirun" "-n" "2"
1678 "./pddrive" "-r" "1" "-c" "2" "g20.rua"))
1679 (zero? (system* "mpirun" "-n" "2"
1680 "./pzdrive" "-r" "1" "-c" "2" "cg20.cua")))))
1683 (lambda* (#:key outputs #:allow-other-keys)
1684 ;; Library is placed in lib during the build phase. Copy over
1685 ;; headers to include.
1686 (let* ((out (assoc-ref outputs "out"))
1687 (incdir (string-append out "/include")))
1688 (for-each (lambda (file)
1689 (let ((base (basename file)))
1690 (format #t "installing `~a' to `~a'~%"
1693 (string-append incdir "/" base))))
1694 (find-files "SRC" ".*\\.h$"))))
1695 %standard-phases)))))))
1696 (home-page (package-home-page superlu))
1697 (synopsis "Parallel supernodal direct solver")
1699 "SuperLU_DIST is a parallel extension to the serial SuperLU library.
1700 It is targeted for distributed memory parallel machines. SuperLU_DIST is
1701 implemented in ANSI C, and MPI for communications.")
1702 (license license:bsd-3)))
1704 (define-public scotch
1711 (uri (string-append "https://gforge.inria.fr/frs/download.php/34618/"
1712 "scotch_" version ".tar.gz"))
1714 (base32 "1ir088mvrqggyqdkx9qfynmiaffqbyih5qfl5mga2nrlm1qlsgzm"))
1715 (patches (search-patches "scotch-test-threading.patch"
1716 "pt-scotch-build-parallelism.patch"))))
1717 (build-system gnu-build-system)
1724 (modify-phases %standard-phases
1726 'unpack 'chdir-to-src
1727 (lambda _ (chdir "src")))
1731 (call-with-output-file "Makefile.inc"
1745 CFLAGS = -O2 -g -fPIC $(CPPFLAGS)
1746 LDFLAGS = -lz -lm -lrt -lpthread
1748 LEX = flex -Pscotchyy -olex.yy.c
1753 YACC = bison -pscotchyy -y -b y
1755 '("COMMON_FILE_COMPRESS_GZ"
1757 "COMMON_RANDOM_FIXED_SEED"
1758 ;; Prevents symbolc clashes with libesmumps
1760 ;; XXX: Causes invalid frees in superlu-dist tests
1762 ;; "SCOTCH_PTHREAD_NUMBER=2"
1763 "restrict=__restrict"))))))
1765 'build 'build-esmumps
1767 (zero? (system* "make"
1768 (format #f "-j~a" (parallel-job-count))
1772 (lambda* (#:key outputs #:allow-other-keys)
1773 (let ((out (assoc-ref outputs "out")))
1775 (zero? (system* "make"
1776 (string-append "prefix=" out)
1778 ;; esmumps files are not installed with the above
1779 (for-each (lambda (f)
1780 (copy-file f (string-append out "/include/" f)))
1781 (find-files "../include" ".*esmumps.h$"))
1782 (for-each (lambda (f)
1783 (copy-file f (string-append out "/lib/" f)))
1784 (find-files "../lib" "^lib.*esmumps.*"))))))))
1785 (home-page "http://www.labri.fr/perso/pelegrin/scotch/")
1786 (synopsis "Programs and libraries for graph algorithms")
1787 (description "SCOTCH is a set of programs and libraries which implement
1788 the static mapping and sparse matrix reordering algorithms developed within
1789 the SCOTCH project. Its purpose is to apply graph theory, with a divide and
1790 conquer approach, to scientific computing problems such as graph and mesh
1791 partitioning, static mapping, and sparse matrix ordering, in application
1792 domains ranging from structural mechanics to operating systems or
1794 ;; See LICENSE_en.txt
1795 (license license:cecill-c)))
1797 (define-public pt-scotch
1798 (package (inherit scotch)
1801 `(("openmpi" ,openmpi))) ;Headers include MPI headers
1803 (substitute-keyword-arguments (package-arguments scotch)
1804 ((#:phases scotch-phases)
1805 `(modify-phases ,scotch-phases
1810 (zero? (system* "make"
1811 (format #f "-j~a" (parallel-job-count))
1812 "ptscotch" "ptesmumps"))
1813 ;; Install the serial metis compatibility library
1814 (zero? (system* "make" "-C" "libscotchmetis" "install")))))
1817 (lambda _ (zero? (system* "make" "ptcheck"))))))))
1818 (synopsis "Programs and libraries for graph algorithms (with MPI)")))
1820 (define-public metis
1827 (uri (string-append "http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/"
1828 "metis-" version ".tar.gz"))
1831 "1cjxgh41r8k6j029yxs8msp3z6lcnpm16g5pvckk35kc7zhfpykn"))))
1832 (build-system cmake-build-system)
1834 `(("blas" ,openblas)))
1836 `(#:tests? #f ;no tests
1837 #:configure-flags `("-DSHARED=ON"
1838 ,(string-append "-DGKLIB_PATH=" (getcwd)
1839 "/metis-" ,version "/GKlib"))))
1840 (home-page "http://glaros.dtc.umn.edu/gkhome/metis/metis/overview")
1841 (synopsis "Graph partitioning and fill-reducing matrix ordering library")
1843 "METIS is a set of serial programs for partitioning graphs, partitioning
1844 finite element meshes, and producing fill-reducing orderings for sparse
1845 matrices. The algorithms implemented in METIS are based on the multilevel
1846 recursive-bisection, multilevel k-way, and multi-constraint partitioning
1848 (license license:asl2.0))) ;As of version 5.0.3
1850 (define-public p4est
1857 (uri (string-append "http://p4est.github.io/release/p4est-"
1861 "0faina2h5qsx3m2izbzaj9bbakma1krbbjmq43wrp1hcbyijflqb"))))
1862 (build-system gnu-build-system)
1864 `(("fortran" ,gfortran)
1869 `(#:configure-flags `(,(string-append "BLAS_LIBS=-L"
1870 (assoc-ref %build-inputs "blas")
1872 ,(string-append "LAPACK_LIBS=-L"
1873 (assoc-ref %build-inputs "lapack")
1875 (home-page "http://www.p4est.org")
1876 (synopsis "Adaptive mesh refinement on forests of octrees")
1878 "The p4est software library enables the dynamic management of a
1879 collection of adaptive octrees, conveniently called a forest of octrees.
1880 p4est is designed to work in parallel and scales to hundreds of thousands of
1882 (license license:gpl2+)))
1884 (define-public p4est-openmpi
1885 (package (inherit p4est)
1886 (name "p4est-openmpi")
1889 ,@(package-inputs p4est)))
1891 (substitute-keyword-arguments (package-arguments p4est)
1892 ((#:configure-flags cf)
1893 ``("--enable-mpi" ,@,cf))))
1894 (synopsis "Parallel adaptive mesh refinement on forests of octrees")))
1896 (define-public gsegrafix
1903 (uri (string-append "mirror://gnu/" name "/" name "-"
1907 "1b13hvx063zv970y750bx41wpx6hwd5ngjhbdrna8w8yy5kmxcda"))))
1908 (build-system gnu-build-system)
1910 `(#:configure-flags '("LDFLAGS=-lm")))
1912 `(("libgnomecanvas" ,libgnomecanvas)
1913 ("libbonoboui" ,libbonoboui)
1914 ("libgnomeui" ,libgnomeui)
1915 ("libgnomeprintui" ,libgnomeprintui)
1918 `(("pkg-config" ,pkg-config)))
1919 (home-page "http://www.gnu.org/software/gsegrafix/")
1920 (synopsis "GNOME application to create scientific and engineering plots")
1921 (description "GSEGrafix is an application which produces high-quality graphical
1922 plots for science and engineering. Plots are specified via simple ASCII
1923 parameter files and data files and are presented in an anti-aliased GNOME
1924 canvas. The program supports rectangular two-dimensional plots, histograms,
1925 polar-axis plots and three-dimensional plots. Plots can be printed or saved
1926 to BMP, JPEG or PNG image formats.")
1927 (license license:gpl3+)))
1929 (define-public maxima
1936 (uri (string-append "mirror://sourceforge/maxima/Maxima-source/"
1937 version "-source/" name "-" version ".tar.gz"))
1940 "1cvignn5y6qzrby6qb885yc8zdcdqdr1d50vcvc3gapw2f0gk3zm"))
1941 (patches (search-patches "maxima-defsystem-mkdir.patch"))))
1942 (build-system gnu-build-system)
1945 ("gnuplot" ,gnuplot) ;for plots
1946 ("tk" ,tk))) ;Tcl/Tk is used by 'xmaxima'
1948 `(("texinfo" ,texinfo)
1950 ("python" ,python)))
1953 (list "--enable-gcl"
1954 (string-append "--with-posix-shell="
1955 (assoc-ref %build-inputs "bash")
1957 (string-append "--with-wish="
1958 (assoc-ref %build-inputs "tk")
1960 (let ((v ,(package-version tk)))
1961 (string-take v (string-index-right v #\.)))))
1962 ;; By default Maxima attempts to write temporary files to
1963 ;; '/tmp/nix-build-maxima-*', which won't exist at run time.
1964 ;; Work around that.
1965 #:make-flags (list "TMPDIR=/tmp")
1966 #:phases (alist-cons-before
1969 (chmod "src/maxima" #o555))
1970 ;; Make sure the doc and emacs files are found in the
1971 ;; standard location. Also configure maxima to find gnuplot
1972 ;; without having it on the PATH.
1974 'install 'post-install
1975 (lambda* (#:key outputs inputs #:allow-other-keys)
1976 (let* ((gnuplot (assoc-ref inputs "gnuplot"))
1977 (out (assoc-ref outputs "out"))
1978 (datadir (string-append out "/share/maxima/" ,version)))
1979 (with-directory-excursion out
1980 (mkdir-p "share/emacs")
1981 (mkdir-p "share/doc")
1983 (string-append datadir "/emacs/")
1984 (string-append out "/share/emacs/site-lisp"))
1986 (string-append datadir "/doc/")
1987 (string-append out "/share/doc/maxima"))
1988 (with-atomic-file-replacement
1989 (string-append datadir "/share/maxima-init.lisp")
1991 (format out "~a ~s~a~%"
1992 "(setf $gnuplot_command "
1993 (string-append gnuplot "/bin/gnuplot") ")")
1994 (dump-port in out))))))
1995 %standard-phases))))
1996 (home-page "http://maxima.sourceforge.net")
1997 (synopsis "Numeric and symbolic expression manipulation")
1998 (description "Maxima is a system for the manipulation of symbolic and
1999 numerical expressions. It yields high precision numeric results by using
2000 exact fractions, arbitrary precision integers, and variable precision floating
2002 ;; Some files are lgpl2.1+. Some are gpl2+. Some explicitly state gpl1+.
2003 ;; Others simply say "GNU General Public License" without stating a
2004 ;; version (which implicitly means gpl1+).
2005 ;; At least one file (src/maxima.asd) says "version 2."
2006 ;; GPLv2 only is therefore the smallest subset.
2007 (license license:gpl2)))
2009 (define-public wxmaxima
2012 ;; Versions 16.12.0 to 16.12.2 have a bug which causes output lines to
2013 ;; overlap. See <https://debbugs.gnu.org/25793>
2018 (uri (string-append "mirror://sourceforge/wxmaxima/wxMaxima/"
2019 version "/" name "-" version ".tar.gz"))
2022 "1fpqzk1921isiqrpgpf433ldq41924qs9sy99fl1zn5661b2l73n"))))
2023 (build-system gnu-build-system)
2025 `(("wxwidgets" ,wxwidgets)
2028 ("adwaita-icon-theme" ,adwaita-icon-theme)
2030 ("shared-mime-info" ,shared-mime-info)))
2032 `(#:phases (modify-phases %standard-phases
2034 'install 'wrap-program
2035 (lambda* (#:key inputs outputs #:allow-other-keys)
2036 (wrap-program (string-append (assoc-ref outputs "out")
2039 (,(string-append (assoc-ref inputs "maxima")
2041 ;; For GtkFileChooserDialog.
2042 `("GSETTINGS_SCHEMA_DIR" =
2043 (,(string-append (assoc-ref inputs "gtk+")
2044 "/share/glib-2.0/schemas")))
2045 `("XDG_DATA_DIRS" ":" prefix
2046 (;; Needed by gdk-pixbuf to know supported icon formats.
2048 (assoc-ref inputs "shared-mime-info") "/share")
2049 ;; The default icon theme of GTK+.
2051 (assoc-ref inputs "adwaita-icon-theme") "/share"))))
2053 (home-page "https://andrejv.github.io/wxmaxima/")
2054 (synopsis "Graphical user interface for the Maxima computer algebra system")
2056 "wxMaxima is a graphical user interface for the Maxima computer algebra
2057 system. It eases the use of Maxima by making most of its commands available
2058 through a menu system and by providing input dialogs for commands that require
2059 more than one argument. It also implements its own display engine that
2060 outputs mathematical symbols directly instead of depicting them with ASCII
2063 wxMaxima also features 2D and 3D inline plots, simple animations, mixing of
2064 text and mathematical calculations to create documents, exporting of input and
2065 output to TeX, and a browser for Maxima's manual including command index and
2066 full text searching.")
2067 (license license:gpl2+)))
2069 (define-public armadillo
2075 (uri (string-append "mirror://sourceforge/arma/armadillo-"
2079 "0bac9y46m61zxinj51l82w06v01ra9vw7a9j6rrwdjhznkkdb437"))))
2080 (build-system cmake-build-system)
2081 (arguments `(#:tests? #f)) ;no test target
2083 `(("openblas" ,openblas)
2085 ("arpack" ,arpack-ng)))
2086 (home-page "http://arma.sourceforge.net/")
2087 (synopsis "C++ linear algebra library")
2089 "Armadillo is a C++ linear algebra library, aiming towards a good balance
2090 between speed and ease of use. It is useful for algorithm development
2091 directly in C++, or quick conversion of research code into production
2092 environments. It can be used for machine learning, pattern recognition,
2093 signal processing, bioinformatics, statistics, econometrics, etc. The library
2094 provides efficient classes for vectors, matrices and cubes, as well as 150+
2095 associated functions (eg. contiguous and non-contiguous submatrix views).")
2096 (license license:mpl2.0)))
2098 (define-public armadillo-for-rcpparmadillo
2099 (package (inherit armadillo)
2103 (uri (string-append "mirror://sourceforge/arma/armadillo-"
2107 "1dxgfd2r9lbh24nszvqm2lag439s0srxaf1l86f6ww6waqm5r8zk"))))))
2109 (define-public muparser
2110 ;; When switching download sites, muparser re-issued a 2.2.5 release with a
2111 ;; different hash. In order to make `guix package --upgrade` work correctly,
2112 ;; we set a Guix packaging revision.
2113 ;; When the next version of muparser is released, we can remove
2114 ;; UPSTREAM-VERSION and REVISION and use the plain VERSION.
2115 (let ((upstream-version "2.2.5")
2119 (version (string-append upstream-version "-" revision))
2123 (uri (string-append "https://github.com/beltoforion/muparser/archive/v"
2124 upstream-version ".tar.gz"))
2125 (file-name (string-append name "-" version ".tar.gz"))
2128 "0277qsi5l23jsck1vhn383bmvc2n9l4a1dl5r9bf7hvjv9ayyrh6"))))
2129 (build-system gnu-build-system)
2131 `(#:configure-flags '("--enable-samples=no")
2132 #:tests? #f)) ;no "check" target
2133 (home-page "http://muparser.beltoforion.de/")
2134 (synopsis "Fast parser library for mathematical expressions")
2136 "muParser is an extensible high performance math parser library. It is
2137 based on transforming an expression into a bytecode and precalculating constant
2139 (license license:expat))))
2141 (define-public openblas
2148 (uri (string-append "https://github.com/xianyi/OpenBLAS/tarball/v"
2150 (file-name (string-append name "-" version ".tar.gz"))
2153 "071zqnmnxhh0c9phzyn3f198yxa0hjxda7016azdbq2056sm70w7"))))
2154 (build-system gnu-build-system)
2156 `(#:tests? #f ;no "check" target
2157 ;; DYNAMIC_ARCH is only supported on x86. When it is disabled and no
2158 ;; TARGET is specified, OpenBLAS will tune itself to the build host, so
2159 ;; we need to disable substitutions.
2161 ,(let ((system (or (%current-target-system) (%current-system))))
2162 (or (string-prefix? "x86_64" system)
2163 (string-prefix? "i686" system)
2164 (string-prefix? "mips" system)))
2166 (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
2169 ;; Build the library for all supported CPUs. This allows
2170 ;; switching CPU targets at runtime with the environment variable
2171 ;; OPENBLAS_CORETYPE=<type>, where "type" is a supported CPU type.
2172 ;; Unfortunately, this is not supported on non-x86 architectures,
2173 ;; where it leads to failed builds.
2174 ,@(let ((system (or (%current-target-system) (%current-system))))
2176 ((or (string-prefix? "x86_64" system)
2177 (string-prefix? "i686" system))
2178 '("DYNAMIC_ARCH=1"))
2179 ;; On MIPS we force the "SICORTEX" TARGET, as for the other
2180 ;; two available MIPS targets special extended instructions
2181 ;; for Loongson cores are used.
2182 ((string-prefix? "mips" system)
2183 '("TARGET=SICORTEX"))
2185 ;; no configure script
2186 #:phases (alist-delete 'configure %standard-phases)))
2188 `(("fortran" ,gfortran)))
2192 (home-page "http://www.openblas.net/")
2193 (synopsis "Optimized BLAS library based on GotoBLAS")
2195 "OpenBLAS is a BLAS library forked from the GotoBLAS2-1.13 BSD version.")
2196 (license license:bsd-3)))
2198 (define-public openlibm
2205 (uri (string-append "https://github.com/JuliaLang/openlibm/archive/v"
2207 (file-name (string-append name "-" version ".tar.gz"))
2210 "11czx2z7nh6dfpz45s3xl7v38hw36jxzxfvny454bk3if14pfakq"))))
2211 (build-system gnu-build-system)
2214 (list (string-append "prefix=" (assoc-ref %outputs "out")))
2216 ;; no configure script
2217 (alist-delete 'configure %standard-phases)
2218 #:tests? #f)) ;the tests are part of the default target
2219 (home-page "http://openlibm.org/")
2220 (synopsis "Portable C mathematical library (libm)")
2222 "OpenLibm is an effort to have a high quality, portable, standalone C
2223 mathematical library (libm). It can be used standalone in applications and
2224 programming language implementations. The project was born out of a need to
2225 have a good libm for the Julia programming language that worked consistently
2226 across compilers and operating systems, and in 32-bit and 64-bit
2228 ;; Each architecture has its own make target, and there is none for mips.
2229 (supported-systems (delete "mips64el-linux" %supported-systems))
2230 ;; See LICENSE.md for details.
2231 (license (list license:expat
2234 license:public-domain
2235 license:lgpl2.1+))))
2237 (define-public openspecfun
2239 (name "openspecfun")
2244 (uri (string-append "https://github.com/JuliaLang/openspecfun/archive/v"
2246 (file-name (string-append name "-" version ".tar.gz"))
2249 "1y5b2h6f2k72536kym3vzy3li3bhpd23x463g7hdmjdi3cncavz1"))))
2250 (build-system gnu-build-system)
2252 '(#:tests? #f ;no "check" target
2254 (list (string-append "prefix=" (assoc-ref %outputs "out")))
2255 ;; no configure script
2256 #:phases (alist-delete 'configure %standard-phases)))
2258 `(("fortran" ,gfortran)))
2259 (home-page "https://github.com/JuliaLang/openspecfun")
2260 (synopsis "Collection of special mathematical functions")
2262 "Openspecfun provides AMOS and Faddeeva. AMOS (from Netlib) is a
2263 portable package for Bessel Functions of a Complex Argument and Nonnegative
2264 Order; it contains subroutines for computing Bessel functions and Airy
2265 functions. Faddeeva allows computing the various error functions of arbitrary
2266 complex arguments (Faddeeva function, error function, complementary error
2267 function, scaled complementary error function, imaginary error function, and
2268 Dawson function); given these, one can also easily compute Voigt functions,
2269 Fresnel integrals, and similar related functions as well.")
2270 ;; Faddeeva is released under the Expat license; AMOS is included as
2271 ;; public domain software.
2272 (license (list license:expat license:public-domain))))
2274 (define-public suitesparse
2276 (name "suitesparse")
2282 "http://faculty.cse.tamu.edu/davis/SuiteSparse/SuiteSparse-"
2286 "100hdzr0mf4mzlwnqpmwpfw4pymgsf9n3g0ywb1yps2nk1zbkdy5"))))
2287 (build-system gnu-build-system)
2289 '(#:parallel-build? #f ;cholmod build fails otherwise
2290 #:tests? #f ;no "check" target
2295 "CHOLMOD_CONFIG=-DNPARTITION" ;required when METIS is not used
2296 (string-append "INSTALL_LIB="
2297 (assoc-ref %outputs "out") "/lib")
2298 (string-append "INSTALL_INCLUDE="
2299 (assoc-ref %outputs "out") "/include"))
2302 'install 'prepare-out
2303 ;; README.txt states that the target directories must exist prior to
2304 ;; running "make install".
2306 (mkdir-p (string-append (assoc-ref %outputs "out") "/lib"))
2307 (mkdir-p (string-append (assoc-ref %outputs "out") "/include")))
2308 ;; no configure script
2309 (alist-delete 'configure %standard-phases))))
2312 ("lapack" ,lapack)))
2313 (home-page "http://faculty.cse.tamu.edu/davis/suitesparse.html")
2314 (synopsis "Suite of sparse matrix software")
2316 "SuiteSparse is a suite of sparse matrix algorithms, including: UMFPACK,
2317 multifrontal LU factorization; CHOLMOD, supernodal Cholesky; SPQR,
2318 multifrontal QR; KLU and BTF, sparse LU factorization, well-suited for circuit
2319 simulation; ordering methods (AMD, CAMD, COLAMD, and CCOLAMD); CSparse and
2320 CXSparse, a concise sparse Cholesky factorization package; and many other
2323 ;; AMD, CAMD, BTF, COLAMD, CCOLAMD, CSparse, CXSparse, KLU, LDL
2325 ;; GPUQREngine, RBio, SuiteSparse_GPURuntime, SuiteSparseQR, UMFPACK
2326 (license (list license:gpl2+ license:lgpl2.1+))))
2328 (define-public atlas
2334 (uri (string-append "mirror://sourceforge/math-atlas/Stable/"
2335 version "/atlas" version ".tar.bz2"))
2338 "1dyjlq3fiparvm8ypwk6rsmjzmnwk81l88gkishphpvc79ryp216"))))
2339 (build-system gnu-build-system)
2340 (home-page "http://math-atlas.sourceforge.net/")
2341 (inputs `(("gfortran" ,gfortran)
2342 ("lapack-tar" ,(package-source lapack))))
2343 (outputs '("out" "doc"))
2344 ;; For the moment we drop support for MIPS at it fails to compile. See
2345 ;; https://lists.gnu.org/archive/html/guix-devel/2014-11/msg00516.html
2346 (supported-systems (delete "mips64el-linux" %supported-systems))
2348 `(#:parallel-build? #f
2349 #:parallel-tests? #f
2351 ;; ATLAS tunes itself for the machine it is built on, as explained at
2352 ;; <http://lists.gnu.org/archive/html/guix-devel/2014-10/msg00305.html>.
2353 ;; For this reason, we want users to build it locally instead of using
2357 #:modules ((srfi srfi-26)
2359 (guix build gnu-build-system)
2362 `(;; Generate position independent code suitable for dynamic libraries
2363 ;; and use WALL timer to get more accurate timing.
2364 "-Fa" "alg" "-fPIC" "-D" "c" "-DWALL"
2367 ,,(if (string-match "64" (%current-system))
2370 ;; Disable parallel build as it gives errors: atlas_pthread.h is
2371 ;; needed to compile C files before it is generated.
2372 "-Ss" "pmake" "make -j 1"
2373 ;; Probe is failing for MIPS. We therefore define the system
2374 ;; architecture explicitly by setting (-A) MACHINETYPE = 49
2375 ;; 'MIPSR1xK' and (-V) ISA = 1 'none'.
2376 ,,@(if (string-prefix? "mips" (%current-system))
2377 (list "-A" "49" "-V" "1")
2379 ;; Generate shared libraries.
2381 ;; Build a full LAPACK library.
2382 ,(string-append "--with-netlib-lapack-tarfile="
2383 (assoc-ref %build-inputs "lapack-tar")))
2385 (modify-phases %standard-phases
2386 (add-after 'install 'install-doc
2387 (lambda* (#:key outputs inputs #:allow-other-keys)
2388 (let ((doc (string-append (assoc-ref outputs "doc")
2389 "/share/doc/atlas")))
2391 (fold (lambda (file previous)
2392 (and previous (zero? (system* "cp" file doc))))
2393 #t (find-files "../ATLAS/doc" ".*")))))
2394 (add-after 'check 'check-pt
2395 (lambda _ (zero? (system* "make" "ptcheck"))))
2396 ;; Fix files required to run configure.
2397 (add-before 'configure 'fix-/bin/sh
2399 ;; Use `sh', not `/bin/sh'.
2400 (substitute* (find-files "." "Makefile|configure|SpewMakeInc\\.c")
2403 ;; Fix /bin/sh in generated make files.
2404 (add-after 'configure 'fix-/bin/sh-in-generated-files
2406 (substitute* (find-files "." "^[Mm]ake\\.inc.*")
2409 ;; ATLAS configure program does not accepts the default flags
2410 ;; passed by the 'gnu-build-system'.
2412 (lambda* (#:key native-inputs inputs outputs
2413 (configure-flags '())
2414 #:allow-other-keys #:rest args)
2415 (let* ((prefix (assoc-ref outputs "out"))
2416 (bash (or (and=> (assoc-ref
2417 (or native-inputs inputs) "bash")
2418 (cut string-append <> "/bin/bash"))
2420 (flags `(,(string-append "--prefix=" prefix)
2422 (abs-srcdir (getcwd))
2423 (srcdir (string-append "../" (basename abs-srcdir))))
2424 (format #t "source directory: ~s (relative from build: ~s)~%"
2428 (format #t "build directory: ~s~%" (getcwd))
2429 (format #t "configure flags: ~s~%" flags)
2430 (zero? (apply system* bash
2431 (string-append srcdir "/configure")
2433 (synopsis "Automatically Tuned Linear Algebra Software")
2435 "ATLAS is an automatically tuned linear algebra software library
2436 providing C and Fortran77 interfaces to a portably efficient BLAS
2437 implementation, as well as a few routines from LAPACK.
2439 Optimization occurs at build time. For this reason, the library is built on
2440 the machine where it is installed, without resorting to pre-built substitutes.
2442 Before building the library, CPU throttling should be disabled. This can be
2443 done in the BIOS, or, on GNU/Linux, with the following command:
2446 # cpupower --governor performance
2449 Failure to do so will result in a library with poor performance.")
2450 (license license:bsd-3)))
2459 (uri (string-append "mirror://sourceforge/ogl-math/glm-" version
2460 "/glm-" version ".zip"))
2463 "1cnjmi033a16a95v6xfkr1bvfmkd26hzdjka8j1819hgn5b1nr8l"))))
2464 (build-system cmake-build-system)
2466 `(("unzip" ,unzip)))
2467 (home-page "http://glm.g-truc.net")
2468 (synopsis "OpenGL Mathematics library")
2469 (description "OpenGL Mathematics (GLM) is a header-only C++ mathematics
2470 library for graphics software based on the OpenGL Shading Language (GLSL)
2472 (license license:expat)))
2474 (define-public lpsolve
2481 (uri (string-append "mirror://sourceforge/lpsolve/lpsolve/" version
2482 "/lp_solve_" version "_source.tar.gz"))
2485 "176c7f023mb6b8bfmv4rfqnrlw88lsg422ca74zjh19i2h5s69sq"))
2486 (modules '((guix build utils)))
2488 '(substitute* (list "lp_solve/ccc" "lpsolve55/ccc")
2490 ;; Pretend to be on a 64 bit platform to obtain a common directory
2491 ;; name for the build results on all architectures; nothing else
2492 ;; seems to depend on it.
2493 (("^PLATFORM=.*$") "PLATFORM=ux64\n")
2495 ;; The check for 'isnan' as it is written fails with
2496 ;; "non-floating-point argument in call to function
2497 ;; ‘__builtin_isnan’", which leads to the 'NOISNAN' cpp macro
2498 ;; definition, which in turn leads to bad things. Fix the feature
2500 (("isnan\\(0\\)") "isnan(0.)")))))
2501 (build-system gnu-build-system)
2503 `(#:tests? #f ; no check target
2505 (modify-phases %standard-phases
2509 (and (with-directory-excursion "lpsolve55"
2510 (zero? (system* "bash" "ccc")))
2511 (with-directory-excursion "lp_solve"
2512 (zero? (system* "bash" "ccc"))))))
2514 (lambda* (#:key outputs #:allow-other-keys)
2515 (let* ((out (assoc-ref outputs "out"))
2516 (bin (string-append out "/bin"))
2517 (lib (string-append out "/lib"))
2518 ;; This is where LibreOffice expects to find the header
2519 ;; files, and where they are installed by Debian.
2520 (include (string-append out "/include/lpsolve")))
2522 (copy-file "lpsolve55/bin/ux64/liblpsolve55.a"
2523 (string-append lib "/liblpsolve55.a"))
2524 (copy-file "lpsolve55/bin/ux64/liblpsolve55.so"
2525 (string-append lib "/liblpsolve55.so"))
2526 (install-file "lp_solve/bin/ux64/lp_solve" bin)
2528 ;; Install a subset of the header files as on Debian
2529 ;; (plus lp_bit.h, which matches the regular expression).
2530 (for-each (lambda (name)
2531 (install-file name include))
2532 (find-files "." "lp_[HMSa-z].*\\.h$"))
2533 (with-directory-excursion "shared"
2534 (for-each (lambda (name)
2535 (install-file name include))
2536 (find-files "." "\\.h$")))
2538 (home-page "http://lpsolve.sourceforge.net/")
2539 (synopsis "Mixed integer linear programming (MILP) solver")
2541 "lp_solve is a mixed integer linear programming solver based on the
2542 revised simplex and the branch-and-bound methods.")
2543 (license license:lgpl2.1+)))
2545 (define-public dealii
2552 (uri (string-append "https://github.com/dealii/dealii/releases/"
2553 "download/v" version "/dealii-" version ".tar.gz"))
2556 "1bdksvvyp1rj37df1ndh8j3x9nzpc3sazw8nd0hzvnlw0qnyk800"))
2557 (modules '((guix build utils)))
2559 ;; Remove bundled sources: UMFPACK, TBB, muParser, and boost
2560 '(delete-file-recursively "bundled"))))
2561 (build-system cmake-build-system)
2569 ("arpack" ,arpack-ng)
2570 ("muparser" ,muparser)
2571 ("gfortran" ,gfortran)
2572 ("suitesparse" ,suitesparse))) ;for UMFPACK
2574 `(#:build-type "DebugRelease" ;only supports Release, Debug, or DebugRelease
2575 #:configure-flags '("-DCOMPAT_FILES=OFF") ;Follow new directory structure
2576 #:phases (modify-phases %standard-phases
2578 'install 'hint-example-prefix
2579 ;; Set Cmake hints in examples so that they can find this
2580 ;; deal.II when configuring.
2581 (lambda* (#:key outputs #:allow-other-keys)
2582 (let* ((out (assoc-ref %outputs "out"))
2583 (exmpl (string-append out "/share/doc"
2584 "/dealii/examples")))
2585 (substitute* (find-files exmpl "CMakeLists.txt")
2586 (("([[:space:]]*HINTS.*)\n" _ line)
2587 (string-append line " $ENV{HOME}/.guix-profile "
2590 (home-page "https://www.dealii.org")
2591 (synopsis "Finite element library")
2593 "Deal.II is a C++ program library targeted at the computational solution
2594 of partial differential equations using adaptive finite elements. The main
2595 aim of deal.II is to enable rapid development of modern finite element codes,
2596 using among other aspects adaptive meshes and a wide array of tools often used
2597 in finite element programs.")
2598 (license license:lgpl2.1+)))
2600 (define-public dealii-openmpi
2601 (package (inherit dealii)
2602 (name "dealii-openmpi")
2605 ;;Supported only with MPI:
2606 ("p4est" ,p4est-openmpi)
2607 ("petsc" ,petsc-openmpi)
2608 ("slepc" ,slepc-openmpi)
2609 ("metis" ,metis) ;for MUMPS
2610 ("scalapack" ,scalapack) ;for MUMPS
2611 ("mumps" ,mumps-metis-openmpi) ;configure supports only metis orderings
2612 ("arpack" ,arpack-ng-openmpi)
2613 ,@(fold alist-delete (package-inputs dealii)
2614 '("p4est" "arpack"))))
2616 (substitute-keyword-arguments (package-arguments dealii)
2617 ((#:configure-flags cf)
2618 ``("-DMPI_C_COMPILER=mpicc"
2619 "-DMPI_CXX_COMPILER=mpicxx"
2620 "-DMPI_Fortran_COMPILER=mpifort"
2622 (synopsis "Finite element library (with MPI support)")))
2624 (define-public flann
2633 "http://www.cs.ubc.ca/research/flann/uploads/FLANN/flann-"
2634 version "-src.zip"))
2637 "022w8hph7bli5zbpnk3z1qh1c2sl5hm8fw2ccim651ynn0hr7fyz"))))
2638 (build-system cmake-build-system)
2640 `(("unzip" ,unzip)))
2644 ("python" ,python-2) ; print syntax
2645 ;; ("python2-numpy" ,python2-numpy) ; only required for the tests
2648 `(;; The 'share/flann/octave' contains a .mex file, which is an ELF file
2649 ;; taken 46 MiB unstripped, and 6 MiB stripped.
2650 #:strip-directories '("lib" "lib64" "libexec"
2651 "bin" "sbin" "share/flann/octave")
2653 ;; Save 12 MiB by not installing .a files. Passing
2654 ;; '-DBUILD_STATIC_LIBS=OFF' has no effect.
2655 #:phases (modify-phases %standard-phases
2656 (add-after 'install 'remove-static-libraries
2657 (lambda* (#:key outputs #:allow-other-keys)
2658 (let* ((out (assoc-ref outputs "out"))
2659 (lib (string-append out "/lib")))
2660 (for-each delete-file
2661 (find-files lib "\\.a$"))
2664 #:tests? #f)) ; The test data are downloaded from the Internet.
2665 (home-page "http://www.cs.ubc.ca/research/flann/")
2666 (synopsis "Library for approximate nearest neighbors computation")
2667 (description "FLANN is a library for performing fast approximate
2668 nearest neighbor searches in high dimensional spaces. It implements a
2669 collection of algorithms and a system for automatically choosing the best
2670 algorithm and optimum parameters depending on the dataset.
2672 FLANN is written in C++ and contains bindings for C, Octave and Python.")
2673 (license (license:non-copyleft "file://COPYING"
2674 "See COPYING in the distribution."))))
2676 (define-public wcalc
2683 (uri (string-append "mirror://sourceforge/w-calc/Wcalc/" version "/"
2684 "wcalc-" version ".tar.bz2"))
2687 "1vi8dl6rccqiq1apmpwawyg2ywx6a1ic1d3cvkf2hlwk1z11fb0f"))))
2688 (build-system gnu-build-system)
2691 ("readline" ,readline)))
2692 (home-page "http://w-calc.sourceforge.net/index.php")
2693 (synopsis "Flexible command-line scientific calculator")
2694 (description "Wcalc is a very capable calculator. It has standard functions
2695 (sin, asin, and sinh for example, in either radians or degrees), many
2696 pre-defined constants (pi, e, c, etc.), support for using variables, \"active\"
2697 variables, a command history, hex/octal/binary input and output, unit
2698 conversions, embedded comments, and an expandable expression entry field. It
2699 evaluates expressions using the standard order of operations.")
2700 (license license:gpl2+)))
2708 (uri (string-append "mirror://sourceforge/xaos/XaoS/" version
2709 "/xaos-" version ".tar.gz"))
2712 "15cd1cx1dyygw6g2nhjqq3bsfdj8sj8m4va9n75i0f3ryww3x7wq"))))
2713 (build-system gnu-build-system)
2714 (native-inputs `(("gettext" ,gettext-minimal)))
2715 (inputs `(("libx11" ,libx11)
2720 `(#:tests? #f ;no "check" target
2721 #:make-flags '("LOCALEDIR=$DATAROOTDIR/locale")))
2722 (synopsis "Real-time fractal zoomer")
2723 (description "GNU XaoS is a graphical program that generates fractal
2724 patterns and allows you to zoom in and out of them infinitely in a fluid,
2725 continuous manner. It also includes tutorials that help to explain how fractals
2726 are built. It can generate many different fractal types such as the Mandelbrot
2728 (home-page "http://www.gnu.org/software/xaos/")
2729 (license license:gpl2+)))
2731 (define-public hypre
2737 (uri (string-append "https://github.com/LLNL/hypre/archive/"
2738 "v" version ".tar.gz"))
2739 (file-name (string-append name "-" version ".tar.gz"))
2742 "0q69ia0jivzcr8p049dn3mg8yjpn6nwq4sw9iqac8vr63vi54l6m"))
2743 (modules '((guix build utils)))
2746 ;; Remove use of __DATE__ and __TIME__ for reproducibility;
2747 ;; substitute the tarball creation time.
2748 (substitute* "src/utilities/HYPRE_utilities.h"
2749 (("Date Compiled: .*$")
2750 "Date Compiled: Mar 28 2016 20:19:59 +0000\"\n"))
2752 (build-system gnu-build-system)
2753 (outputs '("out" ;6.1 MiB of headers and libraries
2754 "doc")) ;4.8 MiB of documentation
2758 ("texlive" ,texlive) ;full package required for fonts
2759 ("ghostscript" ,ghostscript)))
2761 `(("blas" ,openblas)
2762 ("lapack" ,lapack)))
2764 `(#:modules ((srfi srfi-1)
2765 ,@%gnu-build-system-modules)
2766 #:configure-flags '("--enable-shared"
2774 (modify-phases %standard-phases
2775 (add-before 'configure 'chdir-src
2776 (lambda _ (chdir "src")))
2778 (lambda* (#:key build target configure-flags
2779 #:allow-other-keys #:rest args)
2780 (let* ((configure (assoc-ref %standard-phases 'configure)))
2783 (list #:configure-flags
2784 (cons (string-append
2785 "--host=" (or target build))
2786 configure-flags)))))))
2787 (add-after 'build 'build-docs
2789 (zero? (system* "make" "-Cdocs" "pdf" "html"))))
2792 (setenv "LD_LIBRARY_PATH" (string-append (getcwd) "/hypre/lib"))
2793 (setenv "PATH" (string-append "." ":" (getenv "PATH")))
2794 (and (system* "make" "check" "CHECKRUN=")
2795 (fold (lambda (filename result)
2797 (let ((size (stat:size (stat filename))))
2798 (when (not (zero? size))
2799 (format #t "~a size ~d; error indication~%"
2803 (find-files "test" ".*\\.err$")))))
2804 (add-after 'install 'install-docs
2805 (lambda* (#:key outputs #:allow-other-keys)
2806 ;; Custom install because docs/Makefile doesn't honor ${docdir}.
2807 (let* ((doc (assoc-ref outputs "doc"))
2808 (docdir (string-append doc "/share/doc/hypre-" ,version)))
2809 (with-directory-excursion "docs"
2810 (for-each (lambda (base)
2811 (install-file (string-append base ".pdf") docdir)
2812 (copy-recursively base docdir)) ;html docs
2813 '("HYPRE_usr_manual"
2814 "HYPRE_ref_manual")))
2816 (home-page "http://www.llnl.gov/casc/hypre/")
2817 (synopsis "Library of solvers and preconditioners for linear equations")
2819 "HYPRE is a software library of high performance preconditioners and
2820 solvers for the solution of large, sparse linear systems of equations. It
2821 features multigrid solvers for both structured and unstructured grid
2823 (license license:lgpl2.1)))
2825 (define-public hypre-openmpi
2826 (package (inherit hypre)
2827 (name "hypre-openmpi")
2830 ,@(package-inputs hypre)))
2832 (substitute-keyword-arguments (package-arguments hypre)
2833 ((#:configure-flags flags)
2835 ,@(delete "--without-MPI" ,flags)))))
2836 (synopsis "Parallel solvers and preconditioners for linear equations")
2838 "HYPRE is a software library of high performance preconditioners and
2839 solvers for the solution of large, sparse linear systems of equations on
2840 parallel computers. It features parallel multigrid solvers for both
2841 structured and unstructured grid problems.")))
2843 (define-public matio
2850 (uri (string-append "mirror://sourceforge/matio/matio/" version "/"
2851 "matio-" version ".tar.gz"))
2854 "0y2qymgxank8wdiwc68ap8bxdzrhvyw86i29yh3xgn4z1njfd9ir"))))
2855 (build-system gnu-build-system)
2859 (home-page "http://matio.sourceforge.net/")
2860 (synopsis "Library for reading and writing MAT files")
2861 (description "Matio is a library for reading and writing MAT files. It
2862 supports compressed MAT files, as well as newer (version 7.3) MAT files.")
2863 (license license:bsd-2)))
2865 (define-public libhilbert
2872 (uri (string-append "http://web.cs.dal.ca/~chamilto/hilbert/"
2873 "libhilbert-" version ".tar.gz"))
2876 "0v48x8405dj95gjn2saja4bzhw86d6zl6d3dg8h7dzac2qr97s34"))))
2877 (build-system gnu-build-system)
2878 (home-page "http://web.cs.dal.ca/~chamilto/hilbert")
2879 (synopsis "Hilbert indices for multidimensional data")
2880 (description "The libhilbert library can efficiently calculate Hilbert
2881 curves and order-preserving representations of Hilbert curve indices that use
2882 the same amount of space as the original point representation. This is useful
2883 when using the Gilbert curve as a space filling curve through a
2884 high-dimensional space where not all demensions have the same cardinality.")
2885 (license license:lgpl2.1+)))
2892 (origin (method url-fetch)
2893 (uri (string-append "https://github.com/VcDevel/Vc/releases/"
2894 "download/" version "/Vc-" version ".tar.gz"))
2897 "1rh6dhqar3y07n4xqyml0sa0v48qv3ch9dc3yc2in855hlh4vnqi"))))
2898 (build-system cmake-build-system)
2901 '("-DBUILD_TESTING=ON")))
2902 (synopsis "SIMD vector classes for C++")
2903 (description "Vc provides portable, zero-overhead C++ types for explicitly
2904 data-parallel programming. It is a library designed to ease explicit
2905 vectorization of C++ code. Its types enable explicitly stating data-parallel
2906 operations on multiple values. The parallelism is therefore added via the type
2907 system. Vc has an intuitive API and provides portability between different
2908 compilers and compiler versions as well as portability between different vector
2909 instruction sets. Thus, an application written with Vc can be compiled for:
2912 @item SSE2 upto SSE4.2 or SSE4a
2915 @item NEON (in development)
2916 @item NVIDIA GPUs / CUDA (in development)
2918 (home-page "https://github.com/VcDevel/Vc")
2919 (license license:bsd-3)))
2921 (define-public reducelcs
2922 ;; This is the last commit which is available upstream, no
2923 ;; release happened since 2010.
2924 (let ((commit "474f88deb968061abe8cf11c959e02319b8ae5c0")
2928 (version (string-append "1.0-" revision "." (string-take commit 7)))
2933 (url "https://github.com/gdv/Reduce-Expand-for-LCS")
2935 (file-name (string-append name "-" version "-checkout"))
2938 "1rllzcfwc042c336mhq262a8ha90x6afq30kvk60r7i4761j4yjm"))))
2939 (build-system gnu-build-system)
2941 `(("openlibm" ,openlibm)))
2943 `(#:tests? #f ; no tests
2945 (modify-phases %standard-phases
2946 (delete 'configure) ; No configure script exists.
2947 (replace 'install ; No install phase exists.
2948 (lambda* (#:key outputs #:allow-other-keys)
2949 (let* ((out (assoc-ref outputs "out"))
2950 (bin (string-append out "/bin")))
2951 (install-file "Approximation" bin)
2952 (install-file "CollectResults" bin)
2953 (install-file "GenerateInstances" bin)
2955 (synopsis "Approximate Longest Commons Subsequence computation tool")
2957 "@code{reduceLCS} is an implementation of the Reduce-Expand
2958 algorithm for LCS. It is a fast program to compute the approximate
2959 Longest Commons Subsequence of a set of strings.")
2960 (home-page "https://github.com/gdv/Reduce-Expand-for-LCS")
2961 (license license:gpl3+))))
2963 (define-public jacal
2970 "http://groups.csail.mit.edu/mac/ftpdir/scm/jacal-"
2973 "055zrn12a1dmy0dqkwrkq3fklbhg3yir6vn0lacp4mvbg8573a3q"))
2974 (patches (search-patches "jacal-fix-texinfo.patch"))))
2975 (build-system gnu-build-system)
2978 (modify-phases %standard-phases
2979 (add-before 'build 'pre-build
2980 ;; Don't use upstream's script - it really doesn't fit into
2981 ;; Guix's functional paradigm.
2982 (lambda* (#:key inputs outputs #:allow-other-keys)
2983 (substitute* "Makefile"
2984 (("^install: install-script") "install: "))))
2985 (add-after 'install 'post-install
2986 ;; Instead, we provide our own simplified script.
2987 (lambda* (#:key inputs outputs #:allow-other-keys)
2988 (let ((wrapper (string-append (assoc-ref outputs "out")
2990 (format (open wrapper (logior O_WRONLY O_CREAT))
2991 (string-append "#!~a\nexec ~a/bin/scm -ip1 "
2992 "-e '(slib:load \"~a/lib/jacal/math\") "
2995 (assoc-ref inputs "scm")
2996 (assoc-ref outputs "out"))
2997 (chmod wrapper #o555))))
2999 (lambda* (#:key inputs outputs #:allow-other-keys)
3000 (zero? (system* "./configure"
3001 (string-append "--prefix="
3002 (assoc-ref outputs "out")))))))))
3003 (inputs `(("scm" ,scm)))
3004 (native-inputs `(("unzip" ,unzip)
3005 ("texinfo" ,texinfo)))
3006 (synopsis "Symbolic mathematics system")
3007 (description "GNU JACAL is an interactive symbolic mathematics program based on
3008 Scheme. It manipulate and simplify a range of mathematical expressions such
3009 as equations, scalars, vectors, and matrices.")
3010 (home-page "http://www.gnu.org/software/jacal")
3011 (license license:gpl3+)))