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

Locating the source file and line for a runtime error

Jon_D
New Contributor I
572 Views

Hello,

I am using Intel Fortran 2024.0 with VS 2022. Previous versions of the compiler listed the source file and line number where a runtime error occurred when the program was compiled in Debug mode. With this version of the compiler Routine, Line and Source are all listed as Unknown.  This is the case for both ifort and ifx. Is there a compiler setting that will show this information?

Thank you.

Jon

0 Kudos
1 Solution
Jon_D
New Contributor I
489 Views

It turns out linker setting -incremental was set to "default" in my project. Following the settings in your example, I changed it to NO and I am now able to see the proper information. Thank you, Steve.

View solution in original post

0 Kudos
5 Replies
Steve_Lionel
Honored Contributor III
555 Views

/traceback  It is the default in a debug configuration, but not in a release configuration. It's under Fortran > RunTime.

0 Kudos
Jon_D
New Contributor I
549 Views

Thank you, Steve. /traceback is on but I am still not getting the source file/line number information.

0 Kudos
Steve_Lionel
Honored Contributor III
507 Views

Please provide a short example. I tried this:

D:\Projects>type t.f90
implicit none
integer :: a(5) = [1,2,3,4,5]
integer :: i
do i=1,10
print *, a(i)
end do
end

D:\Projects>ifx /traceback /check:bounds t.f90
Intel(R) Fortran Compiler for applications running on Intel(R) 64, Version 2024.1.0 Build 20240308
Copyright (C) 1985-2024 Intel Corporation. All rights reserved.

Microsoft (R) Incremental Linker Version 14.39.33523.0
Copyright (C) Microsoft Corporation.  All rights reserved.

-out:t.exe
-debug
-pdb:t.pdb
-subsystem:console
-incremental:no
t.obj

D:\Projects>t.exe
           1
           2
           3
           4
           5
forrtl: severe (408): fort: (10): Subscript #1 of the array A has value 6 which is greater than the upper bound of 5

Image              PC                Routine            Line        Source
t.exe              00007FF6E92C1182  _UNNAMED_MAIN$$             5  t.f90
t.exe              00007FF6E92CA1CB  Unknown               Unknown  Unknown
t.exe              00007FF6E9326734  Unknown               Unknown  Unknown
KERNEL32.DLL       00007FFD8354257D  Unknown               Unknown  Unknown
ntdll.dll          00007FFD8472AA48  Unknown               Unknown  Unknown
0 Kudos
Jon_D
New Contributor I
490 Views

It turns out linker setting -incremental was set to "default" in my project. Following the settings in your example, I changed it to NO and I am now able to see the proper information. Thank you, Steve.

0 Kudos
Steve_Lionel
Honored Contributor III
455 Views

Good to know. The default when a Fortran project is created is No for this setting.

0 Kudos
Reply