MacOS – switch back to clang after installing gcc through Macports on Mavericks

gccmacosmacportsxcode

After I installed Macports (and after that I have installed several versions of gcc through Macports), whenever I type gcc, one of those gcc installed through Macports will be invoked.

Before I installed Macports, whenever I type gcc, clang that comes with XCode will be invoked. (not sure this is true)

Now I need to compile a 3rd-party package with clang, but I don't know how I should do.

My question is: now that Macports (w gcc48) has been installed, what should I do to switch back to the setting where gcc is linked to clang that comes with XCode?

Best Answer

In Terminal:

nano ~/.bash_profile

find the line that looks like this:

export PATH=/opt/local/bin:/opt/local/sbin:$PATH

comment it out by putting # in front of it.