Revert Apple Clang Version For NVCC

后端 未结 9 1593
说谎
说谎 2020-12-23 12:04

I am trying to run NVCC to compile a CUDA program on my Mac.

When I try to run NVCC, I am receiving the following error: \"nvcc fatal : The version (\'70300\') of

相关标签:
9条回答
  • 2020-12-23 12:16

    I just had the same issue after upgrading to XCode 7.3 on 10.11. Reinstalling the previous (7.2) command line tools didn't downgrade the default clang compiler. To fix this I used a previous XCode.app package to rename and copy the XcodeDefault.xctoolchain directory into the Toolchains director in the current /Applications/Xcode.app. You have to right click on Xcode.app to "Show package contents" then browse to the Toolchains dir.

    Then (re)start Xcode, hit command-, for preferences, then go to locations. You will see the dropdown for Command Line Tools. Change this to the version of the toolchain you copied over.

    You can check the default version of clang in Terminal:

    clang -v OR llvm-gcc -v
    

    Now nvcc should work

    0 讨论(0)
  • 2020-12-23 12:21

    I had the same problem! Looked in my Time Machine Backups and copied Xcode.app (7.2.1) in my /Application folder. You could also download it from the Apple Developer Page and move it into your /Application folder. After it's done, you can change the Xcode Command Line Version in your Preferences of Xcode to 7.2.1 Then nvcc will work again (even with pycuda-2016.1).

    clang --version

    gives me:

    Apple LLVM version 7.0.2 (clang-700.1.81)

    0 讨论(0)
  • 2020-12-23 12:22

    Unfortunately, installing Command Line Tools from X-code version 7.2. currently is not solving this.

    Trying to compile results in:

    nvcc fatal : GNU C/C++ compiler is no longer supported as a host compiler on Mac OS X.

    What did the trick for me, was to uninstall Xcode 7.3 and install Xcode 6.2 from the Apple developer site.

    0 讨论(0)
  • 2020-12-23 12:22

    Rename Xcode exists in your mac as Xcode-7.app in /Applications folder. Then download Xcode6.4 from https://developer.apple.com/download/more/ and install it.

    0 讨论(0)
  • 2020-12-23 12:30

    The accepted answer says to download the next-to-latest command line tools and install them, then select them by typing in the console

    sudo xcode-select --switch /Library/Developer/CommandLineTools
    

    Its been asked how to revert to the original version of the tools. This is achieved by

    sudo xcode-select --switch /Applications/Xcode.app
    
    0 讨论(0)
  • 2020-12-23 12:32

    I would try homebrew's version of llvm, it works for me. brew install llvm37

    Then, set your compiler to homebrew's clang: /usr/local/bin/clang++-3.7 or whatever respondes to which clang++-3.7

    That way you can leave your OS X dev environment defaults as they are.

    0 讨论(0)
提交回复
热议问题