- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello all,
I have a fortran code using XE-12 on windows with dual core intel processor.
My code does not give the same results on optimization O3 than on normal run without optimization (Od).
I wanted to debug it but when I try to build the O3 on debug mode it gives the following erros:
Is it possible to parallel debug with O3?
How can I debug otherwise?
THanks for your help in advance.
Samba.
I have a fortran code using XE-12 on windows with dual core intel processor.
My code does not give the same results on optimization O3 than on normal run without optimization (Od).
I wanted to debug it but when I try to build the O3 on debug mode it gives the following erros:
[bash]1>libcmt.lib(invarg.obj) : error LNK2005: __initp_misc_invarg already defined in LIBCMTD.lib(invarg.obj) 1>libcmt.lib(invarg.obj) : error LNK2005: __call_reportfault already defined in LIBCMTD.lib(invarg.obj) 1>libcmt.lib(invarg.obj) : error LNK2005: __set_invalid_parameter_handler already defined in LIBCMTD.lib(invarg.obj) 1>libcmt.lib(invarg.obj) : error LNK2005: __get_invalid_parameter_handler already defined in LIBCMTD.lib(invarg.obj) 1>libcmt.lib(invarg.obj) : error LNK2005: __invoke_watson already defined in LIBCMTD.lib(invarg.obj) 1>libcmt.lib(invarg.obj) : error LNK2005: "void __cdecl _invoke_watson(unsigned short const *,unsigned short const *,unsigned short const *,unsigned int,unsigned int)" (?_invoke_watson@@YAXPBG00II@Z) already defined in LIBCMTD.lib(invarg.obj) 1>libcmt.lib(invarg.obj) : error LNK2005: __invalid_parameter already defined in LIBCMTD.lib(invarg.obj) 1>libcmt.lib(invarg.obj) : error LNK2005: "void __cdecl _invalid_parameter(unsigned short const *,unsigned short const *,unsigned short const *,unsigned int,unsigned int)" (?_invalid_parameter@@YAXPBG00II@Z) already defined in LIBCMTD.lib(invarg.obj) 1>libcmt.lib(invarg.obj) : error LNK2005: ___pInvalidArgHandler already defined in LIBCMTD.lib(invarg.obj)[/bash]
Is it possible to parallel debug with O3?
How can I debug otherwise?
THanks for your help in advance.
Samba.
Link Copied
5 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The messages state that you are linking both the debug library and the non-debug library. If this is accidental, I suppose a reason could be that you haven't rebuilt all your .obj with the debug option.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Tim,
I have actually rebuild the entire solution but it is still showing the errors.
I have actually rebuild the entire solution but it is still showing the errors.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Build your standard Release configuration.
However, turn IPO off (Inter-Procedural Optimizations)
And, include Debug symbols (IOW do not strip debug symbols). Inspect both compiler and linker properties.
Break points may be somewhat difficult to set due to inlining and code optimizations. Sometimes you may need to insert a call to a non-inlined function in which you can place a break point (and step out of to get to code of interest).
Jim Dempsey
However, turn IPO off (Inter-Procedural Optimizations)
And, include Debug symbols (IOW do not strip debug symbols). Inspect both compiler and linker properties.
Break points may be somewhat difficult to set due to inlining and code optimizations. Sometimes you may need to insert a call to a non-inlined function in which you can place a break point (and step out of to get to code of interest).
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The errors have nothing to do with optimization. It is that, as stated earlier, you have a mix of debug and non-debug libraries being linked in. Are you using libraries built elsewhere (not the compiler libraries). These may be built with other libraries specified.
You can try linking to the non-debug libraries - they won't prevent you from debugging. Under Fortran > Libraries, specify "Multithreaded (/MT)" and not "Multithreaded Debug (/MTd)" for the run-time libraries. If you are including a C/C++ project, set its libraries (under "Code Generation") to the same value.
You can try linking to the non-debug libraries - they won't prevent you from debugging. Under Fortran > Libraries, specify "Multithreaded (/MT)" and not "Multithreaded Debug (/MTd)" for the run-time libraries. If you are including a C/C++ project, set its libraries (under "Code Generation") to the same value.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Steve,
Thank you very much.
You were right, it works now that I set the options to Multithreaded/MT.
Kind regards,
Samba.
Thank you very much.
You were right, it works now that I set the options to Multithreaded/MT.
Kind regards,
Samba.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page