Question: After updating my OSX to 10.9 (Maverick), I cannot compile OpenCV with CUDA support. I was able to install the CUDA SDK and compile and run all samples, so it is not a CUDA problem.

I receive the following error:

```
[ 22%] Built target IlmImf
[ 22%] Building NVCC (Device) object modules/core/CMakeFiles/cuda_compile.dir/src/cuda/./cuda_compile_generated_matrix_operations.cu.o
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/josericardo/Downloads/opencv-2.4.6.1/build/modules/core/CMakeFiles/cuda_compile.dir/src/cuda/./cuda_compile_generated_matrix_operations.cu.o

```

Does anyone have this problem? I've searched on the net about this specific error (some suggestions for previous error like this do exist but not for this one), but without success.

Thanks so much!

Answer: 
Here's how I compiled OpenCV 2.4.8 on OSX Mavericks 10.9.1 using Xcode 5.0.2 and CUDA 5.5:

* open CMake to set the project, and to the basic configuration
* in latest Xcode (I think >= 5) there's no more the gcc compiler, deprecated in favor of clang, so go to the CUDA options of the CMAKE project and change CUDA\_HOST\_COMPILER to use "/usr/bin/clang". Luckily CUDA 5.5 supports clang and not only gcc
* Apparently CUDA 5.5 supports only the older libstdc++ library and not the more modern libc++, so update CUDA\_NVCC\_FLAGS to tell mvcc to pass tell the nativa compilar to use this older library. Add "-Xcompiler -stdlib=libstdc++; -Xlinker -stdlib=libstdc++"
* Tell also the C++ compiler that compiles the rest of the library to use libstdc++: show the advanced options of CMAKE and go to CMAKE to add "-stdlib=libstdc++" to both CMAKE\_CXX\_FLAGS and CMAKE\_EXE\_LINKER\_FLAGS
The solution posted by @Marco was the one that worked for me. However, there is an additional note that should be made. Since we have compiled OpenCV with libstdc++ we will have to change our own apps to also link with this stdlib. 
If we try to compile without the libstdc++ flag we get the undefined symbols linking error, similar to this:

```
Undefined symbols for architecture x86_64:
    "cv::imwrite(cv::String const&, cv::_InputArray const&, std::__1::vector<int, std::__1::allocator<int> > const&)", referenced from:
    lbp::LBP::saveLBPImage(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >) in LBP.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

```