2013-10-29 37 views
-1

当我尝试编译任何文件.CU包括一个简单的Hello World我得到的命令行上此错误:NVCC在Mac OSX上10.9不受支持的选项

Agustin$ nvcc -o hello_world hello_world.cu 
clang: error: unsupported option '-dumpspecs' 
clang: error: no input files 

我运行OSX 10.9小牛

这里是CUDA的版本:

nvcc: NVIDIA (R) Cuda compiler driver 
Copyright (c) 2005-2013 NVIDIA Corporation 
Built on Wed_Jul_10_11:16:01_PDT_2013 
Cuda compilation tools, release 5.5, V5.5.0 

在互联网上同样阅读,如果我excecuted像这样的文件:

nvcc -o hello_world hello_world.cu -ccbin /usr/bin/clang 

我收到以下错误

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/_config(191): error: identifier "_char16_t" is undefined

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/_config(192): error: identifier "_char32_t" is undefined

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/__config(303): error: expected an identifier

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/__config(303): error: inline specifier allowed on function declarations only

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/__config(304): error: expected an expression

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/__config(305): error: expected a ";"

.............. And many more lines of similar error printouts

回答

4

尝试更新到被张贴刚刚为OSX 10.9 here的CUDA工具包的新版本。

一定要按照instructions

您可能也有兴趣我的回答here

3

第二个问题可能来自nvcc和libC++不能很好地一起玩。 Try:

nvcc -o hello_world hello_world.cu -ccbin /usr/bin/clang -Xcompiler -stdlib=libstdc++ 
1

我遇到了类似的问题。正如Robert提到的,这与libstdC++ v.s有关。 libC++(clang的默认值)。

你可以看到这个工作的CMake的HelloWorld项目在这里: https://github.com/drtaglia/homebrew/tree/master/cuda_simple

在main.cpp中我也有手动编译指令(你将不得不调整他们稍微符合你的路)