Ask Your Question
3

-dumpspecs flag is stopping compile of CUDA code

asked 2013-11-03 00:05:22 -0600

Jenniferwillow gravatar image

updated 2013-11-04 01:10:43 -0600

jensenb gravatar image

Problem building OpenCV on Macbook Pro running Mavericks (OSX 10.9) and CUDA driver version 5.5.28. I'm running into the same problem compiling CUDA samples using Nsight and I'm having trouble finding where the '-dumpspecs' flag is being set. Evidently the new version of the CUDA compiler no longer accepts the -dumpspecs flag or the new version or the make has added the -dumpspecs flag and it doesn't work on Mavericks. If you have any insights into what has actually happened I'd love to hear about it.

[ 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:208 (message): Error generating /Users/jennifer/Documents/development/OpenCV/opencv-2.4.6.1/release/modules/core/CMakeFiles/cuda_compile.dir/src/cuda/./cuda_compile_generated_matrix_operations.cu.o

make[2]: * [modules/core/CMakeFiles/cuda_compile.dir/src/cuda/./cuda_compile_generated_matrix_operations.cu.o] Error 1 make[1]: * [modules/core/CMakeFiles/opencv_core.dir/all] Error 2

edit retag flag offensive close merge delete

Comments

What do have CUDA_HOST_COMPILER set to in CMake?

jensenb gravatar imagejensenb ( 2013-11-03 14:00:46 -0600 )edit

Also have you installed the CUDA package specific for 10.9? It was just released several days ago.

jensenb gravatar imagejensenb ( 2013-11-03 14:13:23 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2013-11-04 01:08:41 -0600

jensenb gravatar image

updated 2013-11-21 04:09:18 -0600

I am fairly sure the problem the problem has nothing to do with Mavericks or the CUDA 5.5 Toolkit directly, although the switch to libc++ on Mavericks does mean you have to install the CUDA toolkit specific for 10.9 (just released a short while ago). It was only from CUDA 5.5 onwards that the clang compiler was even supported on OS X.

The problem is most likely an incorrect setting of CUDA_HOST_COMPILER in the CMake settings. By default OpenCV chooses /usr/bin/cc (an alias for /usr/bin/clang), but this is unrecognized by the NVidia host compiler driver and hence the inappropriate compiler flags that are being passed to clang. The fix is simple: just change CUDA_HOST_COMPILER to /usr/bin/clang and everything should work just fine.

EDIT: I stand corrected, I am also unable to get OpenCV to build with Cuda on Mavericks. While setting CUDA_HOST_COMPILER is necessary, this only induces another error at link time.

edit flag offensive delete link more

Comments

Thank you for your suggestion. I set CUDA_HOST_COMPILER to /usr/bin/clang. '-dumpspecs error' is gone! Thanks. But I see the next problem. There are many 'Undefined symbols error' in linking to libopencv_gpu.dylib. For example, "loadFromXML....." referenced from: ncvHaarGetClassifierSize....in cuda_compile_generated_NCVHaarObjectDetection.cu.o, "std::string::find_last_of..." referenced from: ncvHaarGetClassifierSize(... in cuda_compile_generated_NCVHaarObjectDetection.cu.o, Blah-blah-blah...;(

in CUDA tool kit 5.5.28 is for 10.9, OpenCV is 2.4.7.

Any ideas?

--masa

masa.s gravatar imagemasa.s ( 2013-11-20 01:11:50 -0600 )edit

I also have issues with 2.4.7, but not 2.4.6.2, so try that out for now. Also make sure to upgrade to CMake 2.8.12.1

jensenb gravatar imagejensenb ( 2013-11-20 09:34:47 -0600 )edit

The errors look like standard library mismatches, where code compiled against libstc++ is mixed up with code compiled with libc++. I will look further into this issue.

jensenb gravatar imagejensenb ( 2013-11-20 09:36:18 -0600 )edit

CORRECTION: building 2.4.6.2 with cuda enabled does not give any errors, but it also does not build the cuda module! I need to investigate this further.

jensenb gravatar imagejensenb ( 2013-11-21 04:11:05 -0600 )edit

Question Tools

Stats

Asked: 2013-11-03 00:05:22 -0600

Seen: 1,605 times

Last updated: Nov 21 '13