Installing latest GCC/G++ via homebrew

With the holidays here, I finally had time to revisit a programming project I’d been meaning to complete/start. This is my sphere points project, which is available (shameless plug) in my github repo. The goal of which is to compute N equidistant points on S^2 . Along the way, I made a choice to implement much of the calculation in C++ 11. So far I’m really enjoying familiarizing myself with C++ latest enhancements. Presently, at the part where I want to compile and test the first bit of code which I’ve written, but g++ can’t find <random>, <array>, etc. After some googling it seems that my version of g++ (4.2.*) doesn’t support C++ 11. No problem. I just have to get the lastest version which supports C++ 11 — gcc 4.7. For those who might have found this post C++ 11 features are also supported on earlier versions of GCC/G++. A complete list and description of gcc compilers can be found here. Anyway, I chose to install via homebrew because of the convenience and gcc 4.7 is installed in /usr/local/*, preserving my current Xcode llvm configuration of gcc. This is what I did:

The latest version of GCC will always be available through the SynthiNet tap:
brew tap SynthiNet/synthinet

Install GCC 4.7.*
brew install gcc47


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s