@@ -0,0 +1,80 @@
1+{ stdenv, fetchurl, pkgconfig, gfortran, texinfo
2+
3+# Select SIMD alignment width (in bytes) for vectorization.
4+, simdWidth ? 1
5+
6+# Pad arrays to simdWidth by default?
7+# Note: Only useful if simdWidth > 1
8+, enablePadding ? false
9+
10+# Activate serialization through Boost.Serialize?
11+, enableSerialization ? true, boost ? null
12+
13+# Activate test-suite?
14+# WARNING: Some of the tests require up to 1700MB of memory to compile.
15+, doCheck ? true
16+
17+}:
18+
19+assert enableSerialization -> boost != null;
20+
21+let
22+ inherit (stdenv.lib) optional optionals optionalString;
23+in
24+
25+stdenv.mkDerivation rec {
26+ name = "blitz++-0.10";
27+ src = fetchurl {
28+ url = mirror://sourceforge/blitz/blitz-0.10.tar.gz;
29+ sha256 = "153g9sncir6ip9l7ssl6bhc4qzh0qr3lx2d15qm68hqxj7kg0kl0";
30+ };
31+
32+ patches = [ ./blitz-gcc47.patch ./blitz-testsuite-stencil-et.patch ];
33+
34+ buildInputs = [ pkgconfig gfortran texinfo ]
35+ ++ optional (boost != null) boost
36+ ;
37+
38+ configureFlags =
39+ [ "--enable-shared"
40+ "--disable-static"
41+ "--enable-fortran"
42+ "--enable-optimize"
43+ "--with-pic=yes"
44+ "--enable-html-docs"
45+ "--disable-doxygen"
46+ "--disable-dot"
47+ "--disable-latex-docs"
48+ "--enable-simd-width=${toString simdWidth}"
49+ ]
50+ ++ optional enablePadding "--enable-array-length-padding"
51+ ++ optional enableSerialization "--enable-serialization"
52+ ++ optionals (boost != null) [ "--with-boost=${boost.dev}"
53+ "--with-boost-libdir=${boost.lib}/lib" ]
54+ ++ optional stdenv.is64bit "--enable-64bit"
55+ ;
56+
57+ enableParallelBuilding = true;
58+
59+ buildFlags = "lib info pdf html";
60+ installTargets = [ "install" "install-info" "install-pdf" "install-html" ];
61+
62+ inherit doCheck;
63+ checkTarget = "check-testsuite check-examples";
64+
65+ meta = {
66+ description = "Fast multi-dimensional array library for C++";
67+ homepage = http://sourceforge.net/projects/blitz/;
68+ license = stdenv.lib.licenses.lgpl3;
69+ platforms = stdenv.lib.platforms.linux ++ stdenv.lib.platforms.darwin;
70+ maintainers = [ stdenv.lib.maintainers.aherrmann ];
71+
72+ longDescription = ''
73+ Blitz++ is a C++ class library for scientific computing which provides
74+ performance on par with Fortran 77/90. It uses template techniques to
75+ achieve high performance. Blitz++ provides dense arrays and vectors,
76+ random number generators, and small vectors (useful for representing
77+ multicomponent or vector fields).
78+ '';
79+ };
80+}