Search code examples
raspberry-piopenstreetmapraspbianraspberry-pi2tbb

Installing Threading Building Blocks for Open Street Routing Machine


I am trying to build open street routing machine on an RaspberryPi 2 running Raspbian. However, it requires Threading Building Blocks library. I have tried several apt-get commands, but it keeps telling me it cannot find the repository. specifically, it says:

Package libtbb-dev is not available,but is refered to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'libtbb-dev' has no installation candidate. 

I finally broke down and downloaded the TBB source and built that. From what I can tell, threading building blocks built succesfully, but trying to build OSRM I still get the error that the TBB libraries cannot be found. I have tried copying the built TBB directory into where I think OSRM is looking for them ("/opt/intel/tbb" , "/usr/include"), but nothing is working.

Does anyone have an idea of what I might be doing wrong?

edit: This is the error I'm receiving when trying to build OSRM:

ERROR: Intel TBB NOT found!
-- Looked for Threading Building Blocks in     /opt/intel/tbb;/usr/local/include;/usr/include
CMake Error at cmake/FindTBB.cmake:272 (message):
  Could NOT find TBB library.
Call Stack (most recent call first):
  CMakeLists.txt:191 (find_package)

Solution

  • TBB makefile does not support system-wide installation. It puts files neither in /opt nor in /usr. This is usually done either by Intel Composer/Compiler/Parallel Studio installers (in /opt/intel) or by Linux distribution itself (in /usr). But your distribution seems like not providing tbb package for installation.

    So, if you want to use TBB binaries which you compiled yourself, go to $TBBROOT/build/linux*_release/ directory and source tbbvars.sh script from there in order to setup your environment before compiling your program (you will be able to compile TBB examples):

    $ source ./tbbvars.sh

    or

    $ . ./tbbvars.sh

    (note: executing it directly gives you nothing, because your environment will not be modified)

    Though, CMake's FindTBB module might be stupid enough to still report that TBB is not found because TBB does not officially support CMake. In this case, you might need either to fix the FindTBB module for looking into the env variables for TBB paths or to do the system-wide-like installation manually through copying shared library and include files to the place where CMake expects them to be located.

    The layout of files in /opt/intel/tbb is the following (modified/shortened ls -R output):

    /opt/intel/tbb/:
    /opt/intel/tbb/include:
    #copy tbb includes here
    /opt/intel/tbb/include/tbb:
    *.h
    /opt/intel/tbb/include/tbb/compat:
    *.h
    /opt/intel/tbb/include/tbb/internal:
    *.h
    /opt/intel/tbb/include/tbb/machine:
    *.h
    /opt/intel/tbb/lib:
    /opt/intel/tbb/lib/ia32_lin:
    /opt/intel/tbb/lib/ia32_lin/gcc4.1:
    /opt/intel/tbb/lib/ia32_lin/gcc4.1/irml:
    /opt/intel/tbb/lib/ia32_lin/gcc4.4:
    /opt/intel/tbb/lib/ia32_lin/gcc4.4/irml:
    /opt/intel/tbb/lib/intel64_lin:
    /opt/intel/tbb/lib/intel64_lin/gcc4.1:
    /opt/intel/tbb/lib/intel64_lin/gcc4.1/irml:
    /opt/intel/tbb/lib/intel64_lin/gcc4.4:
    irml/                    libtbbmalloc_proxy_debug.so    libtbbmalloc.so.2          libtbb.so
    libtbb_debug.so          libtbbmalloc_proxy_debug.so.2  libtbb_preview_debug.so    libtbb.so.2
    libtbb_debug.so.2        libtbbmalloc_proxy.so          libtbb_preview_debug.so.2
    libtbbmalloc_debug.so    libtbbmalloc_proxy.so.2        libtbb_preview.so
    libtbbmalloc_debug.so.2  libtbbmalloc.so                libtbb_preview.so.2