1{ lib, stdenv
2, fetchFromGitHub
3, cmake
4, boost
5, eigen
6, hdf5
7, mpiSupport ? hdf5.mpiSupport
8, mpi ? hdf5.mpi
9}:
10
11assert mpiSupport -> mpi != null;
12
13stdenv.mkDerivation rec {
14 pname = "highfive${lib.optionalString mpiSupport "-mpi"}";
15 version = "2.7.1";
16
17 src = fetchFromGitHub {
18 owner = "BlueBrain";
19 repo = "HighFive";
20 rev = "v${version}";
21 sha256 = "sha256-apKmIB34uqkqSCtTUzrUOhcRC5a2UG6KCdhp1jnXUgQ=";
22 };
23
24 nativeBuildInputs = [ cmake ];
25
26 buildInputs = [ boost eigen hdf5 ];
27
28 passthru = {
29 inherit mpiSupport mpi;
30 };
31
32 cmakeFlags = [
33 "-DHIGHFIVE_USE_BOOST=ON"
34 "-DHIGHFIVE_USE_EIGEN=ON"
35 "-DHIGHFIVE_EXAMPLES=OFF"
36 "-DHIGHFIVE_UNIT_TESTS=OFF"
37 "-DHIGHFIVE_USE_INSTALL_DEPS=ON"
38 ]
39 ++ (lib.optionals mpiSupport [ "-DHIGHFIVE_PARALLEL_HDF5=ON" ]);
40
41 meta = with lib; {
42 description = "Header-only C++ HDF5 interface";
43 license = licenses.boost;
44 homepage = "https://bluebrain.github.io/HighFive/";
45 platforms = platforms.unix;
46 maintainers = with maintainers; [ robertodr ];
47 };
48}