Skip to content

Instantly share code, notes, and snippets.

@kalashnikov
Last active February 23, 2021 01:36
Show Gist options
  • Save kalashnikov/9b9a74f4177e5b10a227 to your computer and use it in GitHub Desktop.
Save kalashnikov/9b9a74f4177e5b10a227 to your computer and use it in GitHub Desktop.
GCC 5.3 install script from scratch (C-Shell)
#!/bin/csh
# Script to build GCC 5.3 from scratch on REHL6 platform
# Ref: http://stackoverflow.com/questions/9450394/how-to-install-gcc-piece-by-piece-with-gmp-mpfr-mpc-elf-without-shared-libra
setenv PREFIX /net/mosa/data/usr/local
wget ftp://gcc.gnu.org/pub/gcc/infrastructure/gmp-4.3.2.tar.bz2
bunzip2 gmp-4.3.2.tar.bz2
tar xvf gmp-4.3.2.tar
cd gmp-4.3.2
./configure --disable-shared --enable-static --prefix=$PREFIX
make && make check && make install
cd ..
wget ftp://gcc.gnu.org/pub/gcc/infrastructure/mpfr-2.4.2.tar.bz2
bunzip2 mpfr-2.4.2.tar.bz2
tar xvf mpfr-2.4.2.tar
cd mpfr-2.4.2
./configure --disable-shared --enable-static --prefix=$PREFIX --with-gmp=$PREFIX
make && make check && make install
cd ..
wget ftp://gcc.gnu.org/pub/gcc/infrastructure/mpc-0.8.1.tar.gz
tar zxvf mpc-0.8.1.tar.gz
cd mpc-0.8.1
./configure --disable-shared --enable-static --prefix=$PREFIX --with-gmp=$PREFIX --with-mpfr=$PREFIX
make && make check && make install
cd ..
wget http://ftp.tsukuba.wide.ad.jp/software/gcc/releases/gcc-5.3.0/gcc-5.3.0.tar.gz
tar -zxvf gcc-5.3.0.tar.gz
cd gcc-5.3.0
mkdir build
cd build
../configure --prefix=$PREFIX --enable-static --enable-languages=c,c++ --enable-threads=posix --with-gmp=$PREFIX --with-mpfr=$PREFIX --with-mpc=$PREFIX --with-fpmath=sse --with-isl=$PREFIX --disable-multilib
make -j 4 bootstrap && make install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment