I’d like to install the latest clang (3.1) compiler using macports (I use emacs rather than xcode, and the version of clang that comes with xcode is older anyway). macports seems to have the latest versions of gcc, but when I enter “port list clang” the only version that shows up is 2.9. I use the C++11 features, so I want to use the latest version.
I’m running snow leopard on an MBP.
Clang has several different versions available on MacPorts:
So if you just install the
clangport, it’ll install version 2.9. If you want 3.1, install theclang-3.1port. You can also installclang_select, which is a utility that allows you to easily switch between multiple installations of Clang; without it, you have to manually specify the version of the Clang binary you want each time.