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).
This commit is contained in:
parent
8a17536757
commit
f89eac32a7
33
pkgs/development/libraries/blitz/blitz-gcc47.patch
Normal file
33
pkgs/development/libraries/blitz/blitz-gcc47.patch
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
diff -ur blitz-0.10/blitz/bzdebug.h blitz-0.10.new/blitz/bzdebug.h
|
||||||
|
--- blitz-0.10/blitz/bzdebug.h 2012-05-11 22:11:13.000000000 +0200
|
||||||
|
+++ blitz-0.10.new/blitz/bzdebug.h 2012-06-28 15:42:38.060656045 +0200
|
||||||
|
@@ -117,15 +117,15 @@
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
- #define BZASSERT(X) checkAssert(X, __FILE__, __LINE__)
|
||||||
|
- #define BZPRECONDITION(X) checkAssert(X, __FILE__, __LINE__)
|
||||||
|
- #define BZPOSTCONDITION(X) checkAssert(X, __FILE__, __LINE__)
|
||||||
|
- #define BZSTATECHECK(X,Y) checkAssert(X == Y, __FILE__, __LINE__)
|
||||||
|
+ #define BZASSERT(X) blitz::checkAssert(X, __FILE__, __LINE__)
|
||||||
|
+ #define BZPRECONDITION(X) blitz::checkAssert(X, __FILE__, __LINE__)
|
||||||
|
+ #define BZPOSTCONDITION(X) blitz::checkAssert(X, __FILE__, __LINE__)
|
||||||
|
+ #define BZSTATECHECK(X,Y) blitz::checkAssert(X == Y, __FILE__, __LINE__)
|
||||||
|
#define BZPRECHECK(X,Y) \
|
||||||
|
{ \
|
||||||
|
if ((assertFailMode == false) && (!(X))) \
|
||||||
|
BZ_STD_SCOPE(cerr) << Y << BZ_STD_SCOPE(endl); \
|
||||||
|
- checkAssert(X, __FILE__, __LINE__); \
|
||||||
|
+ blitz::checkAssert(X, __FILE__, __LINE__); \
|
||||||
|
}
|
||||||
|
|
||||||
|
#define BZ_DEBUG_MESSAGE(X) \
|
||||||
|
@@ -138,7 +138,7 @@
|
||||||
|
}
|
||||||
|
|
||||||
|
#define BZ_DEBUG_PARAM(X) X
|
||||||
|
- #define BZ_PRE_FAIL checkAssert(0)
|
||||||
|
+ #define BZ_PRE_FAIL blitz::checkAssert(0)
|
||||||
|
#define BZ_ASM_DEBUG_MARKER
|
||||||
|
|
||||||
|
#elif defined(BZ_DEBUG)
|
@ -0,0 +1,13 @@
|
|||||||
|
diff --git a/testsuite/stencil-et.cpp b/testsuite/stencil-et.cpp
|
||||||
|
index b23e979..fe6b5ed 100644
|
||||||
|
--- a/testsuite/stencil-et.cpp
|
||||||
|
+++ b/testsuite/stencil-et.cpp
|
||||||
|
@@ -44,7 +44,7 @@ void test_expr(const T1& d1, const T2& d2)
|
||||||
|
BZTEST(all(d1==d2));
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
-#define test_expr(d1,d2) BZTEST(all((d1)==(d2)));
|
||||||
|
+#define test_expr(d1,d2) BZTEST(all((d1)-(d2)<=1e-7));
|
||||||
|
|
||||||
|
// Test two vector expressions for equality
|
||||||
|
template<typename T1, typename T2>
|
80
pkgs/development/libraries/blitz/default.nix
Normal file
80
pkgs/development/libraries/blitz/default.nix
Normal file
@ -0,0 +1,80 @@
|
|||||||
|
{ stdenv, fetchurl, pkgconfig, gfortran, texinfo
|
||||||
|
|
||||||
|
# Select SIMD alignment width (in bytes) for vectorization.
|
||||||
|
, simdWidth ? 1
|
||||||
|
|
||||||
|
# Pad arrays to simdWidth by default?
|
||||||
|
# Note: Only useful if simdWidth > 1
|
||||||
|
, enablePadding ? false
|
||||||
|
|
||||||
|
# Activate serialization through Boost.Serialize?
|
||||||
|
, enableSerialization ? true, boost ? null
|
||||||
|
|
||||||
|
# Activate test-suite?
|
||||||
|
# WARNING: Some of the tests require up to 1700MB of memory to compile.
|
||||||
|
, doCheck ? true
|
||||||
|
|
||||||
|
}:
|
||||||
|
|
||||||
|
assert enableSerialization -> boost != null;
|
||||||
|
|
||||||
|
let
|
||||||
|
inherit (stdenv.lib) optional optionals optionalString;
|
||||||
|
in
|
||||||
|
|
||||||
|
stdenv.mkDerivation rec {
|
||||||
|
name = "blitz++-0.10";
|
||||||
|
src = fetchurl {
|
||||||
|
url = mirror://sourceforge/blitz/blitz-0.10.tar.gz;
|
||||||
|
sha256 = "153g9sncir6ip9l7ssl6bhc4qzh0qr3lx2d15qm68hqxj7kg0kl0";
|
||||||
|
};
|
||||||
|
|
||||||
|
patches = [ ./blitz-gcc47.patch ./blitz-testsuite-stencil-et.patch ];
|
||||||
|
|
||||||
|
buildInputs = [ pkgconfig gfortran texinfo ]
|
||||||
|
++ optional (boost != null) boost
|
||||||
|
;
|
||||||
|
|
||||||
|
configureFlags =
|
||||||
|
[ "--enable-shared"
|
||||||
|
"--disable-static"
|
||||||
|
"--enable-fortran"
|
||||||
|
"--enable-optimize"
|
||||||
|
"--with-pic=yes"
|
||||||
|
"--enable-html-docs"
|
||||||
|
"--disable-doxygen"
|
||||||
|
"--disable-dot"
|
||||||
|
"--disable-latex-docs"
|
||||||
|
"--enable-simd-width=${toString simdWidth}"
|
||||||
|
]
|
||||||
|
++ optional enablePadding "--enable-array-length-padding"
|
||||||
|
++ optional enableSerialization "--enable-serialization"
|
||||||
|
++ optionals (boost != null) [ "--with-boost=${boost.dev}"
|
||||||
|
"--with-boost-libdir=${boost.lib}/lib" ]
|
||||||
|
++ optional stdenv.is64bit "--enable-64bit"
|
||||||
|
;
|
||||||
|
|
||||||
|
enableParallelBuilding = true;
|
||||||
|
|
||||||
|
buildFlags = "lib info pdf html";
|
||||||
|
installTargets = [ "install" "install-info" "install-pdf" "install-html" ];
|
||||||
|
|
||||||
|
inherit doCheck;
|
||||||
|
checkTarget = "check-testsuite check-examples";
|
||||||
|
|
||||||
|
meta = {
|
||||||
|
description = "Fast multi-dimensional array library for C++";
|
||||||
|
homepage = http://sourceforge.net/projects/blitz/;
|
||||||
|
license = stdenv.lib.licenses.lgpl3;
|
||||||
|
platforms = stdenv.lib.platforms.linux ++ stdenv.lib.platforms.darwin;
|
||||||
|
maintainers = [ stdenv.lib.maintainers.aherrmann ];
|
||||||
|
|
||||||
|
longDescription = ''
|
||||||
|
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).
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
@ -624,6 +624,8 @@ let
|
|||||||
|
|
||||||
blink = callPackage ../applications/networking/instant-messengers/blink { };
|
blink = callPackage ../applications/networking/instant-messengers/blink { };
|
||||||
|
|
||||||
|
blitz = callPackage ../development/libraries/blitz { };
|
||||||
|
|
||||||
blockdiag = pythonPackages.blockdiag;
|
blockdiag = pythonPackages.blockdiag;
|
||||||
|
|
||||||
bmon = callPackage ../tools/misc/bmon { };
|
bmon = callPackage ../tools/misc/bmon { };
|
||||||
|
Loading…
x
Reference in New Issue
Block a user