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

20020903: undef ref to 'nf_...



>From: James McCreight <address@hidden>
>Organization: UMT
>Keywords: 200209031656.g83GuXZ04528 netCDF

James,

>I am in dire need of assistance, I have tried everything I could think of
>and my looks through the archives did not produce any solution. 
>I am trying to compile ccsm sea ice code on my linux box using pghpf and
>I get a bunch error messages like the following
>./compile/ice_history.o(.text+0x1daf): undefined reference to 'nf_create_'
>                           "                                 'nf_def_dim_'
>I have included netcdf.inc and the compiler is able to open it. Maybe the
>problem is with the underscore. I also tried compiling with
>-Msecond_underscore as was suggested at the pghpf site but got nothing.

In the web pages we maintain for netCDF installation, we provide 
recommendations on environment varaible settings that can be used
for a variety of compilers on a variety of platforms:

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

That page has a link for Linux systems:

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

That has recommendations for folks using the Portland Group Fortran
compiler (in combination with GNU C):

CC=/usr/bin/gcc
CPPFLAGS='-DNDEBUG -DpgiFortran'
CFLAGS=-O
FC=/opt/pgi/linux86/bin/pgf90
FFLAGS='-O -w'
CXX=/usr/bin/g++

Try these settings as a starting point before you attempt to build the
CCSM Sea Ice Code.  These environment variable settings must be in
place before the netCDF package is built (if you are building the
netCDF from source), so you may have to do a 'make distclean' before
making another attempt at building the CCSM code.

The other thing I would use to investigate the problem is the Linux
utility 'nm'.  You would use 'nm' on the netCDF library to see how
the entry points in question are named.  Here is one example:

nm libnetcdf.a | grep nf_create

>Thanks
>Sincerely
>James McCreight 

Tom Yoksas