The ChipList, by Adrian Offerman; The Processor Portal

new
Processor Selector

Platform:
Segment:
View: show / edit

bookmark bookmark site
bookmark permalink
Fri 6 Feb 2009, 21:42

How to debug a Windows* Fortran application from the command line


On Fri 6 Feb 2009, at 21:42, Intel Software Network Graphics Feed wrote:

How to debug a Windows* Fortran application from the command line

Introduction

For Fortran applications built within Microsoft Visual Studio*, you can debug the program by setting a breakpoint at the first executable line and then pressing F5 (or clicking the GO button).  But if you built the application using command line tools, this method is not available.  This article describes how to begin debugging an application built from the command line.

Note: This technique requires that a supported version of Microsoft Visual Studio is installed. It will not work if you are using Microsoft Visual C++ Express Edition* or the Windows Platform SDK to support the compiler environment.

Building the Application

Add the /debug option to the ifort command when compiling and linking.  For example:

ifort /debug /Od hello.f90

or

ifort /c /debug /Od main.f90
ifort /c /debug /Od sub.f90
ifort /debug /exe:main.exe main.obj sub.obj

This will create a .pdb (Program Database) file alongside the executable.  The .pdb file is required for debugging. The /Od option disables optimization to enhance debugging.

Start Debugging

In order to start the debugger, you must be in a command prompt environment which includes definitions for Microsoft Visual Studio.  This is the default for an Intel Fortran "Build Environment" session.

Type the ...

Filed under: Intel® Visual Fortran Compiler for Windows*
Source: Intel Software Network Graphics Feed
Also published by:

ChipList news channel Last Months News


ChipList developers news channel Last Months Developers News


Page viewed 2150 times since Sat 7 Feb 2009, 0:41.