Downgrade Xcode for NVCC (Cuda compiler)

On a MacOS 10.12: Assuming your NVCC support only clang version ‘8000’. In that case you want to downgrade your Xcode version to 8.2, by following these simple steps:

  1. Download X_Code 8.2
  2. Unzip “Xcode_8.2.xip” and movie it to “Application folder” as /Applications/
  3. Run sudo xcode-select -s /Applications/
  4. Check version by Run /usr/bin/cc --version, it should be Apple LLVM version 8.0.0

Note: Sometimes, the previous clang compiler generated build files that were not entirely cleared. Be sure to delete all the build files if the method above is not working and you are still getting an error.

Taken from here