Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Revert Apple Clang Version For NVCC

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 the host compiler ('Apple clang') is not supported".

I recently updated my XCode version to 7.3, and my Mac to 10.11.4.

Is there any way to revert my Clang Version?

like image 731
Jude Michael Murphy Avatar asked Mar 27 '16 18:03

Jude Michael Murphy


People also ask

How do I change my Clang version?

Select the Configuration Properties > General property page. Modify the Platform Toolset property to LLVM (clang-cl), if it isn't already set. Select the Configuration Properties > Advanced property page. Modify the LLVM Toolset Version property to your preferred version, and then choose OK to save your changes.

Does Apple Clang support C++20?

C++20 implementation statusClang has support for some of the features of the ISO C++ 2020 standard. You can use Clang in C++20 mode with the -std=c++20 option (use -std=c++2a in Clang 9 and earlier).

How do I know what version of Clang I have Mac?

Also, you will have more than one clang to choose from using. If your mac use separated command-line tools , then, that " Apple LLVM version 9.1. 0 (clang-902.0. 39.1) " ONLY express your installed Xcode 9.3/9.3.


2 Answers

  1. Go to https://developer.apple.com/downloads/, log in and then download http://adcdownload.apple.com/Developer_Tools/Command_Line_Tools_OS_X_10.11_for_Xcode_7.2/Command_Line_Tools_OS_X_10.11_for_Xcode_7.2.dmg, and install, as was suggested by fabregaszy.
  2. Run the following command to switch to the old version: sudo xcode-select --switch /Library/Developer/CommandLineTools
  3. Run the following command to quickly check clang version: clang --version
like image 139
szha Avatar answered Oct 13 '22 07:10

szha


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.

enter image description here

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.

enter image description here

You can check the default version of clang in Terminal:

clang -v OR llvm-gcc -v 

Now nvcc should work

like image 33
adon Avatar answered Oct 13 '22 07:10

adon