Working on the libCF project I just installed the netCDF libraries from Fedora's yum repositories. It was super easy!
yum install netcdf-devel
After this, I was able to build and run the following program:
#include <netcdf.h>
int
main()
{
int ncid;
if (nc_create("tmp.nc", NC_NETCDF4, &ncid))
return 1;
if (nc_close(ncid))
return 2;
return 0;
}
Which I called tmp.c and compiled and ran with the following command:
gcc tmp.c -lnetcdf && ./a.out
It worked! I got a beautiful empty netCDF-4/HDF5 file called tmp.nc.
It's a shame that this is version 4.1.1. We've made lots of changes since then to improve performance, especially with large files, or files containing large numbers of objects. But 4.1.1 will work for my libcf testing machine, and it was very easy to install!