Ask Your Question
0

opencv 3.0.0-alpha build failure with tbb

asked 2014-08-28 17:57:41 -0600

Steven P. Goldsmith gravatar image

Ubuntu 14.04, x86_64 using:

cmake -DCMAKE_BUILD_TYPE=RELEASE -DBUILD_SHARED_LIBS=ON -DINSTALL_PYTHON_EXAMPLES=ON -DWITH_TBB=ON -DBUILD_TBB=ON -DWITH_V4L=ON -DWITH_OPENGL=ON -DWITH_OPENCL=ON -DWITH_EIGEN=ON -DWITH_OPENEXR=ON -DBUILD_JPEG=ON ..

make -j$(getconf _NPROCESSORS_ONLN)

fails with:

Linking CXX executable ../../bin/opencv_test_flann
../../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::task_group_context::is_group_execution_cancelled() const'
../../lib/libopencv_core.so.3.0.0: undefined reference to `tbb::internal::allocate_continuation_proxy::allocate(unsigned long) const'
../../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 `typeinfo for tbb::task'
../../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_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_scheduler_init::initialize(int, unsigned long)'
../../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_child_proxy::allocate(unsigned long) const'
../../lib/libopencv_core.so.3.0.0: undefined reference to `tbb::internal::allocate_root_with_context_proxy::allocate(unsigned long) const'
collect2: error: ld returned 1 exit status
make[2]: *** [bin/opencv_test_flann] Error 1
make[1]: *** [modules/flann/CMakeFiles/opencv_test_flann.dir/all] Error 2

If I disable TBB build makes it 100%.

edit retag flag offensive close merge delete

Comments

Maybe path to tbb wrong? with ccmake instead of cmake you have a comfortable gui where you can check the paths.

Guanta gravatar imageGuanta ( 2014-08-29 03:20:48 -0600 )edit

Perhaps, but this is the same build method I used with 2.4.9.0. Other than -DWITH_TBB=ON -DBUILD_TBB=ON, I'm not sure why the path would be different.

Steven P. Goldsmith gravatar imageSteven P. Goldsmith ( 2014-09-01 12:44:30 -0600 )edit

3 answers

Sort by ยป oldest newest most voted
0

answered 2014-09-10 20:19:27 -0600

Steven P. Goldsmith gravatar image

updated 2014-09-10 20:21:33 -0600

I was able to figure this out after posting a bug.

Here's what I use now to get TBB enabled with OpenCV 3.0.0 master on GitHub:

x86

cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_CUBLAS=ON -D WITH_CUFFT=ON -D WITH_EIGEN=ON -D WITH_OPENGL=ON -D WITH_QT=OFF -D WITH_TBB=ON -D BUILD_SHARED_LIBS=ON -D BUILD_DOCS=ON -D BUILD_EXAMPLES=ON -D BUILD_TESTS=ON ..

armv7l

cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_CUBLAS=ON -D WITH_CUFFT=ON -D WITH_EIGEN=ON -D WITH_OPENGL=ON -D WITH_QT=OFF -D WITH_TBB=ON -D BUILD_SHARED_LIBS=ON -D BUILD_DOCS=ON -D BUILD_EXAMPLES=ON -D BUILD_TESTS=ON -D ENABLE_VFPV3=ON -D ENABLE_NEON=ON ..
edit flag offensive delete link more
0

answered 2014-09-08 17:27:18 -0600

Steven P. Goldsmith gravatar image

The key here is -DBUILD_TBB=ON, if this is set the build will break regardless of the other settings.

edit flag offensive delete link more
-1

answered 2014-09-01 15:02:52 -0600

jmasana gravatar image

updated 2014-09-02 02:04:22 -0600

I am having the same problem, also using Ubuntu 14.04, x86_64. I can build it 100% if I disable TBB like you.

I don't know why appears many "undefined reference to tbb" while building OpenCV 3.0 if we can build OpenCV 2.4.9 with TBB enabled and put all processor cores to work running OpenCV programs.

EDIT:

I solved it and write in this post what I changed (at the end):

http://code.opencv.org/issues/3885

edit flag offensive delete link more

Comments

BUILD_PERF_TESTS, BUILD_TESTS helped the build get to near 100%. I'm not using QT, so I'm not sure that's relevant. You can see I have Python and Java working using shared libs, but no TBB https://github.com/sgjava/install-opencv

Steven P. Goldsmith gravatar imageSteven P. Goldsmith ( 2014-09-02 21:07:23 -0600 )edit

Nice. In my case I can compile and work with OpenCV 3.0 without TBB enabled, but with TBB enabled I followed all the steps I wrote in the above link and I can build OCV 3.0 but after, for example in the samples, I just can compile and run videostab.cpp but drawing.cpp I can't.

jmasana gravatar imagejmasana ( 2014-09-03 06:16:12 -0600 )edit

Yea, TBB is essential for multi-core systems, even ARM. I'm happy to get all my Python and Java examples running. I'm sure TBB will be fixed over time. I'd rather not skip tests, but if I need to patch something I'm OK with that. I already patch the Java source and fix the memory leaks, etc.

Steven P. Goldsmith gravatar imageSteven P. Goldsmith ( 2014-09-03 09:11:40 -0600 )edit

Question Tools

Stats

Asked: 2014-08-28 17:57:41 -0600

Seen: 4,018 times

Last updated: Sep 10 '14