Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing gcc49 with Homebrew

I'm trying to get Homebrew to install gcc49 (GCC 4.9). Specifically, I'm installing using the command,

brew install homebrew/versions/gcc49

However, doing this normally, I get an error saying that I'm missing gmp4. This is where it gets weird.

If I then do brew install homebrew/versions/gmp4, I'm informed once again that gmp4 is missing. The library doesn't install. The exact same thing happens for a few other required libraries. Right now, rather than fixing this strange behaviour, I'm trying to run

brew install homebrew/versions/gcc48 --with homebrew/versions/gmp4 --with homebrew/versions/libmpc08 --with homebrew/versions/mpfr2 --with homebrew/versions/cloog018 --with homebrew/versions/isl011

... Which results in

==> Installing dependencies for gcc48: gmp4, mpfr2, libmpc08, isl011, cloog018
==> Installing gcc48 dependency: gmp4
==> Downloading ftp://ftp.gmplib.org/pub/gmp/gmp-5.1.3.tar.bz2
######################################################################## 100.0%
==> Patching
patching file gmp-h.in
==> ./configure --prefix=/usr/local/Cellar/gmp/5.1.3 --enable-cxx
==> make
==> make check
==> make install
Error: Empty installation

It's that last line that really confuses me. I've never seen that returned by any software I've tried to install - what's going on, and how can I fix it?

Interestingly enough, when I try this on my desktop, which has the same Homebrew version, GCC 4.9 installs without a problem by simply running brew install gcc49, without even having to go through homebrew/versions.

like image 623
Jules Avatar asked Apr 22 '14 01:04

Jules


2 Answers

Try to do

brew tap homebrew/versions

first, and then

brew install gcc49

If you go to the buttom of this page, you can find what I mentioned above.

brew tap allows you to add more Github repos to the list of formulae that brew tracks, updates and installs from. When naming tap repos and formulas, however, there are a few gotchas to beware of...

Read more here.

like image 50
Pouya Avatar answered Nov 07 '22 02:11

Pouya


The accepted answer is now deprecated; the official way to install former versions of gcc is:

brew install [email protected]

See https://github.com/Homebrew/homebrew-versions/pull/1472.

like image 39
lemonzi Avatar answered Nov 07 '22 04:11

lemonzi