Hi Chris,
> So I notice that on some of my netCDF installations from RPMs if you
> link against libnetcdf_c++ that it will automatically link to libnetcdf
> also. Would it be possible to get the same behavior from the hdf5
> libraries when/if netCDF is being built against hdf5?
>
> My case for this is that software we distribute which depends upon
> netCDF but not HDF5 does not know whether the target system has the HDF5
> build of netCDF or not (sorry I am not sophisticated enough to use
> autoconfig at this time). So the user will have to tweak Makefile /
> SConscript files to either add or delete the -lhdf5.
>
> e.g. ncplot does not require hdf5, but when UWyo downloads the source
> and builds they may have to tweak the Makefile for -lhdf5 depending on
> which netCDF version they have.
>
> So, is what I am asking for possible? Am I making sense?
Dennis pointed out that if the target system was built from the latest
source with --enable-shared, then the shared netCDF library is supposed
to link to the HDF5 libraries, if needed.
However, using the nc-config utility may work for what you have in mind,
even if the target system has a static build of netCDF libraries.
Compile and link the Fortran application with something like:
$(FC) `nc-config --fflags` myapp.f90 `nc-config --flibs`
where the particular options to this use of nc-config are
--fflags for the Fortran compiler options used
--flibs for the libraries needed to link against
--Russ