Skip to content

Instantly share code, notes, and snippets.

@hongry18
Created May 27, 2019 09:20
Show Gist options
  • Save hongry18/f0d40b407191eb0875d90a1985ec458e to your computer and use it in GitHub Desktop.
Save hongry18/f0d40b407191eb0875d90a1985ec458e to your computer and use it in GitHub Desktop.

osx gcc-9.1 install

reference

[https://solarianprogrammer.com/2017/05/21/compiling-gcc-macos/]

downloads

  • curl -L https://ftpmirror.gnu.org/gcc/gcc-9.1.0/gcc-9.1.0.tar.xz | tar xf -
  • curl -L ftp://gcc.gnu.org/pub/gcc/infrastructure/gmp-6.1.0.tar.bz2 | tar xf -
  • curl -L ftp://gcc.gnu.org/pub/gcc/infrastructure/mpfr-3.1.4.tar.bz2 | tar xf -
  • curl -L ftp://gcc.gnu.org/pub/gcc/infrastructure/mpc-1.0.3.tar.gz | tar xf -
  • curl -L ftp://gcc.gnu.org/pub/gcc/infrastructure/isl-0.18.tar.bz2 | tar xf -

gmp insatll

cd gmp*
mkdir build && cd build
../configure --prefix=/usr/local/gcc-9.1 --enable-cxx
make -j 8
sudo make install-strip

mpfr insatll

cd ../..
cd mpfr*
mkdir build && cd build
../configure --prefix=/usr/local/gcc-9.1 --with-gmp=/usr/local/gcc-9.1
make -j 8
sudo make install-strip

mpc insatll

cd ../..
cd mpc*
mkdir build && cd build
../configure --prefix=/usr/local/gcc-9.1 --with-gmp=/usr/local/gcc-9.1 --with-mpfr=/usr/local/gcc-9.1
make -j 8
sudo make install-strip

isl insatll

cd ../..
cd isl*
mkdir build && cd build
../configure --prefix=/usr/local/gcc-9.1 --with-gmp-prefix=/usr/local/gcc-9.1
make -j 8
sudo make install-strip

gcc install

cd ../..
cd gcc*
mkdir build && cd build
../configure --prefix=/usr/local/gcc-9.1 \
--enable-checking=release \
--with-gmp=/usr/local/gcc-9.1 \
--with-mpfr=/usr/local/gcc-9.1 \
--with-mpc=/usr/local/gcc-9.1 \
--enable-languages=c,c++,fortran \
--with-isl=/usr/local/gcc-9.1 \
--program-suffix=-9.1
make -j 8
sudo make install-strip

edit envrioment variables

vi ~/.bash_profile

GCC_9_HOME='/usr/local/gcc-9.1' PATH="${PATH}:GCC_9_HOME/bin"

source ~/.bash_profile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment