parallel_for_pthreads undefined reference (Bug #4386)


Added by j c almost 10 years ago. Updated over 9 years ago.


Status:Done Start date:2015-06-05
Priority:Normal Due date:
Assignee:Maksim Shabunin % Done:

0%

Category:build/install
Target version:3.1
Affected version:branch 'master' (3.0-dev) Operating System:Linux
Difficulty: HW Platform:x86
Pull request:https://github.com/Itseez/opencv/pull/4106

Description

when compile opencv-3.0.0 on slackware 12.2 after update of gtk+2 glib2 cmake etc


History

Updated by Maksim Shabunin almost 10 years ago

I couldn't reproduce this issue. Can you, please, provide additional information about your configuration (cmake output)?

  • Status changed from New to Done
  • Assignee set to Maksim Shabunin
  • Category set to build/install
  • Target version set to 3.1

Updated by Maksim Shabunin almost 10 years ago

  • Status changed from Done to Incomplete

Updated by be rak almost 10 years ago

unfortunately, i can reproduce it on a heroku box with gcc4.4.3

[ 64%] Built target opencv_adas
Linking CXX executable ../../../../bin/opencv_fcw_train
../../../../lib/libopencv_core.a(parallel.cpp.o): In function `cv::setNumThreads
(int)':
parallel.cpp:(.text._ZN2cv13setNumThreadsEi+0x7): undefined reference to `parall
el_pthreads_set_threads_num(int)'
../../../../lib/libopencv_core.a(parallel.cpp.o): In function `cv::getNumThreads
()':
parallel.cpp:(.text._ZN2cv13getNumThreadsEv+0x14): undefined reference to `paral
lel_pthreads_get_threads_num()'
../../../../lib/libopencv_core.a(parallel.cpp.o): In function `cv::parallel_for_
(cv::Range const&, cv::ParallelLoopBody const&, double)':
parallel.cpp:(.text._ZN2cv13parallel_for_ERKNS_5RangeERKNS_16ParallelLoopBodyEd+
0x31): undefined reference to `parallel_for_pthreads(cv::Range const&, cv::Paral
lelLoopBody const&, double)'
collect2: ld returned 1 exit status

full konsole log [here](https://gist.github.com/berak/f369932f86d86861ba2e#file-gistfile1-txt-L1908)

in the end, i had to disable the adas module, setting -DWITH_PARALLEL_PF=OFF from cmake does not have any effect (it is never looked at)

Updated by Maksim Shabunin almost 10 years ago

Thank you! I was able to reproduce it with gcc-4.4.3 too.

  • Status changed from Incomplete to Open
  • Pull request set to https://github.com/Itseez/opencv/pull/4106

Updated by be rak over 9 years ago

it would be nice, if -DWITH_PARALLEL_PF=OFF actually had some efect.

Updated by j c over 9 years ago

well,these 3 functions have been called in parallel.cpp,
and defined right before being called. move these definitions to
class def, it is ok now seemingly.

Updated by be rak over 9 years ago

tried a new build (without adas), i now get runtime errors:


ocv3/lib/libopencv_core.a(parallel.cpp.o): In function `cv::setNumThreads(int)':
parallel.cpp:(.text._ZN2cv13setNumThreadsEi+0x7): undefined reference to `parallel_pthreads_set_threads_num(int)'
ocv3/lib/libopencv_core.a(parallel.cpp.o): In function `cv::getNumThreads()':
parallel.cpp:(.text._ZN2cv13getNumThreadsEv+0x14): undefined reference to `parallel_pthreads_get_threads_num()'
ocv3/lib/libopencv_core.a(parallel.cpp.o): In function `cv::parallel_for_(cv::Range const&, cv::ParallelLoopBody const&, double)':
parallel.cpp:(.text._ZN2cv13parallel_for_ERKNS_5RangeERKNS_16ParallelLoopBodyEd+0x31): undefined reference to `parallel_for_pthreads(cv::Range const&, cv::ParallelLoopBody const&, double)'
collect2: ld returned 1 exit status

cmake output: https://gist.github.com/berak/e5c5887e6b5c554aedb7

Updated by Alexander Alekhin over 9 years ago

`3.0.0-1-g424c2bd`: it is master commit without fix (it is not merged yet).

Anyway you can try it directly: https://github.com/Itseez/opencv/pull/4106

Updated by be rak over 9 years ago

oh, thanks for the hint !

https://github.com/Itseez/opencv/pull/4106 works nicely, solved it for me.

Updated by Alexander Alekhin over 9 years ago

be rak wrote:

it would be nice, if -DWITH_PARALLEL_PF=OFF actually had some efect.

This patch should fix it:
https://github.com/Itseez/opencv/pull/4116

Updated by Jonathan Bouchard over 9 years ago

The patch from https://github.com/Itseez/opencv/pull/4116.patch solves the issue for me on CentOS 6.6 / GCC 4.4.7.

I successfully built OpenCV-3.0.0 with the patch, built one of my applications using OpenCV and ran it.

Updated by Alexander Alekhin over 9 years ago

  • Status changed from Open to Done

Also available in: Atom PDF