I came up with a solution. I will post him here to help others with this topic.
1) Download the latest stable source code and unzip it, i.e. in ~ / tbbsrc
2) Inside make, type make. It should start compiling the tbb library and memory allocators.
3) The headers are in ~ / tbbsrc / include
4) Inside ~ / tbbsrc / build there will be two new folders, one for the release version and the other for the debug version. These folders are called "architecture_ldVersion_g ++ Version_kernelVersion".
5) I recommend setting some variables, for example, in a .bashrc file, for example:
- TBB_INSTALL_DIR = $ HOME / tbbsrc
- TBB_INCLUDE = $ TBB_INSTALL_DIR / include
- TBB_LIBRARY_RELEASE = $ TBB_INSTALL_DIR / build / RELEASE_FOLDER
- TBB_LIBRARY_DEBUG = $ TBB_INSTALL_DIR / build / DEBUG_FOLDER
6) Let's try a simple example:
// main.cpp
7) To compile, for example, the release version:
g++ main.cpp -I$TBB_INCLUDE -Wl,-rpath,$TBB_LIBRARY_RELEASE -L$TBB_LIBRARY_RELEASE -ltbb
With -Wl,-rpath,$TBB_LIBRARY_RELEASE we tell the dynamic linker where you can find libtbb.so
8) And it should work fine!
Yours faithfully!
Installation for Apple clang 5.1: [thanks rwols for the info]
Instead of typing make type make compiler=clang or make compiler=clang stdlib=libc++
Adri cs
source share