Prepare the Enviroment

After successfully installing Intel® Threading Building Blocks (Intel® TBB) on your system, you need to do the following:

  • Register the environment variables to locate the necessary library and include files.
  • Find the example file directories.

If your installation was unsuccessful, install Intel TBB according to the instructions in INSTALL.txt

Register the Environment Variables

Before using Intel TBB, you must register the environment variables that are used to locate necessary library and include files as follows:

  1. Locate the configuration scripts for your operating system. The scripts are located in the bin directory.
  2. Execute the appropriate scripts or set properties for your operating system:
    • On Linux* and OS X* operating systems, from the bin directory, source the tbbvars.[c]sh script. These scripts modify the paths held by the LD_LIBRARY_PATH, DYLD_LIBRARY_PATH (OS X), and CPATH variables, and affect only your current shell.
    • On Windows* operating systems, modify your Visual Studio* project build configurations (debug, release) properties as follows:

C/C++ Properties

  • General: add an additional include directory:  "$(TBBROOT)\include"

Linker Properties

  • General: add an additional library directory (shown for Visual Studio 2005 32-bit library): $(TBBROOT)\lib\ia32\vc8
  • Input: add an additional dependency: tbb_debug.lib or tbb.lib

Find the Example File Directories

The default installation locations for the bin, doc, and examples directories used in this document are shown in the following table:

Platform

Default Directories

Linux* OS

/opt/intel/<composer_version>/tbb/[bin|examples]

/opt/intel/<composer_version>/Documentation/<locale>/tbb

OS X*

/opt/intel/<composer_version>/tbb/[bin|examples]

/opt/intel/<composer_version>/Documentation/<locale>/tbb

Windows* OS with Intel® IA-32 processor

C:\Program Files\Intel\<composer_version>\tbb\[bin|examples]

C:\Program Files\Intel\<composer_version>\Documentation\<locale>\tbb

Windows* OS with Intel® 64 Instruction Set Architecture (ISA) processor

C:\Program Files (x86)\Intel\<composer_version>\tbb\[bin|examples]

C:\Program Files (x86)\Intel\<composer_version>\Documentation\<locale>\tbb

where:

  • <composer_version> is the version of the installed Intel® Composer. For example: Composer XE 2013.
  • <locale> is the language version abbreviation. For example en_US represents English, United States language version.

有关编译器优化的更完整信息,请参阅优化通知