Posts Tagged ‘C/C++’

December 20th, 2012

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.

TOP