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