【发布时间】:2023-03-10 07:10:01
【问题描述】:
我正在尝试使用以下 CMAKE 选项构建 opencv:
cmake -D CMAKE_BUILD_TYPE=DEBUG -D CMAKE_INSTALL_PREFIX=/home/luca/Dropbox/SURFSPM/opencvInstall -D OPENCV_EXTRA_MODULES_PATH=/home/luca/ParallelOpenCV/opencv_contrib/modules -D WITH_TBB=ON -D WITH_OPENMP=ON -D ENABLE_PROFILING=ON ..
请注意,在RELEASE 模式下,OpenCV 已正确编译所有其他选项。但是,在 43% 时它返回此错误:
[ 42%] Built target pch_Generate_opencv_perf_optflow
[ 42%] Built target pch_Generate_opencv_test_optflow
[ 43%] Generating precomp.hpp.gch/opencv_structured_light_DEBUG.gch
Scanning dependencies of target opencv_core
[ 43%] Built target pch_Generate_opencv_test_phase_unwrapping
make[2]: *** No rule to make target 'TBB_ENV_LIB_DEBUG-NOTFOUND', needed by 'lib/libopencv_core.so.3.2.0'. Stop.
make[2]: *** Waiting for unfinished jobs....
[ 43%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/system.cpp.o
cc1plus: warning: /home/luca/ParallelOpenCV/opencv/build/modules/core/precomp.hpp.gch/opencv_core_Release.gch: created with -gnone, but used with -gdwarf-2
[ 43%] Built target pch_Generate_opencv_test_stitching
[ 43%] Built target pch_Generate_opencv_phase_unwrapping
[ 43%] Built target pch_Generate_opencv_test_structured_light
[ 43%] Built target pch_Generate_opencv_perf_stitching
[ 43%] Built target pch_Generate_opencv_stitching
[ 43%] Built target pch_Generate_opencv_structured_light
CMakeFiles/Makefile2:2161: recipe for target 'modules/core/CMakeFiles/opencv_core.dir/all' failed
make[1]: *** [modules/core/CMakeFiles/opencv_core.dir/all] Error 2
Makefile:160: recipe for target 'all' failed
make: *** [all] Error 2
我认为这是英特尔 TBB 相关的,但我已经安装了它(实际上它适用于 RELEASE 版本,我不知道如何解决这个问题。
【问题讨论】:
-
在配置过程中似乎找到了 TBB 库的“发布”版本,但没有找到“调试”版本。并且由于未知原因,在配置阶段没有报告。作为快速解决方案,在 CMake 缓存(构建树中的
CMakeCache.txt)中找到变量 TBB_ENV_LIB_DEBUG,并将其值设置为与变量 TBB_ENV_LIB_RELEASE 相同。
标签: c++ opencv debugging cmake tbb