Ocean Modeling Discussion

ROMS/TOMS

Search for:
It is currently Fri Jul 19, 2019 1:49 am




Post new topic Reply to topic  [ 4 posts ] 

All times are UTC

Author Message
PostPosted: Wed Jun 14, 2006 7:08 am 
Offline

Joined: Thu May 25, 2006 2:36 am
Posts: 5
Location: University of Colorado, boulder
I am using Mac G5 with "xlf95_r" to compile the ROMS version 2.2. I got an error at the very last step. I have feeling that it might be problem with flush_ but I am not quite sure. Then I tried to check "Utility/mp_routines.F" by change "AIX" to "XLF" but still not solving this problem. Can anyone know how to deal with this problem. Part of the error message I got is:

xlf95_r -c -qsuffix=f=f90 -qmaxmem=-1 -qextname -O3 -qstrict master.f90
** ocean === End of Compilation 1 ===
1501-510 Compilation successful for file master.f90.
xlf95_r -qsuffix=f=f90 -qmaxmem=-1 -qextname -O3 -qstrict master.o ocean_control.o -o oceanS libNLM.a libUTIL.a libMODS.a -L/usr/local/netcdf-3.6.1/lib -lnetcdf
ld: Undefined symbols:
_nf_close_
_nf_put_var1_double_
_nf_sync_
_nf_strerror_
_nf_open_
_nf_inq_varid_
_nf_get_var1_double_
_nf_inq_var_
_nf_inq_attname_


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Jun 19, 2006 1:49 pm 
Hi

For some reason, the compiler can't find the netcdf functions.
Can you run the following commands?
nm close_io.o | grep nf_close
nm /usr/local/netcdf-3.6.1/lib/libnetcdf.a | grep nf_close

Both commands should give the same function names (including underscores). If you have compiled netcdf will the gcc, you probably need either to compile it with xlf or with somethink like "gcc -fleading-underscore".

Alex


Top
  
Reply with quote  
 Post subject:
PostPosted: Mon Jun 19, 2006 5:11 pm 
Offline

Joined: Thu May 25, 2006 2:36 am
Posts: 5
Location: University of Colorado, boulder
You are right. The results are different. One from model provide underscore at before and after the file names.

nm close_io.o | grep nf_close
U _nf_close_
nm /usr/local/netcdf-3.6.1/lib/libnetcdf.a | grep nf_close
00000818 T _nf_close
U _nf_close

How can I correct this problem? I did reinstall netCDF with same xlf compiler with option of "cc -fleading-underscore" but problem still persist.
I 'll try to see if there any .F file I can modify
Thanks for suggestion.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Jun 19, 2006 5:26 pm 
Offline
User avatar

Joined: Wed Jul 02, 2003 5:29 pm
Posts: 3633
Location: IMS/UAF, USA
The problem is with -qextname. This is an xlf option to put a trailing underscore on the name (_nf_close_) instead of leaving it be (_nf_close). First, check to see if -qextname was used when building the netcdf library. If not, take it out of the compile options on the Mac. Now you will get a link error on missing flush_. To fix this, go into mp_routines and look for my_flush. It does something in the case of AIX - add DARWIN to the list (#if defined AIX || defined DARWIN). I helped someone with this just last week. :)


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 3 guests


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 post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group