nixpkgs/pkgs/development/libraries/blitz/default.nix

79 lines
2.2 KiB
Nix
Raw Normal View History

2021-11-14 04:25:08 +00:00
{ stdenv
, lib
, fetchFromGitHub
, pkg-config
, gfortran
, texinfo
, python
, boost
# Select SIMD alignment width (in bytes) for vectorization.
2019-08-04 02:53:09 +00:00
, simdWidth ? 1
2021-11-14 04:25:08 +00:00
# Pad arrays to simdWidth by default?
# Note: Only useful if simdWidth > 1
2019-08-04 02:53:09 +00:00
, enablePadding ? false
2021-11-14 04:25:08 +00:00
# Activate serialization through Boost.Serialize?
2019-08-04 02:53:09 +00:00
, enableSerialization ? true
2021-11-14 04:25:08 +00:00
# Activate test-suite?
# WARNING: Some of the tests require up to 1700MB of memory to compile.
2019-08-04 02:53:09 +00:00
, doCheck ? true
}:
let
inherit (lib) optional optionals;
in
stdenv.mkDerivation rec {
pname = "blitz++";
version = "1.0.1";
src = fetchFromGitHub {
owner = "blitzpp";
repo = "blitz";
rev = "1.0.1";
sha256 = "0nq84vwvvbq7m0my6h835ijfw53bxdp42qjc6kjhk436888qy9rh";
};
nativeBuildInputs = [ pkg-config python texinfo ];
buildInputs = [ gfortran texinfo boost ];
configureFlags =
2021-11-14 04:25:08 +00:00
[
"--enable-shared"
2019-08-04 02:53:09 +00:00
"--disable-static"
"--enable-fortran"
"--enable-optimize"
"--with-pic=yes"
"--enable-html-docs"
"--disable-doxygen"
"--disable-dot"
"--disable-latex-docs"
"--enable-simd-width=${toString simdWidth}"
"--with-boost=${boost.dev}"
"--with-boost-libdir=${boost.out}/lib"
] ++ optional enablePadding "--enable-array-length-padding"
++ optional enableSerialization "--enable-serialization"
++ optional stdenv.is64bit "--enable-64bit";
2021-11-14 04:25:08 +00:00
# skip broken library name detection
ax_boost_user_serialization_lib = lib.optionalString stdenv.isDarwin "boost_serialization";
2019-08-04 02:53:09 +00:00
enableParallelBuilding = true;
inherit doCheck;
checkTarget = "check-testsuite check-examples";
meta = with lib; {
description = "Fast multi-dimensional array library for C++";
homepage = "https://sourceforge.net/projects/blitz/";
2019-08-04 02:53:09 +00:00
license = licenses.lgpl3;
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).
'';
};
}