MacPorts and Clang

Clemens Lang cal at
Fri Jul 17 01:59:57 PDT 2015

----- On 17 Jul, 2015, at 10:33, firetiti firetiti at wrote:

> I just installed the Clang last version using « sudo port install clang-3.6
> @3.6.1_1 », and it worked perfectly fine.
> But when I check the current version « clang —version », I still have the old
> clang version.

That's because MacPorts' clang doesn't install a "clang" binary in /opt/local/bin.
That makes sense because there are multiple versions of clang to choose from.
MacPorts offers the port select mechanism to choose your preferred version of
clang. Run sudo port select --set clang mp-clang-3.6 to make it the default.

> I tried to modify /usr/bin/clang in order to make a symbolic link on «
> /opt/local/bin/clang-mp-3.6 », but then macport does not work anymore:

Don't do that. You should *NEVER* modify stuff in /usr/bin. That's Apple land,
Apple will do whatever it pleases to these files with the next update and you
should leave them alone, especially because third party tools expect them to be
the ones that Apple shipped, just as you saw with the MacPorts error this change

> FiReTiTi ~ $ sudo port upgrade outdated
> Error: Unable to open port: can't set "compiler.blacklist": couldn't determine
> build number of compiler "clang"
> To report a bug, follow the instructions in the guide:
> How can I do in order to have the last clang version as the current one?

Use port select and make sure /opt/local/bin is first in your $PATH.

Clemens Lang

More information about the macports-users mailing list