git.iko.soy/typeable/nixpkgs
on master help sign in
blitz: New package, version 0.10 (close #5062)

Fast multi-dimensional array library for C++ Blitz++ is a C++ class library for scientific computing which provides performance on par with Fortran 77/90. It uses template techniques to achieve high performance. Blitz++ provides dense arrays and vectors, random number generators, and small vectors (useful for representing multicomponent or vector fields).

commitf89eac32a7a2099d16a1a82709494b5d3f5e3694 authorAndreas Herrmann <andreash87@gmx.ch> dateThu 20 Nov 2014, 11:52 (12 years ago) parent8a17536
4 files changed+128
pkgs/development/libraries/blitz/blitz-gcc47.patch+33 pkgs/development/libraries/blitz/blitz-testsuite-stencil-et.patch+13 pkgs/development/libraries/blitz/default.nix+80 pkgs/top-level/all-packages.nix+2
pkgs/development/libraries/blitz/blitz-gcc47.patchnew file+33
@@ -0,0 +1,33 @@
1+diff -ur blitz-0.10/blitz/bzdebug.h blitz-0.10.new/blitz/bzdebug.h
2+--- blitz-0.10/blitz/bzdebug.h 2012-05-11 22:11:13.000000000 +0200
3++++ blitz-0.10.new/blitz/bzdebug.h 2012-06-28 15:42:38.060656045 +0200
4+@@ -117,15 +117,15 @@
5+ }
6+ }
7+
8+- #define BZASSERT(X) checkAssert(X, __FILE__, __LINE__)
9+- #define BZPRECONDITION(X) checkAssert(X, __FILE__, __LINE__)
10+- #define BZPOSTCONDITION(X) checkAssert(X, __FILE__, __LINE__)
11+- #define BZSTATECHECK(X,Y) checkAssert(X == Y, __FILE__, __LINE__)
12++ #define BZASSERT(X) blitz::checkAssert(X, __FILE__, __LINE__)
13++ #define BZPRECONDITION(X) blitz::checkAssert(X, __FILE__, __LINE__)
14++ #define BZPOSTCONDITION(X) blitz::checkAssert(X, __FILE__, __LINE__)
15++ #define BZSTATECHECK(X,Y) blitz::checkAssert(X == Y, __FILE__, __LINE__)
16+ #define BZPRECHECK(X,Y) \
17+ { \
18+ if ((assertFailMode == false) && (!(X))) \
19+ BZ_STD_SCOPE(cerr) << Y << BZ_STD_SCOPE(endl); \
20+- checkAssert(X, __FILE__, __LINE__); \
21++ blitz::checkAssert(X, __FILE__, __LINE__); \
22+ }
23+
24+ #define BZ_DEBUG_MESSAGE(X) \
25+@@ -138,7 +138,7 @@
26+ }
27+
28+ #define BZ_DEBUG_PARAM(X) X
29+- #define BZ_PRE_FAIL checkAssert(0)
30++ #define BZ_PRE_FAIL blitz::checkAssert(0)
31+ #define BZ_ASM_DEBUG_MARKER
32+
33+ #elif defined(BZ_DEBUG)
pkgs/development/libraries/blitz/blitz-testsuite-stencil-et.patchnew file+13
@@ -0,0 +1,13 @@
1+diff --git a/testsuite/stencil-et.cpp b/testsuite/stencil-et.cpp
2+index b23e979..fe6b5ed 100644
3+--- a/testsuite/stencil-et.cpp
4++++ b/testsuite/stencil-et.cpp
5+@@ -44,7 +44,7 @@ void test_expr(const T1& d1, const T2& d2)
6+ BZTEST(all(d1==d2));
7+ }
8+ */
9+-#define test_expr(d1,d2) BZTEST(all((d1)==(d2)));
10++#define test_expr(d1,d2) BZTEST(all((d1)-(d2)<=1e-7));
11+
12+ // Test two vector expressions for equality
13+ template<typename T1, typename T2>
pkgs/development/libraries/blitz/default.nixnew file+80
@@ -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+}
pkgs/top-level/all-packages.nix+2
@@ -624,6 +624,8 @@ let
624624
625625 blink = callPackage ../applications/networking/instant-messengers/blink { };
626626
627+ blitz = callPackage ../development/libraries/blitz { };
628+
627629 blockdiag = pythonPackages.blockdiag;
628630
629631 bmon = callPackage ../tools/misc/bmon { };