1

Has anyone successfully installed opencv 3.0.0 with TBB enabled on the latest rasperian on pi 2?

I followed the guide here https://www.raspberrypi.org/forums/view ... v3#p761255

The only differences I made was to the enable TBB via cmake... added BUILD and WITH TBB options as shown..

cmake -D CMAKE_BUILD_TYPE=RELEASE -D BUILD_TBB=ON -D WITH_TBB=ON -D CMAKE_INSTALL_PREFIX=$(python3 -c "import sys; print(sys.prefix)") -D PYTHON_EXECUTABLE=$(which python3) ..

I am patched current, all dependencies installed as far as I can tell.. cmake reports its going to install and old version of tbb...

-- Use TBB: YES (ver 4.1 interface 6102)

The make process fails with a linking problem I don't understand fully,

[ 66%] Built target opencv_features2d
Scanning dependencies of target opencv_test_flann
../../lib/libopencv_imgproc.so.3.0.0: undefined reference to `tbb::task_group_context::cancel_group_execution()'
../../lib/libopencv_imgproc.so.3.0.0: undefined reference to `tbb::interface5::internal::task_base::destroy(tbb::task&)'
../../lib/libopencv_core.so.3.0.0: undefined reference to `tbb::task_scheduler_init::initialize(int)'
../../lib/libopencv_core.so.3.0.0: undefined reference to `tbb::task::note_affinity(unsigned short)'
../../lib/libopencv_imgproc.so.3.0.0: undefined reference to `tbb::internal::handle_perror(int, char const*)'
../../lib/libopencv_core.so.3.0.0: undefined reference to `tbb::internal::allocate_child_proxy::allocate(unsigned int) const'
../../lib/libopencv_imgproc.so.3.0.0: undefined reference to `tbb::internal::NFS_Free(void*)'
../../lib/libopencv_core.so.3.0.0: undefined reference to `tbb::task_group_context::is_group_execution_cancelled() const'
../../lib/libopencv_imgproc.so.3.0.0: undefined reference to `tbb::internal::throw_exception_v4(tbb::internal::exception_id)'
../../lib/libopencv_core.so.3.0.0: undefined reference to `tbb::task_scheduler_init::terminate()'
../../lib/libopencv_core.so.3.0.0: undefined reference to `tbb::task_scheduler_init::initialize(int, unsigned int)'
../../lib/libopencv_core.so.3.0.0: undefined reference to `typeinfo for tbb::task'
../../lib/libopencv_imgproc.so.3.0.0: undefined reference to `tbb::internal::allocate_additional_child_of_proxy::allocate(unsigned int) const'
../../lib/libopencv_imgproc.so.3.0.0: undefined reference to `tbb::task_group_context::reset()'
../../lib/libopencv_core.so.3.0.0: undefined reference to `tbb::internal::allocate_continuation_proxy::allocate(unsigned int) const'
../../lib/libopencv_core.so.3.0.0: undefined reference to `vtable for tbb::task'
../../lib/libopencv_core.so.3.0.0: undefined reference to `tbb::internal::allocate_root_with_context_proxy::free(tbb::task&) const'
../../lib/libopencv_core.so.3.0.0: undefined reference to `tbb::task_group_context::init()'
../../lib/libopencv_imgproc.so.3.0.0: undefined reference to `tbb::internal::NFS_Allocate(unsigned int, unsigned int, void*)'
../../lib/libopencv_core.so.3.0.0: undefined reference to `tbb::task_scheduler_init::default_num_threads()'
../../lib/libopencv_core.so.3.0.0: undefined reference to `tbb::internal::get_initial_auto_partitioner_divisor()'
../../lib/libopencv_core.so.3.0.0: undefined reference to `tbb::task_group_context::~task_group_context()'
../../lib/libopencv_core.so.3.0.0: undefined reference to `tbb::internal::allocate_root_with_context_proxy::allocate(unsigned int) const'
[ 66%] Building CXX object modules/core/CMakeFiles/opencv_perf_core.dir/perf/perf_abs.cpp.o
collect2: ld returned 1 exit status
apps/annotation/CMakeFiles/opencv_annotation.dir/build.make:99: recipe for target 'bin/opencv_annotation' failed
make[2]: *** [bin/opencv_annotation] Error 1
CMakeFiles/Makefile2:7228: recipe for target 'apps/annotation/CMakeFiles/opencv_annotation.dir/all' failed
make[1]: *** [apps/annotation/CMakeFiles/opencv_annotation.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....

Things I've tried...

  1. I thought a newer version of TBB may help... so after failing as shown above I hacked the opencv installer and changed the TBB load to the latest release... no joy.. same problem.
  2. Trying to make it finish I found I could update the cmakelists.txt in the opencv/apps folder not install the annotation app.. Still failed. but on a different app.. traincascade... removed it.. same... remove the last app in the directory from CmakeLists.txt and it succeeded. However when attempting to link my c app it complains with the unresolved references on imgproc :|
  3. Ran ccmake ../ and turned of build tests and other extras... no joy.

Appreciate any help I can .. want tbb to use the four cores for my pi if i can!

Anton
  • 6,349
  • 1
  • 25
  • 53
  • you use raspbian? maybe try a different OS: https://www.raspberrypi.org/forums/viewtopic.php?f=33&t=98551 – Micka Jun 20 '15 at 17:46
  • possible duplicate of [How do I build OpenCV with TBB?](http://stackoverflow.com/questions/7994261/how-do-i-build-opencv-with-tbb) – Anton Jun 21 '15 at 08:29
  • I tried compiling OpenCV 3.0.0 with build_tbb and everything on my Rpi 2 just like you mentioned. I failed just like you. However, I was able to compile OpenCV 2.4.9 successfully with with TBB on my Rpi 2. So if version of OpenCV is not critical for your application, you may try compiling OpenCV 2.4.9 with TBB support. Hope it helps. – dhruvvyas90 Jun 21 '15 at 10:39
  • Sorry Anton... Tried that, tbb compiles fine whether opencv does it or I do it myself and set the include/lib paths as shown in your link, ultimately it fails on the same applications. – megaoldgeek Jun 21 '15 at 18:17
  • Sorry Micka, I want rasp. and if you look close at that link they supposedly solved it with rasp. and a beta load of openCV I am using, not by switching OSes. – megaoldgeek Jun 21 '15 at 18:18
  • dastaan, I wanted 3.0.0 for LGP videoio functionality shown in https://github.com/Itseez/opencv/blob/master/samples/cpp/tutorial_code/objectDetection/objectDetection2.cpp. Maybe 2.4.9 will work with this, I simply assumed since it was in the master branch it was 3.0x and higher. PS: I will complile 2.4.9 and let you know! thanks! – megaoldgeek Jun 21 '15 at 18:25
  • @megaoldgeek Did you mean LBP instead of LGP in your comment above ? I didn't understand what you meant by LGP videoio functionality. – dhruvvyas90 Jun 22 '15 at 11:53
  • Yes LBP. So I did in fact get the example I wanted running use the 2.4.11 compile with TBB on.. 3.0.0 is just plain ole broke with TBB on and more. – megaoldgeek Jun 22 '15 at 18:36
  • @megaoldgeek I think LBP cascades can be used with 2.4.9 as well. – dhruvvyas90 Jun 24 '15 at 06:51

1 Answers1

0

Latest update August 2018,

Check out my git: https://github.com/abhiTronix/OpenCV_Raspberry_pi_TBB

Latest pre-compiled binary of Pre-released OpenCV (4.0.0) & Stable OpenCV (3.4.2) along with TBB (2018-Update 4) for the Raspberry Pi (Tested on Rpi version 2/3 Model B/B+ with Stretch) easy install (.deb file)

It is built by me from scratch, you can check it for more detailed information.

abhiTronix
  • 1,248
  • 13
  • 17