我ifort
在 mpi 环境中使用 intel fortran 编译器 ()。事实证明,当我使用 flags 编译时,我的代码出现了缓冲区溢出-g -O2 -check bounds
。运行一段时间后,我收到以下消息:
forrtl: severe (408): fort: (2): Subscript #1 of the array XX has value 4 which is greater than the upper bound of 3
Image PC Routine Line Source
program.exe 00000000006E757E Unknown Unknown Unknown
program.exe 00000000006E6016 Unknown Unknown Unknown
program.exe 00000000006905B2 Unknown Unknown Unknown
program.exe 0000000000642E6B Unknown Unknown Unknown
program.exe 0000000000643381 Unknown Unknown Unknown
program.exe 00000000005F33FB Unknown Unknown Unknown
program.exe 00000000004139E7 Unknown Unknown Unknown
program.exe 000000000040A6B4 Unknown Unknown Unknown
program.exe 0000000000409D2C Unknown Unknown Unknown
libc.so.6 000000380D61ECDD Unknown Unknown Unknown
program.exe 0000000000409C29 Unknown Unknown Unknown
这太好了——我现在知道我已经超支了XX
,但是在哪里呢?使用gfortran
,-fbounds-check
会给我一个文件和行号。有什么办法可以得到ifort
吗?