Created
July 19, 2019 07:05
-
-
Save dmadan86/b88b2fe39014595b8d47a45710c23381 to your computer and use it in GitHub Desktop.
Install GCC any version
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# this script installs GCC | |
# to use it navigate to your home directory and type: | |
# sh install-gcc.sh veersion | |
# download and install gcc | |
wget https://ftp.gnu.org/gnu/gcc/gcc-$1/gcc-$1.tar.gz | |
tar xzf gcc-$1.tar.gz | |
cd gcc-$1 | |
./contrib/download_prerequisites | |
cd .. | |
mkdir objdir | |
cd objdir | |
../gcc-$1/configure --prefix=$HOME/gcc-$1 --enable-languages=c,c++,fortran,go --disable-multilib | |
make | |
# install | |
make install | |
# clean up | |
rm -rf ~/objdir | |
rm -f ~/gcc-$1.tar.gz | |
# add to path (you may want to add these lines to $HOME/.bash_profile) | |
export PATH=$HOME/gcc-$1/bin:$PATH | |
export LD_LIBRARY_PATH=$HOME/gcc-4.9.3/lib:$HOME/gcc-$1/lib64:$LD_LIBRARY_PATH |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment