This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
> That's great - thanks Ed. > Netcdf appears to be functioning correctly now. > > I know this is not strictly a netcdf question but.... > > I'm still having problems compiling WRF, and I'm sure its to do with > linking the hdf5 and netcdf4 libraries, with errors: > > L/home/rich/WRF/WRFV3/external/io_grib1 -lio_grib1 > -L/home/rich/WRF/WRFV3/external/io_grib_share -lio_grib_share > -L/home/rich/WRF/WRFV3/external/io_int -lwrfio_int > /home/rich/WRF/WRFV3/external/esmf_time_f90/libesmf_time.a > /home/rich/WRF/WRFV3/external/esmf_time_f90/libesmf_time.a > /home/rich/WRF/WRFV3/external/RSL_LITE/librsl_lite.a > /home/rich/WRF/WRFV3/frame/module_internal_header_util.o > /home/rich/WRF/WRFV3/frame/pack_utils.o > /home/rich/WRF/WRFV3/external/io_netcdf/libwrfio_nf.a > -L/usr/local/test/lib -lnetcdf -lnetcdff > /usr/local/test/lib/libnetcdf.so: undefined reference to > `H5Tget_member_type' > /usr/local/test/lib/libnetcdf.so: undefined reference to > `H5P_CLS_FILE_CREATE_g' > /usr/local/test/lib/libnetcdf.so: undefined reference to > `H5T_NATIVE_SHORT_g' > /usr/local/test/lib/libnetcdf.so: undefined reference to > `H5Pcreate' > /usr/local/test/lib/libnetcdf.so: undefined reference to > `H5Tcopy' > /usr/local/test/lib/libnetcdf.so: undefined reference to > `H5Pget_filter2' > /usr/local/test/lib/libnetcdf.so: undefined reference to > `H5Aget_space' > /usr/local/test/lib/libnetcdf.so: undefined reference to > `H5Sget_simple_extent_dims' > /usr/local/test/lib/libnetcdf.so: undefined reference to `H5Topen2' > > .... and so on... > > The LD_LIBRARY_PATH variable is set to /usr/local/test/lib, where zlib, > hdf5, netcdf4 are all installed. > > All help greatly appreciated! > Rich Howdy Rich! Looks to me like you are not linking to the HDF5 libraries. You must change your build like to something like this: cc -o myprogram myprogram.o -L/usr/local/netcdf/lib -L/usr/local/hdf5/lib -lnetcdf -lhdf5_hl -lhdf5 -lz That is, where you currently have "-lnetcdf", you need "-lnetcdf -lhdf5_hl -lhdf5 -lz" Please let me know if this doesn't work for you. I would also be very interested to hear about your netCDF-4 experiences with WRF. Thanks, Ed Ticket Details =================== Ticket ID: EDP-282307 Department: Support netCDF Priority: Normal Status: Closed