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

runtime error line number

wen
Beginner
1,624 Views

I am using IVF v.9.1.025 in windows, IA32, to test a simplified piece of code:

program runErr

integer :: i

open( 11, file='abc.txt')

read (11,"(i2)") i

end program runErr

The first line in the input file abc.txt is just a string abc.

On the DOS command line, I ran

iFort runErr.f90 /Zi /Od /warn:declarations /warn:interfaces /warn:uncalled /warn:unused /traceback /check:all /RTCu /threads /dbglibs

to compile/link runErr.f90

The runtime error message told me that there was an input conversion error for unit 11, file abc.txt. It listed eleven locations with unknown routine, unknown line, and unknown source.

How to make it tell me the line number and routine name or source name for the location of the runtime error?

Wen


0 Kudos
5 Replies
Steven_L_Intel1
Employee
1,624 Views
Interesting - the /Zi causes the traceback to go away. I'll ask why.
0 Kudos
wen
Beginner
1,624 Views

Thank you, Steve.

The Link option /debug has the same effect as /Zi we have discussed.

I ran

iFort runErr.f90 /c /traceback

iFort runErr.obj /debug

the runtime error did not show the line number for the line with error.

When I removed the option /debug and ran

iFort runErr.f90 /c /traceback

iFort runErr.obj

the line number appeared.

Wen

0 Kudos
Steven_L_Intel1
Employee
1,624 Views
/debug is the same as /Zi. I've escalated this to development.
0 Kudos
Steven_L_Intel1
Employee
1,624 Views

"Light dawns on Marblehead," as we say here in New England. The problem is that /debug (or /Zi) implies incremental linking and that disables traceback. You can fix this by adding:

/link /incremental:no

to the end of the command line (after source file names). I've suggested to the developers that the ifort driver do this automatically if /traceback is specified. Note that in Visual Studio, incremental linking is disabled in a Debug Fortran configuration.

0 Kudos
drgfthomas
Beginner
1,624 Views

Also, in release config. it would be useful to have Omit Frame Pointers default to 'No' if runtime Traceback is 'Yes'. The default appears to be 'Yes' which doesn't disable Traceback but limits its usefulness.

0 Kudos
Reply