首页 文章

nvcc在mac osx 10.9不支持的选项上

提问于
浏览
-1

当我尝试编译包含简单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) 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):错误:标识符“_char16_t”未定义/Applications/Xcode.app /Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c / v1 / _config(192):错误:标识符“_char32_t”未定义/Applications/Xcode.app/Contents/Developer/Toolchains/ XcodeDefault.xctoolchain / usr / bin /../ lib / c / v1 / __ config(303):错误:预期标识符/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ .. / lib / c / v1 / __ config(303):错误:仅在函数声明上允许使用内联说明符/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c / v1 / __ config(304):错误:预期表达式/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c / v1 / __ config(305):错误:预期a “;” ..............还有更多类似的错误打印输出

3 回答

  • 4

    尝试更新到最近为OSX 10.9 here发布的新版cuda工具包 .

    请务必遵循instructions .

    您可能也对我的回答感兴趣here .

  • 3

    第二个问题可能来自nvcc和libc不能很好地融合在一起 . 尝试:

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

    我遇到了类似的问题 . 正如罗伯特所提到的,这与libstdc v.s.有关 . libc(clang的默认值) .

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

    在main.cpp中我也有手动编译指令(你必须稍微调整它们以匹配你的路径)

相关问题