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