Clang error on OS X 10.8.5 (samples)

Hello,

I tried to compile CUDA 5.5 samples, but I getting error:

clang: error: unsupported option '-dumpspecs'
clang: error: no input files

Error first time appears in asyncAPI sample.

Where can be problem please? Thank you!

According to the CUDA 5.5 release notes (excerpt below), Clang support has beta status at this time meaning one should expect that some things don’t work properly yet. The build expects the compiler to accept a command line flag that Clang does not support. It would probably be a good idea to file a bug report via the registered developer website to make sure this gets addressed in a future CUDA release.

http://docs.nvidia.com/cuda/cuda-toolkit-release-notes/index.html
Clang is now supported as a host compiler on Mac OS 10.8 as a BETA feature in CUDA 5.5. To use Clang as the host compiler, invoke nvcc with -ccbin=path-to-clang-executable. There are some features that are not yet supported: Clang language extensions (see http://clang.llvm.org/docs/LanguageExtensions.html), LLVM libc++ (only GNU libstdc++ is currently supported), language features introduced in C++11, the global function template explicit instantiation definition, and 32-bit architecture cross-compilation.

Install gcc.

Starting with Xcode 4.3 - you must now manually install command line tools from Xcode menu > Preferences > Downloads.

Thank you for your responds. I fixed it with editing findcudalib.mk file in asyncAPI sample. I changed GCC ?= g++ to GCC ?= /usr/bin/llvm-g+±4.2

BTW: I found OSX Maverick condition which uses clang and libstdc++ for compiling, I need to update :)

I add the same problem, thanks to martindeveloper I found the findcudalib.mk but didn’t have llvm-g++ (tried to install it but lost like 2 hours for nothing, because it doesn’t come anymore with XCode and compiling it from llvm.org didn’t work). Tried with gcc/g++ but nothing worked

Finally, I changed GCC ?= g++ to GCC ?= /usr/bin/clang and everything worked fine (even if clang support is beta)

I think it would be great to update the Mac OS X section of CUDA, because the changes from old compiler to clang compiler are causing some troubles. And of course, it’s not easy to edit all “findcudalib.mk” contained in the samples/ directory.

Hope that CUDA 5.6 or 6.0 will resolve this.

Thank you kregalex! That was genius. It worked for me like a charm.

I just upgraded to OS X Mavericks, and samples just compile fine now. I guess that some condition (see findcudalib.mk) to use clang was wrong for Mountain Lion, but for Mavericks it works like a charm.

P.S. : don’t forget to “sudo make” not just “make”

Hi,
May i ask, whats the version of Xcode u have installed?
i tried modifiing code as you did, and its still not working. i dont have llvm-g++ in my bin directory.

Hi,

In fact, you should upgrade to OS X Mavericks because samples are compiling there. If you do not want to update your OS, you have to change GCC ?= g++ to GCC ?=/usr/bin/clang in findcudalib.mk (you have to do that for each sample concerned).

P.S. : My post was deleted, I don’t know why

Thank you so much Kriegalex :)
i managed to compile it and run it successfully. 13 warnings though.
oh i also deleted the CLANG ?= /usr/bin/clang line which i totally missed.

WOW!!! I just spent a few hours trying to figure this out! Just for some background… I am a noob to cuda, mac unix. I am/was trying to install 5.5 cuda on OSX 10.9 on a late 2013 MBP.

So this is what I learned. The make file terminates prematurely due to errors. I still don’t know how to eliminate these errors.

I ran “sudo make -k” to force the compilation through all the errors while being in the samples directory. Once the compilation was complete, I ran the deviceQuery program by “./deviceQuery” while being in the release folder where all compiled programs end up.

I did not know how to run the programs that were being output. I was just typing in the name of the program and would get this error for example:

-bash: deviceQuery: command not found

I hope this helps any one else.

If anyone else has input on why I am receiving so many errors/warnings please let me know!

Thank you!!!