Switching from Debug into Release Mode with VS2010 as IDE and Intel C++ Compiler 13

会有一股神秘感。 提交于 2019-12-13 07:39:19

问题


I have a code of a Plug In from an SDK. The code is in Debug Mode. I use Intel Compiler which only applies optimizations in Release Mode.

Under configuration manager of the project only "Debug" mode is defined.

How could I switch to "Release" mode and enable all Intel Compiler's optimizations? If I enable them on debug mode nothing is applied (Empty Report).

I couldn't find the trick to do so.

Thank You.

P.S. I do use the /MT switch yet still.


回答1:


Project configurations are managed by the user, so you can create Release configuration by yourself if it's missing. In the insides, they can differ by compiler options and defines, mostly. When I had very slow PC, I sometimes used configuration I've created, obviously named Debug_Optimized.

For example, Debug configuration usually has DEBUG defined. It makes some lines of code comment out, to speed up the resulting program.

You can usually speed up creation of another configuration by basing it on existing one. Look for all "Perfomance" and "Optimizations" tabs and set them according to your needs. There usually isn't one best configuration (sometimes "optimize for size" is faster than "optimize for speed"). Try these options out.




回答2:


Ok, here is the solution, First of all using the /MD or /MD, which is trivial. Then define NDEBUG. Pay attention to do this in every file in the project. In my case, some files were set to /MTd which sets the Debug mode.

I used Intel Compiler and this thread might help: http://software.intel.com/en-us/forums/topic/328136



来源:https://stackoverflow.com/questions/12571182/switching-from-debug-into-release-mode-with-vs2010-as-ide-and-intel-c-compiler

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!