2021-01-15 10:19:50 +01:00
|
|
|
{ lib, stdenv
|
2010-08-02 10:58:53 +02:00
|
|
|
, fetchurl
|
2017-09-28 09:09:16 +02:00
|
|
|
, removeReferencesTo
|
2015-10-19 14:57:24 +02:00
|
|
|
, cpp ? false
|
|
|
|
, gfortran ? null
|
2014-06-15 11:12:03 +02:00
|
|
|
, zlib ? null
|
2014-06-15 13:26:44 +02:00
|
|
|
, szip ? null
|
2021-01-10 13:40:19 +01:00
|
|
|
, mpiSupport ? false
|
|
|
|
, mpi
|
2020-12-20 07:11:26 +01:00
|
|
|
, enableShared ? !stdenv.hostPlatform.isStatic
|
2021-02-16 23:24:14 +01:00
|
|
|
, javaSupport ? false
|
|
|
|
, jdk
|
2021-04-04 13:05:19 +02:00
|
|
|
, usev110Api ? false
|
2010-08-02 10:58:53 +02:00
|
|
|
}:
|
2015-11-11 15:14:28 +01:00
|
|
|
|
2015-11-20 10:59:22 +01:00
|
|
|
# cpp and mpi options are mutually exclusive
|
|
|
|
# (--enable-unsupported could be used to force the build)
|
2021-01-10 13:40:19 +01:00
|
|
|
assert !cpp || !mpiSupport;
|
2015-11-20 10:59:22 +01:00
|
|
|
|
2021-01-15 10:19:50 +01:00
|
|
|
let inherit (lib) optional optionals; in
|
2015-11-11 15:14:28 +01:00
|
|
|
|
2014-06-15 11:59:58 +02:00
|
|
|
stdenv.mkDerivation rec {
|
2021-03-25 13:03:33 +01:00
|
|
|
version = "1.12.0";
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "hdf5";
|
2010-08-02 10:58:53 +02:00
|
|
|
src = fetchurl {
|
2021-03-25 13:03:33 +01:00
|
|
|
url = "https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-${lib.versions.majorMinor version}/${pname}-${version}/src/${pname}-${version}.tar.bz2";
|
|
|
|
sha256 = "0qazfslkqbmzg495jafpvqp0khws3jkxa0z7rph9qvhacil6544p";
|
2019-02-21 14:04:05 +01:00
|
|
|
};
|
2014-06-15 11:12:03 +02:00
|
|
|
|
2014-07-01 15:55:12 +02:00
|
|
|
passthru = {
|
2021-01-10 13:40:19 +01:00
|
|
|
inherit mpiSupport;
|
2014-07-01 15:55:12 +02:00
|
|
|
inherit mpi;
|
|
|
|
};
|
|
|
|
|
2019-09-25 17:13:12 +02:00
|
|
|
outputs = [ "out" "dev" ];
|
|
|
|
|
2017-09-28 09:09:16 +02:00
|
|
|
nativeBuildInputs = [ removeReferencesTo ];
|
|
|
|
|
2014-06-15 11:12:03 +02:00
|
|
|
buildInputs = []
|
2015-11-11 15:14:28 +01:00
|
|
|
++ optional (gfortran != null) gfortran
|
2021-02-16 23:24:14 +01:00
|
|
|
++ optional (szip != null) szip
|
|
|
|
++ optional javaSupport jdk;
|
2014-06-15 13:26:44 +02:00
|
|
|
|
2014-07-01 15:55:12 +02:00
|
|
|
propagatedBuildInputs = []
|
2016-07-19 12:07:23 +02:00
|
|
|
++ optional (zlib != null) zlib
|
2021-01-10 13:40:19 +01:00
|
|
|
++ optional mpiSupport mpi;
|
2015-11-11 15:14:28 +01:00
|
|
|
|
|
|
|
configureFlags = []
|
|
|
|
++ optional cpp "--enable-cxx"
|
|
|
|
++ optional (gfortran != null) "--enable-fortran"
|
|
|
|
++ optional (szip != null) "--with-szlib=${szip}"
|
2021-01-10 13:40:19 +01:00
|
|
|
++ optionals mpiSupport ["--enable-parallel" "CC=${mpi}/bin/mpicc"]
|
2021-02-16 23:24:14 +01:00
|
|
|
++ optional enableShared "--enable-shared"
|
2021-04-04 13:05:19 +02:00
|
|
|
++ optional javaSupport "--enable-java"
|
|
|
|
++ optional usev110Api "--with-default-api-version=v110";
|
2015-11-11 15:14:28 +01:00
|
|
|
|
2019-02-21 14:04:05 +01:00
|
|
|
patches = [
|
|
|
|
./bin-mv.patch
|
|
|
|
];
|
2015-11-11 15:14:28 +01:00
|
|
|
|
2017-09-28 09:09:16 +02:00
|
|
|
postInstall = ''
|
|
|
|
find "$out" -type f -exec remove-references-to -t ${stdenv.cc} '{}' +
|
2019-09-27 12:53:14 +02:00
|
|
|
moveToOutput 'bin/h5cc' "''${!outputDev}"
|
|
|
|
moveToOutput 'bin/h5c++' "''${!outputDev}"
|
|
|
|
moveToOutput 'bin/h5fc' "''${!outputDev}"
|
|
|
|
moveToOutput 'bin/h5pcc' "''${!outputDev}"
|
2017-09-28 09:09:16 +02:00
|
|
|
'';
|
|
|
|
|
2010-08-02 10:58:53 +02:00
|
|
|
meta = {
|
2013-10-06 11:49:53 +02:00
|
|
|
description = "Data model, library, and file format for storing and managing data";
|
2010-08-02 10:58:53 +02:00
|
|
|
longDescription = ''
|
2013-10-06 11:49:53 +02:00
|
|
|
HDF5 supports an unlimited variety of datatypes, and is designed for flexible and efficient
|
2017-11-17 23:14:31 +01:00
|
|
|
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
|
2010-08-02 10:58:53 +02:00
|
|
|
applications for managing, manipulating, viewing, and analyzing data in the HDF5 format.
|
|
|
|
'';
|
2021-01-15 10:19:50 +01:00
|
|
|
license = lib.licenses.bsd3; # Lawrence Berkeley National Labs BSD 3-Clause variant
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://www.hdfgroup.org/HDF5/";
|
2021-01-15 10:19:50 +01:00
|
|
|
platforms = lib.platforms.unix;
|
2010-08-02 10:58:53 +02:00
|
|
|
};
|
|
|
|
}
|