Updated by Dmitry Retinskiy over 10 years ago

Configuration of OpenCV on Mac OSX with CUDA is broken (again) in 2.4.9
(it worked fine on my machine in 2.4.8).

During ccmake, I have the following warning :
<pre>
CMake Warning (dev) at cmake/OpenCVDetectCUDA.cmake:245 (link_directories):
This command specifies the relative path

-Wl,/usr/local/cuda

as a link directory.

Policy CMP0015 is not set: link_directories() treats paths relative to the
source dir. Run "cmake --help-policy CMP0015" for policy details. Use the
cmake_policy command to set the policy and suppress this warning.
Call Stack (most recent call first):
cmake/OpenCVFindLibsPerf.cmake:24 (include)
CMakeLists.txt:468 (include)
This warning is for project developers. Use -Wno-dev to suppress it.
</pre>


During compilation (make VERBOSE=1), I get the following error :
<pre>
-- Generating dependency file: /Users/mansencal/tools/opencv-2.4.9/build/modules/core/CMakeFiles/cuda_compile.dir/__/dynamicuda/src/cuda/cuda_compile_generated_matrix_operations.cu.o.NVCC-depend
/usr/local/cuda/bin/nvcc -M -D__CUDACC__ /Users/mansencal/tools/opencv-2.4.9/modules/core/../dynamicuda/src/cuda/matrix_operations.cu -o /Users/mansencal/tools/opencv-2.4.9/build/modules/core/CMakeFiles/cuda_compile.dir/__/dynamicuda/src/cuda/cuda_compile_generated_matrix_operations.cu.o.NVCC-depend -ccbin /usr/bin/cc -m64 -DUSE_CUDA -Xcompiler ,\"-fsigned-char\",\"-W\",\"-Werror=return-type\",\"-Werror=address\",\"-Werror=sequence-point\",\"-Wformat\",\"-Werror=format-security\",\"-Wmissing-declarations\",\"-Wmissing-prototypes\",\"-Wstrict-prototypes\",\"-Winit-self\",\"-Wpointer-arith\",\"-Wno-narrowing\",\"-Wno-unnamed-type-template-args\",\"-fdiagnostics-show-option\",\"-fno-omit-frame-pointer\",\"-ffast-math\",\"-msse\",\"-msse2\",\"-msse3\",\"-Wno-undef\",\"-Wno-shadow\",\"-O3\",\"-DNDEBUG\",\"-DNDEBUG\" -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 -Xcompiler -DCVAPI_EXPORTS -Xcompiler -fPIC -Xcompiler -fno-finite-math-only -DNVCC -I/usr/local/cuda/include -I/Users/mansencal/tools/opencv-2.4.9/modules/gpu/include -I/Users/mansencal/tools/opencv-2.4.9/build/3rdparty/zlib -I/Users/mansencal/tools/opencv-2.4.9/3rdparty/zlib -I/Users/mansencal/tools/opencv-2.4.9/modules/dynamicuda/include -I/Users/mansencal/tools/opencv-2.4.9/build/modules/core -I/Users/mansencal/tools/opencv-2.4.9/modules/core/src -I/Users/mansencal/tools/opencv-2.4.9/modules/core/include -I/Users/mansencal/tools/opencv-2.4.9/build -I/usr/local/include -I/Users/mansencal/tools/tbb42_20140601oss/include -I/Users/mansencal/tools/eigen-3.2.2 -I/usr/local/cuda/include
clang: error: unsupported option '-dumpspecs'
clang: error: no input files
CMake Error at cuda_compile_generated_matrix_operations.cu.o.cmake:206 (message):
Error generating
/Users/mansencal/tools/opencv-2.4.9/build/modules/core/CMakeFiles/cuda_compile.dir/__/dynamicuda/src/cuda/./cuda_compile_generated_matrix_operations.cu.o

make[2]: *** [modules/core/CMakeFiles/cuda_compile.dir/__/dynamicuda/src/cuda/./cuda_compile_generated_matrix_operations.cu.o] Error 1
(...)
</pre>



Details of my configuration :
OS X 10.9.4
cmake 2.8.12.2
clang: Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
CUDA Driver version: 6.0.54

Regards,

Boris.

Back