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.
The Apple Support Community will permanently close on November 20, 2026. Starting today, the site will no longer accept new posts and is available in a read-only state.
You can continue to find trusted guidance and support on the official Apple Support site.
We want to thank the community members who have contributed their time and expertise to help others with their Apple products.
The Apple Support Community will permanently close on November 20, 2026. Starting today, the site will no longer accept new posts and is available in a read-only state.
You can continue to find trusted guidance and support on the official Apple Support site.
We want to thank the community members who have contributed their time and expertise to help others with their Apple products.
How does one install GCC on a Mac?
iMac, OS X Yosemite (10.10), I updated Xcode & Yosemite.
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.
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.
Do you need GCC or just a C compiler environment
<http://osxdaily.com/2014/02/12/install-command-line-tools-mac-os-x>
These instructions will give you a C compiler environment.
However, if you explicitly need GCC, then after installing the command line tools via the above link, you can follow VikingOSX's suggestions.
How does one install GCC on a Mac?