How can I create OpenCV with TBB on a Raspberry Pi?

I am trying to create OpenCV with TBB to enable multithreading.

Note. I can create OpenCV-2.4.10 without TBB from the source code and then use the Python OpenCV bindings.

When I try to perform a new installation and create OpenCV with TBB, the flag is set WITH_TBB=ON, then I could not import cv2 - I believe that something went wrong during the build process.

Here is how I do it:

# 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
+4
source share
1 answer

Just for those who are looking for a solution to the same problem, I got success by simply asking the cmake utility to build TBB for me:

cmake -D CMAKE_BUILD_TYPE=DEBUG -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_TBB=ON -D BUILD_TBB=ON (more options) ..

cmake TBB, - :

Parallel framework:            TBB (ver 4.4 interface 9003)

cmake. Raspbian Jessie Pixel. , .

0

All Articles