Question

I am attempting to make in Nsight IDE but unfortunately without any luck:

Building file: ../src/Cuda_Test.cu
Invoking: NVCC Compiler
/Developer/NVIDIA/CUDA-5.5/bin/nvcc -O3 -gencode arch=compute_12,code=sm_12 -odir "src" -M -o "src/Cuda_Test.d" "../src/Cuda_Test.cu"
clang: error: unsupported option '-dumpspecs'
clang: error: no input files
make: *** [src/Cuda_Test.o] Error 1

As i can understand on following pages:

http://blog.cryptohaze.com/2012/12/nvcc-os-x-clang-and-dumpspecs.html http://lists.freebsd.org/pipermail/freebsd-ports/2011-December/071844.html

It seems that i am using the wrong C and CPP compiler, but how can i change these parameters? The workaround seems to be valid for CMake and not Make.

usr/bin/gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 5.0 (clang-500.2.76) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin12.4.0
Thread model: posix

Environment:

echo $PATH
/usr/local/homebrew/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Developer/NVIDIA/CUDA-5.5/bin

echo $DYLD_LIBRARY_PATH
/Developer/NVIDIA/CUDA-5.5/lib:$DYLD_LIBRARY_PATH
Was it helpful?

Solution

I made a workaround which obviously works in OS X 10.8.4. Simply used clang instead of g++ by adding following flag to nvcc: nvcc -ccbin=/usr/bin/clang

Reference: https://devtalk.nvidia.com/default/topic/608127/clang-error-on-os-x-10-8-5-samples-/

OTHER TIPS

I would like to add that (while JavaCake pointed out the correct solution) the flag has to be set at both: the compiler stage and the linking stage.

To add the option open Project->Properties->Build->Settings->Tool Settings

  • For the compiler select NVCC Compiler->Build Stages and enter /usr/bin/clang at compiler path.
  • For the linker select NVCC Linker and add -ccbin /usr/bin/clang to the command.

(I did not yet find a global setting).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top