Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Debugging problem in Mac OS X

forcpp
New Contributor I
1,067 Views
Hi,
I want to debug fortran/C++ programs on mac os x. Just for check I take a small fortran program:

check.f90:
program check
implicit none
print*,'Hello world!'
end program check

I compile it by $ ifort -g check.f90 and then I prompt debug command: $ idb a.out. I get the following error:

Intel Debugger for applications running on Intel 64, Version 35, Build 20080310
------------------
object file name: a.out
Internal error: cannot create absolute path for: /var/folders/ej/ejzEQMWwH-aFl+aBn9VQ0++++TI/-Tmp-//ifort7zsMS4.o
Reading symbols from /Users/Riki/Udev/a.out...Internal error: cannot create absolute path for: /var/folders/ej/ejzEQMWwH-aFl+aBn9VQ0++++TI/-Tmp-//ifort7zsMS4.o
You cannot debug "/var/folders/ej/ejzEQMWwH-aFl+aBn9VQ0++++TI/-Tmp-//ifort7zsMS4.o" because its type is "unknown".
You cannot debug "/var/folders/ej/ejzEQMWwH-aFl+aBn9VQ0++++TI/-Tmp-//ifort7zsMS4.o" because its type is "unknown".
IDB could not read debugging info from /var/folders/ej/ejzEQMWwH-aFl+aBn9VQ0++++TI/-Tmp-//ifort7zsMS4.o
(no debugging symbols found)...done.

The same thing happened with gfortran:

GNU gdb 6.3.50-20050815 (Apple version gdb-962) (Sat Jul 26 08:14:40 UTC 2008)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386-apple-darwin"...Reading symbols for shared libraries ... done

warning: Could not find object file "/var/folders/ej/ejzEQMWwH-aFl+aBn9VQ0++++TI/-Tmp-//cchGxouL.o" - no debug information available for "check.f90".

I got the same error on my Mac Pro 10.4.11 and Macbook 10.5.6.Both Mac systems are using Intel Core 2 Duo processors.I checked this program on another linux system RED HAT and it works fine. I also checked a small C++ program on my mac systems and it works fine with g++ and gdb but fails with icc and idb.

Help me out please.
Thanks.
0 Kudos
2 Replies
Jeffrey_A_Intel
Employee
1,067 Views
Quoting - forcpp
Hi,
I want to debug fortran/C++ programs on mac os x. Just for check I take a small fortran program:

check.f90:
program check
implicit none
print*,'Hello world!'
end program check

I compile it by $ ifort -g check.f90 and then I prompt debug command: $ idb a.out. I get the following error:

Intel Debugger for applications running on Intel 64, Version 35, Build 20080310
------------------
object file name: a.out
Internal error: cannot create absolute path for: /var/folders/ej/ejzEQMWwH-aFl+aBn9VQ0++++TI/-Tmp-//ifort7zsMS4.o
Reading symbols from /Users/Riki/Udev/a.out...Internal error: cannot create absolute path for: /var/folders/ej/ejzEQMWwH-aFl+aBn9VQ0++++TI/-Tmp-//ifort7zsMS4.o
You cannot debug "/var/folders/ej/ejzEQMWwH-aFl+aBn9VQ0++++TI/-Tmp-//ifort7zsMS4.o" because its type is "unknown".
You cannot debug "/var/folders/ej/ejzEQMWwH-aFl+aBn9VQ0++++TI/-Tmp-//ifort7zsMS4.o" because its type is "unknown".
IDB could not read debugging info from /var/folders/ej/ejzEQMWwH-aFl+aBn9VQ0++++TI/-Tmp-//ifort7zsMS4.o
(no debugging symbols found)...done.

Lines deleted...

Help me out please.
Thanks.

What happens if you add -save-temps to the comand line?

On Mac OS X, the debug information is stored in the .o files, andthe debugger must be able to find the .o's at run-time. However, the compiler normally does not save "temporary" .o files createdwhen compiling without the -c option. Thus, the -save-temps option.

See the ifort (and icc) documentation for more details.
0 Kudos
forcpp
New Contributor I
1,067 Views

What happens if you add -save-temps to the comand line?

On Mac OS X, the debug information is stored in the .o files, andthe debugger must be able to find the .o's at run-time. However, the compiler normally does not save "temporary" .o files createdwhen compiling without the -c option. Thus, the -save-temps option.

See the ifort (and icc) documentation for more details.

Thank you very much Jeff. Your suggestion is working.
0 Kudos
Reply