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

Re: 20020624: NetCDF link errors



>To: address@hidden
>From: Heng Yang <address@hidden>
>Subject: I need your help 
>Organization: UCAR/Unidata
>Keywords: 200206241657.g5OGvxa20967

Hi Cynthia,

> I am a member of a project about netCDF and we want to
> know where is nf_strerror and some other interface in
> netCDF.
> 
> In website, it said that after run configure script,
> when I use make, these interface will go into
> libnetcdf.a or libnetcdfc++.a. However, when I
> reference libnetcdf.a in compiling other things like
> smoketool, system always complain undefined symbol:
> nf_strerror, nf_open, nf_close. So I think the place
> where netCDF interface is is very important to us.

It sounds like you may not have built the netCDF Fortran interface.
The Fortran interface will not be built if either:

  - You set the environment variable FC='' before running the
    configure script, which specifies that no Fortran compiler should
    be used; or

  - The configure script is unable to compile a simple test Fortran
    program that it uses to test the Fortran compiler; or

  - Some error occurs in compiling the Fortran netCDF interface, so it
    can't be built.

I can't tell which of these is the problem unless you send me the
output of running the configure script, and also the output of "make
all" if the Fortran compiler was found but errors occurred during the
compilation.  It would also help if you send me the values of the
relevant environment variables, FC and FFLAGS, if you set them to
anything.  See the section on "Reporting Problems" at the end of the
installation instructions at

  http://www.unidata.ucar.edu/packages/netcdf/INSTALL.html#ReportingProblems

for how to do this.

To answer your question about where the library should be installed,
if you just run "make" or "make all", the library will be built, but
will be left in the source directory where it was compiled.  You must
run "make install" to have the library installed where you want to use
it from.  As it says in the installation instructions:

  Decide where you want to install this package. Use this for the
  "--prefix=" argument to the configure script below. The default
  installation prefix is "..", which will install the package's files
  in ../bin, ../lib, and ../man relative to the netCDF src/ directory.

So, wherever you specified when you ran the configure script is where
"make install" will install the library or libraries, and where you
should link from, after everything is built and the tests run by "make
test" run correctly.

--Russ

_____________________________________________________________________

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