I've installed gcc-4.6
using the homebrew-alternatives gcc
formula, but I can't seem to get it to use that GCC to install other formulas. Specifically Open-MPI and boost.
Does anyone know how to make Homebrew use this new compiler?
Thanks!
I've installed gcc-4.6
using the homebrew-alternatives gcc
formula, but I can't seem to get it to use that GCC to install other formulas. Specifically Open-MPI and boost.
Does anyone know how to make Homebrew use this new compiler?
Thanks!
These answers are all fairly old now. It seems that recent versions of homebrew have a '--cc' option that enables you to select the c compiler to use. For example
will install using the brew version of gcc
It looks like the latest versions of Homebrew now support the
HOMEBREW_CC
andHOMEBREW_CXX
environment variables.So now you can do the following:
From their wiki it sounds like they don't support other compilers:
Homebrew can't adapt to other versions of gcc using command line options. You can easily override the older compiler, though, if you edit the open-mpi and boost formula. For example, you can add a few commands after the "def install" in open-mpi.rb:
That worked for me on Lion. Good luck.