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
compile error on Mac with gfortran
tried but failed again!
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!
________________________
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!
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
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
compile error on Mac with gfortran
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:
What I did to solve this problem is to execute "ranlib" manually or you can change the following in your scripts:
- Add "-s" after ranlib in Compilers/Darwin-xlf.mk (I used Darwin-xlf.mk in my case)
for example, RANLIB := ranlib -s - 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
still having problems:)
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
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