C++ mac osx 10.9上的nvcc不支持选项
当我试图编译任何包含简单Hello World的.cu文件时,我在命令行上遇到以下错误:C++ mac osx 10.9上的nvcc不支持选项,c++,xcode,macos,cuda,clang,C++,Xcode,Macos,Cuda,Clang,当我试图编译任何包含简单Hello World的.cu文件时,我在命令行上遇到以下错误: Agustin$ nvcc -o hello_world hello_world.cu clang: error: unsupported option '-dumpspecs' clang: error: no input files 我正在运行OSX Mavericks 10.9 以下是Cuda版本: nvcc: NVIDIA (R) Cuda compiler driver Copyright (c
Agustin$ nvcc -o hello_world hello_world.cu
clang: error: unsupported option '-dumpspecs'
clang: error: no input files
我正在运行OSX Mavericks 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
同样在互联网上阅读,如果我像这样删减了文件:
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):
错误:标识符“\u char16\u t”未定义
/Applications/Xcode.app/Contents/Developer/toolschains/XcodeDefault.xctoolschain/usr/bin/./lib/c++/v1/_-config(192):
错误:标识符“\u char32\u t”未定义
/Applications/Xcode.app/Contents/Developer/toolschains/XcodeDefault.xctoolschain/usr/bin/./lib/c++/v1/_配置(303):
错误:需要一个标识符
/Applications/Xcode.app/Contents/Developer/toolschains/XcodeDefault.xctoolschain/usr/bin/./lib/c++/v1/_配置(303):
错误:仅在函数声明上允许内联说明符
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/./lib/c++/v1/_配置(304):
错误:应为表达式
/Applications/Xcode.app/Contents/Developer/toolschains/XcodeDefault.xctoolchain/usr/bin/./lib/c++/v1/_配置(305):
错误:应为“;”
。。。。。。。。。。。。。。还有更多行类似的错误打印输出
尝试更新到最近发布的OSX 10.9版cuda工具包的新版本 一定要遵守规则
您可能也对我的答案感兴趣。第二个问题可能来自nvcc和libc++没有很好地配合。 尝试:
我遇到了类似的问题。正如Robert提到的,这与libstdc++v.s.libc++(clang的默认值)有关 您可以在此处看到正在工作的CMake helloworld项目: 在main.cpp中,我还有手动编译指令(您必须稍微调整它们以匹配路径)
nvcc -o hello_world hello_world.cu -ccbin /usr/bin/clang -Xcompiler -stdlib=libstdc++