title: How do I build OpenCV with TBB on Raspberry Pi?
body: <p>I am trying to build OpenCV with TBB to enable multi-threading. </p>
  
  <p><strong>Note:</strong> I am able to build OpenCV-2.4.10 <strong>without TBB</strong> from source and then use the OpenCV Python bindings. </p>
  
  <p>When I try a fresh install and building OpenCV with TBB installed the <code>WITH_TBB=ON</code> flag I am then <strong>unable to</strong> <code>import cv2</code> - I take this to mean something has gone wrong in the build process.</p>
  
  <p>Here's how I'm trying to do it:</p>
  
  <pre><code># Download, unpack and build TBB:
  wget -O ~/tbb43_20150316oss_src.tgz --no-check-certificate https://www.threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb43_20150316oss_src.tgz
  tar -xvzf tbb43_20150316oss_src.tgz
  cd tbb43_20150316oss
  make tbb CXXFLAGS="-DTBB_USE_GCC_BUILTINS=1 -D__TBB_64BIT_ATOMICS=0"
  
  
  # Build OpenCV:
  cmake -D WITH_TBB=ON -D CMAKE_BUILD_TYPE=RELEASE \
  -D CMAKE_INSTALL_PREFIX=/usr/local \
  -D BUILD_NEW_PYTHON_SUPPORT=ON \
  -D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON  \
  -D BUILD_EXAMPLES=ON ..
  
  make -j4
  </code></pre>