2021-12-06 16:07:01 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, fetchFromGitHub
|
2022-11-27 09:42:12 +00:00
|
|
|
, fetchpatch
|
|
|
|
, cmake
|
2021-12-06 16:07:01 +00:00
|
|
|
, pkg-config
|
|
|
|
, gfortran
|
|
|
|
, texinfo
|
2022-11-27 09:42:12 +00:00
|
|
|
, python3
|
2021-12-06 16:07:01 +00:00
|
|
|
, boost
|
|
|
|
# Select SIMD alignment width (in bytes) for vectorization.
|
2021-09-18 10:52:07 +00:00
|
|
|
, simdWidth ? 1
|
2021-12-06 16:07:01 +00:00
|
|
|
# Pad arrays to simdWidth by default?
|
|
|
|
# Note: Only useful if simdWidth > 1
|
2021-09-18 10:52:07 +00:00
|
|
|
, enablePadding ? false
|
2021-12-06 16:07:01 +00:00
|
|
|
# Activate serialization through Boost.Serialize?
|
2021-09-18 10:52:07 +00:00
|
|
|
, enableSerialization ? true
|
2021-12-06 16:07:01 +00:00
|
|
|
# Activate test-suite?
|
|
|
|
# WARNING: Some of the tests require up to 1700MB of memory to compile.
|
2021-09-18 10:52:07 +00:00
|
|
|
, doCheck ? true
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
inherit (lib) optional optionals;
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "blitz++";
|
2022-11-27 09:42:12 +00:00
|
|
|
version = "1.0.2";
|
2021-09-18 10:52:07 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "blitzpp";
|
|
|
|
repo = "blitz";
|
2022-11-27 09:42:12 +00:00
|
|
|
rev = version;
|
|
|
|
hash = "sha256-wZDg+4lCd9iHvxuQQE/qs58NorkxZ0+mf+8PKQ57CDE=";
|
2021-09-18 10:52:07 +00:00
|
|
|
};
|
|
|
|
|
2022-11-27 09:42:12 +00:00
|
|
|
patches = [
|
|
|
|
# https://github.com/blitzpp/blitz/pull/180
|
|
|
|
(fetchpatch {
|
|
|
|
name = "use-cmake-install-full-dir.patch";
|
|
|
|
url = "https://github.com/blitzpp/blitz/commit/020f1d768c7fa3265cec244dc28f3dc8572719c5.patch";
|
|
|
|
hash = "sha256-8hYFNyWrejjIWPN/HzIOphD4Aq6Soe0FFUBmwV4tpWQ=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
pkg-config
|
|
|
|
python3
|
|
|
|
texinfo
|
|
|
|
];
|
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
buildInputs = [ gfortran texinfo boost ];
|
|
|
|
|
2022-11-27 09:42:12 +00:00
|
|
|
cmakeFlags = optional enablePadding "-DARRAY_LENGTH_PADDING=ON"
|
|
|
|
++ optional enableSerialization "-DENABLE_SERIALISATION=ON"
|
|
|
|
++ optional stdenv.is64bit "-DBZ_FULLY64BIT=ON";
|
|
|
|
# FIXME ++ optional doCheck "-DBUILD_TESTING=ON";
|
2021-09-18 10:52:07 +00:00
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
# skip broken library name detection
|
|
|
|
ax_boost_user_serialization_lib = lib.optionalString stdenv.isDarwin "boost_serialization";
|
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
inherit doCheck;
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Fast multi-dimensional array library for C++";
|
2021-12-06 16:07:01 +00:00
|
|
|
homepage = "https://sourceforge.net/projects/blitz/";
|
2022-11-27 09:42:12 +00:00
|
|
|
license = with licenses; [ artistic2 /* or */ bsd3 /* or */ lgpl3Plus ];
|
2021-09-18 10:52:07 +00:00
|
|
|
platforms = platforms.unix;
|
|
|
|
maintainers = with maintainers; [ ToxicFrog ];
|
|
|
|
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).
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
}
|