PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Webinar

NETCDF undefined reference

 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling
View previous topic :: View next topic  
Author Message
roger-wavelink



Joined: 10 Dec 2007
Posts: 2

PostPosted: Fri Jun 29, 2012 3:22 am    Post subject: NETCDF undefined reference Reply with quote

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
Back to top
View user's profile
toepfer



Joined: 04 Dec 2007
Posts: 50

PostPosted: Fri Jun 29, 2012 8:10 am    Post subject: Reply with quote

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.
Back to top
View user's profile
roger-wavelink



Joined: 10 Dec 2007
Posts: 2

PostPosted: Mon Jul 02, 2012 1:57 am    Post subject: NETCDF undefined reference Reply with quote

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
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group