2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv
|
2020-04-24 23:36:52 +00:00
|
|
|
, fetchurl
|
|
|
|
, removeReferencesTo
|
|
|
|
, cpp ? false
|
|
|
|
, gfortran ? null
|
|
|
|
, zlib ? null
|
|
|
|
, szip ? null
|
2021-02-05 17:12:51 +00:00
|
|
|
, mpiSupport ? false
|
|
|
|
, mpi
|
2021-01-05 17:05:55 +00:00
|
|
|
, enableShared ? !stdenv.hostPlatform.isStatic
|
2021-03-09 03:18:52 +00:00
|
|
|
, javaSupport ? false
|
|
|
|
, jdk
|
2021-04-12 18:23:04 +00:00
|
|
|
, usev110Api ? false
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
# cpp and mpi options are mutually exclusive
|
|
|
|
# (--enable-unsupported could be used to force the build)
|
2021-02-05 17:12:51 +00:00
|
|
|
assert !cpp || !mpiSupport;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
let inherit (lib) optional optionals; in
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2021-04-12 18:23:04 +00:00
|
|
|
version = "1.12.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "hdf5";
|
|
|
|
src = fetchurl {
|
2021-04-12 18:23:04 +00:00
|
|
|
url = "https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-${lib.versions.majorMinor version}/${pname}-${version}/src/${pname}-${version}.tar.bz2";
|
|
|
|
sha256 = "0qazfslkqbmzg495jafpvqp0khws3jkxa0z7rph9qvhacil6544p";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
passthru = {
|
2021-02-05 17:12:51 +00:00
|
|
|
inherit mpiSupport;
|
2020-04-24 23:36:52 +00:00
|
|
|
inherit mpi;
|
|
|
|
};
|
|
|
|
|
|
|
|
outputs = [ "out" "dev" ];
|
|
|
|
|
|
|
|
nativeBuildInputs = [ removeReferencesTo ];
|
|
|
|
|
|
|
|
buildInputs = []
|
|
|
|
++ optional (gfortran != null) gfortran
|
2021-03-09 03:18:52 +00:00
|
|
|
++ optional (szip != null) szip
|
|
|
|
++ optional javaSupport jdk;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
propagatedBuildInputs = []
|
|
|
|
++ optional (zlib != null) zlib
|
2021-02-05 17:12:51 +00:00
|
|
|
++ optional mpiSupport mpi;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
configureFlags = []
|
|
|
|
++ optional cpp "--enable-cxx"
|
|
|
|
++ optional (gfortran != null) "--enable-fortran"
|
|
|
|
++ optional (szip != null) "--with-szlib=${szip}"
|
2021-02-05 17:12:51 +00:00
|
|
|
++ optionals mpiSupport ["--enable-parallel" "CC=${mpi}/bin/mpicc"]
|
2021-03-09 03:18:52 +00:00
|
|
|
++ optional enableShared "--enable-shared"
|
2021-04-12 18:23:04 +00:00
|
|
|
++ optional javaSupport "--enable-java"
|
|
|
|
++ optional usev110Api "--with-default-api-version=v110";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
patches = [
|
|
|
|
./bin-mv.patch
|
|
|
|
];
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
find "$out" -type f -exec remove-references-to -t ${stdenv.cc} '{}' +
|
|
|
|
moveToOutput 'bin/h5cc' "''${!outputDev}"
|
|
|
|
moveToOutput 'bin/h5c++' "''${!outputDev}"
|
|
|
|
moveToOutput 'bin/h5fc' "''${!outputDev}"
|
|
|
|
moveToOutput 'bin/h5pcc' "''${!outputDev}"
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Data model, library, and file format for storing and managing data";
|
|
|
|
longDescription = ''
|
|
|
|
HDF5 supports an unlimited variety of datatypes, and is designed for flexible and efficient
|
|
|
|
I/O and for high volume and complex data. HDF5 is portable and is extensible, allowing
|
|
|
|
applications to evolve in their use of HDF5. The HDF5 Technology suite includes tools and
|
|
|
|
applications for managing, manipulating, viewing, and analyzing data in the HDF5 format.
|
|
|
|
'';
|
2021-01-15 22:18:51 +00:00
|
|
|
license = lib.licenses.bsd3; # Lawrence Berkeley National Labs BSD 3-Clause variant
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://www.hdfgroup.org/HDF5/";
|
2021-01-15 22:18:51 +00:00
|
|
|
platforms = lib.platforms.unix;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|