Error during installation of built opencv with CUDA
I am trying to build opencv library from source. Here some platform information:
Ubuntu 16.04, gcc version 5.4.0, CUDA version 8
I added this flags for compilation:
-D ENABLE_CXX11=ON
-D CMAKE_BUILD_TYPE=RELEASE
-D CMAKE_INSTALL_PREFIX=/usr/local
-D OPENCV_EXTRA_MODULES_PATH=/home/USERNAME/opencvdir/opencv_contrib/modules
-D BUILD_opencv_hdf=OFF
-D WITH_CUDA=ON
-D ENABLE_FAST_MATH=1
-D CUDA_FAST_MATH=1
-D WITH_CUBLAS=1
-D INSTALL_C_EXAMPLES=OFF
-D INSTALL_PYTHON_EXAMPLES=OFF
-D BUILD_TESTS=OFF
First make operation is completed successfully, however, when I try to install (sudo make install), I got errors like this:
/usr/lib/gcc/x86_64-linux-gnu/5/include/stddef.h(436): error: identifier "nullptr" is undefined
/usr/lib/gcc/x86_64-linux-gnu/5/include/stddef.h(436): error: expected a ";"
/usr/include/x86_64-linux-gnu/c++/5/bits/c++config.h(200): error: expected a ";"
/usr/include/c++/5/exception(63): error: expected a ";"
/usr/include/c++/5/exception(68): error: expected a ";"
...
/usr/include/c++/5/bits/exception_ptr.h(64): error: function "std::current_exception" returns incomplete type "std::__exception_ptr::exception_ptr"
/usr/include/c++/5/bits/exception_ptr.h(64): error: expected a "{"
/usr/include/c++/5/bits/exception_ptr.h(79): error: expected a ";"
...
Error limit reached. 100 errors detected in the compilation of "/tmp/tmpxft_0000024a_00000000-21_gpu_mat.compute_61.cpp1.ii". Compilation terminated. CMake Error at cuda_compile_generated_gpu_mat.cu.o.cmake:266 (message): Error generating file /home/USERNAME/opencvdir/opencv/build/modules/core/CMakeFiles/cuda_compile.dir/src/cuda/./cuda_compile_generated_gpu_mat.cu.o
It seems like c++11 issue however I can see -std=c++11 flag both among my c++ release and c++ debug flags. What could possibly cause this error? Thanks for taking your time to read.