- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have a VS2005 solution comprising multiple Fortran and VC++ projects. When run from inside the IDE (release; no pdbs), the program generates the expected output. When the very same binary is run from outside the IDE the program generates different output. I confirmed that the same dependencies are loaded at runtime (libmmd.dll; libifportmd.dll; libifcoremd.dll; msvcrt.dll; msvcr80.dll), and there appear to be no project settings that would alter runtime behaviour (e.g. working directory is not set in the ide). Interestingly the debug build generates the correct output when run inside and outside the IDE, which points to a debug-release mismatch (perhaps an uninitialised variable). I am unsure quite why running release mode within the IDE apparently mimics the debug behaviour.
I extracted a filemon log from the differing runs and noticed that the (working) version run from within the IDE queries the location of all C++ lib files built by the solution, first in the release directory followed by the debug directory. The debug check is as follows:
43480 12:36:00 devenv.exe:5816 OPEN C:\TFS\Main\Source\Calculation\mysolution\myproject\Debug\ SUCCESS Options: Open Directory Access: 00100001
43481 12:36:00 devenv.exe:5816 DIRECTORY C:\TFS\Main\Source\Calculation\mysolution\myproject\Debug\ SUCCESS FileBothDirectoryInformation: myproject.lib
43482 12:36:00 devenv.exe:5816 CLOSE C:\TFS\Main\Source\Calculation\mysolution\myproject\Debug\ SUCCESS
This may not help identify the cause of the problem since the lib is not referenced elsewhere; I'm not sure why devenv even locates it at runtime.
Any ideas what may be amiss?
Thanks
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Right click on the Project => select Properties => select Fortran => command line window options
One option that can vary results is the gen-interfaces.
You can try to add /nogen-interfaces to the IDE options to see if this makes a difference.
Wendy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for suggestions. In the end this was tracked down to an uninitialised variable. Outside the IDE the uninitialised value was much larger than that inside (I hadn't realised they use different memory space), whose cumulative effectgenerated noticeably different output. The difference between debug and release IDE output was subtle.
What is your recommended approach for detecting uninitialised variables? I have experimented turning on static verification but the large number of false positives make its output almost impossible to use. The other option, /check:uninit doesn't work with arrays.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page