- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello, I'm trying to build application with debug options using Fortran Complier under Mac OS X.
When I'm compiling with "-debug" option and trying to link object, ld linker throws this an error:
ld: in constants.o, in section __DATA,__debug_frame reloc 0: length < 3 and X86_64_RELOC_UNSIGNED not supporte
constants.f90 is my module file
After removing this file I'm still getting anoter message:
ld: in test.o, object file contains old DWARF debug info - rebuild with newer compiler
My computer configuration:
MacBook 2.2 GHz
2 GB RAM
Mac OS X 10.5.5
Intel Fortan Compiler version 11.0.056
Please let me know if I need to set up some options for compiler and linker.
Thank you.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
My files:
Makefile:
FF = ifort
CFLAG = -c -O0 -debug
LFLAG =
all: test Makefile
test: objs Makefile
$(FF) $(LFLAG) -o test *.o $(LIBS)
objs: *.f90 Makefile
$(FF) $(CFLAG) *.f90
.PHONY: clean
clean:
rm -f *.o
rm -f *.mod
constants.f90:
module constants
implicit none
integer TEST
parameter (TEST = 160)
end module constants
test.f90:
program test
!use constants
write (*,*) "Hello World",SOME_CONSTANT
end program
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Andrew,
This is interesting. I have a MacBook Pro, Core 2 Duo, 10.5.5, ifort 11.0.054. I copied your files and makefiles. I am able to build and link in both 32 and 64 bit modes.
Is your MacBook using a Core Duo or Core Solo processor? that is, do you have a 32bit only system? (Apple menu, 'About this Mac'). The symbol error seems to indicate that the 64bit symbols are not found on your system.
Finally, what version of Xcode do you have installed? I'm at Xcode 3.1.1
What happens if you add -m32 to your CFLAG var options?
thanks
ron
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is your MacBook using a Core Duo or Core Solo processor?
My MacBook is using Core 2 Duo
Finally, what version of Xcode do you have installed? I'm at Xcode 3.1.1
What happens if you add -m32 to your CFLAG var options?
Linker throws (when I'm making via console):
'Undefined symbols: "_MAIN__", referenced from: _main in for_main.o'
With Xcode my app builds fine.
So, my question:Is it possible to build app with debugging flags via command line utility (/usr/make)?
Also I have gcc40 and gcc42 (installed via macports), gcc43(installed via fink). Is it possible, that they conflict with ifort?
Thanks
Andrew
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hmm, Xcode 3.1.2 - interesting. Yes, I see it was released Nov 24th. I'll go get that and see what happens.
Xcode includes the linker, ld, and header files. Maybe something broke with 3.1.2.
I'll check to see if anyone else is seeing issues.
As for the gccs via Fink - possible problem, but I'm more suspicious of the ld version in xcode 3.1.2. We only test against official Apple Xcode tools - released versions of Xcode that is. If you start loading up non-Apple supported gccs, we have no way to validate against that.
Let's see what happens when I update to 3.1.2. I should have an answer this afternoon.
ron
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Actually I tried to make may app with Xcode 3.1.1 too
Methods:
- Via /usr/bin/make
- Via Xcode make like this
There is the table of my results:
method |
xcode 3.1.1 |
xcode 3.1.2 |
1 |
fail |
fail |
2 |
success |
success |
Also there was a similar issue with icc.
Making with Xcode is okay, but it is a little bit inconvenient. Also I don't want use Xcode because it's gdb has poor fortran dynmaic arrays support.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ooops... I think I solved the problem: I've recently installed gdb 6.8.5 from cvs, after gdb uninstalling ifrort works fine.
Thanks
Andrew
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Andrew, that's great. I installed Xcode 3.1.2 this morning and could build w/o problems. I was worried that the new Xcode brought in a new lib or ld that might be the cause. Glad to hear it was just gdb and not Xcode 3.1.2.
ron
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I was reading this thread and I am facing similar problem as mentioned in this thread. When I try to run a source using dlsode on a macbook pro using intel fortran on terminal, i get following error. I am a novice and dont know how to build project on xcode. The files run with no problem on a pc with compaq visual fortran. I changed the syntax for ifort but i get this error.
Undefined symbols:
"_MAIN__", referenced from:
_main in for_main.o
ld: symbol(s) not found
Could please suggest possible solutions.
thanks,
al
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I will need the following:
your code
your command line for both compile and link: ifort
Your Xcode version
Your Xcode installation directory (default is /Developer )
And did you install the compiler AFTER installing this version of Xcode.
thanks
ron
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for your reply. I apologize for not replying for all this time. I will post all the required info tonite. I did install the compiler AFTER installing Xcode (which was the one that came with the laptop I think, I will check the version and let you know).
thanks,
al
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hey Ron,
I could run this with ifort on terminal..i was not linking the files properly..thanks..

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page