[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[netCDF #LKM-299184]: undefined reference to error in netcdf



Hi  Jonathan,

> I have recently run into an issue where MOZART pre-processor for WRF-Chem 
> will not fully compile.
> 
> I get 50-60 error messages similar to the ones below
> 
> /data/data061/jsmith/MOZART/mo_mozart_lib.f90:1030: undefined reference to 
> `nf_close'
> 
> I have attached an output of the compilation output.

It looks like you need to reverse the order in which the libraries are
searched when linking with gfortran, so instead of

  gfortran -o mozbc  ...  -lnetcdf -lnetcdff 

use

  gfortran -o mozbc  ...  -lnetcdff -lnetcdf 

The reason is that the netCDF Fortran90 library, searched with
-lnetcdff, depends on the netCDF C library, searched with -lnetcdf.

--Russ

Russ Rew                                         UCAR Unidata Program
address@hidden                      http://www.unidata.ucar.edu



Ticket Details
===================
Ticket ID: LKM-299184
Department: Support netCDF
Priority: Normal
Status: Closed