Unidata - To provide the data services, tools, and cyberinfrastructure leadership that advance Earth system science, enhance educational opportunities, and broaden participation. Unidata
         
  advanced  
 

Re: [netcdfgroup] Hello —

Mikhail,

> I am trying to compile netCDF to use with FVCOM (they require the
> netCDF library manually compiled with the same compiler - 
> 
> Linux localhost 2.6.22.12-desktop-1mdv #1 SMP Tue Nov 20 13:15:05 EST
> 2007 x86_64 Intel(R) Xeon(R) CPU            5160  @ 3.00GHz GNU/Linux
> 
> gcc (GCC) 4.2.2 20071128 (prerelease) (4.2.2-3.1mdv2008.0)
> 
> 
> "make check" passes w/o any problems
> 
> ) at the linking stage I get
> ...
> .... viscofh.o print_vals.o rho_mean.o viz.o     -L/usr/local/lib 
> -lnetcdff
> /usr/local/lib/libnetcdff.a(netcdf.o): In function
> `__netcdf__nf90_get_var_7d_eightbytereal':
> netcdf.f90:(.text+0xd0e): undefined reference to `nf_get_varm_double'
 ...

I think you just need to add "-lnetcdf" after "-lnetcdff" to link the C
library after the separately compiled Fortran library.  Most
installations have both libraries combined in one, but evidently your
installation specified "--enable-separate-fortran" to the configure
script when the libraries were built, so you have to provide both
libraries in the right order when linking.

--Russ



 
 
  Contact Us     Site Map     Search     Terms and Conditions     Privacy Policy     Participation Policy
 
National Science Foundation (NSF) UCAR Community Programs   Unidata is a member of the UCAR Community Programs, is managed by the University Corporation for Atmospheric Research, and is sponsored by the National Science Foundation.
P.O. Box 3000     Boulder, CO 80307-3000 USA     Tel: 303-497-8643     Fax: 303-497-8690