Ask Your Question

Shlomi's profile - activity

2017-01-30 02:17:52 -0600 received badge  Enthusiast
2017-01-30 02:17:52 -0600 received badge  Enthusiast
2017-01-19 03:54:03 -0600 asked a question 2.4.10 linking problem

Hello,

I am trying to build opencv version 2.4.10 with CUDA 7 on ubuntu 16.04.

Getting stuck at linking stage with the following settings:

cmake -D CMAKE_BUILD_TYPE=Release 
      -D CMAKE_INSTALL_PREFIX=/usr/local 
      -D BUILD_TIFF=ON 
      -D BUILD_EXAMPLES=OFF 
      -D BUILD_TESTS=OFF 
      -D BUILD_NEW_PYTHON_SUPPORT=ON  
      -D CUDA_GENERATION=Kepler 
      -DCUDA_USE_STATIC_CUDA_RUNTIME=OFF 
      -D BUILD_PERF_TESTS=OFF
      -DCUDA_NVCC_FLAGS="-D_FORCE_INLINES" ..

It took me a while to find all these settings which were necessary to at least get to the linking stage. All the tests and examples are off so it will take a little less time to finally get to the next error after every attempt.

In any case, here is the error I am now stuck with:

~/Downloads/opencv-2.4.10/build> make
[  5%] Built target libtiff
[  6%] Built target opencv_core_pch_dephelp
[  7%] Built target pch_Generate_opencv_core
[ 10%] Built target opencv_core
[ 10%] Built target opencv_flann_pch_dephelp
[ 10%] Built target pch_Generate_opencv_flann
[ 10%] Built target opencv_flann
[ 10%] Built target opencv_imgproc_pch_dephelp
[ 10%] Built target pch_Generate_opencv_imgproc
[ 15%] Built target opencv_imgproc
[ 16%] Built target opencv_highgui_pch_dephelp
[ 17%] Built target pch_Generate_opencv_highgui
[ 20%] Built target opencv_highgui
[ 21%] Built target opencv_features2d_pch_dephelp
[ 21%] Built target pch_Generate_opencv_features2d
[ 23%] Built target opencv_features2d
[ 23%] Built target opencv_calib3d_pch_dephelp
[ 23%] Built target pch_Generate_opencv_calib3d
[ 25%] Built target opencv_calib3d
[ 25%] Built target opencv_ml_pch_dephelp
[ 25%] Built target pch_Generate_opencv_ml
[ 28%] Built target opencv_ml
[ 28%] Built target opencv_video_pch_dephelp
[ 28%] Built target pch_Generate_opencv_video
[ 30%] Built target opencv_video
[ 30%] Built target opencv_legacy_pch_dephelp
[ 30%] Built target pch_Generate_opencv_legacy
[ 41%] Built target opencv_legacy
[ 41%] Built target opencv_objdetect_pch_dephelp
[ 41%] Built target pch_Generate_opencv_objdetect
[ 44%] Built target opencv_objdetect
[ 44%] Built target opencv_photo_pch_dephelp
[ 44%] Built target pch_Generate_opencv_photo
[ 45%] Built target opencv_photo
[ 45%] Built target opencv_gpu_pch_dephelp
[ 45%] Built target pch_Generate_opencv_gpu
[ 63%] Built target opencv_gpu
[ 63%] Built target opencv_ts_pch_dephelp
[ 63%] Built target pch_Generate_opencv_ts
[ 64%] Built target opencv_ts
[ 64%] Linking CXX executable ../../../bin/gpu_perf4au
../../../lib/libopencv_gpu.so.2.4.10: undefined reference to `ncvHaarGetClassifierSize(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int&, unsigned int&, unsigned int&)'
../../../lib/libopencv_gpu.so.2.4.10: undefined reference to `ncvDebugOutput(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
../../../lib/libopencv_gpu.so.2.4.10: undefined reference to `ncvSetDebugOutputHandler(void (*)(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&))'
../../../lib/libopencv_gpu.so.2.4.10: undefined reference to `loadFromXML(std::string const&, HaarClassifierCascadeDescriptor&, std::vector<HaarStage64, std::allocator<HaarStage64> >&, std::vector<HaarClassifierNode128, std::allocator<HaarClassifierNode128> >&, std::vector<HaarFeature64, std::allocator<HaarFeature64> >&)'
../../../lib/libopencv_gpu.so.2.4.10: undefined reference to `ncvHaarLoadFromFile_host(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, HaarClassifierCascadeDescriptor&, NCVVector<HaarStage64>&, NCVVector<HaarClassifierNode128>&, NCVVector<HaarFeature64>&)'
collect2: error: ld returned 1 exit status
modules/gpu/perf4au/CMakeFiles/gpu_perf4au.dir/build.make:107: recipe for target 'bin/gpu_perf4au' failed
make[2]: *** [bin/gpu_perf4au] Error 1
CMakeFiles/Makefile2:2422: recipe for target 'modules/gpu/perf4au/CMakeFiles/gpu_perf4au.dir/all' failed
make[1]: *** [modules/gpu/perf4au/CMakeFiles/gpu_perf4au.dir/all] Error 2
Makefile:149: recipe for target 'all' failed
make: *** [all] Error 2

I am not sure what to try next, and will appreciate any clue.

Thanks!