Commit | Line | Data |
---|---|---|
8f8b2451 | 1 | ;;; GNU Guix --- Functional package management for GNU |
b146763a | 2 | ;;; Copyright © 2013, 2014, 2015, 2016 Andreas Enge <andreas@enge.fr> |
da95c817 | 3 | ;;; Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org> |
a53d6719 | 4 | ;;; Copyright © 2014, 2016, 2017 John Darrington <jmd@gnu.org> |
e01397b4 | 5 | ;;; Copyright © 2014, 2015, 2016, 2017, 2018 Eric Bavier <bavier@member.fsf.org> |
df354a77 | 6 | ;;; Copyright © 2014 Federico Beffa <beffa@fbengineering.ch> |
182d6311 | 7 | ;;; Copyright © 2014 Mathieu Lirzin <mathieu.lirzin@openmailbox.org> |
4dba441c | 8 | ;;; Copyright © 2015, 2016, 2017, 2018 Ricardo Wurmus <rekado@elephly.net> |
32158110 | 9 | ;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com> |
9aafbc0c | 10 | ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org> |
83a34647 | 11 | ;;; Copyright © 2015, 2016, 2017 Efraim Flashner <efraim@flashner.co.il> |
45147b0c | 12 | ;;; Copyright © 2015 Fabian Harfert <fhmgufs@web.de> |
ec8c7e47 | 13 | ;;; Copyright © 2016 Roel Janssen <roel@gnu.org> |
3c8ba11a | 14 | ;;; Copyright © 2016 Kei Kebreau <kkebreau@posteo.net> |
5d4bd4cc | 15 | ;;; Copyright © 2016, 2017 Ludovic Courtès <ludo@gnu.org> |
d7cff656 | 16 | ;;; Copyright © 2016 Leo Famulari <leo@famulari.name> |
2fd26d05 | 17 | ;;; Copyright © 2016, 2017 Thomas Danckaert <post@thomasdanckaert.be> |
5d4bd4cc | 18 | ;;; Copyright © 2017 Paul Garlick <pgarlick@tourbillion-technology.com> |
54052a54 | 19 | ;;; Copyright © 2017 ng0 <contact.ng0@cryptolab.net> |
ba1be533 | 20 | ;;; Copyright © 2017 Ben Woodcroft <donttrustben@gmail.com> |
d109b1e8 | 21 | ;;; Copyright © 2017 Theodoros Foradis <theodoros@foradis.org> |
5ca4fe96 | 22 | ;;; Copyright © 2017 Arun Isaac <arunisaac@systemreboot.net> |
59cd0ba4 | 23 | ;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr> |
dc7d6d4e | 24 | ;;; Copyright © 2017 Dave Love <me@fx@gnu.org> |
5b05dce7 | 25 | ;;; Copyright © 2018 Jan Nieuwenhuizen <janneke@gnu.org> |
8f8b2451 AE |
26 | ;;; |
27 | ;;; This file is part of GNU Guix. | |
28 | ;;; | |
29 | ;;; GNU Guix is free software; you can redistribute it and/or modify it | |
30 | ;;; under the terms of the GNU General Public License as published by | |
31 | ;;; the Free Software Foundation; either version 3 of the License, or (at | |
32 | ;;; your option) any later version. | |
33 | ;;; | |
34 | ;;; GNU Guix is distributed in the hope that it will be useful, but | |
35 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of | |
36 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
37 | ;;; GNU General Public License for more details. | |
38 | ;;; | |
39 | ;;; You should have received a copy of the GNU General Public License | |
40 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | |
41 | ||
42 | (define-module (gnu packages maths) | |
ec322be2 | 43 | #:use-module (ice-9 regex) |
8f8b2451 | 44 | #:use-module (gnu packages) |
b5b73a82 | 45 | #:use-module ((guix licenses) #:prefix license:) |
8f8b2451 AE |
46 | #:use-module (guix packages) |
47 | #:use-module (guix download) | |
54052a54 | 48 | #:use-module (guix git-download) |
0e2672ae | 49 | #:use-module (guix utils) |
cec86422 | 50 | #:use-module (guix build utils) |
da95c817 | 51 | #:use-module (guix build-system cmake) |
c9dfa3c7 | 52 | #:use-module (guix build-system gnu) |
ba1be533 | 53 | #:use-module (guix build-system ocaml) |
ec8c7e47 | 54 | #:use-module (guix build-system r) |
3de01d3f | 55 | #:use-module (gnu packages algebra) |
5143517c | 56 | #:use-module (gnu packages autotools) |
3de01d3f | 57 | #:use-module (gnu packages bison) |
a17d4564 | 58 | #:use-module (gnu packages boost) |
e73b49fb | 59 | #:use-module (gnu packages check) |
3de01d3f | 60 | #:use-module (gnu packages cmake) |
c9dfa3c7 | 61 | #:use-module (gnu packages compression) |
668c06ac | 62 | #:use-module (gnu packages curl) |
b7b27a8f | 63 | #:use-module (gnu packages cyrus-sasl) |
528bb464 | 64 | #:use-module (gnu packages documentation) |
57e544e8 | 65 | #:use-module (gnu packages elf) |
3de01d3f | 66 | #:use-module (gnu packages flex) |
668c06ac | 67 | #:use-module (gnu packages fltk) |
f3929800 | 68 | #:use-module (gnu packages fontutils) |
1dba6407 | 69 | #:use-module (gnu packages gettext) |
da95c817 | 70 | #:use-module (gnu packages gcc) |
73fed4f8 | 71 | #:use-module (gnu packages gd) |
668c06ac | 72 | #:use-module (gnu packages ghostscript) |
889187a4 | 73 | #:use-module (gnu packages graphviz) |
f3929800 | 74 | #:use-module (gnu packages gtk) |
45147b0c | 75 | #:use-module (gnu packages image) |
2fd26d05 | 76 | #:use-module (gnu packages java) |
668c06ac | 77 | #:use-module (gnu packages less) |
8731e527 | 78 | #:use-module (gnu packages lisp) |
bc3a2e35 | 79 | #:use-module (gnu packages logging) |
6e64766a | 80 | #:use-module (gnu packages lua) |
5698b8b8 | 81 | #:use-module (gnu packages gnome) |
1b39a196 | 82 | #:use-module (gnu packages guile) |
668c06ac JD |
83 | #:use-module (gnu packages xorg) |
84 | #:use-module (gnu packages gl) | |
9f913401 | 85 | #:use-module (gnu packages imagemagick) |
8731e527 | 86 | #:use-module (gnu packages m4) |
d8c7eeb9 | 87 | #:use-module (gnu packages mpi) |
b92eee75 | 88 | #:use-module (gnu packages multiprecision) |
528bb464 | 89 | #:use-module (gnu packages netpbm) |
ba1be533 | 90 | #:use-module (gnu packages ocaml) |
668c06ac | 91 | #:use-module (gnu packages pcre) |
5698b8b8 | 92 | #:use-module (gnu packages popt) |
c9dfa3c7 AE |
93 | #:use-module (gnu packages perl) |
94 | #:use-module (gnu packages pkg-config) | |
da95c817 | 95 | #:use-module (gnu packages python) |
589e3f4e | 96 | #:use-module (gnu packages python-web) |
5b05dce7 | 97 | #:use-module (gnu packages qt) |
c9dfa3c7 | 98 | #:use-module (gnu packages readline) |
2742f87e | 99 | #:use-module (gnu packages tbb) |
479c4273 | 100 | #:use-module (gnu packages scheme) |
b7194849 | 101 | #:use-module (gnu packages shells) |
df354a77 | 102 | #:use-module (gnu packages tcl) |
668c06ac | 103 | #:use-module (gnu packages texinfo) |
8f9ac901 | 104 | #:use-module (gnu packages tex) |
b7b27a8f | 105 | #:use-module (gnu packages tls) |
5b05dce7 | 106 | #:use-module (gnu packages version-control) |
9aafbc0c | 107 | #:use-module (gnu packages wxwidgets) |
c12efc72 | 108 | #:use-module (gnu packages xml) |
a17d4564 | 109 | #:use-module (srfi srfi-1)) |
8f8b2451 | 110 | |
193abc82 JD |
111 | (define-public aris |
112 | (package | |
1f45f18a JD |
113 | (name "aris") |
114 | (version "2.2") | |
115 | (source (origin | |
116 | (method url-fetch) | |
117 | (uri (string-append "mirror://gnu/" name "/" name "-" version ".tar.gz")) | |
118 | (sha256 (base32 | |
119 | "1q1887ryqdr9sn0522hc7p16kqwlxxyz5dkmma8ar2nxplhgll7q")))) | |
120 | (build-system gnu-build-system) | |
121 | (inputs `(("gtk+" ,gtk+) | |
122 | ("libxml2" ,libxml2))) | |
123 | (native-inputs `(("pkg-config" ,pkg-config))) | |
124 | (synopsis "Natural deduction first-order logic interface") | |
125 | (description "Aris is a program for performing logical proofs. It supports | |
126 | propositional and predicate logic, as well as Boolean algebra and | |
127 | arithmetical logic. In addition to its predefined inference and equivalence | |
128 | rules, Aris also supports references to older proofs. Its use of standard | |
129 | logical symbols and its natural deduction interface make it easy to use for | |
130 | beginners.") | |
131 | (license license:gpl3+) | |
6fd52309 | 132 | (home-page "https://www.gnu.org/software/aris/"))) |
193abc82 | 133 | |
9c45c519 JD |
134 | (define-public c-graph |
135 | (package | |
136 | (name "c-graph") | |
137 | (version "2.0") | |
138 | (source (origin | |
139 | (method url-fetch) | |
140 | (uri (string-append "mirror://gnu/c-graph/c-graph-" version | |
141 | ".tar.gz")) | |
142 | (sha256 (base32 | |
143 | "1hlvpzrh7hzzf533diyfiabzskddi8zx92av9hwkjw3l46z7qv01")))) | |
144 | (build-system gnu-build-system) | |
145 | (inputs | |
146 | `(("fortran" ,gfortran))) | |
a3947cb1 | 147 | (synopsis "Visualizing and demonstrating convolution") |
9c45c519 | 148 | (description |
a3947cb1 LC |
149 | "GNU C-Graph is a tool for demonstrating the theory of convolution. |
150 | Thus, it can serve as an excellent aid to students of signal and systems | |
151 | theory in visualizing the convolution process. Rather than forcing the | |
152 | student to write code, the program offers an intuitive interface with | |
153 | interactive dialogs to guide them.") | |
9c45c519 | 154 | (license license:gpl3+) |
6fd52309 | 155 | (home-page "https://www.gnu.org/software/c-graph/"))) |
9c45c519 | 156 | |
d91025e3 TD |
157 | (define-public coda |
158 | (package | |
159 | (name "coda") | |
440c4273 | 160 | (version "2.18.3") |
d91025e3 TD |
161 | (source |
162 | (origin | |
163 | (method url-fetch) | |
164 | (uri (string-append "https://github.com/stcorp/coda/releases/download/" | |
165 | version "/coda-" version ".tar.gz")) | |
166 | (sha256 | |
440c4273 | 167 | (base32 "1zlzgcvwmmjm8mw8w4rg2rqy0pjilz7kyyxm0y4p8cbljbbjxxz0")) |
4b12fe5c TD |
168 | (patches (search-patches "coda-use-system-libs.patch")) |
169 | (modules '((guix build utils))) | |
170 | (snippet | |
171 | ;; Make sure we don't use the bundled software. | |
172 | '(for-each (lambda (d) | |
173 | (delete-file-recursively (string-append "libcoda/" d))) | |
174 | '("zlib" "pcre" "expat"))))) | |
d91025e3 TD |
175 | (native-inputs |
176 | `(("fortran" ,gfortran) | |
177 | ("python" ,python) | |
178 | ("python-numpy" ,python-numpy))) | |
179 | (inputs | |
180 | `(("zlib" ,zlib) | |
4b12fe5c TD |
181 | ("pcre" ,pcre) |
182 | ("expat" ,expat) | |
d91025e3 TD |
183 | ("hdf4" ,hdf4-alt) |
184 | ("hdf5" ,hdf5))) | |
185 | (build-system gnu-build-system) | |
186 | (arguments | |
4b12fe5c TD |
187 | '(#:configure-flags '("--with-hdf4" "--with-hdf5" "--enable-python" |
188 | "LIBS= -lz -lpcre -lexpat"))) | |
d91025e3 TD |
189 | (synopsis "A common interface to various earth observation data formats") |
190 | (description | |
191 | "The Common Data Access toolbox (CODA) provides a set of interfaces for | |
192 | reading remote sensing data from earth observation data files. It consists of | |
193 | command line applications and interfaces to the C, Fortran, Python, and Java | |
194 | programming languages.") | |
195 | (home-page "https://stcorp.nl/coda") | |
196 | (license license:gpl2+))) | |
197 | ||
8f8b2451 AE |
198 | (define-public units |
199 | (package | |
200 | (name "units") | |
f11d2849 | 201 | (version "2.16") |
8f8b2451 AE |
202 | (source (origin |
203 | (method url-fetch) | |
204 | (uri (string-append "mirror://gnu/units/units-" version | |
205 | ".tar.gz")) | |
206 | (sha256 (base32 | |
f11d2849 | 207 | "11hnp3gcmcc5kci2caxw4hs6m08h2mhqs3xzqq7iafx1ha2ggwyw")))) |
8f8b2451 | 208 | (build-system gnu-build-system) |
0498d248 | 209 | (inputs |
a2549713 EB |
210 | `(("readline" ,readline) |
211 | ("python" ,python-wrapper) ;for 'units_cur' script | |
0498d248 EB |
212 | ("python-requests" ,python-requests))) |
213 | (arguments | |
214 | `(#:phases (modify-phases %standard-phases | |
215 | (add-after 'install 'wrap-units_cur | |
216 | (lambda* (#:key outputs #:allow-other-keys) | |
217 | (let* ((out (assoc-ref outputs "out")) | |
218 | (bin (string-append out "/bin"))) | |
219 | (wrap-program (string-append bin "/units_cur") | |
220 | `("PYTHONPATH" ":" prefix | |
221 | ,(search-path-as-string->list (getenv "PYTHONPATH")))) | |
222 | #t)))))) | |
8f8b2451 AE |
223 | (synopsis "Conversion between thousands of scales") |
224 | (description | |
574e86f9 | 225 | "GNU Units converts numeric quantities between units of measure. It |
7c125ce0 AK |
226 | can handle scale changes through adaptive usage of standard scale |
227 | prefixes (micro-, kilo-, etc.). It can also handle nonlinear | |
228 | conversions such as Fahrenheit to Celsius. Its interpreter is powerful | |
229 | enough to be used effectively as a scientific calculator.") | |
8f8b2451 | 230 | (license license:gpl3+) |
6fd52309 | 231 | (home-page "https://www.gnu.org/software/units/"))) |
c9dfa3c7 | 232 | |
61a529b4 RW |
233 | (define-public double-conversion |
234 | (package | |
235 | (name "double-conversion") | |
236 | (version "1.1.5") | |
237 | (source (origin | |
238 | (method url-fetch) | |
239 | (uri (string-append | |
240 | "https://github.com/floitsch/double-conversion/archive/v" | |
241 | version ".tar.gz")) | |
242 | (file-name (string-append name "-" version ".tar.gz")) | |
243 | (sha256 | |
244 | (base32 | |
245 | "0cnr8xhyjfxijay8ymkqcph3672wp2lj23qhdmr3m4kia5kpdf83")))) | |
246 | (build-system cmake-build-system) | |
247 | (arguments | |
248 | '(#:test-target "test" | |
249 | #:configure-flags '("-DBUILD_SHARED_LIBS=ON" | |
250 | "-DBUILD_TESTING=ON"))) | |
251 | (home-page "https://github.com/floitsch/double-conversion") | |
252 | (synopsis "Conversion routines for IEEE doubles") | |
253 | (description | |
254 | "The double-conversion library provides binary-decimal and decimal-binary | |
255 | routines for IEEE doubles. The library consists of efficient conversion | |
256 | routines that have been extracted from the V8 JavaScript engine.") | |
257 | (license license:bsd-3))) | |
258 | ||
182d6311 ML |
259 | (define-public dionysus |
260 | (package | |
261 | (name "dionysus") | |
262 | (version "1.3.0") | |
263 | (source (origin | |
264 | (method url-fetch) | |
265 | (uri (string-append "mirror://gnu/dionysus/dionysus-" version | |
266 | ".tar.gz")) | |
267 | (sha256 | |
268 | (base32 | |
269 | "1aqnvw6z33bzqgd1ga571pnx6vq2zrkckm1cz91grv45h4jr9vgs")))) | |
270 | (build-system gnu-build-system) | |
271 | (inputs `(("tcl" ,tcl))) ;for 'tclsh' | |
272 | (synopsis "Local search for universal constants and scientific values") | |
273 | (description | |
274 | "GNU Dionysus is a convenient system for quickly retrieving the values of | |
275 | mathematical constants used in science and engineering. Values can be | |
276 | searched using a simple command-line tool, choosing from three databases: | |
277 | universal constants, atomic numbers, and constants related to | |
278 | semiconductors.") | |
279 | (license license:gpl3+) | |
6fd52309 | 280 | (home-page "https://www.gnu.org/software/dionysus/"))) |
182d6311 | 281 | |
88bd1804 AE |
282 | (define-public gsl |
283 | (package | |
284 | (name "gsl") | |
f885fc05 | 285 | (version "2.4") |
ab2cc5cd LC |
286 | (source (origin |
287 | (method url-fetch) | |
288 | (uri (string-append "mirror://gnu/gsl/gsl-" | |
289 | version ".tar.gz")) | |
290 | (sha256 | |
291 | (base32 | |
f885fc05 | 292 | "16yfs5n444s03np1naj6yp1fsysd42kdscxzkg0k2yvfjixx0ijd")) |
ab2cc5cd | 293 | (patches (search-patches "gsl-test-i686.patch")))) |
88bd1804 | 294 | (build-system gnu-build-system) |
71e0f288 | 295 | (arguments |
f885fc05 | 296 | `(;; Currently there are numerous tests that fail on "exotic" |
6f766069 EF |
297 | ;; architectures such as aarch64 and ppc64le. |
298 | ,@(if (string-prefix? "aarch64-linux" | |
299 | (or (%current-target-system) (%current-system))) | |
300 | '(#:tests? #f) | |
301 | '()))) | |
302 | (home-page "https://www.gnu.org/software/gsl/") | |
88bd1804 AE |
303 | (synopsis "Numerical library for C and C++") |
304 | (description | |
a22dc0c4 LC |
305 | "The GNU Scientific Library is a library for numerical analysis in C |
306 | and C++. It includes a wide range of mathematical routines, with over 1000 | |
307 | functions in total. Subject areas covered by the library include: | |
308 | differential equations, linear algebra, Fast Fourier Transforms and random | |
309 | numbers.") | |
88bd1804 AE |
310 | (license license:gpl3+))) |
311 | ||
ba1be533 BW |
312 | (define-public ocaml-gsl |
313 | (package | |
314 | (name "ocaml-gsl") | |
315 | (version "1.19.3") | |
316 | (source | |
317 | (origin | |
318 | (method url-fetch) | |
319 | (uri | |
320 | (string-append | |
321 | "https://github.com/mmottl/gsl-ocaml/releases/download/v" | |
322 | version"/gsl-ocaml-" version ".tar.gz")) | |
323 | (sha256 | |
324 | (base32 | |
325 | "0nzp43hp8pbjqkrxnwp5lgjrabxayf61h18fjaydi0s5faq6f3xh")))) | |
326 | (build-system ocaml-build-system) | |
327 | (inputs | |
328 | `(("gsl" ,gsl))) | |
329 | (home-page "https://mmottl.github.io/gsl-ocaml") | |
330 | (synopsis "Bindings to the GNU Scientific Library") | |
331 | (description | |
332 | "GSL-OCaml is an interface to the @dfn{GNU scientific library} (GSL) for | |
333 | the OCaml language.") | |
334 | (license license:gpl3+))) | |
335 | ||
7adaab9f BW |
336 | (define-public ocaml4.01-gsl |
337 | (package-with-ocaml4.01 ocaml-gsl)) | |
338 | ||
b92eee75 AE |
339 | (define-public glpk |
340 | (package | |
341 | (name "glpk") | |
445929e0 | 342 | (version "4.65") |
b92eee75 AE |
343 | (source |
344 | (origin | |
345 | (method url-fetch) | |
346 | (uri (string-append "mirror://gnu/glpk/glpk-" | |
347 | version ".tar.gz")) | |
348 | (sha256 | |
349 | (base32 | |
445929e0 | 350 | "040sfaa9jclg2nqdh83w71sv9rc1sznpnfiripjdyr48cady50a2")))) |
b92eee75 AE |
351 | (build-system gnu-build-system) |
352 | (inputs | |
353 | `(("gmp" ,gmp))) | |
354 | (arguments | |
355 | `(#:configure-flags '("--with-gmp"))) | |
82110ef6 | 356 | (home-page "https://www.gnu.org/software/glpk/") |
79c311b8 | 357 | (synopsis "GNU Linear Programming Kit, supporting the MathProg language") |
b92eee75 AE |
358 | (description |
359 | "GLPK is a C library for solving large-scale linear programming (LP), | |
360 | mixed integer programming (MIP), and other related problems. It supports the | |
361 | GNU MathProg modeling language, a subset of the AMPL language, and features a | |
362 | translator for the language. In addition to the C library, a stand-alone | |
363 | LP/MIP solver is included in the package.") | |
364 | (license license:gpl3+))) | |
365 | ||
b146763a AE |
366 | (define-public 4ti2 |
367 | (package | |
368 | (name "4ti2") | |
369 | (version "1.6.7") | |
370 | (source | |
371 | (origin | |
372 | (method url-fetch) | |
373 | (uri (string-append "http://www.4ti2.de/version_" version | |
374 | "/4ti2-" version ".tar.gz")) | |
375 | (sha256 | |
376 | (base32 | |
377 | "1frix3rnm9ffr93alqzw4cavxbfpf524l8rfbmcpyhwd3n1km0yl")))) | |
378 | (build-system gnu-build-system) | |
379 | (native-inputs | |
380 | `(("which" ,(@ (gnu packages base) which)))) ; for the tests | |
381 | (inputs | |
382 | `(("glpk" ,glpk) | |
383 | ("gmp" ,gmp))) | |
384 | (home-page "http://www.4ti2.de/") | |
385 | (synopsis "Mathematical tool suite for problems on linear spaces") | |
386 | (description | |
387 | "4ti2 implements algorithms for solving algebraic, geometric and | |
388 | combinatorial problems on linear spaces. Among others, it solves systems | |
389 | of linear equations, computes extreme rays of polyhedral cones, solves | |
390 | integer programming problems and computes Markov bases for statistics.") | |
391 | (license license:gpl2+))) | |
392 | ||
53696f10 AE |
393 | (define-public cddlib |
394 | (package | |
395 | (name "cddlib") | |
396 | (version "0.94h") | |
397 | (source | |
398 | (origin | |
399 | (method url-fetch) | |
182dde82 | 400 | (uri (string-append "ftp://ftp.math.ethz.ch/users/fukudak/cdd/cddlib-" |
53696f10 AE |
401 | (string-delete #\. version) ".tar.gz")) |
402 | (sha256 | |
403 | (base32 | |
404 | "1dasasscwfg793q8fwzgwf64xwj7w62yfvszpr8x8g38jka08vgy")))) | |
405 | (build-system gnu-build-system) | |
406 | (inputs | |
407 | `(("gmp" ,gmp))) | |
408 | (home-page "https://www.inf.ethz.ch/personal/fukudak/cdd_home/index.html") | |
409 | (synopsis "Library for convex hulls and extreme rays of polyhedra") | |
410 | (description | |
411 | "The C-library cddlib implements the Double Description Method of | |
412 | Motzkin et al. for generating all vertices (i.e. extreme points) and extreme | |
413 | rays of a general convex polyhedron given by a system of linear inequalities | |
414 | in arbitrary dimension. It can also be used for the converse operation of | |
415 | computing convex hulls.") | |
416 | (license license:gpl2+))) | |
417 | ||
865a69dd RW |
418 | (define-public arpack-ng |
419 | (package | |
420 | (name "arpack-ng") | |
421 | (version "3.2.0") | |
422 | (source | |
423 | (origin | |
424 | (method url-fetch) | |
425 | (uri (string-append "https://github.com/opencollab/arpack-ng/archive/" | |
426 | version ".tar.gz")) | |
f586c877 | 427 | (file-name (string-append name "-" version ".tar.gz")) |
865a69dd RW |
428 | (sha256 |
429 | (base32 | |
430 | "1fwch6vipms1ispzg2djvbzv5wag36f1dmmr3xs3mbp6imfyhvff")))) | |
431 | (build-system gnu-build-system) | |
432 | (home-page "https://github.com/opencollab/arpack-ng") | |
433 | (inputs | |
434 | `(("lapack" ,lapack) | |
19afbea1 | 435 | ("fortran" ,gfortran))) |
865a69dd RW |
436 | (synopsis "Fortran subroutines for solving eigenvalue problems") |
437 | (description | |
438 | "ARPACK-NG is a collection of Fortran77 subroutines designed to solve | |
439 | large scale eigenvalue problems.") | |
166191b3 | 440 | (license (license:non-copyleft "file://COPYING" |
865a69dd RW |
441 | "See COPYING in the distribution.")))) |
442 | ||
8c94c886 EB |
443 | (define-public arpack-ng-openmpi |
444 | (package (inherit arpack-ng) | |
445 | (name "arpack-ng-openmpi") | |
446 | (inputs | |
447 | `(("mpi" ,openmpi) | |
448 | ,@(package-inputs arpack-ng))) | |
449 | (arguments `(#:configure-flags '("--enable-mpi"))) | |
450 | (synopsis "Fortran subroutines for solving eigenvalue problems with MPI"))) | |
451 | ||
da95c817 NK |
452 | (define-public lapack |
453 | (package | |
454 | (name "lapack") | |
ef39a177 | 455 | (version "3.7.1") |
da95c817 NK |
456 | (source |
457 | (origin | |
458 | (method url-fetch) | |
459 | (uri (string-append "http://www.netlib.org/lapack/lapack-" | |
460 | version ".tgz")) | |
461 | (sha256 | |
462 | (base32 | |
7c0d4c3a | 463 | "1j51r7n5w4k7r3lrvy7710xrpkg40wf4rqnmngfz6ck9ypckzign")))) |
da95c817 NK |
464 | (build-system cmake-build-system) |
465 | (home-page "http://www.netlib.org/lapack/") | |
19afbea1 | 466 | (inputs `(("fortran" ,gfortran) |
da95c817 NK |
467 | ("python" ,python-2))) |
468 | (arguments | |
3ab869b6 | 469 | `(#:configure-flags (list |
3ab869b6 LC |
470 | "-DBUILD_SHARED_LIBS:BOOL=YES" |
471 | "-DLAPACKE=ON" | |
472 | ||
473 | ;; Build the 'LAPACKE_clatms' functions. | |
474 | "-DLAPACKE_WITH_TMG=ON") | |
dc1d3cde KK |
475 | #:phases |
476 | (modify-phases %standard-phases | |
477 | (add-before 'check 'patch-python | |
478 | (lambda* (#:key inputs #:allow-other-keys) | |
479 | (let ((python (assoc-ref inputs "python"))) | |
480 | (substitute* "lapack_testing.py" | |
481 | (("/usr/bin/env python") python))) | |
482 | #t))))) | |
da95c817 NK |
483 | (synopsis "Library for numerical linear algebra") |
484 | (description | |
485 | "LAPACK is a Fortran 90 library for solving the most commonly occurring | |
486 | problems in numerical linear algebra.") | |
166191b3 | 487 | (license (license:non-copyleft "file://LICENSE" |
da95c817 | 488 | "See LICENSE in the distribution.")))) |
73fed4f8 | 489 | |
b509efb3 TF |
490 | (define-public lapack-3.5 |
491 | (package | |
492 | (inherit lapack) | |
493 | (version "3.5.0") | |
494 | (source | |
495 | (origin | |
496 | (method url-fetch) | |
497 | (uri (string-append "http://www.netlib.org/lapack/lapack-" | |
498 | version ".tgz")) | |
499 | (sha256 | |
500 | (base32 | |
501 | "0lk3f97i9imqascnlf6wr5mjpyxqcdj73pgj97dj2mgvyg9z1n4s")))))) | |
502 | ||
e1ff597a EB |
503 | (define-public scalapack |
504 | (package | |
505 | (name "scalapack") | |
506 | (version "2.0.2") | |
507 | (source | |
508 | (origin | |
509 | (method url-fetch) | |
510 | (uri (string-append "http://www.netlib.org/scalapack/scalapack-" | |
511 | version ".tgz")) | |
512 | (sha256 | |
513 | (base32 | |
514 | "0p1r61ss1fq0bs8ynnx7xq4wwsdvs32ljvwjnx6yxr8gd6pawx0c")))) | |
515 | (build-system cmake-build-system) | |
516 | (inputs | |
517 | `(("mpi" ,openmpi) | |
518 | ("fortran" ,gfortran) | |
519 | ("lapack" ,lapack))) ;for testing only | |
520 | (arguments | |
521 | `(#:configure-flags `("-DBUILD_SHARED_LIBS:BOOL=YES"))) | |
522 | (home-page "http://www.netlib.org/scalapack/") | |
523 | (synopsis "Library for scalable numerical linear algebra") | |
524 | (description | |
525 | "ScaLAPACK is a Fortran 90 library of high-performance linear algebra | |
526 | routines on parallel distributed memory machines. ScaLAPACK solves dense and | |
527 | banded linear systems, least squares problems, eigenvalue problems, and | |
528 | singular value problems.") | |
529 | (license (license:bsd-style "file://LICENSE" | |
530 | "See LICENSE in the distribution.")))) | |
531 | ||
73fed4f8 | 532 | (define-public gnuplot |
5f800540 KK |
533 | (package |
534 | (name "gnuplot") | |
7d873e0c | 535 | (version "5.0.6") |
5f800540 KK |
536 | (source (origin |
537 | (method url-fetch) | |
538 | (uri (string-append "mirror://sourceforge/gnuplot/gnuplot/" | |
539 | version "/gnuplot-" | |
540 | version ".tar.gz")) | |
541 | (sha256 | |
542 | (base32 | |
7d873e0c | 543 | "0q5lr6nala3ln6f3yp6g17ziymb9r9gx9zylnw1y3hjmwl9lggjv")))) |
5f800540 KK |
544 | (build-system gnu-build-system) |
545 | (inputs `(("readline" ,readline) | |
546 | ("cairo" ,cairo) | |
547 | ("pango" ,pango) | |
6e64766a DM |
548 | ("gd" ,gd) |
549 | ("lua" ,lua))) | |
612a387f RW |
550 | (native-inputs |
551 | `(("pkg-config" ,pkg-config) | |
552 | ("texlive" ,texlive-tiny))) | |
5f800540 KK |
553 | (home-page "http://www.gnuplot.info") |
554 | (synopsis "Command-line driven graphing utility") | |
555 | (description "Gnuplot is a portable command-line driven graphing | |
35b9e423 | 556 | utility. It was originally created to allow scientists and students to |
73fed4f8 | 557 | visualize mathematical functions and data interactively, but has grown to |
35b9e423 | 558 | support many non-interactive uses such as web scripting. It is also used as a |
73fed4f8 | 559 | plotting engine by third-party applications like Octave.") |
5f800540 KK |
560 | ;; X11 Style with the additional restriction that derived works may only be |
561 | ;; distributed as patches to the original. | |
562 | (license (license:fsf-free | |
563 | "http://gnuplot.cvs.sourceforge.net/gnuplot/gnuplot/Copyright")))) | |
668c06ac | 564 | |
32f70e1f TD |
565 | (define-public gctp |
566 | (package | |
567 | (name "gctp") | |
568 | (version "2.0.0") | |
569 | (source | |
570 | (origin | |
571 | (method url-fetch) | |
572 | (uri (string-append "https://github.com/OkoSanto/GCTP/archive/v" | |
573 | version ".tar.gz")) | |
574 | (file-name (string-append name "-" version ".tar.gz")) | |
575 | (sha256 | |
576 | (base32 | |
577 | "0l9aqnqynh9laicn5dxf3rsb1n14xiks79wbyqccirzmjqd1c1x4")))) | |
578 | (native-inputs | |
579 | `(("fortran" ,gfortran))) | |
580 | (build-system gnu-build-system) | |
581 | (synopsis "General Cartographic Transformation Package (GCTP)") | |
582 | (description | |
583 | "The General Cartographic Transformation Package (GCTP) is a system of | |
584 | software routines designed to permit the transformation of coordinate pairs | |
585 | from one map projection to another. The GCTP is the standard computer | |
586 | software used by the National Mapping Division for map projection | |
587 | computations.") | |
588 | (home-page "https://github.com/OkoSanto/GCTP") | |
0f7cd95b | 589 | (license license:public-domain))) ;https://www2.usgs.gov/laws/info_policies.html |
32f70e1f | 590 | |
becbbefc TD |
591 | (define-public hdf4 |
592 | (package | |
593 | (name "hdf4") | |
0abf5264 | 594 | (version "4.2.13") |
becbbefc TD |
595 | (source |
596 | (origin | |
597 | (method url-fetch) | |
598 | (uri (string-append "https://support.hdfgroup.org/ftp/HDF/releases/HDF" | |
599 | version "/src/hdf-" version ".tar.bz2")) | |
600 | (sha256 | |
0abf5264 | 601 | (base32 "1wz0586zh91pqb95wvr0pbh71a8rz358fdj6n2ksp85x2cis9lsm")) |
15ca49b2 AE |
602 | (patches (search-patches "hdf4-architectures.patch" |
603 | "hdf4-reproducibility.patch" | |
becbbefc | 604 | "hdf4-shared-fortran.patch")))) |
becbbefc TD |
605 | (build-system gnu-build-system) |
606 | (native-inputs | |
607 | `(("gfortran" ,gfortran) | |
608 | ("bison" ,bison) | |
609 | ("flex" ,flex))) | |
610 | (inputs | |
611 | `(("zlib" ,zlib) | |
612 | ("libjpeg" ,libjpeg))) | |
613 | (arguments | |
614 | `(#:parallel-tests? #f | |
615 | #:configure-flags '("--enable-shared") | |
616 | #:phases | |
617 | (modify-phases %standard-phases | |
953a12fa EF |
618 | ;; This is inspired by two of Debian's patches. |
619 | (add-before 'configure 'add-more-aarch64-support | |
620 | (lambda _ | |
621 | (substitute* '("mfhdf/ncgen/ncgen.l" | |
622 | "mfhdf/ncgen/ncgenyy.c" | |
623 | "mfhdf/libsrc/netcdf.h.in") | |
624 | (("AIX5L64") "__aarch64__")) | |
625 | #t)) | |
becbbefc TD |
626 | (add-before 'configure 'patchbuild |
627 | (lambda _ | |
628 | (substitute* | |
629 | '("mfhdf/hdfimport/testutil.sh.in" "hdf/util/testutil.sh.in") | |
630 | (("/bin/rm") "rm") | |
631 | (("/bin/mkdir") "mkdir")) | |
632 | (substitute* (find-files "." "^Makefile\\.in$") | |
633 | (("@HDF_BUILD_XDR_TRUE@XDR_ADD = \ | |
634 | -R\\$\\(abs_top_builddir\\)/mfhdf/xdr/\\.libs") "") | |
635 | (("@HDF_BUILD_SHARED_TRUE@AM_LDFLAGS = \ | |
636 | -R\\$\\(abs_top_builddir\\)/mfhdf/libsrc/\\.libs \ | |
953a12fa | 637 | -R\\$\\(abs_top_builddir\\)/hdf/src/\\.libs \\$\\(XDR_ADD\\)") "")) |
e464b455 TD |
638 | #t)) |
639 | (add-after 'configure 'patch-settings | |
640 | (lambda _ | |
641 | ;; libhdf4.settings contains the full path of the | |
642 | ;; compilers used, and its contents are included in | |
643 | ;; .so-files. We truncate the hashes to avoid | |
644 | ;; unnecessary store references to those compilers: | |
645 | (substitute* "libhdf4.settings" | |
646 | (("(/gnu/store/)([a-Z0-9]*)" all prefix hash) | |
647 | (string-append prefix (string-take hash 10) "..."))) | |
648 | #t)) | |
649 | ))) | |
becbbefc TD |
650 | (home-page "https://www.hdfgroup.org/products/hdf4/") |
651 | (synopsis | |
652 | "Library and multi-object file format for storing and managing data") | |
653 | (description "HDF4 is a library and multi-object file format for storing | |
654 | and managing data between machines. HDF4 is an older hierarchical data format, | |
655 | incompatible with HDF5.") | |
656 | (license | |
657 | (license:non-copyleft | |
658 | "https://www.hdfgroup.org/ftp/HDF/HDF_Current/src/unpacked/COPYING")))) | |
659 | ||
660 | (define-public hdf4-alt | |
661 | (package | |
662 | (inherit hdf4) | |
663 | (name "hdf4-alt") | |
664 | (arguments | |
665 | (substitute-keyword-arguments (package-arguments hdf4) | |
666 | ((#:configure-flags flags) `(cons* "--disable-netcdf" ,flags)))) | |
667 | (synopsis | |
668 | "HDF4 without netCDF API, can be combined with the regular netCDF library"))) | |
669 | ||
7ee3f1a2 JD |
670 | (define-public hdf5 |
671 | (package | |
672 | (name "hdf5") | |
2da63064 | 673 | (version "1.8.19") |
7ee3f1a2 JD |
674 | (source |
675 | (origin | |
676 | (method url-fetch) | |
2da63064 TD |
677 | (uri (list (string-append "https://support.hdfgroup.org/ftp/HDF5/releases/" |
678 | "hdf5-" (version-major+minor version) | |
679 | "/hdf5-" version "/src/hdf5-" | |
dcd9d163 LF |
680 | version ".tar.bz2") |
681 | (string-append "https://support.hdfgroup.org/ftp/HDF5/" | |
682 | "current" | |
683 | (apply string-append | |
684 | (take (string-split version #\.) 2)) | |
685 | "/src/hdf5-" version ".tar.bz2"))) | |
7ee3f1a2 | 686 | (sha256 |
2da63064 | 687 | (base32 "0f3jfbqpaaq21ighi40qzs52nb52kc2d2yjk541rjmsx20b3ih2r")) |
b8d9c93b | 688 | (patches (list (search-patch "hdf5-config-date.patch"))))) |
7ee3f1a2 | 689 | (build-system gnu-build-system) |
12ed1216 AE |
690 | (inputs |
691 | `(("zlib" ,zlib))) | |
e3a1a1de TD |
692 | (native-inputs |
693 | `(("gfortran" ,gfortran))) | |
694 | (outputs '("out" ; core library | |
695 | "fortran")) ; fortran interface | |
7ee3f1a2 | 696 | (arguments |
62126576 | 697 | `(;; Some of the users, notably Flann, need the C++ interface. |
e3a1a1de TD |
698 | #:configure-flags '("--enable-cxx" |
699 | "--enable-fortran" | |
700 | "--enable-fortran2003") | |
4dba441c RW |
701 | ;; Use -fPIC to allow the R bindings to link with the static libraries |
702 | #:make-flags (list "CFLAGS=-fPIC" | |
703 | "CXXFLAGS=-fPIC") | |
62126576 | 704 | #:phases |
f622e212 EB |
705 | (modify-phases %standard-phases |
706 | (add-before 'configure 'patch-configure | |
e3a1a1de | 707 | (lambda* (#:key outputs #:allow-other-keys) |
f622e212 | 708 | (substitute* "configure" |
b8d9c93b | 709 | (("/bin/mv") "mv")) |
e3a1a1de TD |
710 | (substitute* "fortran/src/Makefile.in" |
711 | (("libhdf5_fortran_la_LDFLAGS =") | |
712 | (string-append "libhdf5_fortran_la_LDFLAGS = -Wl-rpath=" | |
713 | (assoc-ref outputs "fortran") "/lib"))) | |
714 | (substitute* "hl/fortran/src/Makefile.in" | |
715 | (("libhdf5hl_fortran_la_LDFLAGS =") | |
716 | (string-append "libhdf5hl_fortran_la_LDFLAGS = -Wl,-rpath=" | |
717 | (assoc-ref outputs "fortran") "/lib"))) | |
b8d9c93b | 718 | #t)) |
fd0378a1 TD |
719 | (add-after 'configure 'patch-settings |
720 | (lambda _ | |
721 | ;; libhdf5.settings contains the full path of the | |
722 | ;; compilers used, and its contents are included in | |
723 | ;; libhdf5.so. We truncate the hashes to avoid | |
724 | ;; unnecessary store references to those compilers: | |
725 | (substitute* "src/libhdf5.settings" | |
726 | (("(/gnu/store/)([a-Z0-9]*)" all prefix hash) | |
727 | (string-append prefix (string-take hash 10) "..."))) | |
b8d9c93b | 728 | #t)) |
f622e212 EB |
729 | (add-after 'install 'patch-references |
730 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
731 | (let ((bin (string-append (assoc-ref outputs "out") "/bin")) | |
732 | (zlib (assoc-ref inputs "zlib"))) | |
733 | (substitute* (find-files bin "h5p?cc") | |
734 | (("-lz" lib) | |
735 | (string-append "-L" zlib "/lib " lib))) | |
e3a1a1de TD |
736 | #t))) |
737 | (add-after 'install 'split | |
738 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
739 | ;; Move all fortran-related files | |
740 | (let* ((out (assoc-ref outputs "out")) | |
741 | (bin (string-append out "/bin")) | |
742 | (lib (string-append out "/lib")) | |
743 | (inc (string-append out "/include")) | |
744 | (ex (string-append out "/share/hdf5_examples/fortran")) | |
745 | (fort (assoc-ref outputs "fortran")) | |
746 | (fbin (string-append fort "/bin")) | |
747 | (flib (string-append fort "/lib")) | |
748 | (finc (string-append fort "/include")) | |
749 | (fex (string-append fort "/share/hdf5_examples/fortran"))) | |
750 | (mkdir-p fbin) | |
751 | (mkdir-p flib) | |
752 | (mkdir-p finc) | |
753 | (mkdir-p fex) | |
754 | (rename-file (string-append bin "/h5fc") | |
755 | (string-append fbin "/h5fc")) | |
756 | (for-each (lambda (file) | |
757 | (rename-file file | |
758 | (string-append flib "/" (basename file)))) | |
759 | (find-files lib ".*fortran.*")) | |
760 | (for-each (lambda (file) | |
761 | (rename-file file | |
762 | (string-append finc "/" (basename file)))) | |
763 | (find-files inc ".*mod")) | |
764 | (for-each (lambda (file) | |
765 | (rename-file file | |
766 | (string-append fex "/" (basename file)))) | |
767 | (find-files ex ".*")) | |
768 | (delete-file-recursively ex)) | |
769 | #t))))) | |
7ee3f1a2 | 770 | (home-page "http://www.hdfgroup.org") |
516e93f8 | 771 | (synopsis "Management suite for extremely large and complex data") |
7ee3f1a2 JD |
772 | (description "HDF5 is a suite that makes possible the management of |
773 | extremely large and complex data collections.") | |
d4bf49b1 EB |
774 | (license (license:x11-style |
775 | "http://www.hdfgroup.org/ftp/HDF5/current/src/unpacked/COPYING")))) | |
7ee3f1a2 | 776 | |
2fd26d05 TD |
777 | (define-public hdf-java |
778 | (package | |
779 | (name "hdf-java") | |
780 | (version "3.3.2") | |
781 | (source | |
782 | (origin | |
783 | (method url-fetch) | |
784 | (uri (string-append | |
785 | "http://www.hdfgroup.org/ftp/HDF5/releases/HDF-JAVA/hdfjni-" | |
786 | version "/src/CMake-hdfjava-" version ".tar.gz")) | |
787 | (sha256 | |
788 | (base32 "0m1gp2aspcblqzmpqbdpfp6giskws85ds6p5gz8sx7asyp7wznpr")) | |
789 | (modules '((guix build utils))) | |
790 | (snippet ; Make sure we don't use the bundled sources and binaries. | |
791 | `(begin | |
792 | (for-each delete-file | |
793 | (list "SZip.tar.gz" "ZLib.tar.gz" "JPEG8d.tar.gz" | |
794 | "HDF4.tar.gz" "HDF5.tar.gz")) | |
795 | (delete-file-recursively ,(string-append "hdfjava-" version "/lib")))))) | |
796 | (build-system gnu-build-system) | |
797 | (native-inputs | |
798 | `(("jdk" ,icedtea "jdk") | |
799 | ("automake" ,automake) ; For up to date 'config.guess' and 'config.sub'. | |
800 | ;; For tests: | |
801 | ("hamcrest-core" ,java-hamcrest-core) | |
802 | ("junit" ,java-junit) | |
803 | ("slf4j-simple" ,java-slf4j-simple))) | |
804 | (inputs | |
805 | `(("hdf4" ,hdf4) | |
806 | ("hdf5" ,hdf5) | |
807 | ("zlib" ,zlib) | |
808 | ("libjpeg" ,libjpeg) | |
809 | ("slf4j-api" ,java-slf4j-api))) | |
810 | (arguments | |
811 | `(#:configure-flags | |
812 | (list (string-append "--target=" ,(or (%current-target-system) (%current-system))) | |
813 | (string-append "--with-jdk=" (assoc-ref %build-inputs "jdk") "/include," | |
814 | (assoc-ref %build-inputs "jdk") "/lib" ) | |
815 | (string-append "--with-hdf4=" (assoc-ref %build-inputs "hdf4") "/lib") | |
816 | (string-append "--with-hdf5=" (assoc-ref %build-inputs "hdf5") "/lib")) | |
817 | ||
818 | #:make-flags | |
819 | (list (string-append "HDFLIB=" (assoc-ref %build-inputs "hdf4") "/lib") | |
820 | (string-append "HDF5LIB=" (assoc-ref %build-inputs "hdf5") "/lib") | |
821 | (string-append "ZLIB=" (assoc-ref %build-inputs "zlib") "/lib/libz.so") | |
822 | (string-append "JPEGLIB=" | |
823 | (assoc-ref %build-inputs "libjpeg") "/lib/libjpeg.so") | |
824 | "LLEXT=so") | |
825 | ||
826 | #:phases | |
827 | (modify-phases %standard-phases | |
828 | (add-before 'configure 'chdir-to-source | |
829 | (lambda _ (chdir ,(string-append "hdfjava-" version)))) | |
830 | (add-before 'configure 'patch-build | |
831 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
832 | (substitute* "configure" | |
833 | (("COPT=\"") "COPT=\"-O2 ") ; CFLAGS is ignored in Makefiles | |
834 | (("/bin/cat") (which "cat"))) | |
835 | ;; Set classpath for compilation | |
836 | (substitute* '("hdf/hdf5lib/Makefile.in" | |
837 | "hdf/hdf5lib/exceptions/Makefile.in" | |
838 | "hdf/hdflib/Makefile.in") | |
839 | (("\\$\\(TOP\\)/lib/slf4j-api-1\\.7\\.5\\.jar") | |
840 | (string-append (assoc-ref inputs "slf4j-api") | |
841 | "/share/java/slf4j-api.jar"))) | |
842 | ;; Replace outdated config.sub and config.guess: | |
843 | (with-directory-excursion "config" | |
844 | (for-each (lambda (file) | |
845 | (copy-file | |
846 | (string-append (assoc-ref inputs "automake") | |
847 | "/share/automake-1.15/" file) file)) | |
848 | '("config.sub" "config.guess"))) | |
849 | (mkdir-p (string-append (assoc-ref outputs "out"))) | |
850 | ;; Set classpath for tests | |
851 | (let* ((build-dir (getcwd)) | |
852 | (lib (string-append build-dir "/lib")) | |
853 | (jhdf (string-append lib "/jhdf.jar")) | |
854 | (jhdf5 (string-append lib "/jhdf5.jar")) | |
855 | (testjars | |
856 | (map (lambda (i) | |
857 | (string-append (assoc-ref inputs i) | |
858 | "/share/java/" i ".jar")) | |
859 | '("junit" "hamcrest-core" "slf4j-api" "slf4j-simple"))) | |
860 | (class-path | |
861 | (string-join `("." ,build-dir ,jhdf ,jhdf5 ,@testjars) ":"))) | |
862 | ||
863 | (substitute* '("test/hdf5lib/Makefile.in" | |
864 | "test/hdf5lib/junit.sh.in" | |
865 | "examples/runExample.sh.in") | |
866 | (("/usr/bin/test") | |
867 | (string-append (assoc-ref inputs "coreutils") | |
868 | "/bin/test")) | |
869 | (("/usr/bin/uname") | |
870 | (string-append (assoc-ref inputs "coreutils") | |
871 | "/bin/uname")) | |
872 | (("CLASSPATH=[^\n]*") | |
873 | (string-append "CLASSPATH=" class-path))) | |
874 | (setenv "CLASSPATH" class-path)) | |
875 | #t)) | |
876 | (add-before 'check 'build-examples | |
877 | (lambda _ | |
878 | (zero? (apply system* `("javac" | |
879 | ,@(find-files "examples" ".*\\.java"))))))) | |
880 | ||
881 | #:parallel-build? #f | |
882 | ||
883 | #:parallel-tests? #f )) | |
884 | (home-page "https://support.hdfgroup.org/products/java") | |
885 | (synopsis "Java interface for the HDF4 and HDF5 libraries") | |
886 | (description "Java HDF Interface (JHI) and Java HDF5 Interface (JHI5) use | |
887 | the Java Native Interface to wrap the HDF4 and HDF5 libraries, which are | |
888 | implemented in C.") | |
889 | ||
890 | ;; BSD-style license: | |
891 | (license (license:x11-style | |
892 | "https://support.hdfgroup.org/ftp/HDF5/hdf-java\ | |
893 | /current/src/unpacked/COPYING")))) | |
894 | ||
d3c4f3bb TD |
895 | (define-public hdf-eos2 |
896 | (package | |
897 | (name "hdf-eos2") | |
898 | (version "19.1.0") | |
899 | (source | |
900 | (origin | |
901 | (method url-fetch) | |
902 | (uri "ftp://edhs1.gsfc.nasa.gov\ | |
903 | /edhs/hdfeos/latest_release/HDF-EOS2.19v1.00.tar.Z") | |
904 | (sha256 | |
905 | (base32 "0c9fcz25s292ldap12wxmlrvnyz99z24p63d8fwx51bf8s0s1zrz")) | |
906 | (patches (search-patches "hdf-eos2-remove-gctp.patch" | |
907 | "hdf-eos2-build-shared.patch" | |
908 | "hdf-eos2-fortrantests.patch")))) | |
909 | (build-system gnu-build-system) | |
910 | (native-inputs | |
911 | `(("gfortran" ,gfortran))) | |
912 | (inputs | |
913 | `(("hdf4" ,hdf4-alt) ; assume most HDF-EOS2 users won't use the HDF4 netCDF API | |
914 | ("zlib" ,zlib) | |
915 | ("libjpeg" ,libjpeg) | |
916 | ("gctp" ,gctp))) | |
917 | (arguments | |
918 | `( #:configure-flags '("--enable-install-include" "--enable-shared" | |
919 | "CC=h4cc -Df2cFortran" "LIBS=-lgctp") | |
920 | #:parallel-tests? #f)) | |
921 | (home-page "http://hdfeos.org/software/library.php#HDF-EOS2") | |
922 | (synopsis "HDF4-based data format for NASA's Earth Observing System") | |
923 | (description "HDF-EOS2 is a software library built on HDF4 which supports | |
924 | the construction of data structures used in NASA's Earth Observing | |
925 | System (Grid, Point and Swath).") | |
926 | ||
927 | ;; Source files carry a permissive license header. | |
928 | (license (license:non-copyleft home-page)))) | |
929 | ||
0f43f835 TD |
930 | (define-public hdf-eos5 |
931 | (package | |
932 | (name "hdf-eos5") | |
933 | (version "1.15") | |
934 | (source (origin | |
935 | (method url-fetch) | |
936 | (uri (string-append "ftp://edhs1.gsfc.nasa.gov\ | |
937 | /edhs/hdfeos5/latest_release/HDF-EOS5." version ".tar.Z")) | |
938 | (sha256 | |
939 | (base32 | |
940 | "1p83333nzzy8rn5chxlm0hrkjjnhh2w1ji8ac0f9q4xzg838i58i")) | |
941 | (patches (search-patches "hdf-eos5-build-shared.patch" | |
942 | "hdf-eos5-remove-gctp.patch" | |
943 | "hdf-eos5-fix-szip.patch" | |
944 | "hdf-eos5-fortrantests.patch")))) | |
945 | (native-inputs | |
946 | `(("gfortran" ,gfortran))) | |
947 | (build-system gnu-build-system) | |
948 | (inputs | |
949 | `(("hdf5" ,hdf5) | |
950 | ("zlib" ,zlib) | |
951 | ("gctp" ,gctp))) | |
952 | (arguments | |
953 | `(#:configure-flags '("--enable-install-include" "--enable-shared" | |
954 | "CC=h5cc -Df2cFortran" "LIBS=-lgctp") | |
955 | #:parallel-tests? #f)) | |
956 | (synopsis "HDF5-based data format for NASA's Earth Observing System") | |
957 | (description | |
958 | "HDF-EOS5 is a software library built on HDF5 to support the construction | |
959 | of data structures used in NASA's Earth Observing System (Grid, Point and | |
960 | Swath).") | |
961 | (home-page "http://www.hdfeos.org/software/library.php#HDF-EOS5") | |
962 | ||
963 | ;; Source files carry a permissive license header. | |
964 | (license (license:non-copyleft home-page)))) | |
965 | ||
c8378eea EB |
966 | (define-public hdf5-parallel-openmpi |
967 | (package (inherit hdf5) | |
968 | (name "hdf5-parallel-openmpi") | |
969 | (inputs | |
970 | `(("mpi" ,openmpi) | |
971 | ,@(package-inputs hdf5))) | |
972 | (arguments | |
973 | (substitute-keyword-arguments `(#:configure-flags '("--enable-parallel") | |
974 | ,@(package-arguments hdf5)) | |
975 | ((#:phases phases) | |
976 | `(modify-phases ,phases | |
977 | (add-before 'check 'patch-tests | |
978 | (lambda _ | |
979 | ;; OpenMPI's mpirun will exit with non-zero status if it | |
980 | ;; detects an "abnormal termination", i.e. any process not | |
981 | ;; calling MPI_Finalize(). Since the test is explicitely | |
982 | ;; avoiding MPI_Finalize so as not to have at_exit and thus | |
983 | ;; H5C_flush_cache from being called, mpirun will always | |
984 | ;; complain, so turn this test off. | |
985 | (substitute* "testpar/Makefile" | |
986 | (("(^TEST_PROG_PARA.*)t_pflush1(.*)" front back) | |
987 | (string-append front back "\n"))) | |
988 | (substitute* "tools/h5diff/testph5diff.sh" | |
989 | (("/bin/sh") (which "sh"))) | |
990 | #t)))))) | |
991 | (synopsis "Management suite for data with parallel IO support"))) | |
992 | ||
00775104 EB |
993 | (define-public h5check |
994 | (package | |
995 | (name "h5check") | |
996 | (version "2.0.1") | |
997 | (source | |
998 | (origin | |
999 | (method url-fetch) | |
1000 | (uri (string-append "http://www.hdfgroup.org/ftp/HDF5/tools/" | |
1001 | "h5check/src/h5check-" version ".tar.gz")) | |
1002 | (sha256 | |
1003 | (base32 | |
1004 | "1gm76jbwhz9adbxgn14zx8cj33dmjdr2g5xcy0m9c2gakp8w59kj")))) | |
1005 | (build-system gnu-build-system) | |
1006 | (inputs `(("hdf5" ,hdf5))) ;h5cc for tests | |
1007 | (home-page "https://www.hdfgroup.org/products/hdf5_tools/h5check.html") | |
1008 | (synopsis "HDF5 format checker") | |
1009 | (description "@code{h5check} is a validation tool for verifying that an | |
1010 | HDF5 file is encoded according to the HDF File Format Specification.") | |
1011 | (license (license:x11-style "file://COPYING")))) | |
1012 | ||
a53d6719 JD |
1013 | (define-public itpp |
1014 | (package | |
1015 | (name "itpp") | |
1016 | (version "4.3.1") | |
1017 | (source (origin | |
1018 | (method url-fetch) | |
1019 | (uri (string-append "mirror://sourceforge/itpp/itpp/" | |
1020 | version "/itpp-" | |
1021 | version ".tar.gz")) | |
1022 | (sha256 | |
1023 | (base32 | |
1024 | "14ddy2xnb6sgp4hiax9v5sv4pr4l4dd4ps76nfha3nrpr1ikhcqm")))) | |
1025 | (build-system cmake-build-system) | |
1026 | (arguments `(#:tests? #f)) ; Tests require googletest *sources* | |
1027 | (inputs `(("lapack" ,lapack) | |
1028 | ("fftw" ,fftw))) | |
3a4d5df2 RW |
1029 | ;; FIXME: Even though the fonts are available dvips complains: |
1030 | ;; "Font cmmi10 not found; characters will be left blank." | |
1031 | (native-inputs | |
1032 | `(("texlive" ,texlive-tiny) | |
1033 | ("ghostscript" ,ghostscript) | |
1034 | ("doxygen" ,doxygen))) | |
a53d6719 JD |
1035 | (home-page "http://itpp.sourceforge.net") |
1036 | (synopsis "C++ library of maths, signal processing and communication classes") | |
1037 | (description "IT++ is a C++ library of mathematical, signal processing and | |
1038 | communication classes and functions. Its main use is in simulation of | |
1039 | communication systems and for performing research in the area of | |
1040 | communications. The kernel of the library consists of generic vector and | |
1041 | matrix classes, and a set of accompanying routines. Such a kernel makes IT++ | |
1042 | similar to MATLAB, GNU Octave or SciPy.") | |
1043 | (license license:gpl3+))) | |
1044 | ||
889187a4 EB |
1045 | (define-public netcdf |
1046 | (package | |
1047 | (name "netcdf") | |
a4b0bfb1 | 1048 | (version "4.4.1.1") |
889187a4 EB |
1049 | (source |
1050 | (origin | |
1051 | (method url-fetch) | |
1052 | (uri (string-append "ftp://ftp.unidata.ucar.edu/pub/netcdf/" | |
1053 | "netcdf-" version ".tar.gz")) | |
1054 | (sha256 | |
1055 | (base32 | |
a4b0bfb1 EB |
1056 | "1blc7ik5yin7i0ls2kag0a9xjk12m0dzx6v1x88az3ras3scci2d")) |
1057 | (patches (search-patches "netcdf-date-time.patch" | |
1058 | "netcdf-tst_h_par.patch")))) | |
889187a4 EB |
1059 | (build-system gnu-build-system) |
1060 | (native-inputs | |
1061 | `(("m4" ,m4) | |
1062 | ("doxygen" ,doxygen) | |
1063 | ("graphviz" ,graphviz))) | |
1064 | (inputs | |
db825570 TD |
1065 | `(("hdf4" ,hdf4-alt) |
1066 | ("hdf5" ,hdf5) | |
1067 | ("zlib" ,zlib) | |
1068 | ("libjpeg" ,libjpeg))) | |
889187a4 | 1069 | (arguments |
db825570 | 1070 | `(#:configure-flags '("--enable-doxygen" "--enable-dot" "--enable-hdf4") |
43d01672 TD |
1071 | |
1072 | #:phases (modify-phases %standard-phases | |
1073 | (add-before 'configure 'fix-source-date | |
1074 | (lambda _ | |
1075 | ;; As we ${SOURCE_DATE_EPOCH} evaluates to "1" in the build | |
1076 | ;; environment, `date -u -d ${SOURCE_DATE_EPOCH}` will evaluate | |
1077 | ;; to '1st hour of the current day', and therefore makes the | |
1078 | ;; package not reproducible. | |
1079 | (substitute* "./configure" | |
1080 | (("date -u -d \"\\$\\{SOURCE_DATE_EPOCH\\}\"") | |
1081 | "date --date='@0'")) | |
1082 | #t)) | |
1083 | (add-after 'configure 'patch-settings | |
1084 | (lambda _ | |
1085 | ;; libnetcdf.settings contains the full filename of the compilers | |
1086 | ;; used to build the library. We truncate the hashes of those | |
1087 | ;; filenames to avoid unnecessary references to the corresponding | |
1088 | ;; store items. | |
1089 | (substitute* "libnetcdf.settings" | |
1090 | (("(/gnu/store/)([a-Z0-9]*)" all prefix hash) | |
1091 | (string-append prefix (string-take hash 10) "..."))) | |
1092 | #t))) | |
1093 | ||
889187a4 EB |
1094 | #:parallel-tests? #f)) ;various race conditions |
1095 | (home-page "http://www.unidata.ucar.edu/software/netcdf/") | |
1096 | (synopsis "Library for scientific data") | |
1097 | (description "NetCDF is an interface for scientific data access and a | |
1098 | software library that provides an implementation of the interface. The netCDF | |
1099 | library defines a machine-independent format for representing scientific data. | |
1100 | Together, the interface, library, and format support the creation, access, and | |
1101 | sharing of scientific data.") | |
1102 | (license (license:x11-style "file://COPYRIGHT")))) | |
1103 | ||
1104 | (define-public netcdf-parallel-openmpi | |
1105 | (package (inherit netcdf) | |
1106 | (name "netcdf-parallel-openmpi") | |
1107 | (inputs | |
1108 | `(("mpi" ,openmpi) | |
1109 | ,@(alist-replace "hdf5" (list hdf5-parallel-openmpi) | |
1110 | (package-inputs netcdf)))) | |
1111 | ;; TODO: Replace pkg-config references in nc-config with absolute references | |
1112 | (arguments | |
1113 | (substitute-keyword-arguments (package-arguments netcdf) | |
1114 | ((#:configure-flags flags) | |
1115 | `(cons* "CC=mpicc" "CXX=mpicxx" | |
1116 | "--enable-parallel-tests" | |
1117 | ;; Shared libraries not supported with parallel IO. | |
1118 | "--disable-shared" "--with-pic" | |
1119 | ,flags)))))) | |
1120 | ||
300200b6 TD |
1121 | (define-public netcdf-fortran |
1122 | (package | |
1123 | (name "netcdf-fortran") | |
1124 | (version "4.4.4") | |
1125 | (source (origin | |
1126 | (method url-fetch) | |
1127 | (uri (string-append | |
1128 | "ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-fortran-" | |
1129 | version ".tar.gz")) | |
1130 | (sha256 | |
1131 | (base32 | |
1132 | "0xaxdcg1p83zmypwml3swsnr3ccn38inwldyr1l3wa4dbwbrblxj")))) | |
1133 | (build-system gnu-build-system) | |
1134 | (arguments | |
1135 | `(#:parallel-tests? #f)) | |
1136 | (inputs | |
1137 | `(("netcdf" ,netcdf))) | |
1138 | (native-inputs | |
1139 | `(("gfortran" ,gfortran))) | |
1140 | (synopsis "Fortran interface for the netCDF library") | |
1141 | (description (package-description netcdf)) | |
1142 | (home-page (package-home-page netcdf)) | |
1143 | (license (package-license netcdf)))) | |
1144 | ||
1b39a196 RJ |
1145 | (define-public nlopt |
1146 | (package | |
1147 | (name "nlopt") | |
1148 | (version "2.4.2") | |
1149 | (source (origin | |
1150 | (method url-fetch) | |
1151 | (uri (string-append "http://ab-initio.mit.edu/nlopt/nlopt-" | |
1152 | version ".tar.gz")) | |
1153 | (sha256 | |
1154 | (base32 "12cfkkhcdf4zmb6h7y6qvvdvqjs2xf9sjpa3rl3bq76px4yn76c0")))) | |
1155 | (build-system gnu-build-system) | |
1156 | (arguments | |
1157 | `(;; Shared libraries are not built by default. They are required to | |
1158 | ;; build the Guile, Octave, and Python bindings. | |
1159 | #:configure-flags '("--enable-shared") | |
1160 | ||
1161 | #:phases | |
1162 | (modify-phases %standard-phases | |
1163 | (add-before 'configure 'set-libnlopt-file-name | |
1164 | (lambda* (#:key outputs #:allow-other-keys) | |
1165 | ;; Make sure the Scheme module refers to the library by its | |
1166 | ;; absolute file name (we cannot do that from a snippet | |
1167 | ;; because the expansion of @libdir@ contains | |
1168 | ;; ${exec_prefix}.) | |
1169 | (let ((out (assoc-ref outputs "out"))) | |
1170 | (substitute* "swig/nlopt.scm.in" | |
1171 | (("libnlopt") | |
1172 | (string-append out "/lib/libnlopt"))) | |
1173 | #t)))))) | |
1174 | (inputs `(("guile" ,guile-2.0))) | |
1175 | (native-inputs `(("pkg-config" ,pkg-config))) | |
1176 | (home-page "http://ab-initio.mit.edu/wiki/") | |
1177 | (synopsis "Library for nonlinear optimization") | |
1178 | (description "NLopt is a library for nonlinear optimization, providing a | |
1179 | common interface for a number of different free optimization routines available | |
1180 | online as well as original implementations of various other algorithms.") | |
1181 | (license license:lgpl2.1+))) | |
1182 | ||
005c787d LC |
1183 | (define-public ipopt |
1184 | (package | |
1185 | (name "ipopt") | |
1186 | (version "3.12.5") | |
1187 | (source (origin | |
1188 | (method url-fetch) | |
1189 | (uri (string-append | |
1190 | "http://www.coin-or.org/download/source/Ipopt/Ipopt-" | |
1191 | version".tgz")) | |
1192 | (sha256 | |
1193 | (base32 | |
1194 | "09bk2hqy2vgi4yi76xng9zxakddwqy3wij9nx7wf2vfbxxpazrsk")) | |
1195 | (modules '((guix build utils))) | |
1196 | (snippet | |
1197 | ;; Make sure we don't use the bundled software. | |
1198 | '(delete-file-recursively "ThirdParty")))) | |
1199 | (build-system gnu-build-system) | |
ad1c4537 LC |
1200 | (arguments |
1201 | '(#:phases (modify-phases %standard-phases | |
1202 | (add-after 'install 'add--L-flags-in-ipopt.pc | |
1203 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
1204 | ;; The '.pc' file lists '-llapack -lblas' in "Libs"; | |
1205 | ;; move it to "Libs.private" where it belongs, and add a | |
1206 | ;; '-L' flag for LAPACK. | |
1207 | (let ((out (assoc-ref outputs "out")) | |
1208 | (lapack (assoc-ref inputs "lapack"))) | |
1209 | (substitute* (string-append out "/lib/pkgconfig/" | |
1210 | "ipopt.pc") | |
1211 | (("Libs: (.*)-llapack -lblas(.*)$" _ before after) | |
1212 | (string-append "Libs: " before " " after "\n" | |
1213 | "Libs.private: " before | |
1214 | "-L" lapack "/lib -llapack -lblas " | |
1215 | after "\n"))) | |
1216 | #t)))))) | |
005c787d LC |
1217 | (native-inputs |
1218 | `(("gfortran" ,gfortran))) | |
1219 | (inputs | |
1220 | ;; TODO: Maybe add dependency on COIN-MUMPS, ASL, and HSL. | |
ad1c4537 | 1221 | `(("lapack" ,lapack))) ;for both libblas and liblapack |
005c787d LC |
1222 | (home-page "http://www.coin-or.org") |
1223 | (synopsis "Large-scale nonlinear optimizer") | |
1224 | (description | |
1225 | "The Interior Point Optimizer (IPOPT) is a software package for | |
1226 | large-scale nonlinear optimization. It provides C++, C, and Fortran | |
1227 | interfaces.") | |
1228 | (license license:epl1.0))) | |
1229 | ||
f9940ef1 LC |
1230 | (define-public ceres |
1231 | (package | |
1232 | (name "ceres-solver") | |
6ad0c92d | 1233 | (version "1.13.0") |
f9940ef1 LC |
1234 | (home-page "http://ceres-solver.org/") |
1235 | (source (origin | |
1236 | (method url-fetch) | |
1237 | (uri (string-append home-page "ceres-solver-" | |
1238 | version ".tar.gz")) | |
1239 | (sha256 | |
1240 | (base32 | |
6ad0c92d | 1241 | "1kbxgab3q1vgyq7hjqasr1lji4b2sgn7ss351amklkb3jyhr1x0x")))) |
f9940ef1 LC |
1242 | (build-system cmake-build-system) |
1243 | (arguments | |
1244 | ;; TODO: Build HTML user documentation and install separately. | |
bc3a2e35 | 1245 | '(#:configure-flags '("-DBUILD_EXAMPLES=OFF" |
f9940ef1 LC |
1246 | "-DBUILD_SHARED_LIBS=ON") |
1247 | ||
1248 | #:phases (modify-phases %standard-phases | |
1249 | (add-before 'configure 'set-library-directory | |
1250 | (lambda _ | |
1251 | ;; Install libraries to lib/, not lib64/. | |
1252 | (substitute* "internal/ceres/CMakeLists.txt" | |
1253 | (("set\\(LIB_SUFFIX \"64\"\\)") | |
1254 | "set(LIB_SUFFIX \"\")")) | |
1255 | #t))))) | |
1256 | (native-inputs | |
1257 | `(("pkg-config" ,pkg-config))) | |
468e0b18 LC |
1258 | (propagated-inputs |
1259 | `(("glog" ,glog))) ;for #include <glog/glog.h> | |
f9940ef1 LC |
1260 | (inputs |
1261 | `(("eigen" ,eigen) | |
1262 | ("blas" ,openblas) | |
1263 | ("lapack" ,lapack) | |
1264 | ("suitesparse" ,suitesparse) | |
1265 | ("gflags" ,gflags))) | |
1266 | (synopsis "C++ library for solving large optimization problems") | |
1267 | (description | |
1268 | "Ceres Solver is a C++ library for modeling and solving large, | |
1269 | complicated optimization problems. It is a feature rich, mature and | |
1270 | performant library which has been used in production since 2010. Ceres Solver | |
1271 | can solve two kinds of problems: | |
1272 | @enumerate | |
1273 | @item non-linear least squares problems with bounds constraints; | |
1274 | @item general unconstrained optimization problems. | |
1275 | @end enumerate\n") | |
1276 | (license license:bsd-3))) | |
1277 | ||
668c06ac | 1278 | ;; For a fully featured Octave, users are strongly recommended also to install |
5ca4fe96 | 1279 | ;; the following packages: less, ghostscript, gnuplot. |
668c06ac JD |
1280 | (define-public octave |
1281 | (package | |
1282 | (name "octave") | |
e9d60eba | 1283 | (version "4.2.1") |
668c06ac JD |
1284 | (source |
1285 | (origin | |
1286 | (method url-fetch) | |
1287 | (uri (string-append "mirror://gnu/octave/octave-" | |
f5a077b1 | 1288 | version ".tar.lz")) |
668c06ac JD |
1289 | (sha256 |
1290 | (base32 | |
e9d60eba | 1291 | "09zhhch79jw3ynw39vizx0i2cbd2bjz3sp38pjdzraqrbivpwp92")))) |
668c06ac JD |
1292 | (build-system gnu-build-system) |
1293 | (inputs | |
1294 | `(("lapack" ,lapack) | |
1295 | ("readline" ,readline) | |
181170c6 | 1296 | ("gl2ps" ,gl2ps) |
668c06ac | 1297 | ("glpk" ,glpk) |
1ec78e9d EB |
1298 | ("fftw" ,fftw) |
1299 | ("fftwf" ,fftwf) | |
1300 | ("arpack" ,arpack-ng) | |
668c06ac JD |
1301 | ("pcre" ,pcre) |
1302 | ("fltk" ,fltk) | |
1303 | ("fontconfig" ,fontconfig) | |
1304 | ("freetype" ,freetype) | |
40029cbe | 1305 | ("hdf5" ,hdf5) |
668c06ac JD |
1306 | ("libxft" ,libxft) |
1307 | ("mesa" ,mesa) | |
1ec78e9d | 1308 | ("glu" ,glu) |
9f913401 AI |
1309 | ("zlib" ,zlib) |
1310 | ("curl" ,curl) | |
5ca4fe96 | 1311 | ("texinfo" ,texinfo) |
9f913401 | 1312 | ("graphicsmagick" ,graphicsmagick))) |
668c06ac | 1313 | (native-inputs |
f5a077b1 EF |
1314 | `(("lzip" ,lzip) |
1315 | ("gfortran" ,gfortran) | |
668c06ac JD |
1316 | ("pkg-config" ,pkg-config) |
1317 | ("perl" ,perl) | |
1ec78e9d EB |
1318 | ;; The following inputs are not actually used in the build process. |
1319 | ;; However, the ./configure gratuitously tests for their existence and | |
1320 | ;; assumes that programs not present at build time are also not, and | |
1321 | ;; can never be, available at run time! If these inputs are therefore | |
1322 | ;; not present, support for them will be built out. However, Octave | |
1323 | ;; will still run without them, albeit without the features they | |
668c06ac JD |
1324 | ;; provide. |
1325 | ("less" ,less) | |
668c06ac JD |
1326 | ("ghostscript" ,ghostscript) |
1327 | ("gnuplot" ,gnuplot))) | |
1328 | (arguments | |
b7b27a8f KY |
1329 | `(#:configure-flags |
1330 | (list (string-append "--with-shell=" | |
1331 | (assoc-ref %build-inputs "bash") | |
5ca4fe96 AI |
1332 | "/bin/sh")) |
1333 | #:phases | |
1334 | (modify-phases %standard-phases | |
1335 | (add-after 'configure 'configure-makeinfo | |
1336 | (lambda* (#:key inputs #:allow-other-keys) | |
1337 | (substitute* "libinterp/corefcn/help.cc" | |
1338 | (("Vmakeinfo_program = \"makeinfo\"") | |
1339 | (string-append "Vmakeinfo_program = \"" | |
1340 | (assoc-ref inputs "texinfo") | |
1341 | "/bin/makeinfo\""))) | |
1342 | #t))))) | |
f5a077b1 | 1343 | (home-page "https://www.gnu.org/software/octave/") |
668c06ac | 1344 | (synopsis "High-level language for numerical computation") |
1ec78e9d EB |
1345 | (description "GNU Octave is a high-level interpreted language that is |
1346 | specialized for numerical computations. It can be used for both linear and | |
1347 | non-linear applications and it provides great support for visualizing results. | |
1348 | Work may be performed both at the interactive command-line as well as via | |
1349 | script files.") | |
668c06ac | 1350 | (license license:gpl3+))) |
3de01d3f | 1351 | |
5d4bd4cc PG |
1352 | (define-public opencascade-oce |
1353 | (package | |
1354 | (name "opencascade-oce") | |
1355 | (version "0.17.2") | |
1356 | (source | |
1357 | (origin | |
1358 | (method url-fetch) | |
1359 | (uri (string-append | |
1360 | "https://github.com/tpaviot/oce/archive/OCE-" | |
1361 | version | |
1362 | ".tar.gz")) | |
a4f393b7 | 1363 | (patches (search-patches "opencascade-oce-glibc-2.26.patch")) |
5d4bd4cc PG |
1364 | (sha256 |
1365 | (base32 | |
1366 | "0vpmnb0k5y2f7lpmwx9pg9yfq24zjvnsak5alzacncfm1hv9b6cd")))) | |
1367 | (build-system cmake-build-system) | |
1368 | (arguments | |
1369 | '(#:configure-flags | |
1370 | (list "-DOCE_TESTING:BOOL=ON" | |
1371 | "-DOCE_USE_TCL_TEST_FRAMEWORK:BOOL=ON" | |
1372 | "-DOCE_DRAW:BOOL=ON" | |
1373 | (string-append "-DOCE_INSTALL_PREFIX:PATH=" | |
1374 | (assoc-ref %outputs "out")) | |
1375 | "-UCMAKE_INSTALL_RPATH"))) | |
1376 | (inputs | |
1377 | `(("freetype" ,freetype) | |
1378 | ("glu" ,glu) | |
1379 | ("libxmu" ,libxmu) | |
1380 | ("mesa" ,mesa) | |
1381 | ("tcl" ,tcl) | |
1382 | ("tk" ,tk))) | |
1383 | (native-inputs | |
1384 | `(("python" ,python-wrapper))) | |
1385 | (home-page "https://github.com/tpaviot/oce") | |
1386 | (synopsis "Libraries for 3D modeling and numerical simulation") | |
1387 | (description | |
1388 | "Open CASCADE is a set of libraries for the development of applications | |
1389 | dealing with 3D CAD data or requiring industrial 3D capabilities. It includes | |
1390 | C++ class libraries providing services for 3D surface and solid modeling, CAD | |
1391 | data exchange, and visualization. It is used for development of specialized | |
1392 | software dealing with 3D models in design (CAD), manufacturing (CAM), | |
1393 | numerical simulation (CAE), measurement equipment (CMM), and quality | |
1394 | control (CAQ) domains. | |
1395 | ||
1396 | This is the ``Community Edition'' (OCE) of Open CASCADE, which gathers | |
1397 | patches, improvements, and experiments contributed by users over the official | |
1398 | Open CASCADE library.") | |
1399 | (license (list license:lgpl2.1; OCE libraries, with an exception for the | |
1400 | ; use of header files; see | |
1401 | ; OCCT_LGPL_EXCEPTION.txt | |
1402 | license:public-domain; files | |
1403 | ; src/Standard/Standard_StdAllocator.hxx and | |
1404 | ; src/NCollection/NCollection_StdAllocator.hxx | |
1405 | license:expat; file src/OpenGl/OpenGl_glext.h | |
1406 | license:bsd-3)))); test framework gtest | |
1407 | ||
3de01d3f EB |
1408 | (define-public gmsh |
1409 | (package | |
1410 | (name "gmsh") | |
8a4d14fa | 1411 | (version "2.16.0") |
3de01d3f EB |
1412 | (source |
1413 | (origin | |
1414 | (method url-fetch) | |
1c79e086 | 1415 | (uri (string-append "http://gmsh.info/src/gmsh-" |
3de01d3f EB |
1416 | version "-source.tgz")) |
1417 | (sha256 | |
8a4d14fa | 1418 | (base32 "1slf0bfkwrcgn6296wb4qhbk4ahz6i4wfb10hnim08x05vrylag8")) |
3de01d3f EB |
1419 | (modules '((guix build utils))) |
1420 | (snippet | |
1421 | ;; Remove non-free METIS code | |
1422 | '(delete-file-recursively "contrib/Metis")))) | |
1423 | (build-system cmake-build-system) | |
3de01d3f EB |
1424 | (propagated-inputs |
1425 | `(("fltk" ,fltk) | |
19afbea1 | 1426 | ("gfortran" ,gfortran) |
3de01d3f | 1427 | ("gmp" ,gmp) |
40029cbe | 1428 | ("hdf5" ,hdf5) |
3de01d3f EB |
1429 | ("lapack" ,lapack) |
1430 | ("mesa" ,mesa) | |
85f41902 | 1431 | ("glu" ,glu) |
45548139 | 1432 | ("opencascade-oce" ,opencascade-oce) |
3de01d3f EB |
1433 | ("libx11" ,libx11) |
1434 | ("libxext" ,libxext))) | |
66395a61 EF |
1435 | (inputs |
1436 | `(("fontconfig" ,fontconfig) | |
1437 | ("libxft" ,libxft))) | |
3de01d3f EB |
1438 | (arguments |
1439 | `(#:configure-flags `("-DENABLE_METIS:BOOL=OFF" | |
1440 | "-DENABLE_BUILD_SHARED:BOOL=ON" | |
45548139 | 1441 | "-DENABLE_BUILD_DYNAMIC:BOOL=ON"))) |
3de01d3f EB |
1442 | (home-page "http://www.geuz.org/gmsh/") |
1443 | (synopsis "3D finite element grid generator") | |
edf684ef EB |
1444 | (description "Gmsh is a 3D finite element grid generator with a built-in |
1445 | CAD engine and post-processor. Its design goal is to provide a fast, light | |
1446 | and user-friendly meshing tool with parametric input and advanced | |
1447 | visualization capabilities. Gmsh is built around four modules: geometry, | |
1448 | mesh, solver and post-processing. The specification of any input to these | |
1449 | modules is done either interactively using the graphical user interface or in | |
1450 | ASCII text files using Gmsh's own scripting language.") | |
3de01d3f | 1451 | (license license:gpl2+))) |
b9100e2f | 1452 | |
6d5f63b6 JD |
1453 | (define-public maxflow |
1454 | (package | |
1455 | (name "maxflow") | |
1456 | (version "3.04") | |
1457 | (source (origin | |
1458 | (method git-fetch) | |
1459 | (uri (git-reference | |
1460 | (url "https://github.com/gerddie/maxflow.git") | |
1461 | (commit "42401fa54823d16b9da47716f04e5d9ef1605875"))) | |
1462 | (file-name (string-append name "-" version "-checkout")) | |
1463 | (sha256 | |
1464 | (base32 | |
1465 | "0rll38whw55h0vcjrrwdnh9ascvxby0ph7n1l0d12z17cg215kkb")))) | |
1466 | (build-system cmake-build-system) | |
1467 | (home-page "http://pub.ist.ac.at/~vnk/software.html") | |
1468 | (synopsis "Library implementing Maxflow algorithm") | |
1469 | (description "An implementation of the maxflow algorithm described in | |
1470 | @cite{An Experimental Comparison of Min-Cut/Max-Flow Algorithms for | |
1471 | Energy Minimization in Computer Vision.\n | |
1472 | Yuri Boykov and Vladimir Kolmogorov.\n | |
1473 | In IEEE Transactions on Pattern Analysis and Machine Intelligence,\n | |
1474 | September 2004}") | |
1475 | (license license:gpl3+))) | |
1476 | ||
b9100e2f EB |
1477 | (define-public petsc |
1478 | (package | |
1479 | (name "petsc") | |
6fec298d | 1480 | (version "3.8.0") |
b9100e2f EB |
1481 | (source |
1482 | (origin | |
1483 | (method url-fetch) | |
1484 | ;; The *-lite-* tarball does not contain the *large* documentation | |
1485 | (uri (string-append "http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/" | |
1486 | "petsc-lite-" version ".tar.gz")) | |
1487 | (sha256 | |
6fec298d | 1488 | (base32 "1lajbk3c29hnh83v6cbmm3a8wv6bdykh0p70kwrr4vrnizalk88s")))) |
b9100e2f EB |
1489 | (build-system gnu-build-system) |
1490 | (native-inputs | |
6fec298d | 1491 | `(("python" ,python-2))) |
b9100e2f | 1492 | (inputs |
19afbea1 | 1493 | `(("gfortran" ,gfortran) |
b9100e2f | 1494 | ("lapack" ,lapack) |
f258212d | 1495 | ("superlu" ,superlu) |
b9100e2f EB |
1496 | ;; leaving out hdf5 and fftw, as petsc expects them to be built with mpi |
1497 | ;; leaving out opengl, as configuration seems to only be for mac | |
1498 | )) | |
1499 | (arguments | |
1500 | `(#:test-target "test" | |
9a899cce | 1501 | #:parallel-build? #f ;build is parallel by default |
b9100e2f EB |
1502 | #:configure-flags |
1503 | `("--with-mpi=0" | |
f258212d EB |
1504 | "--with-openmp=1" |
1505 | "--with-superlu=1" | |
1506 | ,(string-append "--with-superlu-include=" | |
1507 | (assoc-ref %build-inputs "superlu") "/include") | |
1508 | ,(string-append "--with-superlu-lib=" | |
1509 | (assoc-ref %build-inputs "superlu") "/lib/libsuperlu.a")) | |
9731c412 EB |
1510 | #:make-flags |
1511 | ;; Honor (parallel-job-count) for build. Do not use --with-make-np, | |
1512 | ;; whose value is dumped to $out/lib/petsc/conf/petscvariables. | |
1513 | (list (format #f "MAKE_NP=~a" (parallel-job-count))) | |
b9100e2f | 1514 | #:phases |
64dcc289 EB |
1515 | (modify-phases %standard-phases |
1516 | (replace 'configure | |
1517 | ;; PETSc's configure script is actually a python script, so we can't | |
1518 | ;; run it with bash. | |
1519 | (lambda* (#:key outputs (configure-flags '()) | |
1520 | #:allow-other-keys) | |
1521 | (let* ((prefix (assoc-ref outputs "out")) | |
1522 | (flags `(,(string-append "--prefix=" prefix) | |
1523 | ,@configure-flags))) | |
1524 | (format #t "build directory: ~s~%" (getcwd)) | |
1525 | (format #t "configure flags: ~s~%" flags) | |
1526 | (zero? (apply system* "./configure" flags))))) | |
1527 | (add-after 'configure 'clean-local-references | |
9731c412 | 1528 | (lambda* (#:key outputs #:allow-other-keys) |
64dcc289 EB |
1529 | (let ((out (assoc-ref outputs "out"))) |
1530 | (substitute* (find-files "." "^petsc(conf|machineinfo).h$") | |
b730b437 EB |
1531 | ;; Prevent build directory from leaking into compiled code |
1532 | (((getcwd)) out) | |
1533 | ;; Scrub timestamp for reproducibility | |
fafd623e | 1534 | ((".*Libraries compiled on.*") "")) |
9731c412 EB |
1535 | (substitute* (find-files "." "petscvariables") |
1536 | ;; Do not expose build machine characteristics, set to defaults. | |
1537 | (("MAKE_NP = [:digit:]+") "MAKE_NP = 2") | |
1538 | (("NPMAX = [:digit:]+") "NPMAX = 2")) | |
fafd623e | 1539 | #t))) |
64dcc289 | 1540 | (add-after 'install 'clean-install |
10b11968 EB |
1541 | ;; Try to keep installed files from leaking build directory names. |
1542 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
64dcc289 | 1543 | (let ((out (assoc-ref outputs "out"))) |
10b11968 | 1544 | (substitute* (map (lambda (file) |
9a899cce | 1545 | (string-append out "/lib/petsc/conf/" file)) |
fafd623e | 1546 | '("petscvariables")) |
10b11968 EB |
1547 | (((getcwd)) out)) |
1548 | ;; Make compiler references point to the store | |
9a899cce | 1549 | (substitute* (string-append out "/lib/petsc/conf/petscvariables") |
dfdf5716 EB |
1550 | (("= (gcc|g\\+\\+|gfortran)" _ compiler) |
1551 | (string-append "= " (which compiler)))) | |
10b11968 EB |
1552 | ;; PETSc installs some build logs, which aren't necessary. |
1553 | (for-each (lambda (file) | |
9a899cce | 1554 | (let ((f (string-append out "/lib/petsc/conf/" file))) |
10b11968 EB |
1555 | (when (file-exists? f) |
1556 | (delete-file f)))) | |
9a899cce EB |
1557 | '("configure.log" "make.log" "gmake.log" |
1558 | "test.log" "error.log" "RDict.db" | |
fafd623e | 1559 | "PETScBuildInternal.cmake" |
10b11968 | 1560 | ;; Once installed, should uninstall with Guix |
fafd623e EB |
1561 | "uninstall.py")) |
1562 | #t)))))) | |
b9100e2f | 1563 | (home-page "http://www.mcs.anl.gov/petsc") |
16ecf3ff | 1564 | (synopsis "Library to solve PDEs") |
b9100e2f EB |
1565 | (description "PETSc, pronounced PET-see (the S is silent), is a suite of |
1566 | data structures and routines for the scalable (parallel) solution of | |
1567 | scientific applications modeled by partial differential equations.") | |
166191b3 | 1568 | (license (license:non-copyleft |
b9100e2f EB |
1569 | "http://www.mcs.anl.gov/petsc/documentation/copyright.html")))) |
1570 | ||
1571 | (define-public petsc-complex | |
1572 | (package (inherit petsc) | |
1573 | (name "petsc-complex") | |
1574 | (arguments | |
1575 | (substitute-keyword-arguments (package-arguments petsc) | |
1576 | ((#:configure-flags cf) | |
1577 | `(cons "--with-scalar-type=complex" ,cf)))) | |
16ecf3ff | 1578 | (synopsis "Library to solve PDEs (with complex scalars)"))) |
183e44ae | 1579 | |
d8c7eeb9 EB |
1580 | (define-public petsc-openmpi |
1581 | (package (inherit petsc) | |
1582 | (name "petsc-openmpi") | |
1583 | (inputs | |
1584 | `(("openmpi" ,openmpi) | |
1585 | ,@(package-inputs petsc))) | |
1586 | (arguments | |
1587 | (substitute-keyword-arguments (package-arguments petsc) | |
1588 | ((#:configure-flags cf) | |
1589 | ``("--with-mpiexec=mpirun" | |
1590 | ,(string-append "--with-mpi-dir=" | |
1591 | (assoc-ref %build-inputs "openmpi")) | |
1592 | ,@(delete "--with-mpi=0" ,cf))))) | |
16ecf3ff | 1593 | (synopsis "Library to solve PDEs (with MPI support)"))) |
d8c7eeb9 EB |
1594 | |
1595 | (define-public petsc-complex-openmpi | |
1596 | (package (inherit petsc-complex) | |
1597 | (name "petsc-complex-openmpi") | |
1598 | (inputs | |
1599 | `(("openmpi" ,openmpi) | |
1600 | ,@(package-inputs petsc-complex))) | |
1601 | (arguments | |
1602 | (substitute-keyword-arguments (package-arguments petsc-complex) | |
1603 | ((#:configure-flags cf) | |
1604 | ``("--with-mpiexec=mpirun" | |
1605 | ,(string-append "--with-mpi-dir=" | |
1606 | (assoc-ref %build-inputs "openmpi")) | |
1607 | ,@(delete "--with-mpi=0" ,cf))))) | |
16ecf3ff | 1608 | (synopsis "Library to solve PDEs (with complex scalars and MPI support)"))) |
d8c7eeb9 | 1609 | |
a7f01414 EB |
1610 | (define-public slepc |
1611 | (package | |
1612 | (name "slepc") | |
cc809f16 | 1613 | (version "3.8.2") |
a7f01414 EB |
1614 | (source |
1615 | (origin | |
1616 | (method url-fetch) | |
baeaf882 EB |
1617 | (uri (string-append "http://slepc.upv.es/download/distrib/slepc-" |
1618 | version ".tar.gz")) | |
a7f01414 EB |
1619 | (sha256 |
1620 | (base32 | |
cc809f16 | 1621 | "04zd48p43rnvg68p6cp28zll0px5whglc5v0sc3s6vdj1v920z8y")))) |
a7f01414 EB |
1622 | (build-system gnu-build-system) |
1623 | (native-inputs | |
1624 | `(("python" ,python-2))) | |
1625 | (inputs | |
1626 | `(("arpack" ,arpack-ng) | |
1627 | ("gfortran" ,gfortran))) | |
1628 | (propagated-inputs | |
1629 | `(("petsc" ,petsc))) | |
1630 | (arguments | |
1631 | `(#:parallel-build? #f ;build is parallel by default | |
1632 | #:configure-flags | |
1633 | `(,(string-append "--with-arpack-dir=" | |
9cf52454 | 1634 | (assoc-ref %build-inputs "arpack") "/lib")) |
9731c412 EB |
1635 | #:make-flags ;honor (parallel-job-count) |
1636 | `(,(format #f "MAKE_NP=~a" (parallel-job-count))) | |
a7f01414 EB |
1637 | #:phases |
1638 | (modify-phases %standard-phases | |
8787c555 | 1639 | (replace 'configure |
a7f01414 EB |
1640 | ;; configure is a python script, so we can't run it with bash. |
1641 | (lambda* (#:key inputs outputs (configure-flags '()) | |
1642 | #:allow-other-keys) | |
1643 | (let* ((prefix (assoc-ref outputs "out")) | |
1644 | (flags `(,(string-append "--prefix=" prefix) | |
1645 | ,@configure-flags))) | |
1646 | (format #t "build directory: ~s~%" (getcwd)) | |
1647 | (format #t "configure flags: ~s~%" flags) | |
1648 | (setenv "SLEPC_DIR" (getcwd)) | |
9cf52454 | 1649 | (setenv "PETSC_DIR" (assoc-ref inputs "petsc")) |
c6840089 | 1650 | (apply invoke "./configure" flags)))) |
8787c555 | 1651 | (add-after 'install 'delete-doc |
a7f01414 EB |
1652 | ;; TODO: SLEPc installs HTML documentation alongside headers in |
1653 | ;; $out/include. We'd like to move them to share/doc, but delete | |
1654 | ;; them for now, as they are incomplete and installing the complete | |
1655 | ;; documentation is difficult. | |
1656 | (lambda* (#:key outputs #:allow-other-keys) | |
1657 | (let* ((out (assoc-ref outputs "out"))) | |
1658 | (for-each delete-file (find-files out "\\.html$"))))) | |
8787c555 | 1659 | (add-after 'install 'clean-install |
a7f01414 EB |
1660 | ;; Clean up unnecessary build logs from installation. |
1661 | (lambda* (#:key outputs #:allow-other-keys) | |
1662 | (let ((out (assoc-ref outputs "out"))) | |
1663 | (for-each (lambda (file) | |
1664 | (let ((f (string-append out "/lib/slepc/conf/" file))) | |
1665 | (when (file-exists? f) | |
1666 | (delete-file f)))) | |
1667 | '("configure.log" "make.log" "gmake.log" | |
1668 | "test.log" "error.log" "RDict.db" | |
1669 | "uninstall.py")))))))) | |
1670 | (home-page "http://slepc.upv.es") | |
1671 | (synopsis "Scalable library for eigenproblems") | |
1672 | (description "SLEPc is a software library for the solution of large sparse | |
1673 | eigenproblems on parallel computers. It can be used for the solution of | |
1674 | linear eigenvalue problems formulated in either standard or generalized form, | |
1675 | as well as other related problems such as the singular value decomposition. | |
1676 | The emphasis of the software is on methods and techniques appropriate for | |
1677 | problems in which the associated matrices are sparse, for example, those | |
1678 | arising after the discretization of partial differential equations.") | |
3c524f21 | 1679 | (license license:bsd-2))) |
a7f01414 EB |
1680 | |
1681 | (define-public slepc-complex | |
1682 | (package (inherit slepc) | |
1683 | (name "slepc-complex") | |
1684 | (propagated-inputs | |
1685 | `(("petsc" ,petsc-complex) | |
1686 | ,@(alist-delete "petsc" (package-propagated-inputs slepc)))) | |
1687 | (synopsis "Scalable library for eigenproblems (with complex scalars)"))) | |
1688 | ||
1689 | (define-public slepc-openmpi | |
1690 | (package (inherit slepc) | |
1691 | (name "slepc-openmpi") | |
1692 | (inputs | |
1693 | `(("mpi" ,openmpi) | |
1694 | ("arpack" ,arpack-ng-openmpi) | |
1695 | ,@(alist-delete "arpack" (package-inputs slepc)))) | |
1696 | (propagated-inputs | |
1697 | `(("petsc" ,petsc-openmpi) | |
1698 | ,@(alist-delete "petsc" (package-propagated-inputs slepc)))) | |
1699 | (synopsis "Scalable library for eigenproblems (with MPI support)"))) | |
1700 | ||
1701 | (define-public slepc-complex-openmpi | |
1702 | (package (inherit slepc-openmpi) | |
1703 | (name "slepc-complex-openmpi") | |
1704 | (propagated-inputs | |
1705 | `(("petsc" ,petsc-complex-openmpi) | |
1706 | ,@(alist-delete "petsc" (package-propagated-inputs slepc-openmpi)))) | |
1707 | (synopsis "Scalable library for eigenproblems (with complex scalars and MPI support)"))) | |
1708 | ||
cec86422 EB |
1709 | (define-public mumps |
1710 | (package | |
1711 | (name "mumps") | |
fba78d18 | 1712 | (version "5.0.2") |
cec86422 EB |
1713 | (source |
1714 | (origin | |
1715 | (method url-fetch) | |
1716 | (uri (string-append "http://mumps.enseeiht.fr/MUMPS_" | |
1717 | version ".tar.gz")) | |
1718 | (sha256 | |
1719 | (base32 | |
fba78d18 | 1720 | "0igyc1pfzxdhpbad3v3lb86ixkdbqa1a8gbs15b04r2294h2nabp")) |
fc1adab1 | 1721 | (patches (search-patches "mumps-build-parallelism.patch")))) |
cec86422 EB |
1722 | (build-system gnu-build-system) |
1723 | (inputs | |
1724 | `(("fortran" ,gfortran) | |
1725 | ;; These are required for linking against mumps, but we let the user | |
1726 | ;; declare the dependency. | |
1727 | ("blas" ,openblas) | |
1728 | ("metis" ,metis) | |
1729 | ("scotch" ,scotch))) | |
1730 | (arguments | |
1731 | `(#:modules ((ice-9 match) | |
1732 | (ice-9 popen) | |
1733 | (srfi srfi-1) | |
1734 | ,@%gnu-build-system-modules) | |
1735 | #:phases | |
1736 | (modify-phases %standard-phases | |
fba78d18 | 1737 | (replace 'configure |
cec86422 EB |
1738 | (lambda* (#:key inputs #:allow-other-keys) |
1739 | (call-with-output-file "Makefile.inc" | |
1740 | (lambda (port) | |
1741 | (format port " | |
1742 | PLAT = | |
1743 | LIBEXT = .a | |
1744 | OUTC = -o | |
1745 | OUTF = -o | |
1746 | RM = rm -f~:[ | |
1747 | CC = gcc | |
1748 | FC = gfortran | |
1749 | FL = gfortran | |
1750 | INCSEQ = -I$(topdir)/libseq | |
1751 | LIBSEQ = -L$(topdir)/libseq -lmpiseq | |
1752 | LIBSEQNEEDED = libseqneeded~; | |
1753 | CC = mpicc | |
1754 | FC = mpifort | |
1755 | FL = mpifort~] | |
1756 | AR = ar vr # rules require trailing space, ugh... | |
1757 | RANLIB = ranlib | |
1758 | LIBBLAS = -L~a -lopenblas~@[ | |
1759 | SCALAP = -L~a -lscalapack~] | |
1760 | LIBOTHERS = -pthread | |
1761 | CDEFS = -DAdd_ | |
1762 | PIC = -fPIC | |
1763 | OPTF = -O2 -DALLOW_NON_INIT $(PIC) | |
1764 | OPTL = -O2 $(PIC) | |
1765 | OPTC = -O2 $(PIC) | |
1766 | INCS = $(INCSEQ) | |
1767 | LIBS = $(SCALAP) $(LIBSEQ) | |
1768 | LPORDDIR = $(topdir)/PORD/lib | |
1769 | IPORD = -I$(topdir)/PORD/include | |
1770 | LPORD = -L$(LPORDDIR) -lpord | |
1771 | ORDERINGSF = -Dpord~@[ | |
1772 | METISDIR = ~a | |
1773 | IMETIS = -I$(METISDIR)/include | |
1774 | LMETIS = -L$(METISDIR)/lib -lmetis | |
1775 | ORDERINGSF += -Dmetis~]~@[~:{ | |
1776 | SCOTCHDIR = ~a | |
1777 | ISCOTCH = -I$(SCOTCHDIR)/include | |
1778 | LSCOTCH = -L$(SCOTCHDIR)/lib ~a-lesmumps -lscotch -lscotcherr | |
1779 | ORDERINGSF += ~a~}~] | |
1780 | ORDERINGSC = $(ORDERINGSF) | |
1781 | LORDERINGS = $(LPORD) $(LMETIS) $(LSCOTCH) | |
1782 | IORDERINGSF = $(ISCOTCH) | |
1783 | IORDERINGSC = $(IPORD) $(IMETIS) $(ISCOTCH)" | |
1784 | (assoc-ref inputs "mpi") | |
1785 | (assoc-ref inputs "blas") | |
1786 | (assoc-ref inputs "scalapack") | |
1787 | (assoc-ref inputs "metis") | |
1788 | (match (list (assoc-ref inputs "pt-scotch") | |
1789 | (assoc-ref inputs "scotch")) | |
1790 | ((#f #f) | |
1791 | #f) | |
1792 | ((#f scotch) | |
1793 | `((,scotch "" "-Dscotch"))) | |
1794 | ((ptscotch _) | |
1795 | `((,ptscotch | |
1796 | "-lptesmumps -lptscotch -lptscotcherr " | |
1797 | "-Dptscotch"))))))))) | |
fba78d18 | 1798 | (replace 'build |
cec86422 EB |
1799 | ;; By default only the d-precision library is built. Make with "all" |
1800 | ;; target so that all precision libraries and examples are built. | |
1801 | (lambda _ | |
1802 | (zero? (system* "make" "all" | |
1803 | (format #f "-j~a" (parallel-job-count)))))) | |
fba78d18 | 1804 | (replace 'check |
cec86422 EB |
1805 | ;; Run the simple test drivers, which read test input from stdin: |
1806 | ;; from the "real" input for the single- and double-precision | |
1807 | ;; testers, and from the "cmplx" input for complex-precision | |
1808 | ;; testers. The EXEC-PREFIX key is used by the mumps-openmpi | |
1809 | ;; package to prefix execution with "mpirun". | |
1810 | (lambda* (#:key (exec-prefix '()) #:allow-other-keys) | |
1811 | (with-directory-excursion "examples" | |
1812 | (every | |
1813 | (lambda (prec type) | |
1814 | (let ((tester (apply open-pipe* | |
1815 | `(,OPEN_WRITE | |
1816 | ,@exec-prefix | |
1817 | ,(string-append "./" prec | |
1818 | "simpletest")))) | |
1819 | (input (open-input-file | |
1820 | (string-append "input_simpletest_" type)))) | |
1821 | (begin | |
1822 | (dump-port input tester) | |
1823 | (close-port input) | |
1824 | (zero? (close-pipe tester))))) | |
1825 | '("s" "d" "c" "z") | |
1826 | '("real" "real" "cmplx" "cmplx"))))) | |
fba78d18 EB |
1827 | (replace 'install |
1828 | (lambda* (#:key outputs #:allow-other-keys) | |
1829 | (let* ((out (assoc-ref outputs "out")) | |
1830 | (libdir (string-append out "/lib"))) | |
1831 | (copy-recursively "lib" libdir) | |
1832 | (copy-recursively "include" (string-append out "/include")) | |
1833 | (when (file-exists? "libseq/libmpiseq.a") | |
1834 | (install-file "libseq/libmpiseq.a" libdir)) | |
1835 | #t)))))) | |
cec86422 EB |
1836 | (home-page "http://mumps.enseeiht.fr") |
1837 | (synopsis "Multifrontal sparse direct solver") | |
1838 | (description | |
1839 | "MUMPS (MUltifrontal Massively Parallel sparse direct Solver) solves a | |
1840 | sparse system of linear equations A x = b using Guassian elimination.") | |
1841 | (license license:cecill-c))) | |
1842 | ||
1843 | (define-public mumps-metis | |
1844 | (package (inherit mumps) | |
1845 | (name "mumps-metis") | |
1846 | (inputs | |
1847 | (alist-delete "scotch" (package-inputs mumps))))) | |
1848 | ||
1849 | (define-public mumps-openmpi | |
1850 | (package (inherit mumps) | |
1851 | (name "mumps-openmpi") | |
1852 | (inputs | |
1853 | `(("mpi" ,openmpi) | |
1854 | ("scalapack" ,scalapack) | |
1855 | ("pt-scotch" ,pt-scotch) | |
1856 | ,@(alist-delete "scotch" (package-inputs mumps)))) | |
1857 | (arguments | |
1858 | (substitute-keyword-arguments (package-arguments mumps) | |
1859 | ((#:phases phases) | |
1860 | `(modify-phases ,phases | |
1861 | (replace | |
1862 | 'check | |
1863 | (lambda _ | |
1864 | ((assoc-ref ,phases 'check) | |
1865 | #:exec-prefix '("mpirun" "-n" "2")))))))) | |
1866 | (synopsis "Multifrontal sparse direct solver (with MPI)"))) | |
1867 | ||
1868 | (define-public mumps-metis-openmpi | |
1869 | (package (inherit mumps-openmpi) | |
1870 | (name "mumps-metis-openmpi") | |
1871 | (inputs | |
1872 | (alist-delete "pt-scotch" (package-inputs mumps-openmpi))))) | |
1873 | ||
2d047896 RW |
1874 | (define-public r-quadprog |
1875 | (package | |
1876 | (name "r-quadprog") | |
1877 | (version "1.5-5") | |
1878 | (source | |
1879 | (origin | |
1880 | (method url-fetch) | |
1881 | (uri (cran-uri "quadprog" version)) | |
1882 | (sha256 | |
1883 | (base32 | |
1884 | "0jg3r6abmhp8r9vkbhpx9ldjfw6vyl1m4c5vwlyjhk1mi03656fr")))) | |
1885 | (build-system r-build-system) | |
1886 | (native-inputs | |
1887 | `(("gfortran" ,gfortran))) | |
e9960d8c | 1888 | (home-page "https://cran.r-project.org/web/packages/quadprog") |
2d047896 RW |
1889 | (synopsis "Functions to solve quadratic programming problems") |
1890 | (description | |
1891 | "This package contains routines and documentation for solving quadratic | |
1892 | programming problems.") | |
1893 | (license license:gpl3+))) | |
1894 | ||
ec8c7e47 RJ |
1895 | (define-public r-pracma |
1896 | (package | |
1897 | (name "r-pracma") | |
63758425 | 1898 | (version "2.1.4") |
ec8c7e47 RJ |
1899 | (source (origin |
1900 | (method url-fetch) | |
1901 | (uri (cran-uri "pracma" version)) | |
1902 | (sha256 | |
63758425 | 1903 | (base32 "1ygm81i7mqvh229dp9935djjyb120p3bqvaf4k572sa4q63fzjhc")))) |
ec8c7e47 | 1904 | (build-system r-build-system) |
ccd9b151 RW |
1905 | (propagated-inputs |
1906 | `(("r-quadprog" ,r-quadprog))) | |
e9960d8c | 1907 | (home-page "https://cran.r-project.org/web/packages/pracma") |
ec8c7e47 RJ |
1908 | (synopsis "Practical numerical math functions") |
1909 | (description "This package provides functions for numerical analysis and | |
1910 | linear algebra, numerical optimization, differential equations, plus some | |
1911 | special functions. It uses Matlab function names where appropriate to simplify | |
1912 | porting.") | |
1913 | (license license:gpl3+))) | |
1914 | ||
183e44ae EB |
1915 | (define-public superlu |
1916 | (package | |
1917 | (name "superlu") | |
995a09e0 | 1918 | (version "5.2.1") |
183e44ae EB |
1919 | (source |
1920 | (origin | |
1921 | (method url-fetch) | |
1922 | (uri (string-append "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/" | |
1923 | "superlu_" version ".tar.gz")) | |
1924 | (sha256 | |
995a09e0 EB |
1925 | (base32 "0qzlb7cd608q62kyppd0a8c65l03vrwqql6gsm465rky23b6dyr8")) |
1926 | (modules '((guix build utils))) | |
1927 | (snippet | |
1928 | ;; Replace the non-free implementation of MC64 with a stub adapted | |
1929 | ;; from Debian | |
1930 | '(begin | |
1931 | (use-modules (ice-9 regex) | |
1932 | (ice-9 rdelim)) | |
1933 | (call-with-output-file "SRC/mc64ad.c" | |
1934 | (lambda (port) | |
1935 | (display " | |
1936 | #include <stdio.h> | |
1937 | #include <stdlib.h> | |
1938 | void mc64id_(int *a) { | |
1939 | fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\"); | |
1940 | abort (); | |
1941 | } | |
1942 | void mc64ad_ (int *a, int *b, int *c, int *d, int *e, double *f, int *g, | |
1943 | int *h, int *i, int *j, int *k, double *l, int *m, int *n) { | |
1944 | fprintf (stderr, \"SuperLU: non-free MC64 not available. Aborting.\\n\"); | |
1945 | abort (); | |
1946 | }\n" port))) | |
1947 | ;; Remove the corresponding license verbiage. MC64 license follows | |
1948 | ;; a "------" line separator. | |
1949 | (with-atomic-file-replacement "License.txt" | |
1950 | (let ((rx (make-regexp "-{8}"))) | |
1951 | (lambda (in out) | |
1952 | (let loop () | |
1953 | (let ((line (read-line in 'concat))) | |
1954 | (unless (regexp-exec rx line) | |
1955 | (display line out) | |
1956 | (loop))))))))))) | |
1957 | (build-system cmake-build-system) | |
183e44ae EB |
1958 | (native-inputs |
1959 | `(("tcsh" ,tcsh))) | |
1960 | (inputs | |
995a09e0 | 1961 | `(("blas" ,openblas) |
19afbea1 | 1962 | ("gfortran" ,gfortran))) |
183e44ae | 1963 | (arguments |
995a09e0 EB |
1964 | `(#:configure-flags '("-Denable_blaslib:BOOL=NO" ;do not use internal cblas |
1965 | "-DTPL_BLAS_LIBRARIES=openblas" | |
677bc34d | 1966 | "-DBUILD_SHARED_LIBS:BOOL=YES"))) |
183e44ae EB |
1967 | (home-page "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/") |
1968 | (synopsis "Supernodal direct solver for sparse linear systems") | |
1969 | (description | |
1970 | "SuperLU is a general purpose library for the direct solution of large, | |
1971 | sparse, nonsymmetric systems of linear equations on high performance machines. | |
1972 | The library is written in C and is callable from either C or Fortran. The | |
1973 | library routines perform an LU decomposition with partial pivoting and | |
1974 | triangular system solves through forward and back substitution. The library | |
1975 | also provides threshold-based ILU factorization preconditioners.") | |
995a09e0 EB |
1976 | (license (list license:bsd-3 |
1977 | license:gpl2+ ;EXAMPLE/*fgmr.c | |
1978 | (license:fsf-free "file://SRC/colamd.h"))))) | |
f8ed036a | 1979 | |
a54aefea EB |
1980 | (define-public superlu-dist |
1981 | (package | |
1982 | (name "superlu-dist") | |
1983 | (version "3.3") | |
1984 | (source | |
1985 | (origin | |
1986 | (method url-fetch) | |
1987 | (uri (string-append "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/" | |
1988 | "superlu_dist_" version ".tar.gz")) | |
1989 | (sha256 | |
1990 | (base32 "1hnak09yxxp026blq8zhrl7685yip16svwngh1wysqxf8z48vzfj")) | |
29080870 EB |
1991 | (modules '((guix build utils))) |
1992 | (snippet | |
1993 | ;; Replace the non-free implementation of MC64 with a stub | |
1994 | '(begin | |
1995 | (use-modules (ice-9 regex) | |
1996 | (ice-9 rdelim)) | |
1997 | (call-with-output-file "SRC/mc64ad.c" | |
1998 | (lambda (port) | |
1999 | (display " | |
2000 | #include <stdio.h> | |
2001 | #include <stdlib.h> | |
2002 | void mc64id_(int *a) { | |
2003 | fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\"); | |
2004 | abort (); | |
2005 | } | |
2006 | void mc64ad_ (int *a, int *b, int *c, int *d, int *e, double *f, int *g, | |
2007 | int *h, int *i, int *j, int *k, double *l, int *m, int *n) { | |
2008 | fprintf (stderr, \"SuperLU_DIST: non-free MC64 not available. Aborting.\\n\"); | |
2009 | abort (); | |
2010 | }\n" port))) | |
2011 | (delete-file "SRC/mc64ad.f.bak") | |
2012 | (substitute* "SRC/util.c" ;adjust default algorithm | |
2013 | (("RowPerm[[:blank:]]*=[[:blank:]]*LargeDiag") | |
2014 | "RowPerm = NOROWPERM")))) | |
fc1adab1 | 2015 | (patches (search-patches "superlu-dist-scotchmetis.patch")))) |
a54aefea EB |
2016 | (build-system gnu-build-system) |
2017 | (native-inputs | |
2018 | `(("tcsh" ,tcsh))) | |
2019 | (inputs | |
19afbea1 | 2020 | `(("gfortran" ,gfortran))) |
a54aefea EB |
2021 | (propagated-inputs |
2022 | `(("openmpi" ,openmpi) ;headers include MPI heades | |
2023 | ("lapack" ,lapack) ;required to link with output library | |
2024 | ("pt-scotch" ,pt-scotch))) ;same | |
2025 | (arguments | |
2026 | `(#:parallel-build? #f ;race conditions using ar | |
2027 | #:phases | |
dc1d3cde KK |
2028 | (modify-phases %standard-phases |
2029 | (replace 'configure | |
2030 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
2031 | (call-with-output-file "make.inc" | |
2032 | (lambda (port) | |
2033 | (format port " | |
a54aefea EB |
2034 | PLAT = |
2035 | DSuperLUroot = ~a | |
2036 | DSUPERLULIB = ~a/lib/libsuperlu_dist.a | |
2037 | BLASDEF = -DUSE_VENDOR_BLAS | |
2038 | BLASLIB = -L~a/lib -lblas | |
2039 | PARMETISLIB = -L~a/lib \ | |
2040 | -lptscotchparmetis -lptscotch -lptscotcherr -lptscotcherrexit \ | |
2041 | -lscotch -lscotcherr -lscotcherrexit | |
2042 | METISLIB = -L~:*~a/lib \ | |
2043 | -lscotchmetis -lscotch -lscotcherr -lscotcherrexit | |
2044 | LIBS = $(DSUPERLULIB) $(PARMETISLIB) $(METISLIB) $(BLASLIB) | |
2045 | ARCH = ar | |
2046 | ARCHFLAGS = cr | |
2047 | RANLIB = ranlib | |
2048 | CC = mpicc | |
2049 | PIC = -fPIC | |
2050 | CFLAGS = -O3 -g -DPRNTlevel=0 $(PIC) | |
2051 | NOOPTS = -O0 -g $(PIC) | |
2052 | FORTRAN = mpifort | |
2053 | FFLAGS = -O2 -g $(PIC) | |
2054 | LOADER = $(CC) | |
2055 | CDEFS = -DAdd_" | |
dc1d3cde KK |
2056 | (getcwd) |
2057 | (assoc-ref outputs "out") | |
2058 | (assoc-ref inputs "lapack") | |
2059 | (assoc-ref inputs "pt-scotch")))) | |
2060 | #t)) | |
2061 | (add-after 'unpack 'remove-broken-symlinks | |
2062 | (lambda _ | |
2063 | (for-each delete-file | |
2064 | (find-files "MAKE_INC" "\\.#make\\..*")) | |
2065 | #t)) | |
2066 | (add-before 'build 'create-install-directories | |
2067 | (lambda* (#:key outputs #:allow-other-keys) | |
2068 | (for-each | |
2069 | (lambda (dir) | |
2070 | (mkdir-p (string-append (assoc-ref outputs "out") | |
2071 | "/" dir))) | |
2072 | '("lib" "include")) | |
2073 | #t)) | |
2074 | (replace 'check | |
a54aefea EB |
2075 | (lambda _ |
2076 | (with-directory-excursion "EXAMPLE" | |
2077 | (and | |
2078 | (zero? (system* "mpirun" "-n" "2" | |
2079 | "./pddrive" "-r" "1" "-c" "2" "g20.rua")) | |
2080 | (zero? (system* "mpirun" "-n" "2" | |
dc1d3cde KK |
2081 | "./pzdrive" "-r" "1" "-c" "2" "cg20.cua")))))) |
2082 | (replace 'install | |
2083 | (lambda* (#:key outputs #:allow-other-keys) | |
2084 | ;; Library is placed in lib during the build phase. Copy over | |
2085 | ;; headers to include. | |
2086 | (let* ((out (assoc-ref outputs "out")) | |
2087 | (incdir (string-append out "/include"))) | |
2088 | (for-each (lambda (file) | |
2089 | (let ((base (basename file))) | |
2090 | (format #t "installing `~a' to `~a'~%" | |
2091 | base incdir) | |
2092 | (copy-file file | |
2093 | (string-append incdir "/" base)))) | |
2094 | (find-files "SRC" ".*\\.h$"))) | |
2095 | #t))))) | |
a54aefea EB |
2096 | (home-page (package-home-page superlu)) |
2097 | (synopsis "Parallel supernodal direct solver") | |
2098 | (description | |
2099 | "SuperLU_DIST is a parallel extension to the serial SuperLU library. | |
2100 | It is targeted for distributed memory parallel machines. SuperLU_DIST is | |
2101 | implemented in ANSI C, and MPI for communications.") | |
2102 | (license license:bsd-3))) | |
2103 | ||
f8ed036a EB |
2104 | (define-public scotch |
2105 | (package | |
2106 | (name "scotch") | |
6c798540 | 2107 | (version "6.0.4") |
f8ed036a EB |
2108 | (source |
2109 | (origin | |
2110 | (method url-fetch) | |
6c798540 | 2111 | (uri (string-append "https://gforge.inria.fr/frs/download.php/34618/" |
f8ed036a EB |
2112 | "scotch_" version ".tar.gz")) |
2113 | (sha256 | |
6c798540 | 2114 | (base32 "1ir088mvrqggyqdkx9qfynmiaffqbyih5qfl5mga2nrlm1qlsgzm")) |
fc1adab1 AK |
2115 | (patches (search-patches "scotch-test-threading.patch" |
2116 | "pt-scotch-build-parallelism.patch")))) | |
f8ed036a EB |
2117 | (build-system gnu-build-system) |
2118 | (inputs | |
2119 | `(("zlib" ,zlib) | |
5e54f4ad | 2120 | ("flex" ,flex) |
f8ed036a EB |
2121 | ("bison" ,bison))) |
2122 | (arguments | |
2123 | `(#:phases | |
d6602ee9 EB |
2124 | (modify-phases %standard-phases |
2125 | (add-after | |
2126 | 'unpack 'chdir-to-src | |
2127 | (lambda _ (chdir "src"))) | |
2128 | (replace | |
2129 | 'configure | |
2130 | (lambda _ | |
2131 | (call-with-output-file "Makefile.inc" | |
2132 | (lambda (port) | |
2133 | (format port " | |
f8ed036a EB |
2134 | EXE = |
2135 | LIB = .a | |
2136 | OBJ = .o | |
2137 | MAKE = make | |
2138 | AR = ar | |
2139 | ARFLAGS = -ruv | |
cf0ec6c4 | 2140 | CAT = cat |
f8ed036a EB |
2141 | CCS = gcc |
2142 | CCP = mpicc | |
2143 | CCD = gcc | |
2144 | CPPFLAGS =~{ -D~a~} | |
6c798540 | 2145 | CFLAGS = -O2 -g -fPIC $(CPPFLAGS) |
f8ed036a EB |
2146 | LDFLAGS = -lz -lm -lrt -lpthread |
2147 | CP = cp | |
2148 | LEX = flex -Pscotchyy -olex.yy.c | |
2149 | LN = ln | |
2150 | MKDIR = mkdir | |
2151 | MV = mv | |
2152 | RANLIB = ranlib | |
2153 | YACC = bison -pscotchyy -y -b y | |
2154 | " | |
d6602ee9 EB |
2155 | '("COMMON_FILE_COMPRESS_GZ" |
2156 | "COMMON_PTHREAD" | |
2157 | "COMMON_RANDOM_FIXED_SEED" | |
26599d69 | 2158 | "INTSIZE64" ;use 'long' instead of 'int' |
cf0ec6c4 EB |
2159 | ;; Prevents symbolc clashes with libesmumps |
2160 | "SCOTCH_RENAME" | |
d6602ee9 EB |
2161 | ;; XXX: Causes invalid frees in superlu-dist tests |
2162 | ;; "SCOTCH_PTHREAD" | |
2163 | ;; "SCOTCH_PTHREAD_NUMBER=2" | |
2164 | "restrict=__restrict")))))) | |
cf0ec6c4 EB |
2165 | (add-after |
2166 | 'build 'build-esmumps | |
2167 | (lambda _ | |
2168 | (zero? (system* "make" | |
2169 | (format #f "-j~a" (parallel-job-count)) | |
2170 | "esmumps")))) | |
d6602ee9 | 2171 | (replace |
f8ed036a EB |
2172 | 'install |
2173 | (lambda* (#:key outputs #:allow-other-keys) | |
2174 | (let ((out (assoc-ref outputs "out"))) | |
2175 | (mkdir out) | |
2176 | (zero? (system* "make" | |
2177 | (string-append "prefix=" out) | |
cf0ec6c4 EB |
2178 | "install")) |
2179 | ;; esmumps files are not installed with the above | |
2180 | (for-each (lambda (f) | |
2181 | (copy-file f (string-append out "/include/" f))) | |
2182 | (find-files "../include" ".*esmumps.h$")) | |
2183 | (for-each (lambda (f) | |
2184 | (copy-file f (string-append out "/lib/" f))) | |
2185 | (find-files "../lib" "^lib.*esmumps.*")))))))) | |
f8ed036a EB |
2186 | (home-page "http://www.labri.fr/perso/pelegrin/scotch/") |
2187 | (synopsis "Programs and libraries for graph algorithms") | |
2188 | (description "SCOTCH is a set of programs and libraries which implement | |
2189 | the static mapping and sparse matrix reordering algorithms developed within | |
2190 | the SCOTCH project. Its purpose is to apply graph theory, with a divide and | |
2191 | conquer approach, to scientific computing problems such as graph and mesh | |
2192 | partitioning, static mapping, and sparse matrix ordering, in application | |
2193 | domains ranging from structural mechanics to operating systems or | |
2194 | bio-chemistry.") | |
2195 | ;; See LICENSE_en.txt | |
2196 | (license license:cecill-c))) | |
6acb4adb | 2197 | |
1c39f3b8 PG |
2198 | (define-public scotch32 |
2199 | ;; This is the 'INTSIZE32' variant, which uses 32-bit integers, as needed by | |
2200 | ;; some applications. | |
2201 | (package (inherit scotch) | |
2202 | (name "scotch32") | |
2203 | (arguments | |
2204 | (substitute-keyword-arguments (package-arguments scotch) | |
2205 | ((#:phases scotch-phases) | |
2206 | `(modify-phases ,scotch-phases | |
2207 | (replace | |
2208 | 'configure | |
2209 | (lambda _ | |
2210 | (call-with-output-file "Makefile.inc" | |
2211 | (lambda (port) | |
2212 | (format port " | |
2213 | EXE = | |
2214 | LIB = .a | |
2215 | OBJ = .o | |
2216 | MAKE = make | |
2217 | AR = ar | |
2218 | ARFLAGS = -ruv | |
2219 | CAT = cat | |
2220 | CCS = gcc | |
2221 | CCP = mpicc | |
2222 | CCD = gcc | |
2223 | CPPFLAGS =~{ -D~a~} | |
2224 | CFLAGS = -O2 -g -fPIC $(CPPFLAGS) | |
2225 | LDFLAGS = -lz -lm -lrt -lpthread | |
2226 | CP = cp | |
2227 | LEX = flex -Pscotchyy -olex.yy.c | |
2228 | LN = ln | |
2229 | MKDIR = mkdir | |
2230 | MV = mv | |
2231 | RANLIB = ranlib | |
2232 | YACC = bison -pscotchyy -y -b y | |
2233 | " | |
2234 | '("COMMON_FILE_COMPRESS_GZ" | |
2235 | "COMMON_PTHREAD" | |
2236 | "COMMON_RANDOM_FIXED_SEED" | |
2237 | "INTSIZE32" ;use 32-bit integers. See INSTALL.txt | |
2238 | ;; Prevents symbolc clashes with libesmumps | |
2239 | "SCOTCH_RENAME" | |
2240 | ;; XXX: Causes invalid frees in superlu-dist tests | |
2241 | ;; "SCOTCH_PTHREAD" | |
2242 | ;; "SCOTCH_PTHREAD_NUMBER=2" | |
2243 | "restrict=__restrict")))))))))) | |
2244 | (synopsis | |
2245 | "Programs and libraries for graph algorithms (32-bit integers)"))) | |
2246 | ||
6acb4adb EB |
2247 | (define-public pt-scotch |
2248 | (package (inherit scotch) | |
2249 | (name "pt-scotch") | |
2250 | (propagated-inputs | |
2251 | `(("openmpi" ,openmpi))) ;Headers include MPI headers | |
2252 | (arguments | |
2253 | (substitute-keyword-arguments (package-arguments scotch) | |
2254 | ((#:phases scotch-phases) | |
d6602ee9 EB |
2255 | `(modify-phases ,scotch-phases |
2256 | (replace | |
2257 | 'build | |
d6602ee9 EB |
2258 | (lambda _ |
2259 | (and | |
cf0ec6c4 EB |
2260 | (zero? (system* "make" |
2261 | (format #f "-j~a" (parallel-job-count)) | |
2262 | "ptscotch" "ptesmumps")) | |
d6602ee9 EB |
2263 | ;; Install the serial metis compatibility library |
2264 | (zero? (system* "make" "-C" "libscotchmetis" "install"))))) | |
2265 | (replace | |
2266 | 'check | |
2267 | (lambda _ (zero? (system* "make" "ptcheck")))))))) | |
6acb4adb | 2268 | (synopsis "Programs and libraries for graph algorithms (with MPI)"))) |
5698b8b8 | 2269 | |
1c25a52c PG |
2270 | (define-public pt-scotch32 |
2271 | (package (inherit scotch32) | |
2272 | (name "pt-scotch32") | |
2273 | (propagated-inputs | |
2274 | `(("openmpi" ,openmpi))) ;headers include MPI headers | |
2275 | (arguments | |
c4d4a779 PG |
2276 | (substitute-keyword-arguments (package-arguments scotch32) |
2277 | ((#:phases scotch32-phases) | |
2278 | `(modify-phases ,scotch32-phases | |
1c25a52c PG |
2279 | (replace 'build |
2280 | (lambda _ | |
2281 | (and | |
2282 | (zero? (system* "make" | |
2283 | (format #f "-j~a" (parallel-job-count)) | |
2284 | "ptscotch" "ptesmumps")) | |
2285 | ;; Install the serial metis compatibility library | |
2286 | (zero? (system* "make" "-C" "libscotchmetis" "install"))))) | |
2287 | (replace 'check | |
2288 | (lambda _ | |
2289 | (zero? (system* "make" "ptcheck")))))))) | |
2290 | (synopsis | |
2291 | "Programs and libraries for graph algorithms (with MPI and 32-bit integers)"))) | |
2292 | ||
aa75ad00 EB |
2293 | (define-public metis |
2294 | (package | |
2295 | (name "metis") | |
2296 | (version "5.1.0") | |
2297 | (source | |
2298 | (origin | |
2299 | (method url-fetch) | |
2300 | (uri (string-append "http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/" | |
2301 | "metis-" version ".tar.gz")) | |
2302 | (sha256 | |
2303 | (base32 | |
2304 | "1cjxgh41r8k6j029yxs8msp3z6lcnpm16g5pvckk35kc7zhfpykn")))) | |
2305 | (build-system cmake-build-system) | |
2306 | (inputs | |
2307 | `(("blas" ,openblas))) | |
2308 | (arguments | |
2309 | `(#:tests? #f ;no tests | |
2310 | #:configure-flags `("-DSHARED=ON" | |
2311 | ,(string-append "-DGKLIB_PATH=" (getcwd) | |
2312 | "/metis-" ,version "/GKlib")))) | |
2313 | (home-page "http://glaros.dtc.umn.edu/gkhome/metis/metis/overview") | |
2314 | (synopsis "Graph partitioning and fill-reducing matrix ordering library") | |
2315 | (description | |
2316 | "METIS is a set of serial programs for partitioning graphs, partitioning | |
2317 | finite element meshes, and producing fill-reducing orderings for sparse | |
2318 | matrices. The algorithms implemented in METIS are based on the multilevel | |
2319 | recursive-bisection, multilevel k-way, and multi-constraint partitioning | |
2320 | schemes.") | |
2321 | (license license:asl2.0))) ;As of version 5.0.3 | |
2322 | ||
700ff222 EB |
2323 | (define-public p4est |
2324 | (package | |
2325 | (name "p4est") | |
4150da63 | 2326 | (version "2.0") |
700ff222 EB |
2327 | (source |
2328 | (origin | |
2329 | (method url-fetch) | |
2330 | (uri (string-append "http://p4est.github.io/release/p4est-" | |
2331 | version ".tar.gz")) | |
2332 | (sha256 | |
2333 | (base32 | |
4150da63 | 2334 | "16h267z256kxcxfjs390qqzv19hr58vrj4x8lndb7alnk2vca8n5")))) |
700ff222 EB |
2335 | (build-system gnu-build-system) |
2336 | (inputs | |
2337 | `(("fortran" ,gfortran) | |
2338 | ("blas" ,openblas) | |
2339 | ("lapack" ,lapack) | |
2340 | ("zlib" ,zlib))) | |
2341 | (arguments | |
2342 | `(#:configure-flags `(,(string-append "BLAS_LIBS=-L" | |
2343 | (assoc-ref %build-inputs "blas") | |
2344 | " -lopenblas") | |
2345 | ,(string-append "LAPACK_LIBS=-L" | |
2346 | (assoc-ref %build-inputs "lapack") | |
2347 | " -llapack")))) | |
2348 | (home-page "http://www.p4est.org") | |
2349 | (synopsis "Adaptive mesh refinement on forests of octrees") | |
2350 | (description | |
2351 | "The p4est software library enables the dynamic management of a | |
2352 | collection of adaptive octrees, conveniently called a forest of octrees. | |
2353 | p4est is designed to work in parallel and scales to hundreds of thousands of | |
2354 | processor cores.") | |
2355 | (license license:gpl2+))) | |
2356 | ||
2357 | (define-public p4est-openmpi | |
2358 | (package (inherit p4est) | |
2359 | (name "p4est-openmpi") | |
2360 | (inputs | |
2361 | `(("mpi" ,openmpi) | |
2362 | ,@(package-inputs p4est))) | |
2363 | (arguments | |
2364 | (substitute-keyword-arguments (package-arguments p4est) | |
2365 | ((#:configure-flags cf) | |
2366 | ``("--enable-mpi" ,@,cf)))) | |
2367 | (synopsis "Parallel adaptive mesh refinement on forests of octrees"))) | |
2368 | ||
5698b8b8 JD |
2369 | (define-public gsegrafix |
2370 | (package | |
2371 | (name "gsegrafix") | |
2372 | (version "1.0.6") | |
2373 | (source | |
2374 | (origin | |
2375 | (method url-fetch) | |
2376 | (uri (string-append "mirror://gnu/" name "/" name "-" | |
2377 | version ".tar.gz")) | |
2378 | (sha256 | |
2379 | (base32 | |
2380 | "1b13hvx063zv970y750bx41wpx6hwd5ngjhbdrna8w8yy5kmxcda")))) | |
2381 | (build-system gnu-build-system) | |
2382 | (arguments | |
2383 | `(#:configure-flags '("LDFLAGS=-lm"))) | |
2384 | (inputs | |
2385 | `(("libgnomecanvas" ,libgnomecanvas) | |
2386 | ("libbonoboui" ,libbonoboui) | |
2387 | ("libgnomeui" ,libgnomeui) | |
2388 | ("libgnomeprintui" ,libgnomeprintui) | |
2389 | ("popt" ,popt))) | |
2390 | (native-inputs | |
2391 | `(("pkg-config" ,pkg-config))) | |
6fd52309 | 2392 | (home-page "https://www.gnu.org/software/gsegrafix/") |
5698b8b8 JD |
2393 | (synopsis "GNOME application to create scientific and engineering plots") |
2394 | (description "GSEGrafix is an application which produces high-quality graphical | |
2395 | plots for science and engineering. Plots are specified via simple ASCII | |
2396 | parameter files and data files and are presented in an anti-aliased GNOME | |
2397 | canvas. The program supports rectangular two-dimensional plots, histograms, | |
2398 | polar-axis plots and three-dimensional plots. Plots can be printed or saved | |
2399 | to BMP, JPEG or PNG image formats.") | |
2400 | (license license:gpl3+))) | |
8731e527 JD |
2401 | |
2402 | (define-public maxima | |
2403 | (package | |
2404 | (name "maxima") | |
b3b2efc8 | 2405 | (version "5.41.0") |
8731e527 JD |
2406 | (source |
2407 | (origin | |
2408 | (method url-fetch) | |
2409 | (uri (string-append "mirror://sourceforge/maxima/Maxima-source/" | |
2410 | version "-source/" name "-" version ".tar.gz")) | |
2411 | (sha256 | |
2412 | (base32 | |
b3b2efc8 | 2413 | "0x0n81z0s4pl8nwpf7ivlsbvsdphm9w42250g7qdkizl0132by6s")) |
fc1adab1 | 2414 | (patches (search-patches "maxima-defsystem-mkdir.patch")))) |
8731e527 | 2415 | (build-system gnu-build-system) |
df354a77 | 2416 | (inputs |
6b2eafaa | 2417 | `(("gcl" ,gcl) |
df354a77 | 2418 | ("gnuplot" ,gnuplot) ;for plots |
f36afe4d | 2419 | ("tk" ,tk))) ;Tcl/Tk is used by 'xmaxima' |
df354a77 FB |
2420 | (native-inputs |
2421 | `(("texinfo" ,texinfo) | |
ccbc5758 KK |
2422 | ("perl" ,perl) |
2423 | ("python" ,python))) | |
8731e527 | 2424 | (arguments |
df354a77 FB |
2425 | `(#:configure-flags |
2426 | (list "--enable-gcl" | |
2427 | (string-append "--with-posix-shell=" | |
2428 | (assoc-ref %build-inputs "bash") | |
2429 | "/bin/sh") | |
2430 | (string-append "--with-wish=" | |
2431 | (assoc-ref %build-inputs "tk") | |
2432 | "/bin/wish" | |
2433 | (let ((v ,(package-version tk))) | |
2434 | (string-take v (string-index-right v #\.))))) | |
df354a77 | 2435 | ;; By default Maxima attempts to write temporary files to |
77af7b24 MW |
2436 | ;; '/tmp/nix-build-maxima-*', which won't exist at run time. |
2437 | ;; Work around that. | |
df354a77 | 2438 | #:make-flags (list "TMPDIR=/tmp") |
0093b126 KK |
2439 | #:phases |
2440 | (modify-phases %standard-phases | |
2441 | (add-before 'check 'pre-check | |
2442 | (lambda _ | |
2443 | (chmod "src/maxima" #o555) | |
2444 | #t)) | |
2445 | ;; Make sure the doc and emacs files are found in the | |
2446 | ;; standard location. Also configure maxima to find gnuplot | |
2447 | ;; without having it on the PATH. | |
2448 | (add-after 'install 'post-install | |
2449 | (lambda* (#:key outputs inputs #:allow-other-keys) | |
2450 | (let* ((gnuplot (assoc-ref inputs "gnuplot")) | |
2451 | (out (assoc-ref outputs "out")) | |
2452 | (datadir (string-append out "/share/maxima/" ,version)) | |
2453 | (binutils (string-append (assoc-ref inputs "binutils") | |
2454 | "/bin"))) | |
2455 | (with-directory-excursion out | |
2456 | (mkdir-p "share/emacs") | |
2457 | (mkdir-p "share/doc") | |
2458 | (symlink | |
2459 | (string-append datadir "/emacs/") | |
2460 | (string-append out "/share/emacs/site-lisp")) | |
2461 | (symlink | |
2462 | (string-append datadir "/doc/") | |
2463 | (string-append out "/share/doc/maxima")) | |
2464 | (with-atomic-file-replacement | |
2465 | (string-append datadir "/share/maxima-init.lisp") | |
2466 | (lambda (in out) | |
2467 | (format out "~a ~s~a~%" | |
2468 | "(setf $gnuplot_command " | |
2469 | (string-append gnuplot "/bin/gnuplot") ")") | |
2470 | (dump-port in out)))) | |
2471 | ;; Ensure that Maxima will have access to the GNU binutils | |
2472 | ;; components at runtime. | |
2473 | (wrap-program (string-append out "/bin/maxima") | |
2474 | `("PATH" prefix (,binutils)))) | |
2475 | #t))))) | |
8731e527 JD |
2476 | (home-page "http://maxima.sourceforge.net") |
2477 | (synopsis "Numeric and symbolic expression manipulation") | |
2478 | (description "Maxima is a system for the manipulation of symbolic and | |
2479 | numerical expressions. It yields high precision numeric results by using | |
2480 | exact fractions, arbitrary precision integers, and variable precision floating | |
e881752c | 2481 | point numbers.") |
8731e527 JD |
2482 | ;; Some files are lgpl2.1+. Some are gpl2+. Some explicitly state gpl1+. |
2483 | ;; Others simply say "GNU General Public License" without stating a | |
2484 | ;; version (which implicitly means gpl1+). | |
2485 | ;; At least one file (src/maxima.asd) says "version 2." | |
2486 | ;; GPLv2 only is therefore the smallest subset. | |
f36afe4d | 2487 | (license license:gpl2))) |
ec322be2 | 2488 | |
9aafbc0c MW |
2489 | (define-public wxmaxima |
2490 | (package | |
2491 | (name "wxmaxima") | |
a8db968f | 2492 | (version "17.10.1") |
9aafbc0c MW |
2493 | (source |
2494 | (origin | |
2495 | (method url-fetch) | |
5143517c KK |
2496 | (uri (string-append "https://github.com/andrejv/" name "/archive" |
2497 | "/Version-" version ".tar.gz")) | |
2498 | (file-name (string-append name "-" version ".tar.gz")) | |
9aafbc0c MW |
2499 | (sha256 |
2500 | (base32 | |
a8db968f | 2501 | "0qlzc31cqkwpfgrb9cif9bcnkj3rq487plg4rns7jxv6pq4609v1")))) |
9aafbc0c | 2502 | (build-system gnu-build-system) |
5143517c KK |
2503 | (native-inputs |
2504 | `(("autoconf" ,autoconf) | |
2505 | ("automake" ,automake) | |
2506 | ("gettext" ,gettext-minimal))) | |
9aafbc0c MW |
2507 | (inputs |
2508 | `(("wxwidgets" ,wxwidgets) | |
de477809 SB |
2509 | ("maxima" ,maxima) |
2510 | ;; Runtime support. | |
2511 | ("adwaita-icon-theme" ,adwaita-icon-theme) | |
2512 | ("gtk+" ,gtk+) | |
2513 | ("shared-mime-info" ,shared-mime-info))) | |
9aafbc0c | 2514 | (arguments |
ac2ddcc6 KK |
2515 | `(#:phases |
2516 | (modify-phases %standard-phases | |
2517 | (add-after 'unpack 'autoconf | |
2518 | (lambda _ | |
2519 | (zero? (system* "sh" "bootstrap")))) | |
2520 | (add-after 'install 'wrap-program | |
2521 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
2522 | (wrap-program (string-append (assoc-ref outputs "out") | |
2523 | "/bin/wxmaxima") | |
2524 | `("PATH" ":" prefix | |
2525 | (,(string-append (assoc-ref inputs "maxima") | |
2526 | "/bin"))) | |
2527 | ;; For GtkFileChooserDialog. | |
2528 | `("GSETTINGS_SCHEMA_DIR" = | |
2529 | (,(string-append (assoc-ref inputs "gtk+") | |
2530 | "/share/glib-2.0/schemas"))) | |
2531 | `("XDG_DATA_DIRS" ":" prefix | |
2532 | (;; Needed by gdk-pixbuf to know supported icon formats. | |
2533 | ,(string-append | |
2534 | (assoc-ref inputs "shared-mime-info") "/share") | |
2535 | ;; The default icon theme of GTK+. | |
2536 | ,(string-append | |
2537 | (assoc-ref inputs "adwaita-icon-theme") "/share")))) | |
2538 | #t))))) | |
9aafbc0c MW |
2539 | (home-page "https://andrejv.github.io/wxmaxima/") |
2540 | (synopsis "Graphical user interface for the Maxima computer algebra system") | |
2541 | (description | |
2542 | "wxMaxima is a graphical user interface for the Maxima computer algebra | |
2543 | system. It eases the use of Maxima by making most of its commands available | |
2544 | through a menu system and by providing input dialogs for commands that require | |
2545 | more than one argument. It also implements its own display engine that | |
2546 | outputs mathematical symbols directly instead of depicting them with ASCII | |
2547 | characters. | |
2548 | ||
2549 | wxMaxima also features 2D and 3D inline plots, simple animations, mixing of | |
2550 | text and mathematical calculations to create documents, exporting of input and | |
2551 | output to TeX, and a browser for Maxima's manual including command index and | |
2552 | full text searching.") | |
2553 | (license license:gpl2+))) | |
2554 | ||
b15e47f9 RW |
2555 | (define-public armadillo |
2556 | (package | |
2557 | (name "armadillo") | |
133cba8c | 2558 | (version "7.800.2") |
b15e47f9 RW |
2559 | (source (origin |
2560 | (method url-fetch) | |
2561 | (uri (string-append "mirror://sourceforge/arma/armadillo-" | |
7397cd9e | 2562 | version ".tar.xz")) |
b15e47f9 RW |
2563 | (sha256 |
2564 | (base32 | |
133cba8c | 2565 | "1qqzy7dp891j9v7062mv1599hdwr97vqzrd3j2fl8c3gmc00dmzg")))) |
b15e47f9 RW |
2566 | (build-system cmake-build-system) |
2567 | (arguments `(#:tests? #f)) ;no test target | |
2568 | (inputs | |
2569 | `(("openblas" ,openblas) | |
2570 | ("lapack" ,lapack) | |
2571 | ("arpack" ,arpack-ng))) | |
2572 | (home-page "http://arma.sourceforge.net/") | |
2573 | (synopsis "C++ linear algebra library") | |
2574 | (description | |
2575 | "Armadillo is a C++ linear algebra library, aiming towards a good balance | |
2576 | between speed and ease of use. It is useful for algorithm development | |
2577 | directly in C++, or quick conversion of research code into production | |
2578 | environments. It can be used for machine learning, pattern recognition, | |
2579 | signal processing, bioinformatics, statistics, econometrics, etc. The library | |
2580 | provides efficient classes for vectors, matrices and cubes, as well as 150+ | |
2581 | associated functions (eg. contiguous and non-contiguous submatrix views).") | |
fe418cc5 | 2582 | (license license:asl2.0))) |
b15e47f9 | 2583 | |
279663ef | 2584 | (define-public muparser |
d7cff656 LF |
2585 | ;; When switching download sites, muparser re-issued a 2.2.5 release with a |
2586 | ;; different hash. In order to make `guix package --upgrade` work correctly, | |
2587 | ;; we set a Guix packaging revision. | |
2588 | ;; When the next version of muparser is released, we can remove | |
2589 | ;; UPSTREAM-VERSION and REVISION and use the plain VERSION. | |
2590 | (let ((upstream-version "2.2.5") | |
2591 | (revision "2")) | |
2592 | (package | |
2593 | (name "muparser") | |
2594 | (version (string-append upstream-version "-" revision)) | |
2595 | (source | |
2596 | (origin | |
2597 | (method url-fetch) | |
2598 | (uri (string-append "https://github.com/beltoforion/muparser/archive/v" | |
2599 | upstream-version ".tar.gz")) | |
2600 | (file-name (string-append name "-" version ".tar.gz")) | |
2601 | (sha256 | |
2602 | (base32 | |
2603 | "0277qsi5l23jsck1vhn383bmvc2n9l4a1dl5r9bf7hvjv9ayyrh6")))) | |
2604 | (build-system gnu-build-system) | |
2605 | (arguments | |
2606 | `(#:configure-flags '("--enable-samples=no") | |
2607 | #:tests? #f)) ;no "check" target | |
2608 | (home-page "http://muparser.beltoforion.de/") | |
2609 | (synopsis "Fast parser library for mathematical expressions") | |
2610 | (description | |
2611 | "muParser is an extensible high performance math parser library. It is | |
2612 | based on transforming an expression into a bytecode and precalculating constant | |
2613 | parts of it.") | |
2614 | (license license:expat)))) | |
279663ef | 2615 | |
e73b49fb RW |
2616 | (define-public openblas |
2617 | (package | |
2618 | (name "openblas") | |
1b8de87c | 2619 | (version "0.2.20") |
e73b49fb RW |
2620 | (source |
2621 | (origin | |
2622 | (method url-fetch) | |
2623 | (uri (string-append "https://github.com/xianyi/OpenBLAS/tarball/v" | |
2624 | version)) | |
2625 | (file-name (string-append name "-" version ".tar.gz")) | |
2626 | (sha256 | |
2627 | (base32 | |
1b8de87c | 2628 | "1bd03c5xni0bla0wg1wba841b36b0sg13sjja955kn5xzvy4i61a")))) |
e73b49fb RW |
2629 | (build-system gnu-build-system) |
2630 | (arguments | |
5789566a | 2631 | `(#:test-target "test" |
bd0b4379 RW |
2632 | ;; DYNAMIC_ARCH is only supported on x86. When it is disabled and no |
2633 | ;; TARGET is specified, OpenBLAS will tune itself to the build host, so | |
2634 | ;; we need to disable substitutions. | |
71923a91 AE |
2635 | #:substitutable? |
2636 | ,(let ((system (or (%current-target-system) (%current-system)))) | |
2637 | (or (string-prefix? "x86_64" system) | |
bd0b4379 | 2638 | (string-prefix? "i686" system) |
83a34647 EF |
2639 | (string-prefix? "mips" system) |
2640 | (string-prefix? "aarch64" system))) | |
e73b49fb RW |
2641 | #:make-flags |
2642 | (list (string-append "PREFIX=" (assoc-ref %outputs "out")) | |
2643 | "SHELL=bash" | |
af5b817e RW |
2644 | ;; Build the library for all supported CPUs. This allows |
2645 | ;; switching CPU targets at runtime with the environment variable | |
2646 | ;; OPENBLAS_CORETYPE=<type>, where "type" is a supported CPU type. | |
71923a91 AE |
2647 | ;; Unfortunately, this is not supported on non-x86 architectures, |
2648 | ;; where it leads to failed builds. | |
2649 | ,@(let ((system (or (%current-target-system) (%current-system)))) | |
8a637e79 RW |
2650 | (cond |
2651 | ((or (string-prefix? "x86_64" system) | |
71923a91 | 2652 | (string-prefix? "i686" system)) |
8a637e79 RW |
2653 | '("DYNAMIC_ARCH=1")) |
2654 | ;; On MIPS we force the "SICORTEX" TARGET, as for the other | |
2655 | ;; two available MIPS targets special extended instructions | |
2656 | ;; for Loongson cores are used. | |
2657 | ((string-prefix? "mips" system) | |
2658 | '("TARGET=SICORTEX")) | |
83a34647 EF |
2659 | ;; On aarch64 force the generic 'armv8-a' target |
2660 | ((string-prefix? "aarch64" system) | |
2661 | '("TARGET=ARMV8")) | |
8a637e79 | 2662 | (else '())))) |
e73b49fb | 2663 | ;; no configure script |
493937ae DL |
2664 | #:phases |
2665 | (modify-phases %standard-phases | |
2666 | (delete 'configure) | |
2667 | (add-before 'build 'set-extralib | |
2668 | (lambda* (#:key inputs #:allow-other-keys) | |
2669 | ;; Get libgfortran found when building in utest. | |
2670 | (setenv "FEXTRALIB" | |
2671 | (string-append "-L" (assoc-ref inputs "fortran-lib") | |
2672 | "/lib")) | |
2673 | #t))))) | |
e73b49fb | 2674 | (inputs |
493937ae | 2675 | `(("fortran-lib" ,gfortran "lib"))) |
e73b49fb RW |
2676 | (native-inputs |
2677 | `(("cunit" ,cunit) | |
493937ae | 2678 | ("fortran" ,gfortran) |
e73b49fb RW |
2679 | ("perl" ,perl))) |
2680 | (home-page "http://www.openblas.net/") | |
2681 | (synopsis "Optimized BLAS library based on GotoBLAS") | |
2682 | (description | |
2683 | "OpenBLAS is a BLAS library forked from the GotoBLAS2-1.13 BSD version.") | |
2684 | (license license:bsd-3))) | |
2685 | ||
5a7deb11 LC |
2686 | (define* (make-blis implementation #:optional substitutable?) |
2687 | "Return a BLIS package with the given IMPLEMENTATION (see config/ in the | |
2688 | source tree for a list of implementations.) | |
2689 | ||
2690 | SUBSTITUTABLE? determines whether the package is made available as a | |
2691 | substitute. | |
2692 | ||
2693 | Currently the specialization must be selected at configure-time, but work is | |
2694 | underway to allow BLIS to select the right optimized kernels at run time: | |
2695 | <https://github.com/flame/blis/issues/129>." | |
2696 | (package | |
2697 | (name (if (string=? implementation "reference") | |
2698 | "blis" | |
2699 | (string-append "blis-" implementation))) | |
2700 | (version "0.2.2") | |
2701 | (home-page "https://github.com/flame/blis") | |
2702 | (source (origin | |
2703 | (method git-fetch) | |
2704 | (uri (git-reference (url home-page) (commit version))) | |
2705 | (sha256 | |
2706 | (base32 | |
2707 | "1wr79a50nm4abhw8w3sn96nmwp5mrzifcigk7khw9qcgyyyqayfh")) | |
2708 | (file-name (git-file-name "blis" version)))) | |
2709 | (build-system gnu-build-system) | |
2710 | (arguments | |
2711 | `(#:test-target "test" | |
2712 | ||
2713 | #:substitutable? ,substitutable? | |
2714 | ||
2715 | #:phases (modify-phases %standard-phases | |
2716 | (replace 'configure | |
2717 | (lambda* (#:key outputs #:allow-other-keys) | |
2718 | ;; This is a home-made 'configure' script. | |
2719 | (let ((out (assoc-ref outputs "out"))) | |
2720 | (zero? (system* "./configure" "-p" out | |
2721 | "-d" "opt" | |
2722 | "--disable-static" | |
2723 | "--enable-shared" | |
2724 | "--enable-threading=openmp" | |
2725 | ||
2726 | ,implementation))))) | |
2727 | (add-before 'check 'show-test-output | |
2728 | (lambda _ | |
2729 | ;; By default "make check" is silent. Make it verbose. | |
2730 | (system "tail -F output.testsuite &") | |
2731 | #t))))) | |
2732 | (synopsis "High-performance basic linear algebra (BLAS) routines") | |
2733 | (description | |
2734 | "BLIS is a portable software framework for instantiating high-performance | |
2735 | BLAS-like dense linear algebra libraries. The framework was designed to | |
2736 | isolate essential kernels of computation that, when optimized, immediately | |
2737 | enable optimized implementations of most of its commonly used and | |
2738 | computationally intensive operations. While BLIS exports a new BLAS-like API, | |
2739 | it also includes a BLAS compatibility layer which gives application developers | |
2740 | access to BLIS implementations via traditional BLAS routine calls.") | |
2741 | (license license:bsd-3))) | |
2742 | ||
2743 | (define-public blis | |
2744 | ;; This is the "reference" implementation, which is the non-optimized but | |
2745 | ;; portable variant (no assembly). | |
2746 | (make-blis "reference" #t)) | |
2747 | ||
2748 | (define ignorance blis) | |
2749 | ||
2750 | (define-syntax-rule (blis/x86_64 processor) | |
2751 | "Expand to a package specialized for PROCESSOR." | |
2752 | (package | |
2753 | (inherit (make-blis processor)) | |
2754 | (supported-systems '("x86_64-linux")))) | |
2755 | ||
2756 | (define-public blis-sandybridge | |
2757 | ;; BLIS specialized for Sandy Bridge processors (launched 2011): | |
2758 | ;; <http://ark.intel.com/products/codename/29900/Sandy-Bridge>. | |
2759 | (blis/x86_64 "sandybridge")) | |
2760 | ||
2761 | (define-public blis-haswell | |
2762 | ;; BLIS specialized for Haswell processors (launched 2013): | |
2763 | ;; <http://ark.intel.com/products/codename/42174/Haswell>. | |
2764 | (blis/x86_64 "haswell")) | |
2765 | ||
2766 | (define-public blis-knl | |
2767 | ;; BLIS specialized for Knights Landing processor (launched 2016): | |
2768 | ;; <http://ark.intel.com/products/series/92650/Intel-Xeon-Phi-x200-Product-Family>. | |
2769 | (blis/x86_64 "knl")) | |
2770 | ||
2771 | ||
e1605e36 RW |
2772 | (define-public openlibm |
2773 | (package | |
2774 | (name "openlibm") | |
26f6e565 | 2775 | (version "0.5.1") |
e1605e36 RW |
2776 | (source |
2777 | (origin | |
2778 | (method url-fetch) | |
2779 | (uri (string-append "https://github.com/JuliaLang/openlibm/archive/v" | |
2780 | version ".tar.gz")) | |
2781 | (file-name (string-append name "-" version ".tar.gz")) | |
2782 | (sha256 | |
2783 | (base32 | |
26f6e565 | 2784 | "11czx2z7nh6dfpz45s3xl7v38hw36jxzxfvny454bk3if14pfakq")))) |
e1605e36 RW |
2785 | (build-system gnu-build-system) |
2786 | (arguments | |
2787 | `(#:make-flags | |
2788 | (list (string-append "prefix=" (assoc-ref %outputs "out"))) | |
2789 | #:phases | |
2790 | ;; no configure script | |
dc1d3cde | 2791 | (modify-phases %standard-phases (delete 'configure)) |
e1605e36 RW |
2792 | #:tests? #f)) ;the tests are part of the default target |
2793 | (home-page "http://openlibm.org/") | |
2794 | (synopsis "Portable C mathematical library (libm)") | |
2795 | (description | |
2796 | "OpenLibm is an effort to have a high quality, portable, standalone C | |
2797 | mathematical library (libm). It can be used standalone in applications and | |
2798 | programming language implementations. The project was born out of a need to | |
e881752c | 2799 | have a good libm for the Julia programming language that worked consistently |
e1605e36 RW |
2800 | across compilers and operating systems, and in 32-bit and 64-bit |
2801 | environments.") | |
538c0e3b EF |
2802 | ;; Each architecture has its own make target, and there is none for mips. |
2803 | (supported-systems (delete "mips64el-linux" %supported-systems)) | |
e1605e36 RW |
2804 | ;; See LICENSE.md for details. |
2805 | (license (list license:expat | |
2806 | license:isc | |
2807 | license:bsd-2 | |
2808 | license:public-domain | |
2809 | license:lgpl2.1+)))) | |
2810 | ||
e62be58f RW |
2811 | (define-public openspecfun |
2812 | (package | |
2813 | (name "openspecfun") | |
59cd0ba4 | 2814 | (version "0.5.3") |
e62be58f RW |
2815 | (source |
2816 | (origin | |
2817 | (method url-fetch) | |
2818 | (uri (string-append "https://github.com/JuliaLang/openspecfun/archive/v" | |
2819 | version ".tar.gz")) | |
2820 | (file-name (string-append name "-" version ".tar.gz")) | |
2821 | (sha256 | |
2822 | (base32 | |
59cd0ba4 | 2823 | "1rs1bv8jq751fv9vq79890wqf9xlbjc7lvz3ighzyfczbyjcf18m")))) |
e62be58f RW |
2824 | (build-system gnu-build-system) |
2825 | (arguments | |
59cd0ba4 | 2826 | '(#:tests? #f ; no "check" target |
e62be58f RW |
2827 | #:make-flags |
2828 | (list (string-append "prefix=" (assoc-ref %outputs "out"))) | |
59cd0ba4 TGR |
2829 | #:phases |
2830 | (modify-phases %standard-phases | |
2831 | (delete 'configure)))) ; no configure script | |
e62be58f | 2832 | (inputs |
19afbea1 | 2833 | `(("fortran" ,gfortran))) |
e62be58f RW |
2834 | (home-page "https://github.com/JuliaLang/openspecfun") |
2835 | (synopsis "Collection of special mathematical functions") | |
2836 | (description | |
2837 | "Openspecfun provides AMOS and Faddeeva. AMOS (from Netlib) is a | |
2838 | portable package for Bessel Functions of a Complex Argument and Nonnegative | |
2839 | Order; it contains subroutines for computing Bessel functions and Airy | |
2840 | functions. Faddeeva allows computing the various error functions of arbitrary | |
2841 | complex arguments (Faddeeva function, error function, complementary error | |
2842 | function, scaled complementary error function, imaginary error function, and | |
2843 | Dawson function); given these, one can also easily compute Voigt functions, | |
2844 | Fresnel integrals, and similar related functions as well.") | |
2845 | ;; Faddeeva is released under the Expat license; AMOS is included as | |
2846 | ;; public domain software. | |
2847 | (license (list license:expat license:public-domain)))) | |
2848 | ||
2742f87e RW |
2849 | (define-public suitesparse |
2850 | (package | |
2851 | (name "suitesparse") | |
bd5b5ac0 | 2852 | (version "4.5.5") |
2742f87e RW |
2853 | (source |
2854 | (origin | |
2855 | (method url-fetch) | |
2856 | (uri (string-append | |
2857 | "http://faculty.cse.tamu.edu/davis/SuiteSparse/SuiteSparse-" | |
2858 | version ".tar.gz")) | |
2859 | (sha256 | |
2860 | (base32 | |
bd5b5ac0 EB |
2861 | "1dnr6pmjzc2qmbkmb4shigx1l74ilf6abn7svyd6brxgvph8vadr")) |
2862 | (modules '((guix build utils))) | |
2863 | (snippet | |
2864 | ;; Remove bundled metis source | |
2865 | '(delete-file-recursively "metis-5.1.0")))) | |
2742f87e RW |
2866 | (build-system gnu-build-system) |
2867 | (arguments | |
bd5b5ac0 | 2868 | '(#:tests? #f ;no "check" target |
2742f87e RW |
2869 | #:make-flags |
2870 | (list "CC=gcc" | |
2871 | "BLAS=-lblas" | |
2872 | "TBB=-ltbb" | |
bd5b5ac0 | 2873 | "MY_METIS_LIB=-lmetis" |
2742f87e RW |
2874 | (string-append "INSTALL_LIB=" |
2875 | (assoc-ref %outputs "out") "/lib") | |
2876 | (string-append "INSTALL_INCLUDE=" | |
bd5b5ac0 EB |
2877 | (assoc-ref %outputs "out") "/include") |
2878 | "library") | |
2742f87e | 2879 | #:phases |
2509522c | 2880 | (modify-phases %standard-phases |
bd5b5ac0 | 2881 | (delete 'configure)))) ;no configure script |
2742f87e RW |
2882 | (inputs |
2883 | `(("tbb" ,tbb) | |
bd5b5ac0 EB |
2884 | ("lapack" ,lapack) |
2885 | ("metis" ,metis))) | |
2742f87e RW |
2886 | (home-page "http://faculty.cse.tamu.edu/davis/suitesparse.html") |
2887 | (synopsis "Suite of sparse matrix software") | |
2888 | (description | |
2889 | "SuiteSparse is a suite of sparse matrix algorithms, including: UMFPACK, | |
2890 | multifrontal LU factorization; CHOLMOD, supernodal Cholesky; SPQR, | |
2891 | multifrontal QR; KLU and BTF, sparse LU factorization, well-suited for circuit | |
2892 | simulation; ordering methods (AMD, CAMD, COLAMD, and CCOLAMD); CSparse and | |
2893 | CXSparse, a concise sparse Cholesky factorization package; and many other | |
2894 | packages.") | |
2895 | ;; LGPLv2.1+: | |
2896 | ;; AMD, CAMD, BTF, COLAMD, CCOLAMD, CSparse, CXSparse, KLU, LDL | |
2897 | ;; GPLv2+: | |
2898 | ;; GPUQREngine, RBio, SuiteSparse_GPURuntime, SuiteSparseQR, UMFPACK | |
2899 | (license (list license:gpl2+ license:lgpl2.1+)))) | |
2900 | ||
ec322be2 FB |
2901 | (define-public atlas |
2902 | (package | |
2903 | (name "atlas") | |
3c98ac02 | 2904 | (version "3.10.3") |
ec322be2 FB |
2905 | (source (origin |
2906 | (method url-fetch) | |
de67e922 LF |
2907 | (uri (string-append "mirror://sourceforge/math-atlas/Stable/" |
2908 | version "/atlas" version ".tar.bz2")) | |
ec322be2 FB |
2909 | (sha256 |
2910 | (base32 | |
3c98ac02 | 2911 | "1dyjlq3fiparvm8ypwk6rsmjzmnwk81l88gkishphpvc79ryp216")))) |
ec322be2 FB |
2912 | (build-system gnu-build-system) |
2913 | (home-page "http://math-atlas.sourceforge.net/") | |
19afbea1 | 2914 | (inputs `(("gfortran" ,gfortran) |
ec322be2 FB |
2915 | ("lapack-tar" ,(package-source lapack)))) |
2916 | (outputs '("out" "doc")) | |
01480b9e FB |
2917 | ;; For the moment we drop support for MIPS at it fails to compile. See |
2918 | ;; https://lists.gnu.org/archive/html/guix-devel/2014-11/msg00516.html | |
2919 | (supported-systems (delete "mips64el-linux" %supported-systems)) | |
ec322be2 FB |
2920 | (arguments |
2921 | `(#:parallel-build? #f | |
2922 | #:parallel-tests? #f | |
f15615b1 LC |
2923 | |
2924 | ;; ATLAS tunes itself for the machine it is built on, as explained at | |
2925 | ;; <http://lists.gnu.org/archive/html/guix-devel/2014-10/msg00305.html>. | |
2926 | ;; For this reason, we want users to build it locally instead of using | |
2927 | ;; substitutes. | |
2928 | #:substitutable? #f | |
2929 | ||
ec322be2 FB |
2930 | #:modules ((srfi srfi-26) |
2931 | (srfi srfi-1) | |
2932 | (guix build gnu-build-system) | |
2933 | (guix build utils)) | |
40029cbe | 2934 | #:configure-flags |
ec322be2 FB |
2935 | `(;; Generate position independent code suitable for dynamic libraries |
2936 | ;; and use WALL timer to get more accurate timing. | |
2937 | "-Fa" "alg" "-fPIC" "-D" "c" "-DWALL" | |
2938 | ;; Set word width. | |
2939 | "-b" | |
2940 | ,,(if (string-match "64" (%current-system)) | |
2941 | "64" | |
2942 | "32") | |
2943 | ;; Disable parallel build as it gives errors: atlas_pthread.h is | |
2944 | ;; needed to compile C files before it is generated. | |
2945 | "-Ss" "pmake" "make -j 1" | |
af89a667 FB |
2946 | ;; Probe is failing for MIPS. We therefore define the system |
2947 | ;; architecture explicitly by setting (-A) MACHINETYPE = 49 | |
2948 | ;; 'MIPSR1xK' and (-V) ISA = 1 'none'. | |
2949 | ,,@(if (string-prefix? "mips" (%current-system)) | |
2950 | (list "-A" "49" "-V" "1") | |
2951 | (list)) | |
ec322be2 FB |
2952 | ;; Generate shared libraries. |
2953 | "--shared" | |
2954 | ;; Build a full LAPACK library. | |
2955 | ,(string-append "--with-netlib-lapack-tarfile=" | |
2956 | (assoc-ref %build-inputs "lapack-tar"))) | |
2957 | #:phases | |
e5b4b96b EF |
2958 | (modify-phases %standard-phases |
2959 | (add-after 'install 'install-doc | |
2960 | (lambda* (#:key outputs inputs #:allow-other-keys) | |
2961 | (let ((doc (string-append (assoc-ref outputs "doc") | |
2962 | "/share/doc/atlas"))) | |
2963 | (mkdir-p doc) | |
2964 | (fold (lambda (file previous) | |
2965 | (and previous (zero? (system* "cp" file doc)))) | |
2966 | #t (find-files "../ATLAS/doc" ".*"))))) | |
2967 | (add-after 'check 'check-pt | |
2968 | (lambda _ (zero? (system* "make" "ptcheck")))) | |
2969 | ;; Fix files required to run configure. | |
2970 | (add-before 'configure 'fix-/bin/sh | |
ec322be2 FB |
2971 | (lambda _ |
2972 | ;; Use `sh', not `/bin/sh'. | |
2973 | (substitute* (find-files "." "Makefile|configure|SpewMakeInc\\.c") | |
2974 | (("/bin/sh") | |
e5b4b96b EF |
2975 | "sh")))) |
2976 | ;; Fix /bin/sh in generated make files. | |
2977 | (add-after 'configure 'fix-/bin/sh-in-generated-files | |
2978 | (lambda _ | |
2979 | (substitute* (find-files "." "^[Mm]ake\\.inc.*") | |
2980 | (("/bin/sh") | |
2981 | "sh")))) | |
2982 | ;; ATLAS configure program does not accepts the default flags | |
2983 | ;; passed by the 'gnu-build-system'. | |
2984 | (replace 'configure | |
2985 | (lambda* (#:key native-inputs inputs outputs | |
2986 | (configure-flags '()) | |
2987 | #:allow-other-keys #:rest args) | |
2988 | (let* ((prefix (assoc-ref outputs "out")) | |
2989 | (bash (or (and=> (assoc-ref | |
2990 | (or native-inputs inputs) "bash") | |
2991 | (cut string-append <> "/bin/bash")) | |
2992 | "/bin/sh")) | |
2993 | (flags `(,(string-append "--prefix=" prefix) | |
2994 | ,@configure-flags)) | |
2995 | (abs-srcdir (getcwd)) | |
2996 | (srcdir (string-append "../" (basename abs-srcdir)))) | |
2997 | (format #t "source directory: ~s (relative from build: ~s)~%" | |
2998 | abs-srcdir srcdir) | |
2999 | (mkdir "../build") | |
3000 | (chdir "../build") | |
3001 | (format #t "build directory: ~s~%" (getcwd)) | |
3002 | (format #t "configure flags: ~s~%" flags) | |
3003 | (zero? (apply system* bash | |
3004 | (string-append srcdir "/configure") | |
3005 | flags)))))))) | |
ec322be2 FB |
3006 | (synopsis "Automatically Tuned Linear Algebra Software") |
3007 | (description | |
3008 | "ATLAS is an automatically tuned linear algebra software library | |
3009 | providing C and Fortran77 interfaces to a portably efficient BLAS | |
3010 | implementation, as well as a few routines from LAPACK. | |
3011 | ||
f15615b1 LC |
3012 | Optimization occurs at build time. For this reason, the library is built on |
3013 | the machine where it is installed, without resorting to pre-built substitutes. | |
ec322be2 | 3014 | |
f15615b1 | 3015 | Before building the library, CPU throttling should be disabled. This can be |
d97c429a | 3016 | done in the BIOS, or, on GNU/Linux, with the following command: |
ec322be2 | 3017 | |
8e9ba611 | 3018 | @example |
d97c429a | 3019 | # cpupower --governor performance |
8e9ba611 | 3020 | @end example |
ec322be2 | 3021 | |
d97c429a | 3022 | Failure to do so will result in a library with poor performance.") |
ec322be2 | 3023 | (license license:bsd-3))) |
c12efc72 AE |
3024 | |
3025 | (define-public glm | |
3026 | (package | |
3027 | (name "glm") | |
3028 | (version "0.9.6.3") | |
3029 | (source | |
3030 | (origin | |
3031 | (method url-fetch) | |
de67e922 LF |
3032 | (uri (string-append "mirror://sourceforge/ogl-math/glm-" version |
3033 | "/glm-" version ".zip")) | |
c12efc72 AE |
3034 | (sha256 |
3035 | (base32 | |
3036 | "1cnjmi033a16a95v6xfkr1bvfmkd26hzdjka8j1819hgn5b1nr8l")))) | |
3037 | (build-system cmake-build-system) | |
3038 | (native-inputs | |
3039 | `(("unzip" ,unzip))) | |
3040 | (home-page "http://glm.g-truc.net") | |
3041 | (synopsis "OpenGL Mathematics library") | |
3042 | (description "OpenGL Mathematics (GLM) is a header-only C++ mathematics | |
3043 | library for graphics software based on the OpenGL Shading Language (GLSL) | |
3044 | specifications.") | |
3045 | (license license:expat))) | |
7f18257b AE |
3046 | |
3047 | (define-public lpsolve | |
3048 | (package | |
3049 | (name "lpsolve") | |
3050 | (version "5.5.2.0") | |
3051 | (source | |
3052 | (origin | |
3053 | (method url-fetch) | |
3054 | (uri (string-append "mirror://sourceforge/lpsolve/lpsolve/" version | |
3055 | "/lp_solve_" version "_source.tar.gz")) | |
3056 | (sha256 | |
3057 | (base32 | |
3058 | "176c7f023mb6b8bfmv4rfqnrlw88lsg422ca74zjh19i2h5s69sq")) | |
3059 | (modules '((guix build utils))) | |
3060 | (snippet | |
3061 | '(substitute* (list "lp_solve/ccc" "lpsolve55/ccc") | |
3062 | (("^c=cc") "c=gcc") | |
3063 | ;; Pretend to be on a 64 bit platform to obtain a common directory | |
3064 | ;; name for the build results on all architectures; nothing else | |
3065 | ;; seems to depend on it. | |
5dbfbef7 LC |
3066 | (("^PLATFORM=.*$") "PLATFORM=ux64\n") |
3067 | ||
3068 | ;; The check for 'isnan' as it is written fails with | |
3069 | ;; "non-floating-point argument in call to function | |
3070 | ;; ‘__builtin_isnan’", which leads to the 'NOISNAN' cpp macro | |
3071 | ;; definition, which in turn leads to bad things. Fix the feature | |
3072 | ;; test. | |
3073 | (("isnan\\(0\\)") "isnan(0.)"))))) | |
7f18257b AE |
3074 | (build-system gnu-build-system) |
3075 | (arguments | |
6c96b545 | 3076 | `(#:tests? #f ; no check target |
7f18257b AE |
3077 | #:phases |
3078 | (modify-phases %standard-phases | |
6c96b545 | 3079 | (delete 'configure) ; no configure script |
7f18257b AE |
3080 | (replace 'build |
3081 | (lambda _ | |
6c96b545 TGR |
3082 | (with-directory-excursion "lpsolve55" |
3083 | (invoke "bash" "ccc")) | |
3084 | (with-directory-excursion "lp_solve" | |
3085 | (invoke "bash" "ccc")) | |
3086 | #t)) | |
7f18257b AE |
3087 | (replace 'install |
3088 | (lambda* (#:key outputs #:allow-other-keys) | |
3089 | (let* ((out (assoc-ref outputs "out")) | |
3090 | (bin (string-append out "/bin")) | |
3091 | (lib (string-append out "/lib")) | |
3092 | ;; This is where LibreOffice expects to find the header | |
3093 | ;; files, and where they are installed by Debian. | |
3094 | (include (string-append out "/include/lpsolve"))) | |
6c96b545 TGR |
3095 | (install-file "lpsolve55/bin/ux64/liblpsolve55.a" lib) |
3096 | (install-file "lpsolve55/bin/ux64/liblpsolve55.so" lib) | |
96c46210 LC |
3097 | (install-file "lp_solve/bin/ux64/lp_solve" bin) |
3098 | ||
7f18257b AE |
3099 | ;; Install a subset of the header files as on Debian |
3100 | ;; (plus lp_bit.h, which matches the regular expression). | |
96c46210 LC |
3101 | (for-each (lambda (name) |
3102 | (install-file name include)) | |
3103 | (find-files "." "lp_[HMSa-z].*\\.h$")) | |
7f18257b | 3104 | (with-directory-excursion "shared" |
96c46210 LC |
3105 | (for-each (lambda (name) |
3106 | (install-file name include)) | |
3107 | (find-files "." "\\.h$"))) | |
7f18257b AE |
3108 | #t)))))) |
3109 | (home-page "http://lpsolve.sourceforge.net/") | |
3110 | (synopsis "Mixed integer linear programming (MILP) solver") | |
3111 | (description | |
3112 | "lp_solve is a mixed integer linear programming solver based on the | |
3113 | revised simplex and the branch-and-bound methods.") | |
3114 | (license license:lgpl2.1+))) | |
a17d4564 EB |
3115 | |
3116 | (define-public dealii | |
3117 | (package | |
3118 | (name "dealii") | |
24404eaf | 3119 | (version "8.5.1") |
a17d4564 EB |
3120 | (source |
3121 | (origin | |
3122 | (method url-fetch) | |
3123 | (uri (string-append "https://github.com/dealii/dealii/releases/" | |
3124 | "download/v" version "/dealii-" version ".tar.gz")) | |
3125 | (sha256 | |
3126 | (base32 | |
24404eaf | 3127 | "1bh9rsmkrg0zi70n27b11djmac9lximghsiy7mg7w7x544n82gnk")) |
a17d4564 EB |
3128 | (modules '((guix build utils))) |
3129 | (snippet | |
3130 | ;; Remove bundled sources: UMFPACK, TBB, muParser, and boost | |
3131 | '(delete-file-recursively "bundled")))) | |
3132 | (build-system cmake-build-system) | |
3133 | (inputs | |
3134 | `(("tbb" ,tbb) | |
3135 | ("zlib" ,zlib) | |
3136 | ("boost" ,boost) | |
3137 | ("p4est" ,p4est) | |
3138 | ("blas" ,openblas) | |
3139 | ("lapack" ,lapack) | |
3140 | ("arpack" ,arpack-ng) | |
3141 | ("muparser" ,muparser) | |
3142 | ("gfortran" ,gfortran) | |
3143 | ("suitesparse" ,suitesparse))) ;for UMFPACK | |
3144 | (arguments | |
3145 | `(#:build-type "DebugRelease" ;only supports Release, Debug, or DebugRelease | |
d84b09e9 EB |
3146 | #:configure-flags |
3147 | ;; Work around a bug in libsuitesparseconfig linking | |
3148 | ;; see https://github.com/dealii/dealii/issues/4745 | |
3149 | '("-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON"))) | |
a17d4564 EB |
3150 | (home-page "https://www.dealii.org") |
3151 | (synopsis "Finite element library") | |
3152 | (description | |
3153 | "Deal.II is a C++ program library targeted at the computational solution | |
3154 | of partial differential equations using adaptive finite elements. The main | |
3155 | aim of deal.II is to enable rapid development of modern finite element codes, | |
3156 | using among other aspects adaptive meshes and a wide array of tools often used | |
3157 | in finite element programs.") | |
3158 | (license license:lgpl2.1+))) | |
3159 | ||
3160 | (define-public dealii-openmpi | |
3161 | (package (inherit dealii) | |
3162 | (name "dealii-openmpi") | |
3163 | (inputs | |
3164 | `(("mpi" ,openmpi) | |
3165 | ;;Supported only with MPI: | |
3166 | ("p4est" ,p4est-openmpi) | |
3167 | ("petsc" ,petsc-openmpi) | |
3168 | ("slepc" ,slepc-openmpi) | |
3169 | ("metis" ,metis) ;for MUMPS | |
3170 | ("scalapack" ,scalapack) ;for MUMPS | |
3171 | ("mumps" ,mumps-metis-openmpi) ;configure supports only metis orderings | |
3172 | ("arpack" ,arpack-ng-openmpi) | |
3173 | ,@(fold alist-delete (package-inputs dealii) | |
3174 | '("p4est" "arpack")))) | |
3175 | (arguments | |
3176 | (substitute-keyword-arguments (package-arguments dealii) | |
3177 | ((#:configure-flags cf) | |
3178 | ``("-DMPI_C_COMPILER=mpicc" | |
3179 | "-DMPI_CXX_COMPILER=mpicxx" | |
3180 | "-DMPI_Fortran_COMPILER=mpifort" | |
3181 | ,@,cf)))) | |
3182 | (synopsis "Finite element library (with MPI support)"))) | |
194c7f95 AE |
3183 | |
3184 | (define-public flann | |
3185 | (package | |
3186 | (name "flann") | |
3187 | (version "1.8.4") | |
3188 | (source | |
3189 | (origin | |
3190 | (method url-fetch) | |
3191 | (uri | |
3192 | (string-append | |
3193 | "http://www.cs.ubc.ca/research/flann/uploads/FLANN/flann-" | |
3194 | version "-src.zip")) | |
3195 | (sha256 | |
3196 | (base32 | |
3197 | "022w8hph7bli5zbpnk3z1qh1c2sl5hm8fw2ccim651ynn0hr7fyz")))) | |
3198 | (build-system cmake-build-system) | |
6b6aca9b LC |
3199 | (outputs '("out" |
3200 | "octave")) ;46 MiB .mex file that pulls Octave | |
194c7f95 AE |
3201 | (native-inputs |
3202 | `(("unzip" ,unzip))) | |
3203 | (inputs | |
3204 | `(("hdf5" ,hdf5) | |
3205 | ("octave" ,octave) | |
3206 | ("python" ,python-2) ; print syntax | |
3207 | ;; ("python2-numpy" ,python2-numpy) ; only required for the tests | |
3208 | ("zlib" ,zlib))) | |
3209 | (arguments | |
39b30337 LC |
3210 | `(;; The 'share/flann/octave' contains a .mex file, which is an ELF file |
3211 | ;; taken 46 MiB unstripped, and 6 MiB stripped. | |
3212 | #:strip-directories '("lib" "lib64" "libexec" | |
3213 | "bin" "sbin" "share/flann/octave") | |
3214 | ||
9684e30b LC |
3215 | ;; Save 12 MiB by not installing .a files. Passing |
3216 | ;; '-DBUILD_STATIC_LIBS=OFF' has no effect. | |
3217 | #:phases (modify-phases %standard-phases | |
6b6aca9b LC |
3218 | (add-before 'configure 'set-octave-directory |
3219 | (lambda* (#:key outputs #:allow-other-keys) | |
3220 | ;; Install the .mex file in the "octave" output. | |
3221 | (let ((out (assoc-ref outputs "octave"))) | |
3222 | (substitute* "src/matlab/CMakeLists.txt" | |
3223 | (("share/flann/octave") | |
3224 | (string-append out "/share/flann/octave"))) | |
3225 | #t))) | |
9684e30b LC |
3226 | (add-after 'install 'remove-static-libraries |
3227 | (lambda* (#:key outputs #:allow-other-keys) | |
3228 | (let* ((out (assoc-ref outputs "out")) | |
3229 | (lib (string-append out "/lib"))) | |
3230 | (for-each delete-file | |
3231 | (find-files lib "\\.a$")) | |
3232 | #t)))) | |
3233 | ||
39b30337 | 3234 | #:tests? #f)) ; The test data are downloaded from the Internet. |
194c7f95 AE |
3235 | (home-page "http://www.cs.ubc.ca/research/flann/") |
3236 | (synopsis "Library for approximate nearest neighbors computation") | |
3237 | (description "FLANN is a library for performing fast approximate | |
3238 | nearest neighbor searches in high dimensional spaces. It implements a | |
3239 | collection of algorithms and a system for automatically choosing the best | |
3240 | algorithm and optimum parameters depending on the dataset. | |
3241 | ||
3242 | FLANN is written in C++ and contains bindings for C, Octave and Python.") | |
3243 | (license (license:non-copyleft "file://COPYING" | |
3244 | "See COPYING in the distribution.")))) | |
d8c97beb EF |
3245 | |
3246 | (define-public wcalc | |
3247 | (package | |
3248 | (name "wcalc") | |
3249 | (version "2.5") | |
3250 | (source | |
3251 | (origin | |
3252 | (method url-fetch) | |
de67e922 LF |
3253 | (uri (string-append "mirror://sourceforge/w-calc/Wcalc/" version "/" |
3254 | "wcalc-" version ".tar.bz2")) | |
d8c97beb EF |
3255 | (sha256 |
3256 | (base32 | |
3257 | "1vi8dl6rccqiq1apmpwawyg2ywx6a1ic1d3cvkf2hlwk1z11fb0f")))) | |
3258 | (build-system gnu-build-system) | |
3259 | (inputs | |
3260 | `(("mpfr" ,mpfr) | |
3261 | ("readline" ,readline))) | |
3262 | (home-page "http://w-calc.sourceforge.net/index.php") | |
3263 | (synopsis "Flexible command-line scientific calculator") | |
3264 | (description "Wcalc is a very capable calculator. It has standard functions | |
3265 | (sin, asin, and sinh for example, in either radians or degrees), many | |
3266 | pre-defined constants (pi, e, c, etc.), support for using variables, \"active\" | |
3267 | variables, a command history, hex/octal/binary input and output, unit | |
3268 | conversions, embedded comments, and an expandable expression entry field. It | |
3269 | evaluates expressions using the standard order of operations.") | |
3270 | (license license:gpl2+))) | |
45147b0c FH |
3271 | |
3272 | (define-public xaos | |
3273 | (package | |
3274 | (name "xaos") | |
3275 | (version "3.6") | |
3276 | (source (origin | |
3277 | (method url-fetch) | |
de67e922 LF |
3278 | (uri (string-append "mirror://sourceforge/xaos/XaoS/" version |
3279 | "/xaos-" version ".tar.gz")) | |
45147b0c FH |
3280 | (sha256 |
3281 | (base32 | |
3282 | "15cd1cx1dyygw6g2nhjqq3bsfdj8sj8m4va9n75i0f3ryww3x7wq")))) | |
3283 | (build-system gnu-build-system) | |
b94a6ca0 | 3284 | (native-inputs `(("gettext" ,gettext-minimal))) |
45147b0c FH |
3285 | (inputs `(("libx11" ,libx11) |
3286 | ("zlib" ,zlib) | |
3287 | ("libpng" ,libpng) | |
3288 | ("gsl" ,gsl))) | |
3289 | (arguments | |
3290 | `(#:tests? #f ;no "check" target | |
3291 | #:make-flags '("LOCALEDIR=$DATAROOTDIR/locale"))) | |
3292 | (synopsis "Real-time fractal zoomer") | |
3293 | (description "GNU XaoS is a graphical program that generates fractal | |
3294 | patterns and allows you to zoom in and out of them infinitely in a fluid, | |
3295 | continuous manner. It also includes tutorials that help to explain how fractals | |
3296 | are built. It can generate many different fractal types such as the Mandelbrot | |
3297 | set.") | |
6fd52309 | 3298 | (home-page "https://www.gnu.org/software/xaos/") |
45147b0c | 3299 | (license license:gpl2+))) |
528bb464 EB |
3300 | |
3301 | (define-public hypre | |
3302 | (package | |
3303 | (name "hypre") | |
3304 | (version "2.11.0") | |
3305 | (source (origin | |
3306 | (method url-fetch) | |
3307 | (uri (string-append "https://github.com/LLNL/hypre/archive/" | |
3308 | "v" version ".tar.gz")) | |
3309 | (file-name (string-append name "-" version ".tar.gz")) | |
3310 | (sha256 | |
3311 | (base32 | |
3312 | "0q69ia0jivzcr8p049dn3mg8yjpn6nwq4sw9iqac8vr63vi54l6m")) | |
3313 | (modules '((guix build utils))) | |
3314 | (snippet | |
3315 | '(begin | |
3316 | ;; Remove use of __DATE__ and __TIME__ for reproducibility; | |
3317 | ;; substitute the tarball creation time. | |
3318 | (substitute* "src/utilities/HYPRE_utilities.h" | |
3319 | (("Date Compiled: .*$") | |
3320 | "Date Compiled: Mar 28 2016 20:19:59 +0000\"\n")) | |
3321 | #t)))) | |
3322 | (build-system gnu-build-system) | |
3323 | (outputs '("out" ;6.1 MiB of headers and libraries | |
3324 | "doc")) ;4.8 MiB of documentation | |
3325 | (native-inputs | |
3326 | `(("doc++" ,doc++) | |
3327 | ("netpbm" ,netpbm) | |
3328 | ("texlive" ,texlive) ;full package required for fonts | |
3329 | ("ghostscript" ,ghostscript))) | |
3330 | (inputs | |
3331 | `(("blas" ,openblas) | |
3332 | ("lapack" ,lapack))) | |
3333 | (arguments | |
3334 | `(#:modules ((srfi srfi-1) | |
3335 | ,@%gnu-build-system-modules) | |
3336 | #:configure-flags '("--enable-shared" | |
3337 | "--disable-fortran" | |
3338 | "--without-MPI" | |
3339 | "--with-openmp" | |
3340 | "--with-fei" | |
3341 | "--with-lapack" | |
3342 | "--with-blas") | |
3343 | #:phases | |
3344 | (modify-phases %standard-phases | |
3345 | (add-before 'configure 'chdir-src | |
3346 | (lambda _ (chdir "src"))) | |
3347 | (replace 'configure | |
3348 | (lambda* (#:key build target configure-flags | |
3349 | #:allow-other-keys #:rest args) | |
3350 | (let* ((configure (assoc-ref %standard-phases 'configure))) | |
3351 | (apply configure | |
3352 | (append args | |
3353 | (list #:configure-flags | |
3354 | (cons (string-append | |
3355 | "--host=" (or target build)) | |
3356 | configure-flags))))))) | |
3357 | (add-after 'build 'build-docs | |
3358 | (lambda _ | |
3359 | (zero? (system* "make" "-Cdocs" "pdf" "html")))) | |
3360 | (replace 'check | |
3361 | (lambda _ | |
3362 | (setenv "LD_LIBRARY_PATH" (string-append (getcwd) "/hypre/lib")) | |
3363 | (setenv "PATH" (string-append "." ":" (getenv "PATH"))) | |
3364 | (and (system* "make" "check" "CHECKRUN=") | |
3365 | (fold (lambda (filename result) | |
3366 | (and result | |
3367 | (let ((size (stat:size (stat filename)))) | |
3368 | (when (not (zero? size)) | |
3369 | (format #t "~a size ~d; error indication~%" | |
3370 | filename size)) | |
3371 | (zero? size)))) | |
3372 | #t | |
3373 | (find-files "test" ".*\\.err$"))))) | |
3374 | (add-after 'install 'install-docs | |
3375 | (lambda* (#:key outputs #:allow-other-keys) | |
3376 | ;; Custom install because docs/Makefile doesn't honor ${docdir}. | |
3377 | (let* ((doc (assoc-ref outputs "doc")) | |
3378 | (docdir (string-append doc "/share/doc/hypre-" ,version))) | |
528bb464 EB |
3379 | (with-directory-excursion "docs" |
3380 | (for-each (lambda (base) | |
3381 | (install-file (string-append base ".pdf") docdir) | |
3382 | (copy-recursively base docdir)) ;html docs | |
3383 | '("HYPRE_usr_manual" | |
3384 | "HYPRE_ref_manual"))) | |
3385 | #t)))))) | |
3386 | (home-page "http://www.llnl.gov/casc/hypre/") | |
3387 | (synopsis "Library of solvers and preconditioners for linear equations") | |
3388 | (description | |
3389 | "HYPRE is a software library of high performance preconditioners and | |
3390 | solvers for the solution of large, sparse linear systems of equations. It | |
3391 | features multigrid solvers for both structured and unstructured grid | |
3392 | problems.") | |
3393 | (license license:lgpl2.1))) | |
3394 | ||
3395 | (define-public hypre-openmpi | |
3396 | (package (inherit hypre) | |
3397 | (name "hypre-openmpi") | |
3398 | (inputs | |
3399 | `(("mpi" ,openmpi) | |
3400 | ,@(package-inputs hypre))) | |
3401 | (arguments | |
3402 | (substitute-keyword-arguments (package-arguments hypre) | |
3403 | ((#:configure-flags flags) | |
3404 | ``("--with-MPI" | |
3405 | ,@(delete "--without-MPI" ,flags))))) | |
3406 | (synopsis "Parallel solvers and preconditioners for linear equations") | |
3407 | (description | |
3408 | "HYPRE is a software library of high performance preconditioners and | |
3409 | solvers for the solution of large, sparse linear systems of equations on | |
3410 | parallel computers. It features parallel multigrid solvers for both | |
3411 | structured and unstructured grid problems."))) | |
6c90e183 EB |
3412 | |
3413 | (define-public matio | |
3414 | (package | |
3415 | (name "matio") | |
3416 | (version "1.5.6") | |
3417 | (source | |
3418 | (origin | |
3419 | (method url-fetch) | |
de67e922 | 3420 | (uri (string-append "mirror://sourceforge/matio/matio/" version "/" |
6c90e183 EB |
3421 | "matio-" version ".tar.gz")) |
3422 | (sha256 | |
3423 | (base32 | |
3424 | "0y2qymgxank8wdiwc68ap8bxdzrhvyw86i29yh3xgn4z1njfd9ir")))) | |
3425 | (build-system gnu-build-system) | |
3426 | (inputs | |
3427 | `(("zlib" ,zlib) | |
3428 | ("hdf5" ,hdf5))) | |
3429 | (home-page "http://matio.sourceforge.net/") | |
3430 | (synopsis "Library for reading and writing MAT files") | |
3431 | (description "Matio is a library for reading and writing MAT files. It | |
3432 | supports compressed MAT files, as well as newer (version 7.3) MAT files.") | |
3433 | (license license:bsd-2))) | |
d721c83a | 3434 | |
517318ad LF |
3435 | (define-public vc |
3436 | (package | |
3437 | (name "vc") | |
3438 | (version "1.2.0") | |
3439 | (source | |
3440 | (origin (method url-fetch) | |
3441 | (uri (string-append "https://github.com/VcDevel/Vc/releases/" | |
3442 | "download/" version "/Vc-" version ".tar.gz")) | |
3443 | (sha256 | |
3444 | (base32 | |
3445 | "1rh6dhqar3y07n4xqyml0sa0v48qv3ch9dc3yc2in855hlh4vnqi")))) | |
3446 | (build-system cmake-build-system) | |
3447 | (arguments | |
3448 | '(#:configure-flags | |
3449 | '("-DBUILD_TESTING=ON"))) | |
3450 | (synopsis "SIMD vector classes for C++") | |
3451 | (description "Vc provides portable, zero-overhead C++ types for explicitly | |
3452 | data-parallel programming. It is a library designed to ease explicit | |
3453 | vectorization of C++ code. Its types enable explicitly stating data-parallel | |
3454 | operations on multiple values. The parallelism is therefore added via the type | |
3455 | system. Vc has an intuitive API and provides portability between different | |
3456 | compilers and compiler versions as well as portability between different vector | |
3457 | instruction sets. Thus, an application written with Vc can be compiled for: | |
3458 | @enumerate | |
3459 | @item AVX and AVX2 | |
d1e4ad1b | 3460 | @item SSE2 up to SSE4.2 or SSE4a |
517318ad LF |
3461 | @item Scalar |
3462 | @item MIC | |
3463 | @item NEON (in development) | |
3464 | @item NVIDIA GPUs / CUDA (in development) | |
3465 | @end enumerate\n") | |
3466 | (home-page "https://github.com/VcDevel/Vc") | |
a8ead6f9 EF |
3467 | ;; "No support_???.cpp file exists for this architecture." |
3468 | (supported-systems '("x86_64-linux" "i686-linux")) | |
517318ad | 3469 | (license license:bsd-3))) |
54052a54 | 3470 | |
3471 | (define-public reducelcs | |
3472 | ;; This is the last commit which is available upstream, no | |
3473 | ;; release happened since 2010. | |
3474 | (let ((commit "474f88deb968061abe8cf11c959e02319b8ae5c0") | |
3475 | (revision "1")) | |
3476 | (package | |
3477 | (name "reducelcs") | |
3478 | (version (string-append "1.0-" revision "." (string-take commit 7))) | |
3479 | (source | |
3480 | (origin | |
3481 | (method git-fetch) | |
3482 | (uri (git-reference | |
3483 | (url "https://github.com/gdv/Reduce-Expand-for-LCS") | |
3484 | (commit commit))) | |
3485 | (file-name (string-append name "-" version "-checkout")) | |
3486 | (sha256 | |
3487 | (base32 | |
3488 | "1rllzcfwc042c336mhq262a8ha90x6afq30kvk60r7i4761j4yjm")))) | |
3489 | (build-system gnu-build-system) | |
3490 | (inputs | |
3491 | `(("openlibm" ,openlibm))) | |
3492 | (arguments | |
3493 | `(#:tests? #f ; no tests | |
3494 | #:phases | |
3495 | (modify-phases %standard-phases | |
3496 | (delete 'configure) ; No configure script exists. | |
3497 | (replace 'install ; No install phase exists. | |
3498 | (lambda* (#:key outputs #:allow-other-keys) | |
3499 | (let* ((out (assoc-ref outputs "out")) | |
3500 | (bin (string-append out "/bin"))) | |
3501 | (install-file "Approximation" bin) | |
3502 | (install-file "CollectResults" bin) | |
3503 | (install-file "GenerateInstances" bin) | |
3504 | #t)))))) | |
3505 | (synopsis "Approximate Longest Commons Subsequence computation tool") | |
3506 | (description | |
3507 | "@code{reduceLCS} is an implementation of the Reduce-Expand | |
3508 | algorithm for LCS. It is a fast program to compute the approximate | |
3509 | Longest Commons Subsequence of a set of strings.") | |
3510 | (home-page "https://github.com/gdv/Reduce-Expand-for-LCS") | |
c000b6b1 | 3511 | (license license:gpl3+)))) |
479c4273 JD |
3512 | |
3513 | (define-public jacal | |
3514 | (package | |
3515 | (name "jacal") | |
3516 | (version "1c4") | |
3517 | (source (origin | |
3518 | (method url-fetch) | |
3519 | (uri (string-append | |
3520 | "http://groups.csail.mit.edu/mac/ftpdir/scm/jacal-" | |
3521 | version ".zip")) | |
3522 | (sha256 (base32 | |
3523 | "055zrn12a1dmy0dqkwrkq3fklbhg3yir6vn0lacp4mvbg8573a3q")) | |
3524 | (patches (search-patches "jacal-fix-texinfo.patch")))) | |
3525 | (build-system gnu-build-system) | |
3526 | (arguments | |
3527 | `(#:phases | |
3528 | (modify-phases %standard-phases | |
3529 | (add-before 'build 'pre-build | |
3530 | ;; Don't use upstream's script - it really doesn't fit into | |
3531 | ;; Guix's functional paradigm. | |
3532 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
3533 | (substitute* "Makefile" | |
3534 | (("^install: install-script") "install: ")))) | |
3535 | (add-after 'install 'post-install | |
3536 | ;; Instead, we provide our own simplified script. | |
3537 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
3538 | (let ((wrapper (string-append (assoc-ref outputs "out") | |
3539 | "/bin/jacal"))) | |
3540 | (format (open wrapper (logior O_WRONLY O_CREAT)) | |
3541 | (string-append "#!~a\nexec ~a/bin/scm -ip1 " | |
3542 | "-e '(slib:load \"~a/lib/jacal/math\") " | |
3543 | "(math)' \"$@\"\n") | |
3544 | (which "bash") | |
3545 | (assoc-ref inputs "scm") | |
3546 | (assoc-ref outputs "out")) | |
3547 | (chmod wrapper #o555)))) | |
3548 | (replace 'configure | |
3549 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
3550 | (zero? (system* "./configure" | |
3551 | (string-append "--prefix=" | |
3552 | (assoc-ref outputs "out"))))))))) | |
3553 | (inputs `(("scm" ,scm))) | |
3554 | (native-inputs `(("unzip" ,unzip) | |
3555 | ("texinfo" ,texinfo))) | |
3556 | (synopsis "Symbolic mathematics system") | |
3557 | (description "GNU JACAL is an interactive symbolic mathematics program based on | |
3558 | Scheme. It manipulate and simplify a range of mathematical expressions such | |
3559 | as equations, scalars, vectors, and matrices.") | |
6fd52309 | 3560 | (home-page "https://www.gnu.org/software/jacal/") |
479c4273 JD |
3561 | (license license:gpl3+))) |
3562 | ||
313844d9 TF |
3563 | (define-public z3 |
3564 | (package | |
3565 | (name "z3") | |
3566 | (version "4.5.0") | |
3567 | (source (origin | |
3568 | (method url-fetch) | |
3569 | (uri (string-append | |
3570 | "https://github.com/Z3Prover/z3/archive/z3-" | |
3571 | version ".tar.gz")) | |
3572 | (sha256 | |
3573 | (base32 | |
3574 | "032a5lvji2liwmc25jv52bdrhimqflvqbpg77ccaq1jykhiivbmf")))) | |
cf684d87 | 3575 | (build-system cmake-build-system) |
313844d9 | 3576 | (arguments |
cf684d87 TF |
3577 | `(#:configure-flags |
3578 | (list "-DBUILD_PYTHON_BINDINGS=true" | |
3579 | "-DINSTALL_PYTHON_BINDINGS=true" | |
3580 | (string-append "-DCMAKE_INSTALL_PYTHON_PKG_DIR=" | |
3581 | %output | |
677bc34d | 3582 | "/lib/python2.7/site-packages")) |
313844d9 TF |
3583 | #:phases |
3584 | (modify-phases %standard-phases | |
cf684d87 TF |
3585 | (add-before 'configure 'bootstrap |
3586 | (lambda _ | |
313844d9 | 3587 | (zero? |
cf684d87 TF |
3588 | (system* "python" "contrib/cmake/bootstrap.py" "create")))) |
3589 | (add-before 'check 'make-test-z3 | |
313844d9 | 3590 | (lambda _ |
cf684d87 TF |
3591 | ;; Build the test suite executable. |
3592 | (zero? (system* "make" "test-z3" "-j" | |
3593 | (number->string (parallel-job-count)))))) | |
3594 | (replace 'check | |
3595 | (lambda _ | |
3596 | ;; Run all the tests that don't require arguments. | |
3597 | (zero? (system* "./test-z3" "/a"))))))) | |
313844d9 TF |
3598 | (native-inputs |
3599 | `(("python" ,python-2))) | |
3600 | (synopsis "Theorem prover") | |
3601 | (description "Z3 is a theorem prover and @dfn{satisfiability modulo | |
cf684d87 | 3602 | theories} (SMT) solver. It provides a C/C++ API, as well as Python bindings.") |
313844d9 TF |
3603 | (home-page "https://github.com/Z3Prover/z3") |
3604 | (license license:expat))) | |
3d5d87a3 JL |
3605 | |
3606 | (define-public cubicle | |
3607 | (package | |
3608 | (name "cubicle") | |
3609 | (version "1.1.1") | |
3610 | (source (origin | |
3611 | (method url-fetch) | |
3612 | (uri (string-append "http://cubicle.lri.fr/cubicle-" | |
3613 | version ".tar.gz")) | |
3614 | (sha256 | |
3615 | (base32 | |
3616 | "1sny9c4fm14k014pk62ibpwbrjjirkx8xmhs9jg7q1hk7y7x3q2h")))) | |
3617 | (build-system gnu-build-system) | |
3618 | (native-inputs | |
3619 | `(("ocaml" ,ocaml) | |
83fef82b | 3620 | ("which" ,(@@ (gnu packages base) which)))) |
3d5d87a3 JL |
3621 | (propagated-inputs |
3622 | `(("z3" ,z3))) | |
3623 | (arguments | |
3624 | `(#:configure-flags (list "--with-z3") | |
3625 | #:tests? #f | |
3626 | #:phases | |
3627 | (modify-phases %standard-phases | |
3628 | (add-before 'configure 'configure-for-release | |
3629 | (lambda _ | |
3630 | (substitute* "Makefile.in" | |
3631 | (("SVNREV=") "#SVNREV=")))) | |
3632 | (add-before 'configure 'fix-/bin/sh | |
3633 | (lambda _ | |
3634 | (substitute* "configure" | |
3635 | (("/bin/sh") (which "sh"))))) | |
3636 | (add-before 'configure 'fix-smt-z3wrapper.ml | |
3637 | (lambda _ | |
3638 | (substitute* "Makefile.in" | |
3639 | (("\\\\n") ""))))))) | |
3640 | (home-page "http://cubicle.lri.fr/") | |
3641 | (synopsis "Model checker for array-based systems") | |
5a80c15c RW |
3642 | (description "Cubicle is a model checker for verifying safety properties |
3643 | of array-based systems. This is a syntactically restricted class of | |
3644 | parametrized transition systems with states represented as arrays indexed by | |
3645 | an arbitrary number of processes. Cache coherence protocols and mutual | |
3646 | exclusion algorithms are typical examples of such systems.") | |
3d5d87a3 | 3647 | (license license:asl2.0))) |
e01397b4 EB |
3648 | |
3649 | (define-public elemental | |
3650 | (package | |
3651 | (name "elemental") | |
3652 | (version "0.87.7") | |
3653 | (source (origin | |
3654 | (method url-fetch) | |
3655 | (uri (string-append "https://github.com/elemental/Elemental/" | |
3656 | "archive/v" version ".tar.gz")) | |
3657 | (file-name (string-append name "-" version ".tar.gz")) | |
3658 | (sha256 | |
3659 | (base32 | |
3660 | "1nfp82w22pi8x8fg9sc37z8kf84dqi1dhxp8bbk7571y4aygvv3v")))) | |
3661 | (build-system cmake-build-system) | |
3662 | (home-page "http://libelemental.org") | |
3663 | (native-inputs | |
3664 | `(("gfortran" ,gfortran))) | |
3665 | (inputs | |
3666 | `(("blas" ,openblas) | |
3667 | ("gfortran:lib" ,gfortran "lib") | |
3668 | ("gmp" ,gmp) | |
3669 | ("lapack" ,lapack) | |
3670 | ("metis" ,metis) | |
3671 | ("mpc" ,mpc) | |
3672 | ("mpfr" ,mpfr) | |
3673 | ("mpi" ,openmpi) | |
3674 | ("qd" ,qd))) | |
3675 | (arguments | |
3676 | `(#:build-type "Release" ;default RelWithDebInfo not supported | |
3677 | #:configure-flags `("-DEL_DISABLE_PARMETIS:BOOL=YES" | |
3678 | "-DEL_AVOID_COMPLEX_MPI:BOOL=NO" | |
3679 | "-DEL_CACHE_WARNINGS:BOOL=YES" | |
3680 | "-DEL_TESTS:BOOL=YES" | |
3681 | "-DCMAKE_INSTALL_LIBDIR=lib" | |
3682 | "-DGFORTRAN_LIB=gfortran") | |
3683 | #:phases (modify-phases %standard-phases | |
3684 | (add-before 'check 'setup-tests | |
3685 | (lambda _ | |
3686 | ;; Parallelism is done at the MPI layer. | |
3687 | (setenv "OMP_NUM_THREADS" "1") | |
3688 | #t)) | |
3689 | (add-after 'install 'remove-tests | |
3690 | (lambda* (#:key outputs #:allow-other-keys) | |
3691 | ;; Tests are installed, with no easy configuration | |
3692 | ;; switch to prevent this, so delete them. | |
3693 | (delete-file-recursively | |
3694 | (string-append (assoc-ref outputs "out") "/bin")) | |
3695 | #t))))) | |
3696 | (synopsis "Dense and sparse-direct linear algebra and optimization") | |
3697 | (description "Elemental is a modern C++ library for distributed-memory | |
3698 | dense and sparse-direct linear algebra, conic optimization, and lattice | |
3699 | reduction.") | |
3700 | (license license:bsd-2))) | |
5b05dce7 JN |
3701 | |
3702 | (define-public mcrl2 | |
3703 | (package | |
3704 | (name "mcrl2") | |
3705 | (version "201707.1.15162") | |
3706 | (source (origin | |
3707 | (method url-fetch) | |
3708 | (uri (string-append "http://www.mcrl2.org/download/devel/mcrl2-" | |
3709 | version | |
3710 | ".tar.gz")) | |
3711 | (sha256 | |
3712 | (base32 | |
3713 | "1ziww2fchsklm25hl9p2mngssxfh9w07nc114cncqaxfibqp2p8f")))) | |
3714 | (native-inputs | |
3715 | `(("subversion" ,subversion))) | |
3716 | (inputs | |
3717 | `(("boost" ,boost) | |
3718 | ("glu" ,glu) | |
3719 | ("mesa" ,mesa) | |
3720 | ("qt" ,qt))) | |
3721 | (build-system cmake-build-system) | |
ed0c5d3c | 3722 | (synopsis "Toolset for the mCRL2 formal specification language") |
5b05dce7 | 3723 | (description |
ed0c5d3c TGR |
3724 | "@dfn{mCRL2} (micro Common Representation Language 2) is a formal |
3725 | specification language for describing concurrent discrete event systems. Its | |
3726 | toolset supports analysis and automatic verification, linearisation, simulation, | |
3727 | state-space exploration and generation, and tools to optimise and analyse | |
5b05dce7 JN |
3728 | specifications. Also, state spaces can be manipulated, visualised and |
3729 | analysed.") | |
3730 | (home-page "http://mcrl2.org") | |
3731 | (license license:boost1.0))) |