PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Webinar

netcdf and SCAM - uses netcdf
Goto page 1, 2  Next
 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling
View previous topic :: View next topic  
Author Message
morto



Joined: 23 Sep 2004
Posts: 4

PostPosted: Fri Sep 05, 2008 4:42 pm    Post subject: netcdf and SCAM - uses netcdf Reply with quote

Hi,
We are attempting to compile a program called SCAM (Single Column Atmospheric Model) using PGI Workstation 7.0-4 .

The program requires netcdf (v4.0 we're using) and NCAR Graphics (v5.0.0 we're using).

So I have built both netcdf and ncarg using PGI, and both appear to install cleanly.

However when we attempt to compile SCAM, we are seeing some of the errors referred to in another post from PGI ("Known Issues at bottom):

http://www.pgroup.com/resources/netcdf/netcdf362_pgi71.htm

So, I try recompiling netcdf with the same environment variable options listed on the above site. Netcdf seems to install ok.

But when attempting to compile SCAM again, we see the same errors:

/usr/local/netcdf/lib/libnetcdf.a(putget.o)(.text+0x79): In function `NC_fill_schar':
: undefined reference to `__c_mset1'
/usr/local/netcdf/lib/libnetcdf.a(putget.o)(.text+0xd2): In function `NC_fill_char':
: undefined reference to `__c_mzero1'
/usr/local/netcdf/lib/libnetcdf.a(putget.o)(.text+0x148): In function `NC_fill_short':
: undefined reference to `__c_mset2'
/usr/local/netcdf/lib/libnetcdf.a(putget.o)(.text+0x1bd): In function `NC_fill_int':
: undefined reference to `__c_mset4'
/usr/local/netcdf/lib/libnetcdf.a(putget.o)(.text+0x22b): In function `NC_fill_float':
: undefined reference to `__c_mset4'
/usr/local/netcdf/lib/libnetcdf.a(putget.o)(.text+0x2a1): In function `NC_fill_double':
: undefined reference to `__c_mset8'
/usr/local/netcdf/lib/libnetcdf.a(putget.o)(.text+0x7e46): In function `nc_put_vara_text':
: undefined reference to `__builtin_alloca'
/usr/local/netcdf/lib/libnetcdf.a(putget.o)(.text+0x7e59): In function `nc_put_vara_text':
: undefined reference to `__builtin_alloca'
/usr/local/netcdf/lib/libnetcdf.a(putget.o)(.text+0x81a6): In function `nc_put_vara_uchar':
: undefined reference to `__builtin_alloca'
/usr/local/netcdf/lib/libnetcdf.a(putget.o)(.text+0x81b9): In function `nc_put_vara_uchar':
: undefined reference to `__builtin_alloca'
/usr/local/netcdf/lib/libnetcdf.a(putget.o)(.text+0x8506): In function `nc_put_vara_schar':
: undefined reference to `__builtin_alloca'
/usr/local/netcdf/lib/libnetcdf.a(putget.o)(.text+0x8519): more undefined references to `__builtin_alloca' follow
collect2: ld returned 1 exit status
gmake[1]: *** [../scamgui] Error 1
gmake[1]: Leaving directory `/usr/local/cam1/models/atm/cam/tools/scam/ui'
gmake: *** [all] Error 2


I would appreciate any ideas on how to fix this. It still seems like a Netcdf problem.

Below is environment config from .bashrc for use compiling netcdf, ncarg, and scam:

#
# SCAM pre-reqs
#
export CSMDATA=/usr/local/cam1/models/atm/cam/tools/scam/data
export QTDIR=/usr/local/qt
export LD_LIBRARY_PATH=/usr/local/qt/lib/:/usr/local/ncarg/lib:/usr/local/netcdf/lib:/usr/lib/gcc/x86_64-redhat-linux/3.4.3:/usr/lib64:/usr/X11R6/lib64:/usr/lib64:/lib64:/opt/pgi/linux86-64/7.0-4/lib
export PGI=/opt/pgi/linux86-64/7.0-4/
export PATH=/usr/local/netcdf/bin:/usr/local/qt/bin/:/usr/local/ncarg/bin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/bin:/sbin:/opt/pgi/linux86-64/7.0-4/bin
export NCARG_ROOT=/usr/local/ncarg

#
# COMPILER pre-reqs
#
export CC=/opt/pgi/linux86-64/7.0-4/bin/pgcc
export CFLAGS="-O2 -Msignextend -V"
export CXX=/opt/pgi/linux86-64/7.0-4/bin/pgCC
export CPPFLAGS="-DNDEBUG -DpgiFortran"
export FC=/opt/pgi/linux86-64/7.0-4/bin/pgf90
export F77=/opt/pgi/linux86-64/7.0-4/bin/pgf77
export F90=/opt/pgi/linux86-64/7.0-4/bin/pgf90
export FFLAGS="-O2 -w -V"

Thanks for any ideas.
-Mark
Back to top
View user's profile
mkcolg



Joined: 30 Jun 2004
Posts: 6218
Location: The Portland Group Inc.

PostPosted: Mon Sep 08, 2008 12:04 pm    Post subject: Reply with quote

Hi Mark,

The missing symbols are found in libpgc library which leads me to believe that you are not linking SCAM with either pgf90 or pgcc or there is an ordering problem. Can you please post the link command for SCAM?

Thanks,
Mat
Back to top
View user's profile
morto



Joined: 23 Sep 2004
Posts: 4

PostPosted: Mon Sep 08, 2008 1:24 pm    Post subject: lpgc Reply with quote

Hi Mat,
Sorry to be obtuse, but where do I find the link command...? There are several Makefile (s) in the SCAM directory structure:

./tools/diurnal_ave/Makefile
./tools/ncadd/Makefile
./tools/ccm2iop/Makefile
./tools/sdev/Makefile
./tools/pdf/Makefile
./tools/ncmult/Makefile
./tools/intercomparison-post-processing/Makefile
./tools/nctrans/Makefile
./obj/Makefile

I just tried adding "-lpgc" to:
CFLAGS=-O2 -Msignextend -V -lpgc
FFLAGS=-O2 -w -V -lpgc
CPPFLAGS=-DNDEBUG -DpgiFortran -lpgc

...but same missing function errors. My LD_LIBRARY_PATH is:

LD_LIBRARY_PATH=/usr/lib64/qt-3.3/lib:/usr/local/qt/lib/:/usr/local/ncarg/lib:/usr/local/netcdf/lib:/usr/lib/gcc/x86_64-redhat-linux/3.4.3:/usr/lib64:/usr/X11R6/lib64:/usr/lib64:/lib64:/opt/pgi/linux86-64/7.0-4/lib

thanks,
-mark
Back to top
View user's profile
mkcolg



Joined: 30 Jun 2004
Posts: 6218
Location: The Portland Group Inc.

PostPosted: Mon Sep 08, 2008 3:32 pm    Post subject: Reply with quote

Hi Mark,

Do you have a complete log of the build? If so, look for a line above the undefined reference errors where all the object files are. Something like "gcc -o scam -O2 obj1.o obj2.o ...etc.". This should be the link command.

Thanks,
Mat
Back to top
View user's profile
morto



Joined: 23 Sep 2004
Posts: 4

PostPosted: Mon Sep 08, 2008 3:54 pm    Post subject: partial scam build log Reply with quote

It does appear that -lpgc is missing... How would I add that if not to my environment variables?

thanks,
-mark

------------------
gcc ChangeAxisScaleDlg.moc.o ChangeAxisScaleDlg.o ChangeAxisScaleDlgImpl.moc.o ChangeAxisScaleDlgImpl.o IOPSelectDateDlg.moc.o IOPSelectDateDl
g.o IOPSelectDateDlgImpl.moc.o IOPSelectDateDlgImpl.o LoadData.moc.o LoadData.o LoadDataImpl.moc.o LoadDataImpl.o MainWnd.moc.o MainWnd.o Main
WndImpl.moc.o MainWndImpl.o OptionsDlg.moc.o OptionsDlg.o OptionsDlgImpl.moc.o OptionsDlgImpl.o PlistDlg.moc.o PlistDlg.o PlistDlgImpl.moc.o P
listDlgImpl.o PlotDlg.moc.o PlotDlg.o PlotDlgImpl.moc.o PlotDlgImpl.o PostPlottingDlg.moc.o PostPlottingDlg.o PostPlottingDlgImpl.moc.o PostPl
ottingDlgImpl.o SelectGlobalDataDlg.moc.o SelectGlobalDataDlg.o SelectGlobalDataDlgImpl.moc.o SelectGlobalDataDlgImpl.o crm.o dataset.o dbgmod
el.o defaults.o field.o fieldlistbox.o fifomodel.o history.o main.o manager.o map.o model.o msgdlg.o ncarg.o ncarg_stubs.o ncfile.o plot.moc.o
plot.o rpcmodel.o sicfile.o timeconvert.o utils.o \
-o ../scamgui -L/usr/local/netcdf/lib -lnetcdf -L/usr/local/ncarg/lib -lncarg -lncarg_gks -lncarg_c -lg2c -L/usr/lib64/qt-3.3/lib
-lqt-mt -lqui -L/usr/X11R6/lib -lX11 -lm -lXext -ldl
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
Goto page 1, 2  Next
Page 1 of 2

 
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