1. Download Clang Version 5.0.0 for macOS (.sig). (Scroll down a bit, and you’ll see 5.0.0.)
  2. Unzip it by clicking it.
  3. cd ~/Downloads/clang+llvm-5.0.0-x86_64-apple-darwin.
  4. Run ls and confirm that you see bin, include, lib, libexec and share.
  5. Run sudo cp -R * /usr/local/.
    • NOTE: In retrospect, I think it’s better to do sudo cp -R bin/clang-format /usr/local/bin/.
    • It is because I couldn’t build stellar-core after doing this step.
    • I’m not certain if it was because of this, but I think it’s just better to only move clang-format.
    • I actually realloy don’t know which one is better. If I don’t move everything, there might be some dependency issues.
  6. Run clang-format --version.
  7. Most likely, macOS will complain that the program can’t be trusted. Open System Preferences and go to Security & Privacy. You will probably see something about clang-format there.
  8. Once you are done with that, go back to the terminal, and run clang-format --version.
  9. Hopefully, you will see clang-format version 5.0.0 (tags/RELEASE_500/final).