Ask Your Question
7

How to build OpenCV with TBB support?

asked 2012-06-09 02:47:37 -0600

Kirill Kornyakov gravatar image

updated 2017-10-16 14:45:11 -0600

I want to use OpenCV with multi-threading enabled, how can I achieve this?

edit retag flag offensive close merge delete

3 answers

Sort by ยป oldest newest most voted
10

answered 2012-06-26 09:53:05 -0600

icedecker gravatar image

updated 2012-06-26 09:55:18 -0600

First of all, you need to have TBB installed. You can get it at http://threadingbuildingblocks.org/.

When you build OpenCV with cmake, include the option WITH_TBB=ON. Example:

cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_TBB=ON -D BUILD_PYTHON_SUPPORT=ON  ..
edit flag offensive delete link more

Comments

2

If you dont want to build tbb from source and are using linux you can pull the library using apt-get. libtbb2 and libtbb-dev are the libraries you need to install

benzun gravatar imagebenzun ( 2012-11-20 11:46:46 -0600 )edit
1

If I build with tbb, does it mean that openCV will automatically use multiple cores on its functions? Or is there any further procedure?

Pedro Batista gravatar imagePedro Batista ( 2014-07-14 07:02:56 -0600 )edit

And if cmake WITH_TBB=ON=ON followed by make still produces Use TBB: NO, what could be causing that?

cvandroid gravatar imagecvandroid ( 2014-07-28 19:35:22 -0600 )edit

On OS X, if you don't want to build TBB brew install tbb also works fine

Dmitry Zaytsev gravatar imageDmitry Zaytsev ( 2016-04-01 04:59:03 -0600 )edit
2

answered 2012-07-09 01:34:16 -0600

Niu ZhiHeng gravatar image

updated 2012-07-09 01:35:20 -0600

You may also CMake GUI. Just check the box of WITH_TBB.

You can download CMake from the link below.

http://www.cmake.org/cmake/resources/software.html

edit flag offensive delete link more
0

answered 2014-01-19 09:24:29 -0600

SpiderGears gravatar image

updated 2014-01-19 09:33:57 -0600

berak gravatar image

Add option WITH_TBB=ON when building opencv.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2012-06-09 02:47:37 -0600

Seen: 31,480 times

Last updated: Jan 19 '14