-
Introduction
This guide is intended to help the Intel® C++ Compiler customers to use the Intel® Threading Building Blocks (TBB) to thread applications and build the applications with Intel C++ Compiler. It covers Windows*, Linux* and Mac OS* X Operating Systems.
-
Version information and where to download
-
The latest Intel C++ Compiler is 10.1 release. To get a free 30-day eval version, visit Intel® Software Evaluation Center.
-
The latest TBB is 2.0 release. You can download it free from http://threadingbuildingblocks.org/*.
-
Prerequisites
Both Intel C++ Compiler for Windows* and TBB for Windows require a version of Visual Studio*. Please read the system requirements below.
-
For Intel C++ Compilers system requirements, please visit following links:
-
For TBB system requirements, please visit here Threading Building blocks.org*.
-
Set build environment
Windows*
-
Set the command window with Visual Studio* 2005 compatibility:
-
Open the Intel C++ Compiler Build Environment by selecting Start » All Programs » Intel® software development tools » Intel C++ Compiler 10.x.x.x » C++ Build Environment for Applications running on [IA32 | Intel® 64]. This sets up the environment to use the Intel C++ Compiler.
-
Run TBB .bat file from the above build environment window to setup the environment to include TBB directories.
>> [tbb-install-dir-root]\2.0\ia32\vc8\bin\tbbvars.bat or
>> [tbb-install-dir-root]\2.0\em64t\vc8\bin\tbbvars.bat
- Now you can compile your application that uses TBB with Intel C++ Compiler. E.G.:
>> icl -c tbb_app.cpp
>> xilink tbb_app.obj tbb.lib tbbmalloc.lib
Set the Visual Studio 2005* IDE to build applications using TBB and Intel C++ Compiler:
Make sure you have installed the Visual Studio Integrations Component from Intel C++ Compiler. To check, open the Visual Studio 2005, select menu Help, if you see Intel(R) C++ Compiler Help, it means you do have it installed.
To add TBB directories to Visual Studio 2005, open Visual Studio 2005, select menu Tools » Options. It will open the Options dialog and select Projects and Soution » VC++ Directories in the left side, add following directories:
Add [tbb-install-dir-root]\2.0\ia32\vc8\bin to directory list of Executable files for platforms you'd like i.e. Win32, x64" and Itanium.
Add [tbb-install-dir-root]\2.0\ia32\vc8\lib to directory list of Library files for the same platforms.
Add [tbb-install-dir-root]\2.0\include to directory list of Include files for the same platforms.
Open your application from Visual Studio 2005, convert the solution or some projects to use Intel C++ Project System by right click on the projects in Solution Explorer and select Convert to use Intel C++ Project System in the pop-up menu.
Now you're ready to use TBB and compile those projects with Intel C++ Compiler.
Mac OS* X
-
Set the command window on Mac OS* X:
-
Open a terminal window and source the Intel C++ Compiler script iccvars.sh:
$ source /opt/intel/cc/10.1.xxx/bin/iccvars.sh
-
In the same terminal window, source the TBB script tbbvars.sh:
$ source /Library/Frameworks/Intel_TBB.framework/Versions/2.0/bin/tbbvars.sh
- Now you can use Intel C++ Compiler to build your application that uses TBB like below:
$ icpc -c tbb_app.cpp
$ icpc tbb_app.o tbb.lib tbbmalloc.lib
-
Set Xcode* to use TBB and Intel C++ Compiler:
-
Open your mytest.xcodeproj with Xcode.
- Open the Project mytest Info dialog to add the TBB paths to the project:
-
Set Configurations field to All Configurations
-
Select Build tab on the Project Info dialog, scroll down to Search paths section, Add [tbb-install-dir-root]\2.0\include to Header Search Paths.
-
Add [tbb-install-dir-root]\2.0\include to Library Search Paths
-
Close the Project Info dialog.
-
Next is to set the compiler to Intel C++ Compiler:
-
Select one of the Targets under Groups & Files, then click Info button on top. It opens the Target Info dialog.
-
Select Rules" tab, click + button to add a new setting. Then on the new setting box, set Process as C++ Source Files, set using as Intel C++ Compiler 10.x.
-
Click + button again to add a new setting for C Source Files using Intel C++ Compiler 10.x like above.
-
Close this Target Info dialog.
-
Now you can build the program that uses both TBB and Intel C++ Compiler.
Linux*
-
Set the command window:
-
Open a terminal window and source the Intel C++ Compiler script iccvars.sh:
$ source /opt/intel/cc/10.1.xxx/bin/iccvars.sh
-
In the same terminal window, source the TBB script tbbvars.sh:
$ source /opt/intel/tbb/2.0/bin/tbbvars.sh
-
Now you can use Intel C++ Compiler to build your application that uses TBB like below:
$ icpc -c tbb_app.cpp
$ icpc tbb_app.o tbb.lib tbbmalloc.lib
-
Set Eclipse* to use TBB and Intel C++ Compiler:
-
Intel C++ Compiler 10.x supports Eclipse 3.2.x and CDT 3.1.x.
-
Start Eclipse by following command:
$ iccec
-
Open an existing Intel C/C++ Compiler project - see "Build Applications in Eclipse" in the User's Guide.
-
Select your project in the C/C++ Projects view, then select menu Project &rquao; Properties » C/C++ Build. You should see Properties for yourproject dialog:
-
Select C/C++ Build on the left, under Configuration settings list, you can add the TBB include -I[tbb-install-dir-root]\2.0\include to Command Line under the C Compiler.
-
Add the additional TBB lib directory -L[tbb-install-dir-root]\2.0\lib or Command Line under Linker.
-
Close the properties dialog.
-
Now you can build the project.
Other useful links
This applies to:
|