Software Archive
Read-only legacy content

Debugging FORTRAN code with XCode 7.3

Farzin_Z_
Beginner
807 Views

 

 Hello,

I am new to using FORTRAN on Xcode so please bear with me.

I have been able to compile and run FORTRAN codes (under Xcode) so far but debugging is giving me a hard time. In essence, I cannot see local, or global, variables once the program stops at a breakpoint. I would like to check the value of variables as my code moves from one line to another. I am not looking for something fancy here as I have seen such capability under Visual Studio (windows). Can you please point me in the right direction? Should I install additional software to get debugging capabilities? Is there any setting in the Build section that I am missing?

I am using Xcode 7.3, OS X El Capitan (version 10.11.4), and Intel Fortran Compiler 16.0.

thanks

Farzin

 

0 Kudos
4 Replies
Georg_Z_Intel
Employee
807 Views

Hello Farzin,

I only can offer to use the command line GDB that we ship with our compilers.

IIRC, XCode uses LLDB which does not (yet) have Fortran awareness. Hence, the only way I see is using "gdb-ia" (Intel version of GDB) on the command line. It's not as nice as debugging in XCode but should work well.

Please let me know if you need help with GDB.

Best regards,

Georg Zitzlsberger

 

 

0 Kudos
Farzin_Z_
Beginner
807 Views

 

Hello Georg,

 

Thanks for the information you posted. I hope LLDB picks up Fortran soon.

I have been a Fortran user on Windows (using Visual Studio) so all I know about debugging is through the VS environment. Can you please put me in the right direction as to how I can use gdb-ia.

 

I have another question, which is unrelated to the debugging problem I posted here. I have few old QuickWin Fortran projects in Windows. Do you what is the equivalent of QuickWin in Mac OS environment. Ultimately, I want to compile those programs under Xcode and see some graphics.

 

I really appreciate your help.

 

best

Farzin

 

0 Kudos
Georg_Z_Intel
Employee
807 Views

Hello Farzin,

you need to run gdb-ia on the command line (in a terminal). To make it available you first source the environment (compilervars script). The following document describes the exact steps:
https://software.intel.com/en-us/get-started-with-parallel-studio-xe-for-osx

After that you should be able to start "gdb-ia":

$ gdb-ia --args myapp arg1 arg2 ...

This starts the debugger with debuggee called myapp and the debuggee arguments arg1, arg2, ... (arguments are optional).

You can find the general manual either online:
https://www.gnu.org/software/gdb/

or here <installation_root>/documentation_2016/en/debugger/ps2016/gdb.pdf

Best regards,

Georg Zitzlsberger

0 Kudos
Emmanuel_I_
Beginner
807 Views
This comment has been moved to its own thread
0 Kudos
Reply