ryan
ryan

Reputation: 725

OS X 10.9 gcc links to clang

I just noticed that after installing OS X 10.9, the g++ compiler links to the clang compiler. Is there anyway to revert back to gcc/g++?

Upvotes: 59

Views: 54344

Answers (5)

Adam
Adam

Reputation: 17329

It has been this way for a long time already. The "GCC" that came with 10.8 was really GCC front-end with LLVM back-end.

The best way to get GCC is via Homebrew. After the one-line homebrew install command on the bottom of the linked page, you just need:

$ brew install gcc49

Unlike macports, Homebrew doesn't clutter your system dirs and it's much better at managing versions and uninstalls. It also doesn't require the crutch known as sudo.

Upvotes: 72

Zachary Kraus
Zachary Kraus

Reputation: 1101

you can also get a g++ compiler from http://hpc.sourceforge.net/. They have the compiler in a pre-built package. Just download and follow their directions. Note you may need to change your executable PATH and have /usr/local/bin ahead of /usr/bin. This is to insure g++ calls the right compiler.

Upvotes: 3

user2962717
user2962717

Reputation: 41

Accessible and up to date GCC packages are at http://hpc.sourceforge.net/

Upvotes: 4

trojanfoe
trojanfoe

Reputation: 122391

You'd have to install it from macports:

$ sudo port install gcc49

However I am not certain how you'd integrate gcc into Xcode 5, however you don't mention why you cannot use clang?

Upvotes: 11

rubenvb
rubenvb

Reputation: 76519

This is by design, and not new in OS X 10.9. Apple deprecated GCC a long time ago. Just use Clang, or if you need fortran/openmp/..., install GCC yourself through homebrew/macports/...

Upvotes: -1

Related Questions