Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
21 Views

Different results between "Start Debugging" and just running the file

Hello,

I have this C++ project built in release mode (see the compiler and linker options below) but I get some strange behaviour. Running the program from WITHIN the IDE, that is, using either "Start Debugging" or "Start Without Debugging" - it works fine. But if I try running the program by just using the executable file produced - it gives a different result (in my case, a matrix is not positive-definite). This happens only in a few test cases. I am using Visual Studio 2008 Professional SP 1 with Intel C++ Compiler 11.1.054. Here are the compiler options (I have removed the includes):

/c /O3 /Og /Ob2 /Oi /Ot /Oy /GT /Qipo /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "QT_DLL" /D "_VC80_UPGRADE=0x0710" /D "_MBCS" /GF /EHsc /MD /GS- /fp:strict /fp:except /GR- /Fo".\\Release/" /W0 /nologo /Qfp-speculation:off /QaxSSE2 /QxSSE2 -Qoption,cpp,--extended_float_type

The linker options (again without libraries anddirs):

/INCREMENTAL:NO /nologo /MANIFEST /MANIFESTFILE:".\\Release\\prog.exe.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /NODEFAULTLIB:"LIBCMT" /TLBID:1 /SUBSYSTEM:CONSOLE /OPT:REF /OPT:ICF /DYNAMICBASE:NO /MACHINE:X86

What am I missing? I was thinking it might have something to do with floating point speculation, but as you see I have turned it off and changed the fp model to strict.
0 Kudos
3 Replies
Highlighted
Beginner
21 Views

Anyone can help?

0 Kudos
Highlighted
New Contributor I
21 Views

When I've run into issues like this in the past, the cause has usually been an unintialized variable/value. The main difference between start debugging and running the app is that the IDE provides a clean (zeroed) space for the app to run in.
0 Kudos
Highlighted
Moderator
21 Views

When running the .exe from a cmd window, make sure to to use the "build environment" from the intel C++ compiler menu from "Start->all programs -> intel software development tools-> Intel C++ Compiler... -> Build env....". So the correct DLLs will be loaded.

If you just run the .exe from Explorer by double clicking it, you need to make sure the "path" env is set to the correct IntelC bin directory.
Or you can copy/paste the DLLs from the intelc-bin-dir to the folder where .exe exists.

thanks,
Jennifer

0 Kudos