Use specific local gcc and related libraries with Homebrew I would like to use Homebrew to install some stuff,

In the mean time, I have already installed my local gcc, and I want Homebrew to use this specific one (this gcc at /usr/local/bin/gcc is frequently upgraded by myself).

Unfortunately, Homebrew always figure out its gcc dependency, and related libraries, then download them all at /usr/local/Cellar.

For instance:

On my Mac, which gcc indeed points to /usr/local/bin/gcc, when I brew install suite-sparse, it downloads gcc-4.9.1, while I already have gcc-4.9.2 locally.

I just want to keep things simple, use my local gcc with the associated library, e.g. gmp and mpfr (at /usr/local/lib), is it possible with Homebrew?
No, it's not possible. When you install gcc, you must satisfied the required dependencies, otherwise this packages will be installed to ensure that works property.

Required: gmp ✔, libmpc ✘, mpfr ✘, cloog ✘, isl ✘


Same occurs on linux system, you can install gcc without it's dependencies:

Depends: cpp-4.8 (= 4.8.2-19ubuntu1), gcc-4.8-base (= 4.8.2-19ubuntu1), binutils (&gt;= 2.24), libgcc-4.8-dev (= 4.8.2-19ubuntu1), libc6 (&gt;= 2.14), libcloog-isl4 (&gt;= 0.17), libgmp10, libisl10 (&gt;= 0.10), libmpc3, libmpfr4 (&gt;= 3.1.2), zlib1g (&gt;= 1:1.1.4)
Recommends: libc6-dev (&gt;= 2.13-0ubuntu6)