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

[netCDF #ILQ-730613]: Can't find 'netcdf MOD nf90 put att real'

Hi Natalie,

> I have the NetCDF 4.2 libraries successfully installed, including the
> Fortran libraries. When I try to make my executable, the variable
> '__netcdf_MOD_nf90_put_att_real' (and various others) is not
> recognised. The command 'nm libnetcdff.a' shows me similar variables
> such as '__netcdf_MOD_nf90_put_att_fourbytereal'.
> Is it possible that I am using the wrong version?

Probably not.  Any version of the netCDF C library > version 4.1.3 is
compatible with netcdf-fortran-4.2.  The most recent version of the
netCDF C library is netcdf-4.3.0, so that would currently have the most 
bug fixes for anything that works with netcdf-fortran-4.2.  But I suspect
the problem you are seeing is simpler than any recent bug fixed in the
netCDF C library, so netcdf-4.2.0 is probably OK.

If you have not built the netCDF Fortran as a shared library (for example 
by configuring with --disable-shared), then you need to link your Fortran 
programs using both the Fortran and C libraries, for example 

  gfortran myprog.f90 -o myprog -I/usr/local/include -L/usr/local/lib -lnetcdff 

and possibly other libraries as well.  You can see what's needed by
running the nf-config utility, which is installed when you build and 
install netcdf-fortran, like so

  nf-config --flibs

You can even use this on your compile line, for example:

  gfortran myprog.f90 -o myprog `nf-config --fflags --flibs`

If your system has the pkg-config program, you can use it instead,
as follows:

  gfortran myprog.f90 -o myprog `pkg-config --cflags --libs netcdf-fortran`

(For pkg-config, "cflags" means "compiler flags", so that's not a typo.)


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

Ticket Details
Ticket ID: ILQ-730613
Department: Support netCDF
Priority: Normal
Status: Closed

NOTE: All email exchanges with Unidata User Support are recorded in the Unidata inquiry tracking system and then made publicly available through the web. If you do not want to have your interactions made available in this way, you must let us know in each email you send to us.