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
19assert enableSerialization -> boost != null;
20
21let
22 inherit (stdenv.lib) optional optionals optionalString;
23in
24
25stdenv.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.lib ];
36
37 configureFlags =
38 [ "--enable-shared"
39 "--disable-static"
40 "--enable-fortran"
41 "--enable-optimize"
42 "--with-pic=yes"
43 "--enable-html-docs"
44 "--disable-doxygen"
45 "--disable-dot"
46 "--disable-latex-docs"
47 "--enable-simd-width=${toString simdWidth}"
48 ]
49 ++ optional enablePadding "--enable-array-length-padding"
50 ++ optional enableSerialization "--enable-serialization"
51 ++ optionals (boost != null) [ "--with-boost=${boost.dev}"
52 "--with-boost-libdir=${boost.lib}/lib" ]
53 ++ optional stdenv.is64bit "--enable-64bit"
54 ;
55
56 enableParallelBuilding = true;
57
58 buildFlags = "lib info pdf html";
59 installTargets = [ "install" "install-info" "install-pdf" "install-html" ];
60
61 inherit doCheck;
62 checkTarget = "check-testsuite check-examples";
63
64 meta = {
65 description = "Fast multi-dimensional array library for C++";
66 homepage = http://sourceforge.net/projects/blitz/;
67 license = stdenv.lib.licenses.lgpl3;
68 platforms = stdenv.lib.platforms.linux ++ stdenv.lib.platforms.darwin;
69 maintainers = [ stdenv.lib.maintainers.aherrmann ];
70
71 longDescription = ''
72 Blitz++ is a C++ class library for scientific computing which provides
73 performance on par with Fortran 77/90. It uses template techniques to
74 achieve high performance. Blitz++ provides dense arrays and vectors,
75 random number generators, and small vectors (useful for representing
76 multicomponent or vector fields).
77 '';
78 };
79}