Overview

This directory contains the internal Makefile infrastructure for Threading Building Blocks.

See below for how to build TBB and how to port TBB to a new platform, operating system or architecture.

Files

The files here are not intended to be used directly. See below for usage.
Makefile.tbb
Main Makefile to build the TBB library. Invoked via 'make tbb' from top-level Makefile.
Makefile.tbbmalloc
Main Makefile to build the TBB scalable memory allocator library as well as its tests. Invoked via 'make tbbmalloc' from top-level Makefile.
Makefile.test
Main Makefile to build and run the tests for the TBB library. Invoked via 'make test' from top-level Makefile.
common.inc
Main common included Makefile that includes OS-specific and compiler-specific Makefiles.
<os>.inc
OS-specific Makefile for a particular <os>.
<os>.<compiler>.inc
Compiler-specific Makefile for a particular <os> / <compiler> combination.
*.sh
Infrastructure utilities for Linux*, Mac OS* X, and UNIX*-related systems.
*.js, *.bat
Infrastructure utilities for Windows* systems.

To Build

To port TBB to a new platform, operating system or architecture, see the porting directions below.

Software prerequisites:

  1. C++ compiler for the platform, operating system and architecture of interest. Either the native compiler for your system, or, optionally, the appropriate Intel® C++ compiler, may be used.
  2. GNU make utility. On Windows*, if a UNIX* emulator is used to run GNU make, it should be able to run Windows* utilities and commands. On Linux*, Mac OS* X, etc., shell commands issued by GNU make should execute in a Bourne or BASH compatible shell.

TBB libraries can be built by performing the following steps. On systems that support only one ABI (e.g., 32-bit), these steps build the libraries for that ABI. On systems that support both 64-bit and 32-bit libraries, these steps build the 64-bit libraries (Linux*, Mac OS* X, and related systems) or whichever ABI is selected in the development environment (Windows* systems).

  1. Change to the top-level directory of the installed software.
  2. If using the Intel® C++ compiler, make sure the appropriate compiler is available in your PATH (e.g., by sourcing the appropriate iccvars script for the compiler to be used).
  3. Invoke GNU make using no arguments, for example, 'gmake'.

To build TBB libraries for other than the default ABI (e.g., to build 32-bit libraries on Linux*, Mac OS* X, or related systems that support both 64-bit and 32-bit libraries), perform the following steps.

  1. Change to the top-level directory of the installed software.
  2. If using the Intel® C++ compiler, make sure the appropriate compiler is available in your PATH (e.g., by sourcing the appropriate iccvars script for the compiler to be used).
  3. Invoke GNU make as follows, 'gmake arch=ia32'.

The default make target will build the release and debug versions of the TBB library.

Other targets are available in the top-level Makefile. You might find the following targets useful:

See also the list of other targets below.

By default, the libraries will be built in sub-directories within the build/ directory. The sub-directories are named according to the operating system, architecture, compiler and software environment used (the sub-directory names also distinguish release vs. debug libraries). On Linux*, the software environment comprises the GCC, libc and kernel version used. On Mac OS* X, the software environment comprises the GCC and OS version used. On Windows, the software environment comprises the Microsoft* Visual Studio* version used. See below for how to change the default build directory.

To perform different build and/or test operations, use the following steps.

  1. Change to the top-level directory of the installed software.
  2. If using the Intel® C++ compiler, make sure the appropriate compiler is available in your PATH (e.g., by sourcing the appropriate iccvars script for the compiler to be used).
  3. Invoke GNU make by using one or more of the following commands.
    make
    Default build. Equivalent to 'make tbb tbbmalloc'.
    make all
    Equivalent to 'make tbb tbbmalloc test examples'.
    cd src;make release
    Build and test release libraries only.
    cd src;make debug
    Build and test debug libraries only.
    make tbb
    Make TBB release and debug libraries.
    make tbbmalloc
    Make TBB scalable memory allocator libraries.
    make test
    Compile and run unit-tests
    make examples
    Build libraries and run all examples, like doing 'make debug clean release' from the general example Makefile.
    make compiler={icl, icc} [(above options or targets)]
    Build and run as above, but use Intel® compilers instead of default, native compilers (e.g., icl instead of cl.exe on Windows* systems, or icc instead of g++ on Linux* or Mac OS* X systems).
    make arch={ia32, intel64, ia64} [(above options or targets)]
    Build and run as above, but build libraries for the selected ABI. Might be useful for cross-compilation; ensure proper environment is set before running this command.
    make tbb_root={(TBB directory)} [(above options or targets)]
    Build and run as above; for use when invoking 'make' from a directory other than the top-level directory.
    make tbb_build_dir={(build directory)} [(above options or targets)]
    Build and run as above, but place the built libraries in the specified directory, rather than in the default sub-directory within the build/ directory. This command might have troubles with the build in case the sources installed to the directory with spaces in the path.
    make tbb_build_prefix={(build sub-directory)} [(above options or targets)]
    Build and run as above, but place the built libraries in the specified sub-directory within the build/ directory, rather than using the default sub-directory name.
    make tbb_cpf=1 [(above options or targets)]
    Build and run as above, but build and use libraries with the Community Preview Features enabled, rather than the default libraries.
    make [(above options)] clean
    Remove any executables or intermediate files produced by the above commands. Includes build directories, object files, libraries and test executables.

To Port

This section provides information on how to port TBB to a new platform, operating system or architecture. A subset or a superset of these steps may be required for porting to a given platform.

To port the TBB source code:

  1. If porting to a new architecture, create a file that describes the architecture-specific details for that architecture.
  2. Add an implementation of DetectNumberOfWorkers() in src/tbb/tbb_misc.h, if needed, that returns the number of cores found on the system. This is used to determine the default number of threads for the TBB task scheduler.
  3. Either properly define FillDynamicLinks for use in src/tbb/cache_aligned_allocator.cpp, or hardcode the allocator to be used.
  4. Additional types might be required in the union defined in include/tbb/aligned_space.h to ensure proper alignment on your platform.
  5. Changes may be required in include/tbb/tick_count.h for systems that do not provide gettimeofday.

To port the Makefile infrastructure:

Modify the appropriate files in the Makefile infrastructure to add a new platform, operating system or architecture as needed. See the Makefile infrastructure files for examples.
  1. The top-level Makefile includes common.inc to determine the operating system.
  2. The <os>.inc file makes OS-specific settings for a particular <os>.
  3. The <os>.<compiler>.inc file makes compiler-specific settings for a particular <os> / <compiler> combination.

Up to parent directory

Copyright © 2005-2012 Intel Corporation. All Rights Reserved.

Intel and Itanium are registered trademarks or trademarks of Intel Corporation or its subsidiaries in the United States and other countries.

* Other names and brands may be claimed as the property of others.