Symlink GCC - Linuxbrew/brew GitHub Wiki
Create symlinks for /usr/bin/gcc
in $(brew --prefix)/bin
These instructions are unneeded on Ubuntu or Debian, or if your preferred compiler already has GCC executables found in your path named gcc-4.?
, gcc-5
, or gcc-6
.
gcc-5
or gcc-6
)
GCC 5 or 6 (ln -s $(which gcc) $(brew --prefix)/bin/gcc-$(gcc -dumpversion |cut -d. -f1)
ln -s $(which g++) $(brew --prefix)/bin/g++-$(g++ -dumpversion |cut -d. -f1)
ln -s $(which gfortran) $(brew --prefix)/bin/gfortran-$(gfortran -dumpversion |cut -d. -f1)
brew install hello && brew test hello; brew remove hello
gcc-4.x
)
GCC 4.x (ln -s $(which gcc) $(brew --prefix)/bin/gcc-$(gcc -dumpversion |cut -d. -f1,2)
ln -s $(which g++) $(brew --prefix)/bin/g++-$(g++ -dumpversion |cut -d. -f1,2)
ln -s $(which gfortran) $(brew --prefix)/bin/gfortran-$(gfortran -dumpversion |cut -d. -f1,2)
brew install hello && brew test hello; brew remove hello
gcc44
) on CentOS 5
GCC 4.4 (sudo yum install gcc44 gcc44-c++
ln -s /usr/bin/gcc44 $(brew --prefix)/bin/gcc-4.4
ln -s /usr/bin/g++44 $(brew --prefix)/bin/g++-4.4
ln -s /usr/bin/gfortran44 $(brew --prefix)/bin/gfortran-4.4
brew install --cc=gcc-4.4 hello && brew test hello; brew remove hello