Advertisement
akhfa

install gcc 4.9.3 Centos 7

Aug 21st, 2015
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.79 KB | None | 0 0
  1. # source: https://www.vultr.com/docs/how-to-install-gcc-on-centos-6
  2. # minimum ram 1 GB or 512 RAM + 512 SWAP
  3. # Not tested in centos 6
  4. # Maybe will be fine for another gcc version. Just change 4.9.3 with the version
  5.  
  6. #!/bin/bash
  7. version=4.9.3
  8. numproc=8
  9. sudo yum install texinfo-tex flex zip libgcc.i686 glibc-devel.i686
  10. wget -c http://ftp.gnu.org/gnu/gcc/gcc-$version/gcc-$version.tar.bz2
  11. tar xf gcc-$version.tar.bz2
  12. cd gcc-$version
  13. contrib/download_prerequisites
  14. cd ..
  15. mkdir objdir
  16. cd objdir
  17.  
  18. # install gcc to /usr/local
  19. ../gcc-$version/configure
  20.  
  21. # change 6 with number of processor. Check with "nproc"
  22. make -j$numproc
  23. sudo make install
  24.  
  25. # Not required for centos 6
  26. echo 'pathmunge /usr/local/bin' > /etc/profile.d/userLocalBin.sh
  27. chmod +x /etc/profile.d/userLocalBin.sh
  28. . /etc/profile
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement