
Clang is a compiler front end for programming languages C, C++, Objective-C, Objective-C++, and the software frameworks OpenMP, OpenCL, RenderScript, CUDA, SYCL, and HIP.
Clang could already be installed on your Mac.
To verify if Clang is on your computer already, open a macOS Terminal window and enter the following command:
$ clang --version
If Clang is installed, you will see Compiler version (example: Apple clang version 15.0.0), target architecture (like arm64-apple-darwin or x86_64), and installed location.
If Clang isn’t installed, enter the following command:
$ xcode-select --install
(Note: the “–version” and “–install” above is two hyphens before the word “version” and “install”)
This will install the Xcode Command Line Tools on macOS. They are a lightweight package from Apple that gives you the following:
clang(C/C++ compiler)gcc(actually an alias to clang on Mac)make(build automation)git(version control)- Standard headers and libraries