1{ stdenv
2, fetchurl
3, hdf5
4, m4
5, curl # for DAP
6}:
7
8let
9 mpiSupport = hdf5.mpiSupport;
10 mpi = hdf5.mpi;
11in stdenv.mkDerivation rec {
12 name = "netcdf-4.6.0";
13
14 src = fetchurl {
15 url = "https://www.unidata.ucar.edu/downloads/netcdf/ftp/${name}.tar.gz";
16 sha256 = "099qmdjj059wkj5za13zqnz0lcziqkcvyfdf894j4n6qq4c5iw2b";
17 };
18
19 nativeBuildInputs = [ m4 ];
20 buildInputs = [ hdf5 curl mpi ];
21
22 passthru = {
23 mpiSupport = mpiSupport;
24 inherit mpi;
25 };
26
27 configureFlags = [
28 "--enable-netcdf-4"
29 "--enable-dap"
30 "--enable-shared"
31 ]
32 ++ (stdenv.lib.optionals mpiSupport [ "--enable-parallel-tests" "CC=${mpi}/bin/mpicc" ]);
33
34 meta = {
35 platforms = stdenv.lib.platforms.unix;
36 homepage = https://www.unidata.ucar.edu/software/netcdf/;
37 };
38}