GCC in Mac OS X 10.8 Mountain Lion – Xcode 4.3 / Xcode 4.4

Hah! So since I’m a registered developer, I installed the preview version of Mac OS X 10.8 Mountain Lion and of course Xcode 4.4 developer preview.

The operating system is stable as hell Lion, although Safari doesn’t like to parse RSS feeds ;-)

Today I wanted to compile the latest yarick release to do some simulations in quantum physics and discovered that neither cc nor gcc are located in “/usr/bin”. Instead they’re now inside the Xcode.app folder (which is normally located in “/Applications”).

Well, you can set the $PATH variable of your BASH/CSH-enviroment with (for bash):
export PATH=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:$PATH
Just put that line into your .profile or .bash_profile and you’re fine.

Unfortunately you’re not fine at all, if you need the “non-llvm”-version of gcc. This has disappeared in Mountain Lion. Hah! Get MacPorts and install the gnu-gcc if you need it ;-)

9 thoughts on “GCC in Mac OS X 10.8 Mountain Lion – Xcode 4.3 / Xcode 4.4

  1. se

    This is completely unnecessary. Just install the Command Line Tools in XCode’s Preferences | Downloads section and gcc is back globally.

    1. Brian

      @se – Though technically unnecessary, I was able to get gcc back immediately while the 115.1MB command-line tools installer was still downloading :)

      Can also pop the export line into the ~/.bash_profile so it doesn’t need to be run each time terminal is opened.

      1. Brian

        Spoke too soon:

        checking for gcc… (cached) gcc
        checking whether the C compiler (gcc ) works… no
        configure: error: installation or configuration problem: C compiler cannot create executables.

        1. Peter

          Let me add a ME TOO, when configuring modjk
          ./configure CFLAGS=”-arch x86_64″ APXSLDFLAGS=”-arch x86_64″ -with-apxs=/usr/sbin/apxs

          1. Mickey

            Whoa, did somebody see that dog? He mut9&#3s;ve been a big one!I mentioned yesterday I was going to send my son the recipe for the beer-cheese dip for all the parties he has. This one will be perfect for all the party-goers the next day!Happy New Year's Day!

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>