Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # source: https://www.vultr.com/docs/how-to-install-gcc-on-centos-6
- # minimum ram 1 GB or 512 RAM + 512 SWAP
- # Not tested in centos 6
- # Maybe will be fine for another gcc version. Just change 4.9.3 with the version
- #!/bin/bash
- version=4.9.3
- numproc=8
- sudo yum install texinfo-tex flex zip libgcc.i686 glibc-devel.i686
- wget -c http://ftp.gnu.org/gnu/gcc/gcc-$version/gcc-$version.tar.bz2
- tar xf gcc-$version.tar.bz2
- cd gcc-$version
- contrib/download_prerequisites
- cd ..
- mkdir objdir
- cd objdir
- # install gcc to /usr/local
- ../gcc-$version/configure
- # change 6 with number of processor. Check with "nproc"
- make -j$numproc
- sudo make install
- # Not required for centos 6
- echo 'pathmunge /usr/local/bin' > /etc/profile.d/userLocalBin.sh
- chmod +x /etc/profile.d/userLocalBin.sh
- . /etc/profile
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement