Ask Your Question

Revision history [back]

OpenCV failing to compile with CUDA support

(Arch linux, cuda 9.1, gcc5, glibc 2.27) So I git cloned the opencv repository, mkdir build && cd build then I used

cmake -D WITH_TBB=ON -D WITH_V4L=ON -D WITH_QT=ON -DCMAKE_C_COMPILER=gcc-5 -DCMAKE_CXX_COMPILER=g++-5 -DWITH_CUDA=ON -DENABLE_FAST_MATH=1 -D CUDA_FAST_MATH=1 -D WITH_CUBLAS=1 -D WITH_EIGEN=ON -D WITH_OPENGL=ON -D OPENCV_TRAITS_ENABLE_DEPRECATED=OFF ..

and that went fine, but when I compile I get

/usr/lib/libtbb.so.2: undefined reference to [email protected]_1.3.11 /usr/lib/libtbb.so.2: undefined reference to std::__exception_ptr::exception_ptr::exception_ptr(void*)@CXXABI_1.3.11' collect2: error: ld returned 1 exit status make[2]: *** [apps/annotation/CMakeFiles/opencv_annotation.dir/build.make:94: bin/opencv_annotation] Error 1 make[1]: *** [CMakeFiles/Makefile2:12238: apps/annotation/CMakeFiles/opencv_annotation.dir/all] Error 2 make[1]: *** Waiting for unfinished jobs.... [ 1%] Building NVCC (Device) object modules/cudaimgproc/CMakeFiles/cuda_compile.dir/src/cuda/cuda_compile_generated_blend.cu.o /usr/lib/libtbb.so.2: undefined reference to [email protected]_1.3.11' /usr/lib/libtbb.so.2: undefined reference to std::__exception_ptr::exception_ptr::exception_ptr(void*)@CXXABI_1.3.11' collect2: error: ld returned 1 exit status make[2]: *** [apps/visualisation/CMakeFiles/opencv_visualisation.dir/build.make:94: bin/opencv_visualisation] Error 1 make[1]: *** [CMakeFiles/Makefile2:12299: apps/visualisation/CMakeFiles/opencv_visualisation.dir/all] Error 2

So I tried taking -D WITH_TBB=ON out of the cmake command but that same thing happens. Any advice on what to do?