| 1 | ;;; GNU Guix --- Functional package management for GNU |
| 2 | ;;; Copyright © 2013 Andreas Enge <andreas@enge.fr> |
| 3 | ;;; Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org> |
| 4 | ;;; Copyright © 2014 John Darrington <jmd@gnu.org> |
| 5 | ;;; |
| 6 | ;;; This file is part of GNU Guix. |
| 7 | ;;; |
| 8 | ;;; GNU Guix is free software; you can redistribute it and/or modify it |
| 9 | ;;; under the terms of the GNU General Public License as published by |
| 10 | ;;; the Free Software Foundation; either version 3 of the License, or (at |
| 11 | ;;; your option) any later version. |
| 12 | ;;; |
| 13 | ;;; GNU Guix is distributed in the hope that it will be useful, but |
| 14 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | ;;; GNU General Public License for more details. |
| 17 | ;;; |
| 18 | ;;; You should have received a copy of the GNU General Public License |
| 19 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. |
| 20 | |
| 21 | (define-module (gnu packages maths) |
| 22 | #:use-module (gnu packages) |
| 23 | #:use-module ((guix licenses) |
| 24 | #:renamer (symbol-prefix-proc 'license:)) |
| 25 | #:use-module (guix packages) |
| 26 | #:use-module (guix download) |
| 27 | #:use-module (guix build-system cmake) |
| 28 | #:use-module (guix build-system gnu) |
| 29 | #:use-module (gnu packages compression) |
| 30 | #:use-module (gnu packages curl) |
| 31 | #:use-module (gnu packages fltk) |
| 32 | #:use-module (gnu packages fontutils) |
| 33 | #:use-module (gnu packages gettext) |
| 34 | #:use-module (gnu packages gcc) |
| 35 | #:use-module (gnu packages gd) |
| 36 | #:use-module (gnu packages ghostscript) |
| 37 | #:use-module (gnu packages gtk) |
| 38 | #:use-module (gnu packages less) |
| 39 | #:use-module (gnu packages xorg) |
| 40 | #:use-module (gnu packages gl) |
| 41 | #:use-module (gnu packages multiprecision) |
| 42 | #:use-module (gnu packages pcre) |
| 43 | #:use-module (gnu packages perl) |
| 44 | #:use-module (gnu packages pkg-config) |
| 45 | #:use-module (gnu packages python) |
| 46 | #:use-module (gnu packages readline) |
| 47 | #:use-module (gnu packages texinfo) |
| 48 | #:use-module (gnu packages texlive) |
| 49 | #:use-module (gnu packages xml)) |
| 50 | |
| 51 | (define-public units |
| 52 | (package |
| 53 | (name "units") |
| 54 | (version "2.11") |
| 55 | (source (origin |
| 56 | (method url-fetch) |
| 57 | (uri (string-append "mirror://gnu/units/units-" version |
| 58 | ".tar.gz")) |
| 59 | (sha256 (base32 |
| 60 | "1gjs3wc212aaiq4r76hx9nl1h3fa39n0ljwl9420d6ixl3rdmdjk")))) |
| 61 | (build-system gnu-build-system) |
| 62 | (synopsis "Conversion between thousands of scales") |
| 63 | (description |
| 64 | "GNU Units converts numeric quantities between units of measure. It |
| 65 | can handle scale changes through adaptive usage of standard scale prefixes |
| 66 | (micro-, kilo-, etc.). It can also handle nonlinear conversions such as |
| 67 | Fahrenheit to Celsius. Its interpreter is powerful enough to be used |
| 68 | effectively as a scientific calculator.") |
| 69 | (license license:gpl3+) |
| 70 | (home-page "http://www.gnu.org/software/units/"))) |
| 71 | |
| 72 | (define-public gsl |
| 73 | (package |
| 74 | (name "gsl") |
| 75 | (version "1.16") |
| 76 | (source |
| 77 | (origin |
| 78 | (method url-fetch) |
| 79 | (uri (string-append "mirror://gnu/gsl/gsl-" |
| 80 | version ".tar.gz")) |
| 81 | (sha256 |
| 82 | (base32 |
| 83 | "0lrgipi0z6559jqh82yx8n4xgnxkhzj46v96dl77hahdp58jzg3k")))) |
| 84 | (build-system gnu-build-system) |
| 85 | (arguments |
| 86 | `(#:parallel-tests? #f |
| 87 | #:phases |
| 88 | (alist-replace |
| 89 | 'configure |
| 90 | (lambda* (#:key target system outputs #:allow-other-keys #:rest args) |
| 91 | (let ((configure (assoc-ref %standard-phases 'configure))) |
| 92 | ;; disable numerically unstable test on i686, see thread at |
| 93 | ;; http://lists.gnu.org/archive/html/bug-gsl/2011-11/msg00019.html |
| 94 | (if (string=? (or target system) "i686-linux") |
| 95 | (substitute* "ode-initval2/Makefile.in" |
| 96 | (("TESTS = \\$\\(check_PROGRAMS\\)") "TESTS ="))) |
| 97 | (apply configure args))) |
| 98 | %standard-phases))) |
| 99 | (home-page "http://www.gnu.org/software/gsl/") |
| 100 | (synopsis "Numerical library for C and C++") |
| 101 | (description |
| 102 | "The GNU Scientific Library is a library for numerical analysis in C |
| 103 | and C++. It includes a wide range of mathematical routines, with over 1000 |
| 104 | functions in total. Subject areas covered by the library include: |
| 105 | differential equations, linear algebra, Fast Fourier Transforms and random |
| 106 | numbers.") |
| 107 | (license license:gpl3+))) |
| 108 | |
| 109 | (define-public glpk |
| 110 | (package |
| 111 | (name "glpk") |
| 112 | (version "4.54") |
| 113 | (source |
| 114 | (origin |
| 115 | (method url-fetch) |
| 116 | (uri (string-append "mirror://gnu/glpk/glpk-" |
| 117 | version ".tar.gz")) |
| 118 | (sha256 |
| 119 | (base32 |
| 120 | "18gr2anv8gyps6j9f22k7li6w07glvww666sdqblvlq2hh3whwmb")))) |
| 121 | (build-system gnu-build-system) |
| 122 | (inputs |
| 123 | `(("gmp" ,gmp))) |
| 124 | (arguments |
| 125 | `(#:configure-flags '("--with-gmp"))) |
| 126 | (home-page "http://www.gnu.org/software/glpk/") |
| 127 | (synopsis "GNU Linear Programming Kit, supporting the MathProg language") |
| 128 | (description |
| 129 | "GLPK is a C library for solving large-scale linear programming (LP), |
| 130 | mixed integer programming (MIP), and other related problems. It supports the |
| 131 | GNU MathProg modeling language, a subset of the AMPL language, and features a |
| 132 | translator for the language. In addition to the C library, a stand-alone |
| 133 | LP/MIP solver is included in the package.") |
| 134 | (license license:gpl3+))) |
| 135 | |
| 136 | (define-public pspp |
| 137 | (package |
| 138 | (name "pspp") |
| 139 | (version "0.8.2") |
| 140 | (source |
| 141 | (origin |
| 142 | (method url-fetch) |
| 143 | (uri (string-append "mirror://gnu/pspp/pspp-" |
| 144 | version ".tar.gz")) |
| 145 | (sha256 |
| 146 | (base32 |
| 147 | "1w7h3dglgx0jlq1wb605b8pgfsk2vr1q2q2rj7bsajh9ihbcsixr")))) |
| 148 | (build-system gnu-build-system) |
| 149 | (inputs |
| 150 | `(("cairo" ,cairo) |
| 151 | ("fontconfig" ,fontconfig) |
| 152 | ("gettext" ,gnu-gettext) |
| 153 | ("gsl" ,gsl) |
| 154 | ("libxml2" ,libxml2) |
| 155 | ("pango" ,pango) |
| 156 | ("readline" ,readline) |
| 157 | ("gtk" ,gtk+-2) |
| 158 | ("gtksourceview" ,gtksourceview) |
| 159 | ("zlib" ,zlib))) |
| 160 | (native-inputs |
| 161 | `(("perl" ,perl) |
| 162 | ("pkg-config" ,pkg-config))) |
| 163 | (home-page "http://www.gnu.org/software/pspp/") |
| 164 | (synopsis "Statistical analysis") |
| 165 | (description |
| 166 | "GNU PSPP is a statistical analysis program. It can perform |
| 167 | descriptive statistics, T-tests, linear regression and non-parametric tests. |
| 168 | It features both a graphical interface as well as command-line input. PSPP is |
| 169 | designed to interoperate with Gnumeric, LibreOffice and OpenOffice. Data can |
| 170 | be imported from spreadsheets, text files and database sources and it can be |
| 171 | output in text, PostScript, PDF or HTML.") |
| 172 | (license license:gpl3+))) |
| 173 | |
| 174 | (define-public lapack |
| 175 | (package |
| 176 | (name "lapack") |
| 177 | (version "3.5.0") |
| 178 | (source |
| 179 | (origin |
| 180 | (method url-fetch) |
| 181 | (uri (string-append "http://www.netlib.org/lapack/lapack-" |
| 182 | version ".tgz")) |
| 183 | (sha256 |
| 184 | (base32 |
| 185 | "0lk3f97i9imqascnlf6wr5mjpyxqcdj73pgj97dj2mgvyg9z1n4s")))) |
| 186 | (build-system cmake-build-system) |
| 187 | (home-page "http://www.netlib.org/lapack/") |
| 188 | (inputs `(("fortran" ,gfortran-4.8) |
| 189 | ("python" ,python-2))) |
| 190 | (arguments |
| 191 | `(#:modules ((guix build cmake-build-system) |
| 192 | (guix build utils) |
| 193 | (srfi srfi-1)) |
| 194 | #:configure-flags '("-DBUILD_SHARED_LIBS:BOOL=YES") |
| 195 | #:phases (alist-cons-before |
| 196 | 'check 'patch-python |
| 197 | (lambda* (#:key inputs #:allow-other-keys) |
| 198 | (let ((python (assoc-ref inputs "python"))) |
| 199 | (substitute* "lapack_testing.py" |
| 200 | (("/usr/bin/env python") python)))) |
| 201 | %standard-phases))) |
| 202 | (synopsis "Library for numerical linear algebra") |
| 203 | (description |
| 204 | "LAPACK is a Fortran 90 library for solving the most commonly occurring |
| 205 | problems in numerical linear algebra.") |
| 206 | (license (license:bsd-style "file://LICENSE" |
| 207 | "See LICENSE in the distribution.")))) |
| 208 | |
| 209 | (define-public gnuplot |
| 210 | (package |
| 211 | (name "gnuplot") |
| 212 | (version "4.6.3") |
| 213 | (source |
| 214 | (origin |
| 215 | (method url-fetch) |
| 216 | (uri (string-append "mirror://sourceforge/gnuplot/gnuplot/" |
| 217 | version "/gnuplot-" version ".tar.gz")) |
| 218 | (sha256 |
| 219 | (base32 |
| 220 | "1xd7gqdhlk7k1p9yyqf9vkk811nadc7m4si0q3nb6cpv4pxglpyz")))) |
| 221 | (build-system gnu-build-system) |
| 222 | (inputs `(("readline" ,readline) |
| 223 | ("cairo" ,cairo) |
| 224 | ("pango" ,pango) |
| 225 | ("gd" ,gd))) |
| 226 | (native-inputs `(("texlive" ,texlive) |
| 227 | ("pkg-config" ,pkg-config))) |
| 228 | (home-page "http://www.gnuplot.info") |
| 229 | (synopsis "Command-line driven graphing utility") |
| 230 | (description "Gnuplot is a portable command-line driven graphing |
| 231 | utility. It was originally created to allow scientists and students to |
| 232 | visualize mathematical functions and data interactively, but has grown to |
| 233 | support many non-interactive uses such as web scripting. It is also used as a |
| 234 | plotting engine by third-party applications like Octave.") |
| 235 | ;; X11 Style with the additional restriction that derived works may only be |
| 236 | ;; distributed as patches to the original. |
| 237 | (license (license:fsf-free |
| 238 | "http://gnuplot.cvs.sourceforge.net/gnuplot/gnuplot/Copyright")))) |
| 239 | |
| 240 | (define-public hdf5 |
| 241 | (package |
| 242 | (name "hdf5") |
| 243 | (version "1.8.12") |
| 244 | (source |
| 245 | (origin |
| 246 | (method url-fetch) |
| 247 | (uri (string-append "http://www.hdfgroup.org/ftp/HDF5/current/src/hdf5-" |
| 248 | version ".tar.bz2")) |
| 249 | (sha256 |
| 250 | (base32 "0f9n0v3p3lwc7564791a39c6cn1d3dbrn7d1j3ikqsi27a8hy23d")))) |
| 251 | (build-system gnu-build-system) |
| 252 | (arguments |
| 253 | `(#:phases |
| 254 | (alist-cons-before |
| 255 | 'configure 'patch-configure |
| 256 | (lambda _ |
| 257 | (substitute* "configure" |
| 258 | (("/bin/mv") "mv"))) |
| 259 | %standard-phases))) |
| 260 | (outputs '("out" "bin" "lib" "include")) |
| 261 | (home-page "http://www.hdfgroup.org") |
| 262 | (synopsis "Management suite for extremely large and complex data") |
| 263 | (description "HDF5 is a suite that makes possible the management of |
| 264 | extremely large and complex data collections.") |
| 265 | (license (license:x11-style |
| 266 | "http://www.hdfgroup.org/ftp/HDF5/current/src/unpacked/COPYING")))) |
| 267 | |
| 268 | |
| 269 | ;; For a fully featured Octave, users are strongly recommended also to install |
| 270 | ;; the following packages: texinfo, less, ghostscript, gnuplot. |
| 271 | (define-public octave |
| 272 | (package |
| 273 | (name "octave") |
| 274 | (version "3.8.0") |
| 275 | (source |
| 276 | (origin |
| 277 | (method url-fetch) |
| 278 | (uri (string-append "mirror://gnu/octave/octave-" |
| 279 | version ".tar.gz")) |
| 280 | (sha256 |
| 281 | (base32 |
| 282 | "0ks9pr154syw0vb3jn6xsnrkkrbvf9y7i7gaxa28rz6ngxbxvq9l")))) |
| 283 | (build-system gnu-build-system) |
| 284 | (inputs |
| 285 | `(("lapack" ,lapack) |
| 286 | ("readline" ,readline) |
| 287 | ("glpk" ,glpk) |
| 288 | ("curl" ,curl) |
| 289 | ("pcre" ,pcre) |
| 290 | ("fltk" ,fltk) |
| 291 | ("fontconfig" ,fontconfig) |
| 292 | ("freetype" ,freetype) |
| 293 | ("hdf5-lib" ,hdf5 "lib") |
| 294 | ("hdf5-include" ,hdf5 "include") |
| 295 | ("libxft" ,libxft) |
| 296 | ("mesa" ,mesa) |
| 297 | ("zlib" ,zlib))) |
| 298 | (native-inputs |
| 299 | `(("gfortran" ,gfortran-4.8) |
| 300 | ("pkg-config" ,pkg-config) |
| 301 | ("perl" ,perl) |
| 302 | ;; The following inputs are not actually used in the build process. However, the |
| 303 | ;; ./configure gratuitously tests for their existence and assumes that programs not |
| 304 | ;; present at build time are also not, and can never be, available at run time! |
| 305 | ;; If these inputs are therefore not present, support for them will be built out. |
| 306 | ;; However, Octave will still run without them, albeit without the features they |
| 307 | ;; provide. |
| 308 | ("less" ,less) |
| 309 | ("texinfo" ,texinfo) |
| 310 | ("ghostscript" ,ghostscript) |
| 311 | ("gnuplot" ,gnuplot))) |
| 312 | (arguments |
| 313 | `(#:configure-flags (list (string-append "--with-shell=" |
| 314 | (assoc-ref %build-inputs "bash") |
| 315 | "/bin/sh")))) |
| 316 | (home-page "http://www.gnu.org/software/octave/") |
| 317 | (synopsis "High-level language for numerical computation") |
| 318 | (description "GNU Octave is a high-level interpreted language that is specialized |
| 319 | for numerical computations. It can be used for both linear and non-linear |
| 320 | applications and it provides great support for visualizing results. Work may |
| 321 | be performed both at the interactive command-line as well as via script |
| 322 | files.") |
| 323 | (license license:gpl3+))) |