Ocean Modeling Discussion

ROMS/TOMS

Search for:
It is currently Sat Jul 20, 2019 5:16 am




Post new topic Reply to topic  [ 7 posts ] 

All times are UTC

Author Message
PostPosted: Tue Oct 10, 2006 2:21 pm 
Hello,

I run into a compile error with ROMS 2.2 on my Mac OSX with gfortran. It runs fine for awhile (I am new at this) but then I get an error about the 'ld' command as follows:
____________________
gfortran -ff2c -O1 master.o ocean_control.o -o /Applications/roms-2.2/Tests/oceanS libNLM.a libUTIL.a libMODS.a -L/usr/local/lib -lnetcdf
/usr/bin/ld: Undefined symbols:
___dso_handle
collect2: ld returned 1 exit status
make: *** [/Applications/roms-2.2/Tests/oceanS] Error 1
rm mod_kinds.f90

_____________________
I configured the makefile and .mk file correctly I think and I have the netcdf libs and .inc files. Any ideas? Thanks,

Dave Sutherland


Top
  
Reply with quote  
 Post subject:
PostPosted: Wed Oct 11, 2006 7:43 am 
The symbol "__dso_handle" is in the standart C libary (you can type the command
"nm /usr/lib/libc.a |grep __dso_handle" and here is the simbol...)

So it seems that the linker ("ld") can't find this symbol...
An problem in the binutils package?
A problem in the standard library?


Top
  
Reply with quote  
 Post subject:
PostPosted: Wed Oct 11, 2006 1:54 pm 
Offline
User avatar

Joined: Thu Jul 03, 2003 3:39 pm
Posts: 79
Location: TAMU,USA
I've found that I need to copy libc or libc++ to a place the linker can find. This was a particular problem when the new macs updated to gcc4. See if you can find libc, and if it's not already in /usr/lib, put a copy there.


Top
 Profile  
Reply with quote  
 Post subject: tried but failed again!
PostPosted: Thu Oct 12, 2006 1:53 pm 
i couldn't find libc but put the libgcc.a and other libs i found in my gcc folder in /usr/local/lib and ran make again and got the following error:
________________________
g95 master.o ocean_control.o -o /Applications/roms-2.2/Tests/oceanS libNLM.a libUTIL.a libMODS.a -L/usr/local/lib -lnetcdf
ld: table of contents for archive: /usr/local/lib/libf95.a is out of date; rerun ranlib(1) (can't load from it)
ld: table of contents for archive: /usr/local/lib/libgcc.a is out of date; rerun ranlib(1) (can't load from it)
ld: table of contents for archive: /usr/local/lib/libgcc_eh.a is out of date; rerun ranlib(1) (can't load from it)
make: *** [/Applications/roms-2.2/Tests/oceanS] Error 1
_________________________

about the lib's being out of date. any more help would be awesome! do i need to reinstall gcc somehow or update those libs (or maybe i got them from the wrong place?)? thanks!


Top
  
Reply with quote  
 Post subject:
PostPosted: Thu Oct 12, 2006 2:01 pm 
Offline
User avatar

Joined: Thu Jul 03, 2003 3:39 pm
Posts: 79
Location: TAMU,USA
Did you install XTools? Did you get the latest version from the Developer Connection?

As you probably know, gcc does not come installed by default on a Mac. Also, there have been pretty significant changes recently between gcc4.0 and gcc4.1. Make sure you are running gcc 4.1:

$ gcc --version
i686-apple-darwin8-gcc-4.0.1 (GCC) 4.0.1 (Apple Computer, Inc. build 5341)
Copyright (C) 2005 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

If not, go to http://www.apple.com/developer/ and get the latest XTools.

Then, come back with whatever other errors you are having, and we'll see if we can get ROMS going..
-r


Top
 Profile  
Reply with quote  
PostPosted: Fri Oct 13, 2006 4:49 am 
Offline

Joined: Thu May 25, 2006 2:36 am
Posts: 5
Location: University of Colorado, boulder
I got similar error: e.g. f90 -w -O3 master.o ocean_control.o -o oceanS libNLM.a libUTIL.a libMODS.a -L/usr/local/netcdf/lib -lnetcdf -lU77 /usr/bin/ld: archive: libNLM.a has no table of contents, add one with ranlib(1) (can't load from it)

What I did to solve this problem is to execute "ranlib" manually or you can change the following in your scripts:
  1. Add "-s" after ranlib in Compilers/Darwin-xlf.mk (I used Darwin-xlf.mk in my case)
    for example, RANLIB := ranlib -s
  2. Add " $(RANLIB) $@" (start this line with "TAB") in the last line of the following files:
    • Adjoint/Module.mk
    • Nonlinear/Module.mk
    • Modules/Module.mk
    • Utility/Module.mk
    These files doing "ar" of libNLM.a, libUTIL.a, and libMODS.a


Top
 Profile  
Reply with quote  
 Post subject: still having problems:)
PostPosted: Fri Oct 13, 2006 6:21 pm 
hello,

well, i'm learning a lot by going through all this but i am still having problems. i tried updating my gcc as hetland suggested, and through fink got 4.0.2, but when i gcc --version it still says 4.0.1? i think the root of my problem lies in this- i have a few versions of gcc now on my system and just don't know enough to start messing around with links and copying libraries. any ideas? start from scratch?

when i did put libgcc.a in /usr/local/lib i got errors saying it was out of date but then when i reran ranlib it still didn't work- i get errors that say:

"ranlib: file: libMODS.a(mod_bbl.o) has no symbols"

and so on. any more suggestions would be awesome- thanks,

dave


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 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