NETCDF undefined reference

Hi,

I include “-Dpgifortran” in the “CPPFLAGS” when building NetCDF Ver 4.1.3. When I comile the RIP4, I get the error messages for undefined reference to nf_* like below:

RIP4/src/./refmos2calc.f:14: undefined reference to nf_open_' RIP4/src/./refmos2calc.f:14: undefined reference to nf_inq_dimid_’
RIP4/src/./refmos2calc.f:14: undefined reference to nf_inq_dimlen_' RIP4/src/./refmos2calc.f:14: undefined reference to nf_inq_dimid_’
RIP4/src/./refmos2calc.f:14: undefined reference to nf_inq_dimlen_' RIP4/src/./refmos2calc.f:21: undefined reference to nf_get_att_real_’
… … …

The output of the command “nm /opt/pgi/NETCDF4/lib/libnetcdf.a | grep -i nf_get_vara_real” is null.

I use ver. 12.5 PGI compiler and 6.0.0 ncarg package. Can any body help me in this case?


Thanks, Roger

Based on the information provided, it appears that your build of the NETCDF library was not successful. You need to check the build logs for NETCDF to see if there were any errors. Since the libnetcdf.a library does not contain these entry points, something must have failed during the build.

Dear toepfer,

Thank you for your help.
I recompiled the NETCDF library, and didn’t find any error/fail message in build logs. I installed necdf4.1.1 using the below command.

export CC=pgcc; export CXX=pgcpp; export FC=pgfortran; export F90=pgfortran; export CFLAGS="-O2 -Msignextend -V"; export CPPFLAGS=”-DNDEBUG -DpgiFortran"; export FFLAGS= “-O2 -w -V”; export LD=pgfortran

./configure --disable-netcdf-4 --prefix=/opt/netcdf_pgi

The output of the command “nm ./libnetcdf.a | grep -i nf_get_vara_real” is still null.
I’m quite puzzled as I compiled NETCDF without error and installation of NETCDF is no problem. Why the libnetcdf.a library does not contain these entry points? Is the problem caused by option --disable-netcdf-4?
Thanks, Roger

Wavelink technology Inc. Taiwan