I am compiling some numerical code with gfortran using Code::Blocks. I have two versions of the executable: Debug and Release.
- Debug compilation flags:
-Jobj\Debug\ -Wall -g -c - Release compilation flags:
-Jobj\Release\ -Wall -O2 -c - gdb invokation flags:
-nx -fullname -quiet -args
When I run the code normally, both the Release and Debug executables produce the same output. However, when I run the code in gdb, the output is different. This appears to be due to numerical calculations producing different results during execution.
For example, the result of one calculation when run in gdb is 7.93941842553643E-06 and when run normally is 1.71006041855278E-03. More oddly, some of the non-zero results are identical within double precision accuracy.
How can I ensure that the output is the same when I run using gdb? Is a different type of numerical calculation or evaluation used by default when using gdb?