Hi
I'm trying to build OpenCV with CUDA support on ubuntu 15.10. CMake shows there is CUDA 7.5 available. And CMAKE is successful. When I run make command, I get the following output> -- Configuring done> -- Generating done> -- Build files have been written to: /home/jishnu/Downloads/opencv-2.4.13/Release> [ 5%] Built target IlmImf [ 6%]> Built target opencv_core_pch_dephelp [> 6%] Built target> pch_Generate_opencv_core [ 8%] Built> target opencv_core [ 9%] Built target> opencv_ts_pch_dephelp [ 9%] Built> target pch_Generate_opencv_ts [ 9%]> Built target> opencv_imgproc_pch_dephelp [ 9%]> Built target> pch_Generate_opencv_imgproc [ 12%]> Built target opencv_imgproc [ 12%]> Built target opencv_flann_pch_dephelp> [ 12%] Built target> pch_Generate_opencv_flann [ 12%] Built> target opencv_flann [ 12%] Built> target opencv_highgui_pch_dephelp [> 13%] Built target> pch_Generate_opencv_highgui [ 15%]> Built target opencv_highgui [ 15%]> Built target> opencv_features2d_pch_dephelp [ 15%]> Built target> pch_Generate_opencv_features2d [ 16%]> Built target opencv_features2d [ 16%]> Built target> opencv_calib3d_pch_dephelp [ 16%]> Built target> pch_Generate_opencv_calib3d [ 18%]> Built target opencv_calib3d [ 19%]> Built target opencv_video_pch_dephelp> [ 19%] Built target> pch_Generate_opencv_video [ 19%] Built> target opencv_video [ 19%] Built> target opencv_ts [ 19%] Built target> opencv_perf_core_pch_dephelp [ 19%]> Built target> pch_Generate_opencv_perf_core [ 21%]> Built target opencv_perf_core [ 21%]> Built target> opencv_test_core_pch_dephelp [ 21%]> Built target> pch_Generate_opencv_test_core [ 22%]> Built target opencv_test_core [ 22%]> Built target> opencv_test_flann_pch_dephelp [ 22%]> Built target> pch_Generate_opencv_test_flann [ 23%]> Built target opencv_test_flann [ 24%]> Built target> opencv_perf_imgproc_pch_dephelp [ 24%]> Built target> pch_Generate_opencv_perf_imgproc [> 25%] Built target opencv_perf_imgproc> [ 25%] Built target> opencv_test_imgproc_pch_dephelp [ 25%]> Built target> pch_Generate_opencv_test_imgproc [> 27%] Built target opencv_test_imgproc> [ 27%] Built target> opencv_perf_highgui_pch_dephelp [ 27%]> Built target> pch_Generate_opencv_perf_highgui [> 28%] Built target opencv_perf_highgui> [ 28%] Built target> opencv_test_highgui_pch_dephelp [ 28%]> Built target> pch_Generate_opencv_test_highgui [> 29%] Built target opencv_test_highgui> [ 29%] Built target> opencv_perf_features2d_pch_dephelp [> 29%] Built target> pch_Generate_opencv_perf_features2d [> 29%] Built target> opencv_perf_features2d [ 29%] Built> target> opencv_test_features2d_pch_dephelp [> 30%] Built target> pch_Generate_opencv_test_features2d [> 31%] Built target> opencv_test_features2d [ 31%] Built> target opencv_perf_calib3d_pch_dephelp> [ 31%] Built target> pch_Generate_opencv_perf_calib3d [> 31%] Built target opencv_perf_calib3d> [ 31%] Built target> opencv_test_calib3d_pch_dephelp [ 31%]> Built target> pch_Generate_opencv_test_calib3d [> 33%] Built target opencv_test_calib3d> [ 33%] Built target> opencv_ml_pch_dephelp [ 33%] Built> target pch_Generate_opencv_ml [ 34%]> Built target opencv_ml [ 34%] Built> target opencv_test_ml_pch_dephelp [> 35%] Built target> pch_Generate_opencv_test_ml [ 36%]> Built target opencv_test_ml [ 36%]> Built target> opencv_perf_video_pch_dephelp [ 37%]> Built target> pch_Generate_opencv_perf_video [ 38%]> Built target opencv_perf_video [ 38%]> Built target> opencv_test_video_pch_dephelp [ 39%]> Built target> pch_Generate_opencv_test_video [ 40%]> Built target opencv_test_video [ 40%]> Built target opencv_legacy_pch_dephelp> [ 40%] Built target> pch_Generate_opencv_legacy [ 47%]> Built target opencv_legacy [ 47%]> Built target> opencv_test_legacy_pch_dephelp [ 47%]> Built target> pch_Generate_opencv_test_legacy [ 47%]> Built target opencv_test_legacy [ 47%]> Built target> opencv_objdetect_pch_dephelp [ 47%]> Built target> pch_Generate_opencv_objdetect [ 48%]> Built target opencv_objdetect [ 48%]> Built target> opencv_perf_objdetect_pch_dephelp [> 48%] Built target> pch_Generate_opencv_perf_objdetect [> 48%] Built target> opencv_perf_objdetect [ 48%] Built> target> opencv_test_objdetect_pch_dephelp [> 48%] Built target> pch_Generate_opencv_test_objdetect [> 48%] Built target> opencv_test_objdetect [ 48%] Built> target opencv_photo_pch_dephelp [ 48%]> Built target pch_Generate_opencv_photo> [ 48%] Built target opencv_photo [> 48%] Built target> opencv_perf_photo_pch_dephelp [ 48%]> Built target> pch_Generate_opencv_perf_photo [ 49%]> Built target opencv_perf_photo [ 49%]> Built target> opencv_test_photo_pch_dephelp [ 49%]> Built target> pch_Generate_opencv_test_photo [ 50%]> Built target opencv_test_photo [ 50%]> Built target opencv_gpu_pch_dephelp [> 50%] Built target> pch_Generate_opencv_gpu Linking CXX> shared library> ../../lib/libopencv_gpu.so [ 61%]> Built target opencv_gpu [ 61%] Built> target opencv_perf_gpu_pch_dephelp [> 61%] Built target> pch_Generate_opencv_perf_gpu Linking> CXX executable> ../../bin/opencv_perf_gpu> ../../lib/libopencv_gpu.so.2.4.13:> undefined reference to> `ncvHaarGetClassifierSize(std::__cxx11::basic_string std::char_traits,> std::allocator> const&,> unsigned int&, unsigned int&, unsigned> int&)'> ../../lib/libopencv_gpu.so.2.4.13:> undefined reference to> `cv::gpu::device::hough::GHT_Ballard_Pos_findPosInHist_gpu(cv::gpu::PtrStepSz,> float4*, int3*, int, float, int)'> ../../lib/libopencv_gpu.so.2.4.13:> undefined reference to> `cv::gpu::device::hough::buildRTable_gpu(unsigned> int const*, float const*, int,> cv::gpu::PtrStepSz, int*,> short2, int)'> ../../lib/libopencv_gpu.so.2.4.13:> undefined reference to> `cv::gpu::device::hough::GHT_Guil_Full_calcPHist_gpu(int> const*, int const*,> cv::gpu::PtrStepSz, float, float,> float, float, int, int)'> ../../lib/libopencv_gpu.so.2.4.13:> undefined reference to> `cv::gpu::device::hough::GHT_Ballard_PosRotation_calcHist_gpu(unsigned> int const*, float const*, int,> cv::gpu::PtrStepSz, int> const*, cv::gpu::PtrStep, int,> int, float, float, int, float, int)'> ../../lib/libopencv_gpu.so.2.4.13:> undefined reference to> `cv::gpu::device::hough::GHT_Guil_Full_buildImageFeatureList_gpu(unsigned> int const*, float const*, int, int*,> int, float, float, int, float2,> float)'> ../../lib/libopencv_gpu.so.2.4.13:> undefined reference to `int> cv::gpu::device::hough::buildEdgePointList_gpu(cv::gpu::PtrStepSz char>, cv::gpu::PtrStepSz char>, cv::gpu::PtrStepSz char>, unsigned int*, float*)'> ../../lib/libopencv_gpu.so.2.4.13:> undefined reference to> `ncvDebugOutput(std::__cxx11::basic_string std::char_traits,> std::allocator> const&)'> ../../lib/libopencv_gpu.so.2.4.13:> undefined reference to> `cv::gpu::device::hough::GHT_Guil_Full_calcSHist_gpu(int> const*, int const*, int*, float,> float, float, float, float, int, int,> int)'> ../../lib/libopencv_gpu.so.2.4.13:> undefined reference to> `cv::gpu::device::hough::GHT_Ballard_PosScale_findPosInHist_gpu(cv::gpu::PtrStep,> int, int, int, float4*, int3*, int,> float, float, float, int)'> ../../lib/libopencv_gpu.so.2.4.13:> undefined reference to `int> cv::gpu::device::hough::buildEdgePointList_gpu(cv::gpu::PtrStepSz char>, cv::gpu::PtrStepSz char>, cv::gpu::PtrStepSz char>, unsigned int*, float*)'> ../../lib/libopencv_gpu.so.2.4.13:> undefined reference to> `cv::gpu::device::hough::GHT_Ballard_PosRotation_findPosInHist_gpu(cv::gpu::PtrStep,> int, int, int, float4*, int3*, int,> float, float, float, int)'> ../../lib/libopencv_gpu.so.2.4.13:> undefined reference to> `cv::gpu::device::hough::GHT_Guil_Full_setImageFeatures(cv::gpu::PtrStep char>, cv::gpu::PtrStep char>, cv::gpu::PtrStep char>, cv::gpu::PtrStep char>, cv::gpu::PtrStep char>, cv::gpu::PtrStep char>)'> ../../lib/libopencv_gpu.so.2.4.13:> undefined reference to `int> cv::gpu::device::hough::buildEdgePointList_gpu(cv::gpu::PtrStepSz char>, cv::gpu::PtrStepSz char>, cv::gpu::PtrStepSz char>, unsigned int*, float*)'> ../../lib/libopencv_gpu.so.2.4.13:> undefined reference to> `cv::gpu::device::hough::GHT_Guil_Full_findPosInHist_gpu(cv::gpu::PtrStepSz,> float4*, int3*, int, int, float, int,> float, int, float, int)'> ../../lib/libopencv_gpu.so.2.4.13:> undefined reference to> `ncvSetDebugOutputHandler(void> (*)(std::__cxx11::basic_string std::char_traits,> std::allocator> const&))'> ../../lib/libopencv_gpu.so.2.4.13:> undefined reference to> `cv::gpu::device::hough::GHT_Ballard_Pos_calcHist_gpu(unsigned> int const*, float const*, int,> cv::gpu::PtrStepSz, int> const*, cv::gpu::PtrStepSz,> float, int)'> ../../lib/libopencv_gpu.so.2.4.13:> undefined reference to> `cv::gpu::device::hough::GHT_Guil_Full_setTemplFeatures(cv::gpu::PtrStep char>, cv::gpu::PtrStep char>, cv::gpu::PtrStep char>, cv::gpu::PtrStep char>, cv::gpu::PtrStep char>, cv::gpu::PtrStep char>)'> ../../lib/libopencv_gpu.so.2.4.13:> undefined reference to> `loadFromXML(std::string const&,> HaarClassifierCascadeDescriptor&,> std::vector std::allocator>&,> std::vector std::allocator>>&, std::vector>&)'> ../../lib/libopencv_gpu.so.2.4.13:> undefined reference to> `cv::gpu::device::hough::GHT_Guil_Full_calcOHist_gpu(int> const*, int const*, int*, float,> float, float, int, int, int)'> ../../lib/libopencv_gpu.so.2.4.13:> undefined reference to> `cv::gpu::device::hough::GHT_Guil_Full_buildTemplFeatureList_gpu(unsigned> int const*, float const*, int, int*,> int, float, float, int, float2,> float)'> ../../lib/libopencv_gpu.so.2.4.13:> undefined reference to> `cv::gpu::device::hough::GHT_Ballard_PosScale_calcHist_gpu(unsigned> int const*, float const*, int,> cv::gpu::PtrStepSz, int> const*, cv::gpu::PtrStep, int,> int, float, float, int, float, int)'> ../../lib/libopencv_gpu.so.2.4.13:> undefined reference to> `ncvHaarLoadFromFile_host(std::__cxx11::basic_string,> std::allocator> const&,> HaarClassifierCascadeDescriptor&,> NCVVector&,> NCVVector&,> NCVVector&)' collect2:> error: ld returned 1 exit status> modules/gpu/CMakeFiles/opencv_perf_gpu.dir/build.make:364:> recipe for target> 'bin/opencv_perf_gpu' failed make[2]:> *** [bin/opencv_perf_gpu] Error 1 CMakeFiles/Makefile2:4453: recipe for> target> 'modules/gpu/CMakeFiles/opencv_perf_gpu.dir/all'> failed make[1]: ***> [modules/gpu/CMakeFiles/opencv_perf_gpu.dir/all]> Error 2 Makefile:146: recipe for> target 'all' failed make: *** [all]> Error 2
I had built OpenCV without CUDA support earlier and it worked fine.
↧