Opencv 4.1.0 with cuda 10.0 Make error redefinition of argument 'std' #20213

System information (version)
  • OpenCV = 4.1.0
  • Operating System / Platform => Ubuntu 64
  • Compiler => cmake
  • CUDA 10.0
  • Error:
[ 30%] Building NVCC (Device) object modules/core/CMakeFiles/cuda_compile_1.dir/src/cuda/cuda_compile_1_generated_gpu_mat.cu.o
nvcc fatal   : redefinition of argument 'std'
CMake Error at cuda_compile_1_generated_gpu_mat.cu.o.RELEASE.cmake:224 (message):
  Error generating
  /media/frank/easystore/Downloads/opencv-4.1.0/build/modules/core/CMakeFiles/cuda_compile_1.dir/src/cuda/./cuda_compile_1_generated_gpu_mat.cu.o


modules/core/CMakeFiles/opencv_core.dir/build.make:63: recipe for target 'modules/core/CMakeFiles/cuda_compile_1.dir/src/cuda/cuda_compile_1_generated_gpu_mat.cu.o' failed
make[2]: *** [modules/core/CMakeFiles/cuda_compile_1.dir/src/cuda/cuda_compile_1_generated_gpu_mat.cu.o] Error 1
CMakeFiles/Makefile2:2684: recipe for target 'modules/core/CMakeFiles/opencv_core.dir/all' failed
make[1]: *** [modules/core/CMakeFiles/opencv_core.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....

log:

iview.dir/robust_estimation.cc.o
[ 30%] Built target pch_Generate_opencv_perf_stitching
[ 30%] Building CXX object modules/sfm/src/libmv/libmv/multiview/CMakeFiles/multiview.dir/robust_fundamental.cc.o
Scanning dependencies of target pch_Generate_opencv_test_cudaoptflow
[ 30%] Generating test_precomp.hpp
[ 30%] Generating test_precomp.hpp.gch/opencv_test_cudaoptflow_RELEASE.gch
[ 30%] Building CXX object modules/sfm/src/libmv/libmv/multiview/CMakeFiles/multiview.dir/robust_resection.cc.o
Scanning dependencies of target pch_Generate_opencv_perf_cudaoptflow
Scanning dependencies of target pch_Generate_opencv_stereo
Scanning dependencies of target pch_Generate_opencv_test_stereo
[ 30%] Generating perf_precomp.hpp
[ 30%] Generating precomp.hpp
[ 30%] Generating perf_precomp.hpp.gch/opencv_perf_cudaoptflow_RELEASE.gch
[ 30%] Generating test_precomp.hpp
[ 30%] Generating precomp.hpp.gch/opencv_stereo_RELEASE.gch
[ 30%] Generating test_precomp.hpp.gch/opencv_test_stereo_RELEASE.gch
Scanning dependencies of target pch_Generate_opencv_perf_stereo
[ 30%] Generating perf_precomp.hpp
[ 30%] Generating perf_precomp.hpp.gch/opencv_perf_stereo_RELEASE.gch
Scanning dependencies of target pch_Generate_opencv_superres
[ 30%] Generating precomp.hpp
[ 30%] Generating precomp.hpp.gch/opencv_superres_RELEASE.gch
[ 30%] Built target pch_Generate_opencv_test_tracking
[ 30%] Building CXX object modules/sfm/src/libmv/libmv/multiview/CMakeFiles/multiview.dir/triangulation.cc.o
[ 30%] Built target pch_Generate_opencv_perf_tracking
[ 30%] Building CXX object modules/sfm/src/libmv/libmv/multiview/CMakeFiles/multiview.dir/twoviewtriangulation.cc.o
Scanning dependencies of target pch_Generate_opencv_test_superres
[ 30%] Generating test_precomp.hpp
[ 30%] Generating test_precomp.hpp.gch/opencv_test_superres_RELEASE.gch
[ 30%] Built target pch_Generate_opencv_cudaoptflow
Scanning dependencies of target pch_Generate_opencv_perf_superres
[ 30%] Generating perf_precomp.hpp
[ 30%] Generating perf_precomp.hpp.gch/opencv_perf_superres_RELEASE.gch
Scanning dependencies of target pch_Generate_opencv_videostab
[ 30%] Generating precomp.hpp
[ 30%] Generating precomp.hpp.gch/opencv_videostab_RELEASE.gch
Scanning dependencies of target pch_Generate_opencv_test_videostab
[ 30%] Generating test_precomp.hpp
[ 30%] Generating test_precomp.hpp.gch/opencv_test_videostab_RELEASE.gch
[ 30%] Linking CXX static library ../../../../../../lib/libmultiview.a
[ 30%] Built target multiview
Scanning dependencies of target simple_pipeline
[ 30%] Processing OpenCL kernels (core)
[ 30%] Building NVCC (Device) object modules/core/CMakeFiles/cuda_compile_1.dir/src/cuda/cuda_compile_1_generated_gpu_mat.cu.o
nvcc fatal   : redefinition of argument 'std'
CMake Error at cuda_compile_1_generated_gpu_mat.cu.o.RELEASE.cmake:224 (message):
  Error generating
  /media/frank/easystore/Downloads/opencv-4.1.0/build/modules/core/CMakeFiles/cuda_compile_1.dir/src/cuda/./cuda_compile_1_generated_gpu_mat.cu.o


modules/core/CMakeFiles/opencv_core.dir/build.make:63: recipe for target 'modules/core/CMakeFiles/cuda_compile_1.dir/src/cuda/cuda_compile_1_generated_gpu_mat.cu.o' failed
make[2]: *** [modules/core/CMakeFiles/cuda_compile_1.dir/src/cuda/cuda_compile_1_generated_gpu_mat.cu.o] Error 1
CMakeFiles/Makefile2:2684: recipe for target 'modules/core/CMakeFiles/opencv_core.dir/all' failed
make[1]: *** [modules/core/CMakeFiles/opencv_core.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 30%] Built target pch_Generate_opencv_stereo
[ 30%] Built target pch_Generate_opencv_test_cudaoptflow
[ 30%] Built target pch_Generate_opencv_test_stereo
[ 30%] Built target pch_Generate_opencv_test_superres
[ 30%] Built target pch_Generate_opencv_perf_stereo
[ 30%] Built target pch_Generate_opencv_perf_cudaoptflow
[ 30%] Built target pch_Generate_opencv_perf_superres
[ 30%] Built target pch_Generate_opencv_superres
[ 30%] Building CXX object modules/sfm/src/libmv/libmv/simple_pipeline/CMakeFiles/simple_pipeline.dir/camera_intrinsics.cc.o
[ 30%] Building CXX object modules/sfm/src/libmv/libmv/simple_pipeline/CMakeFiles/simple_pipeline.dir/bundle.cc.o
[ 30%] Building CXX object modules/sfm/src/libmv/libmv/simple_pipeline/CMakeFiles/simple_pipeline.dir/distortion_models.cc.o
[ 30%] Building CXX object modules/sfm/src/libmv/libmv/simple_pipeline/CMakeFiles/simple_pipeline.dir/initialize_reconstruction.cc.o
[ 30%] Building CXX object modules/sfm/src/libmv/libmv/simple_pipeline/CMakeFiles/simple_pipeline.dir/intersect.cc.o
[ 30%] Building CXX object modules/sfm/src/libmv/libmv/simple_pipeline/CMakeFiles/simple_pipeline.dir/keyframe_selection.cc.o
[ 30%] Building CXX object modules/sfm/src/libmv/libmv/simple_pipeline/CMakeFiles/simple_pipeline.dir/reconstruction.cc.o
[ 30%] Building CXX object modules/sfm/src/libmv/libmv/simple_pipeline/CMakeFiles/simple_pipeline.dir/pipeline.cc.o
[ 30%] Building CXX object modules/sfm/src/libmv/libmv/simple_pipeline/CMakeFiles/simple_pipeline.dir/reconstruction_scale.cc.o
[ 30%] Building CXX object modules/sfm/src/libmv/libmv/simple_pipeline/CMakeFiles/simple_pipeline.dir/resect.cc.o
[ 30%] Built target pch_Generate_opencv_videostab
[ 30%] Building CXX object modules/sfm/src/libmv/libmv/simple_pipeline/CMakeFiles/simple_pipeline.dir/tracks.cc.o
[ 30%] Built target pch_Generate_opencv_test_videostab
[ 31%] Linking CXX static library ../../../../../../lib/libsimple_pipeline.a
[ 31%] Built target simple_pipeline
Makefile:162: recipe for target 'all' failed
make: *** [all] Error 2

please do not try with outdated 4.1.0, noone can help you with it

check out recent master branch (4.5.3-pre) from github and try again with that, please