Closed alealv closed 6 years ago
make VERBOSE=1
)-Wl,--verbose
).I guess you have installed system libtbb.so.2.
To fix this, ensure that you call tbbvars.sh
before "make" (it should setup "LIBRARY_PATH" environment variable).
I've installed the last intel performance libraries 2018.1.163
So I ran manually
source /opt/intel/compilers_and_libraries_2018.1.163/linux/tbb/bin/tbbvars.sh intel64
before compiling. But I've got the same output
[ 64%] Linking CXX executable ../../../../bin/opencv_waldboost_detector cd /home/alejandroalvarez/Software/opencv/build/modules/xobjdetect/tools/waldboost_detector && /usr/bin/cmake -E cmake_link_script CMakeFiles/opencv_waldboost_detector.dir/link.txt --verbose=1 /usr/bin/c++ -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-comment -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -msse -msse2 -msse3 -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG -DNDEBUG -Wl,--gc-sections CMakeFiles/opencv_waldboost_detector.dir/waldboost_detector.cpp.o -o ../../../../bin/opencv_waldboost_detector -L/opt/intel/compilers_and_libraries_2018.0.128/linux/mkl/lib/intel64 -rdynamic ../../../../lib/libopencv_core.a ../../../../lib/libopencv_imgproc.a ../../../../lib/libopencv_imgcodecs.a ../../../../lib/libopencv_videoio.a ../../../../lib/libopencv_highgui.a ../../../../lib/libopencv_xobjdetect.a ../../../../lib/libopencv_videoio.a -lgstbase-0.10 -lgstreamer-0.10 -lgmodule-2.0 -lxml2 -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lgthread-2.0 -lglib-2.0 ../../../../lib/libopencv_imgcodecs.a -ljpeg ../../../../3rdparty/lib/liblibwebp.a -lpng ../../../../3rdparty/lib/liblibtiff.a ../../../../3rdparty/lib/liblibjasper.a ../../../../3rdparty/lib/libIlmImf.a ../../../../lib/libopencv_objdetect.a ../../../../lib/libopencv_imgproc.a ../../../../lib/libopencv_core.a -lz -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lpthread -lm -ldl ../../../../3rdparty/lib/libittnotify.a -ldl -lm -lpthread -lrt /opt/intel/compilers_and_libraries_2018.1.163/linux/tbb/lib/intel64/gcc4.7/libtbb.so ../../../../3rdparty/lib/libippiw.a /opt/intel/ipp/lib/intel64/libippcv.so /opt/intel/ipp/lib/intel64/libippi.so /opt/intel/ipp/lib/intel64/libippcc.so /opt/intel/ipp/lib/intel64/libipps.so /opt/intel/ipp/lib/intel64/libippvm.so /opt/intel/ipp/lib/intel64/libippcore.so -Wl,-rpath,/opt/intel/compilers_and_libraries_2018.0.128/linux/mkl/lib/intel64:/opt/intel/ipp/lib/intel64::::::::::::::: ../../../../lib/libopencv_core.a(parallel.cpp.o): In function
cv::getNumThreads()': parallel.cpp:(.text._ZN2cv13getNumThreadsEv+0x38): undefined reference to
tbb::interface7::internal::task_arena_base::internal_max_concurrency(tbb::interface7::task_arena const*)' collect2: error: ld returned 1 exit status modules/xobjdetect/tools/waldboost_detector/CMakeFiles/opencv_waldboost_detector.dir/build.make:130: recipe for target 'bin/opencv_waldboost_detector' failed make[2]: [bin/opencv_waldboost_detector] Error 1 make[2]: Leaving directory '/home/alejandroalvarez/Software/opencv/build' CMakeFiles/Makefile2:5135: recipe for target 'modules/xobjdetect/tools/waldboost_detector/CMakeFiles/opencv_waldboost_detector.dir/all' failed make[1]: [modules/xobjdetect/tools/waldboost_detector/CMakeFiles/opencv_waldboost_detector.dir/all] Error 2 make[1]: Leaving directory '/home/alejandroalvarez/Software/opencv/build' Makefile:163: recipe for target 'all' failed make: *** [all] Error 2
What LIBRARY_PATH
do you have?
$ echo ${LIBRARY_PATH}
/opt/intel/compilers_and_libraries_2018.1.163/linux/tbb/lib/intel64/gcc4.7
Problem is here:
$ cat /opt/intel/tbb/lib/intel64/gcc4.7/libtbb.so
INPUT (libtbb.so.2)
This occasionally redirects linker to system libtbb.so.2
if LIBRARY_PATH
is not correct. This leads that you did't use Intel TBB binary really (if you have system one).
BTW, I believe this is very strange way to simulate versioning .so
symbolic link (via linker scripts). True Linux way looks like this:
$ ll /usr/lib64/libtbb.so*
lrwxrwxrwx. 1 root root 11 Jun 11 2017 /usr/lib64/libtbb.so -> libtbb.so.2
-rwxr-xr-x. 1 root root 246056 Jun 11 2017 /usr/lib64/libtbb.so.2
Perhaps this should be reported to TBB team (https://github.com/01org/tbb/issues)
Sorry, Looks like LIBRARY_PATH
doesn't work well.
Try to add this linker option instead:
-L/opt/intel/compilers_and_libraries_2018.1.163/linux/tbb/lib/intel64/gcc4.7
For example:
cmake -DCMAKE_CXX_FLAGS="-Wl,-L/opt/intel/compilers_and_libraries_2018.1.163/linux/tbb/lib/intel64/gcc4.7" <...>
Example of bad sequence (Fedora 26, -Wl,--verbose
):
attempt to open /opt/intel/tbb/lib/intel64/gcc4.7/libtbb.so succeeded
opened script file /opt/intel/tbb/lib/intel64/gcc4.7/libtbb.so
attempt to open libtbb.so.2 failed
attempt to open /usr/lib/gcc/x86_64-redhat-linux/7/libtbb.so.2 failed
attempt to open /usr/lib/gcc/x86_64-redhat-linux/7/../../../../lib64/libtbb.so.2 succeeded
libtbb.so.2 (/usr/lib/gcc/x86_64-redhat-linux/7/../../../../lib64/libtbb.so.2)
Good linker sequence:
attempt to open /opt/intel/tbb/lib/intel64/gcc4.7/libtbb.so succeeded
opened script file /opt/intel/tbb/lib/intel64/gcc4.7/libtbb.so
attempt to open libtbb.so.2 failed
attempt to open /opt/intel/tbb/lib/intel64/gcc4.7//libtbb.so.2 succeeded
libtbb.so.2 (/opt/intel/tbb/lib/intel64/gcc4.7//libtbb.so.2)
CMake output:
Detailed description
I experiencing a problem when compiling OpenCV with TBB libraries after this merge https://github.com/opencv/opencv/pull/10697
Compiling output