Build the Application

Intel® Threading Building Blocks is compatible with the GCC* and Microsoft compilers. This section assumes that you are using the Intel® C++ Compiler. You can use the GCC or Microsoft C++ compilers interchangeably in the directions given below.

Building Code from the Examples Directory

If you did not follow the steps in the example in the previous topic, you can build from the completed source code provided in the examples/GettingStarted folder.

Linux* OS or macOS* Systems

  1. cd to the directory examples/GettingStarted/sub_string_finder/.
  2. Enter make to build and run the example.

Windows* Operating Systems

  1. Invoke Visual Studio on the file examples\GettingStarted\sub_string_finder\msvs\sub_string_finder.sln using one of the following methods:
    • Browse to the directory containing sub_string_finder.sln and double-click the file.
    • Invoke Visual Studio from the Start menu, and then open the sub_string_finder.sln file via File > Open > Open Project.
  2. Press <Ctrl-F5> to build and run the example.

Building Manually Typed Code

If you manually typed the code provided in the previous topic, build your application by invoking the appropriate compiler directly:

Linux* OS or macOS* Systems

Use the command line:

icc sub_string_finder.cpp ltbb 

Windows* OS from the Command Line

From within the Intel C++ Compiler build environment issue the following command:

icl /MD sub_string_finder.cpp tbb.lib 

Para obtener información más completa sobre las optimizaciones del compilador, consulte nuestro Aviso de optimización.