Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

How does one install GCC on a Mac?

How does one install GCC on a Mac?

iMac, OS X Yosemite (10.10), I updated Xcode & Yosemite.

Posted on Mar 28, 2018 4:34 PM

Reply
Question marked as Best reply

Posted on Mar 28, 2018 5:56 PM

If you have the most recent Apple Command Line Tools (macOS 10.nn) for Xcode installed for your operating system version — which you get from developer.apple.com/download/more, then you need a package manager (e.g. homebrew) to install, and compile GCC and all of its dependencies. That compilation process will take at least an hour. After you initially install homebrew (brew):


# In the bash shell (e.g. .bash_profile), gag Google Analytics in Homebrew.

export HOMEBREW_NO_ANALYTICS=1


brew update

brew upgrade

brew info gcc

brew install gcc

brew cleanup (this removes previous application/dependency revisions saving considerable space)


The gcc application will be installed by default in /usr/local/bin.


Personally, I use Apple's clang/clang++ compilation tools rather than deal with GNU gcc.

2 replies
Question marked as Best reply

Mar 28, 2018 5:56 PM in response to Kevin_Cahill

If you have the most recent Apple Command Line Tools (macOS 10.nn) for Xcode installed for your operating system version — which you get from developer.apple.com/download/more, then you need a package manager (e.g. homebrew) to install, and compile GCC and all of its dependencies. That compilation process will take at least an hour. After you initially install homebrew (brew):


# In the bash shell (e.g. .bash_profile), gag Google Analytics in Homebrew.

export HOMEBREW_NO_ANALYTICS=1


brew update

brew upgrade

brew info gcc

brew install gcc

brew cleanup (this removes previous application/dependency revisions saving considerable space)


The gcc application will be installed by default in /usr/local/bin.


Personally, I use Apple's clang/clang++ compilation tools rather than deal with GNU gcc.

How does one install GCC on a Mac?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.