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.
Hi Hugh, Sorry it's taken so long to respond to your question ... > I'm trying to build WRF3.2 on Linux. This apparently requires > that a recent version of NetCDF be available, first. I downloaded > NetCDF 4.0 binaries for Linux and installed the various bits in > /user/local/bin, /user/local/lib, etc. I think WRF3.2 does not require netCDF-4 features such as compression and chunking, so you could have built netCDF with the --disable-netcdf-4 flag to configure, to make sure it didn't try to include the netCDF-4 features supported by an HDF5 library. If you did not specify --disable-netcdf-4 and an HDF5 library was installed where the configure script could find it, then your netCDF installation would have been built to depend on the HDF5 library, requiring linking with something like ... -L/usr/local/netcdf/lib -L/usr/local/hdf5/lib -lnetcdf -lhdf5_hl -lhdf5 -lz if the HDF5 library was installed in /usr/local/hdf5/lib, for example. > At compile time for WRF, the build fails. It looks like there's > a hard-coded path in the netcdf library: > > mpif90 -f90=ifort -o wrf.exe -g -O3 -w -ftz -align all -fno-alias -fp-model > precise -FR -convert big_endian -ip wrf.o ../main/module_wrf_top.o > libwrflib.a > /home/hmcaffey/WL/WRF3/3.2/WRFV3/external/fftpack/fftpack5/libfftpack.a > /home/hmcaffey/WL/WRF3/3.2/WRFV3/external/io_grib1/libio_grib1.a > /home/hmcaffey/WL/WRF3/3.2/WRFV3/external/io_grib_share/libio_grib_share.a > /home/hmcaffey/WL/WRF3/3.2/WRFV3/external/io_int/libwrfio_int.a > /home/hmcaffey/WL/WRF3/3.2/WRFV3/external/esmf_time_f90/libesmf_time.a > /home/hmcaffey/WL/WRF3/3.2/WRFV3/external/RSL_LITE/librsl_lite.a > /home/hmcaffey/WL/WRF3/3.2/WRFV3/frame/module_internal_header_util.o > /home/hmcaffey/WL/WRF3/3.2/WRFV3/frame/pack_utils.o > /home/hmcaffey/WL/WRF3/3.2/WRFV3/external/io_netcdf/libwrfio_nf.a > -L/usr/local/lib -lnetcdf > > /usr/local/lib/libnetcdf.a(nc4attr.o): In function `nc_del_att': > /dan/netcdf/n4_dan/netcdf-4.0/libsrc4/nc4attr.c:817: undefined reference to > `H5Dclose' > /dan/netcdf/n4_dan/netcdf-4.0/libsrc4/nc4attr.c:806: undefined reference to > `H5Adelete' > ... many more of these undefined references > > Result is that 'wrf.exe' is not generated. > > Where is "/dan/netcdf/n4_dan" coming from? Is this why my build is failing? It looks like /dan/netcdf/n4_dan/netcdf-4.0/ was where you built netCDF from source. Did you run "make check" and "make install" after building it? Running "make install" is recommended rather than trying to copy libraries and include files manually into the install directories. A program named "nc-config" is also installed which should help in determining how to link to netCDF, by running "nc-config --fflags" to see what include files are needed and "nc-config --flibs" to see how libraries need to be linked. I recommend you try downloading the more recent netcdf-4.1.1 distribution, because it has fixes for some nc-config problems in the 4.0 distribution. When building, specify --disable-netcdf-4 if necessary and follow the installation instructions by invoking "make check" and "make install". --Russ Russ Rew UCAR Unidata Program address@hidden http://www.unidata.ucar.edu Ticket Details =================== Ticket ID: RZV-501204 Department: Support netCDF Priority: Critical Status: Closed