Files
runner-images/images/macos/provision/core/gcc.sh
T

19 lines
696 B
Bash
Raw Normal View History

#!/bin/bash -e -o pipefail
2020-09-10 14:34:08 +03:00
echo "Installing GCC@8 using homebrew..."
brew install gcc@8
echo "Installing GCC@9 using homebrew..."
2020-11-11 13:11:31 +07:00
brew install gcc@9
2020-11-11 13:20:18 +07:00
# Known issue with brew that prevent installation of multiple formulas
# https://github.com/Homebrew/brew/issues/9100
2020-11-11 13:11:31 +07:00
echo "Applying workaround for the GCC"
cellarPath=$(brew --cellar gcc@8)
gccVersion=$(ls $cellarPath | head -n1)
fullCellarPath=$cellarPath/$gccVersion
ln -s $fullCellarPath/bin/c++-8 /usr/local/bin/c++-8
ln -s $fullCellarPath/bin/cpp-8 /usr/local/bin/cpp-8
ln -s $fullCellarPath/bin/g++-8 /usr/local/bin/g++-8
ln -s $fullCellarPath/bin/gcc-8 /usr/local/bin/gcc-8
ln -s $fullCellarPath/bin/gfortran-8 /usr/local/bin/gfortran-8