I use ubuntu, use following cmake options:
cmake .. -DBUILD_EXAMPLES:BOOL="1" -DBUILD_opencv_world:BOOL="1" -DWITH_TBB:BOOL="1" -DENABLE_FAST_MATH:BOOL="1" -DENABLE_AVX:BOOL="1" -DINSTALL_C_EXAMPLES:BOOL="1" -DCMAKE_INSTALL_PREFIX:STRING="/opt/opencv-cuda" -DCUDA_TOOLKIT_ROOT_DIR="/usr/local/cuda-5.5/" -DCUDA_FAST_MATH:BOOL="1" -DWITH_NVCUVID:BOOL="1" -DWITH_CUBLAS:BOOL="1" -DBUILD_DOCS:BOOL="1"
cuda-related output of cmake:
-- CUDA detected: 5.5
-- CUDA NVCC target flags: -gencode;arch=compute_11,code=sm_11;-gencode;arch=compute_12,code=sm_12;-gencode;arch=compute_13,code=sm_13;-gencode;arch=compute_20,code=sm_20;-gencode;arch=compute_20,code=sm_21;-gencode;arch=compute_30,code=sm_30;-gencode;arch=compute_35,code=sm_35;-gencode;arch=compute_30,code=compute_30
...
-- NVIDIA CUDA
-- Use CUFFT: YES
-- Use CUBLAS: YES
-- USE NVCUVID: YES
-- NVIDIA GPU arch: 11 12 13 20 21 30 35
-- NVIDIA PTX archs: 30
-- Use fast math: YES
When I compile, however, I get the following errors:
/home/cthulhu/src/opencv/modules/cudev/include/opencv2/cudev/util/atomic.hpp(67): error: no instance of overloaded function "atomicAdd" matches the argument list
argument types are: (float *, float)
/home/cthulhu/src/opencv/modules/cudev/include/opencv2/cudev/util/atomic.hpp(77): error: identifier "__longlong_as_double" is undefined
/home/cthulhu/src/opencv/modules/cudev/include/opencv2/cudev/util/atomic.hpp(77): error: identifier "__double_as_longlong" is undefined
/home/cthulhu/src/opencv/modules/cudev/include/opencv2/cudev/util/atomic.hpp(76): error: no instance of overloaded function "atomicCAS" matches the argument list
argument types are: (unsigned long long *, unsigned long long, <error-type>)
/home/cthulhu/src/opencv/modules/cudev/include/opencv2/cudev/util/atomic.hpp(79): error: identifier "__longlong_as_double" is undefined
/home/cthulhu/src/opencv/modules/cudev/include/opencv2/cudev/util/atomic.hpp(113): error: identifier "__longlong_as_double" is undefined
/home/cthulhu/src/opencv/modules/cudev/include/opencv2/cudev/util/atomic.hpp(113): error: identifier "__double_as_longlong" is undefined
/home/cthulhu/src/opencv/modules/cudev/include/opencv2/cudev/util/atomic.hpp(112): error: no instance of overloaded function "atomicCAS" matches the argument list
argument types are: (unsigned long long *, unsigned long long, <error-type>)
/home/cthulhu/src/opencv/modules/cudev/include/opencv2/cudev/util/atomic.hpp(115): error: identifier "__longlong_as_double" is undefined
/home/cthulhu/src/opencv/modules/cudev/include/opencv2/cudev/util/atomic.hpp(149): error: identifier "__longlong_as_double" is undefined
/home/cthulhu/src/opencv/modules/cudev/include/opencv2/cudev/util/atomic.hpp(149): error: identifier "__double_as_longlong" is undefined
/home/cthulhu/src/opencv/modules/cudev/include/opencv2/cudev/util/atomic.hpp(148): error: no instance of overloaded function "atomicCAS" matches the argument list
argument types are: (unsigned long long *, unsigned long long, <error-type>)
/home/cthulhu/src/opencv/modules/cudev/include/opencv2/cudev/util/atomic.hpp(151): error: identifier "__longlong_as_double" is undefined
/home/cthulhu/src/opencv/modules/cudev/include/opencv2/cudev/util/saturate_cast.hpp(231): error: identifier "__double2int_rn" is undefined
/home/cthulhu/src/opencv/modules/cudev/include/opencv2/cudev/util/saturate_cast.hpp(259): error: identifier "__double2uint_rn" is undefined
15 errors detected in the compilation of "/tmp/tmpxft_000067a1_00000000-22_gpu_mat.compute_11.cpp1.ii".
CMake Error at cuda_compile_generated_gpu_mat.cu.o.cmake:264 (message):
Error generating file
/home/cthulhu/src/opencv/build/modules/core/CMakeFiles/cuda_compile.dir/src/cuda/./cuda_compile_generated_gpu_mat.cu.o
Now, it compiles fine without CUDA (after a bit editing ffmpeg-related sources) but I cannot figure out what to do with this atomicAdd error. Help would be much appreciated.
P.S. 2.4.6.1 compiles fine but I kind of like using latest versions...