git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #31781 from robertodr/hdf5-fortran-2003

Update HDF5 and add option to compile Fortran2003 interface

commit88eea6947fd4e7e2b92d4e778a6ab3ed66761ae6 authorFrederik Rietdijk <freddyrietdijk@fridh.nl> dateSat 25 Nov 2017, 10:37 (9 years ago) parent6d9ad27eb43cc5
3 files changed+87−8
pkgs/tools/misc/hdf5/1_8.nix+76 pkgs/tools/misc/hdf5/default.nix+5−8 pkgs/top-level/all-packages.nix+6
pkgs/tools/misc/hdf5/1_8.nixnew file+76
@@ -0,0 +1,76 @@
1+{ stdenv
2+, fetchurl
3+, gcc
4+, removeReferencesTo
5+, cpp ? false
6+, gfortran ? null
7+, fortran2003 ? false
8+, zlib ? null
9+, szip ? null
10+, mpi ? null
11+, enableShared ? true
12+}:
13+
14+# cpp and mpi options are mutually exclusive
15+# (--enable-unsupported could be used to force the build)
16+assert !cpp || mpi == null;
17+
18+# Need a Fortran compiler for Fortran2003 bindings
19+assert fortran2003 -> gfortran != null;
20+
21+# No point splitting version 1.8.18 into multiple outputs.
22+# The library /lib/libhdf5.so has a reference to gcc-wrapper
23+
24+let inherit (stdenv.lib) optional optionals; in
25+
26+stdenv.mkDerivation rec {
27+ version = "1.8.19";
28+ name = "hdf5-${version}";
29+ src = fetchurl {
30+ url = "https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.8/${name}/src/${name}.tar.bz2";
31+ sha256 = "0f3jfbqpaaq21ighi40qzs52nb52kc2d2yjk541rjmsx20b3ih2r" ;
32+ };
33+
34+ passthru = {
35+ mpiSupport = (mpi != null);
36+ inherit mpi;
37+ };
38+
39+ nativeBuildInputs = [ removeReferencesTo ];
40+
41+ buildInputs = []
42+ ++ optional (gfortran != null) gfortran
43+ ++ optional (szip != null) szip;
44+
45+ propagatedBuildInputs = []
46+ ++ optional (zlib != null) zlib
47+ ++ optional (mpi != null) mpi;
48+
49+ configureFlags = []
50+ ++ optional cpp "--enable-cxx"
51+ ++ optional (gfortran != null) "--enable-fortran"
52+ ++ optional fortran2003 "--enable-fortran2003"
53+ ++ optional (szip != null) "--with-szlib=${szip}"
54+ ++ optionals (mpi != null) ["--enable-parallel" "CC=${mpi}/bin/mpicc"]
55+ ++ optional enableShared "--enable-shared";
56+
57+ patches = [./bin-mv.patch];
58+
59+ postInstall = ''
60+ find "$out" -type f -exec remove-references-to -t ${stdenv.cc} '{}' +
61+ '';
62+
63+ meta = {
64+ description = "Data model, library, and file format for storing and managing data";
65+ longDescription = ''
66+ HDF5 supports an unlimited variety of datatypes, and is designed for flexible and efficient
67+ I/O and for high volume and complex data. HDF5 is portable and is extensible, allowing
68+ applications to evolve in their use of HDF5. The HDF5 Technology suite includes tools and
69+ applications for managing, manipulating, viewing, and analyzing data in the HDF5 format.
70+ '';
71+ license = stdenv.lib.licenses.free; # BSD-like
72+ homepage = https://www.hdfgroup.org/HDF5/;
73+ platforms = stdenv.lib.platforms.unix;
74+ broken = (gfortran != null) && stdenv.isDarwin;
75+ };
76+}
pkgs/tools/misc/hdf5/default.nix+5−8
@@ -14,17 +14,14 @@
1414# (--enable-unsupported could be used to force the build)
1515assert !cpp || mpi == null;
1616
17−# No point splitting version 1.8.18 into multiple outputs.
18−# The library /lib/libhdf5.so has a reference to gcc-wrapper
19−
2017let inherit (stdenv.lib) optional optionals; in
2118
2219stdenv.mkDerivation rec {
23− version = "1.8.18";
20+ version = "1.10.1";
2421 name = "hdf5-${version}";
2522 src = fetchurl {
26− url = "https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.8/${name}/src/${name}.tar.bz2";
27− sha256 = "13542vrnl1p35n8vbq0wzk40vddmm33q5nh04j98c7r1yjnxxih1";
23+ url = "https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.10/${name}/src/${name}.tar.bz2";
24+ sha256 = "1wpbi15za7kbsvih88kfcxblw412pjndl16x88dgnqr47piy2p4w";
2825 };
2926
3027 passthru = {
@@ -59,8 +56,8 @@ stdenv.mkDerivation rec {
5956 description = "Data model, library, and file format for storing and managing data";
6057 longDescription = ''
6158 HDF5 supports an unlimited variety of datatypes, and is designed for flexible and efficient
62− I/O and for high volume and complex data. HDF5 is portable and is extensible, allowing
63− applications to evolve in their use of HDF5. The HDF5 Technology suite includes tools and
59+ I/O and for high volume and complex data. HDF5 is portable and is extensible, allowing
60+ applications to evolve in their use of HDF5. The HDF5 Technology suite includes tools and
6461 applications for managing, manipulating, viewing, and analyzing data in the HDF5 format.
6562 '';
6663 license = stdenv.lib.licenses.free; # BSD-like
pkgs/top-level/all-packages.nix+6
@@ -2590,6 +2590,12 @@ with pkgs;
25902590 mpi = null;
25912591 };
25922592
2593+ hdf5_1_8 = callPackage ../tools/misc/hdf5/1_8.nix {
2594+ gfortran = null;
2595+ szip = null;
2596+ mpi = null;
2597+ };
2598+
25932599 hdf5-mpi = appendToName "mpi" (hdf5.override {
25942600 szip = null;
25952601 mpi = pkgs.openmpi;