Using the Intel C++ Compiler with Visual Studio 2010

December 20th, 2012 | Categories: C/C++, programming, Windows | Tags:

I recently installed the 64bit version of the Intel C++ Composer XE 2013 on a Windows 7 desktop alongside Visual Studio 2010.  Here are the steps I went through to compile a simple piece of code using the Intel Compiler from within Visual Studio.

  • From the Windows Start Menu click on  Intel Parallel Studio XE 2013->Parallel Studio XE 2013 with VS2010

  • Open a new project within Visual Studio: File->New Project
  • In the New Project window, in the Installed Templates pane, select Visual C++ and click on Win32 Console Application.  Give your project a name.  In this example, I have called my project ‘helloworld’. Click on OK.

  • When the Win32 Application Wizard starts, accept all of the default settings and click Finish.
  • An example source file will pop up called helloworld.cpp.  Modify the source code so that it reads as follows
#include "stdafx.h"
#include<iostream>
using namespace std;

int _tmain(int argc, _TCHAR* argv[])
{
	cout << "Hello World";
        cin.get(); 
	return 0;
}

We now need to target a 64bit platform as follows:

  • Click on Project->helloworld Properties->Configuration Properties and click on Configuration Manager.

  • The drop down menu under Active Solution Platform will say Win32. Click on this and then click on New.

  • In the New Solution Platform window choose x64 and click on OK.

  • Close the Configuration Manager and to return to the helloworld Property Pages window.
  • At the helloworld Property Pages window click on C/C++ and ensure that Suppress Startup Banner is set to No and click OK.

  • Click on Project->Intel Composer XE 2013->Use Intel C++ followed by OK. This switches from the Visual Studio Compiler to the Intel C++ compiler.
  • Finally, build the project by clicking on Build->Build Solution.  Somewhere near the top of the output window you should see
    1> Intel(R) C++ Intel(R) 64 Compiler XE for applications running on Intel(R) 64, 
    Version 13.0.1.119 Build 20121008
    1> Copyright (C) 1985-2012 Intel Corporation. All rights reserved.

    This demonstrates that we really are using the Intel Compiler to do the compilation.

  • Once compilation has completed you can run the application by pressing F5. It should open a console window that will disappear when you press Enter.

  1. MD
    December 21st, 2012 at 18:53
    Reply | Quote | #1

    Is the non-standard #include “stdafx.h” / _tmain(int argc, _TCHAR* argv[]) stuff required?
    BTW, if you use MSVC compiler, then “cin.get();” isn’t necessary, simply run your app using CTRL+F5: http://blogs.msdn.com/b/saraford/archive/2008/09/19/did-you-know-if-you-do-a-ctrl-f5-on-a-console-application-the-console-stays-open-317.aspx
    Isn’t it supported when using Inter’s compiler?

  2. December 22nd, 2012 at 22:31
    Reply | Quote | #2

    Is the non-standard stuff required? Probably not. I copied and pasted that hello world code from who knows where back in the dark ages. Copied and pasted to my own Windows compiler install notes ever since.

    I’m not sure about the cin.get() thing on Intel. Will check when I get back into work in the new year.

    To be honest, my main use of the Intel Compiler is as a mex Compiler for MATLAB. The code it produces is usually faster than that of Visual Studio.

1 trackbacks

Comments are closed.