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 Jish, > I have installed NetCDF (netcdf-3.6.1 ) in my home directory and tried > to compile WRF. > > I am getting the following error;(/usr/bin/ld: cannot find -lnetcdf): > > > mpif90 -f90=gfortran -o real.exe -fopenmp -O3 -ftree-vectorize > -ftree-loop-linear -funroll-loops -w -ffree-form -ffree-line-length-none > -fconvert=big-endian -frecord-marker=4 real_em.o > ../dyn_em/module_initialize_real.o libwrflib.a > -L/home/external/iitk/sachchidanandt/jish/model1/WRFV3/external/fftpack/fftpack5 > -lfftpack > -L/home/external/iitk/sachchidanandt/jish/model1/WRFV3/external/io_grib1 > -lio_grib1 > -L/home/external/iitk/sachchidanandt/jish/model1/WRFV3/external/io_grib_share > -lio_grib_share > -L/home/external/iitk/sachchidanandt/jish/model1/WRFV3/external/io_int > -lwrfio_int > -L/home/external/iitk/sachchidanandt/jish/model1/WRFV3/external/esmf_time_f90 > -lesmf_time > /home/external/iitk/sachchidanandt/jish/model1/WRFV3/external/RSL_LITE/librsl_lite.a > /home/external/iitk/sachchidanandt/jish/model1/WRFV3/frame/module_internal_header_util.o > /home/external/iitk/sachchidanandt/jish/model1/WRFV3/frame/pack_utils.o > /home/external/iitk/sachchidanandt/jish/model1/WRFV3/external/io_netcdf/libwrfio_nf.a > -L/home/external/iitk/sachchidanandt/jish/model1/WRFV3/netcdf_links/lib > -lnetcdf > > /usr/bin/ld: cannot find -lnetcdf > > collect2: ld returned 1 exit status I can only think of a few problems that would cause this error message: - You haven't installed the netCDF library in the directory /home/external/iitk/sachchidanandt/jish/model1/WRFV3/netcdf_links/lib - You installed the library there, but it is for a different library format or machine architecture than expected by mpif90, for example it is a 64-bit library but mpif90 requires 32-bit libraries, or vice versa - The link step should be done by the Fortran compiler you are using rather than "/usr/bin/ld". Perhaps there was a script you needed to run before invoking mpif90 so that the right program would perform the link, rather than /usr/bin/ld? This also may be a problem with your mpif90 installation rather than netCDF. Can you compile and link simple F90 programs with mpif90? I recommend posing your question to the address@hidden mailing list, as it may be wrf-specific. --Russ Russ Rew UCAR Unidata Program address@hidden http://www.unidata.ucar.edu Ticket Details =================== Ticket ID: KFQ-906859 Department: Support netCDF Priority: Normal Status: Closed