Skip to content

Instantly share code, notes, and snippets.

@shaybensasson
Created March 5, 2018 15:30
Show Gist options
  • Select an option

  • Save shaybensasson/88395d71dbf11b3f110f5e099324b1f7 to your computer and use it in GitHub Desktop.

Select an option

Save shaybensasson/88395d71dbf11b3f110f5e099324b1f7 to your computer and use it in GitHub Desktop.
Install gcc-4.9.4.sh which is compatible with matlab 2017b, ubuntu 16 gcc is 5.4.0
#!/bin/bash
# this script installs GCC 4.9.4
# to use it navigate to your home directory and type:
# sh install-gcc-4.9.4.sh
# download and install gcc 4.9.4
wget https://ftp.gnu.org/gnu/gcc/gcc-4.9.4/gcc-4.9.4.tar.gz
tar xzf gcc-4.9.4.tar.gz
cd gcc-4.9.4
./contrib/download_prerequisites
cd ..
mkdir objdir
cd objdir
../gcc-4.9.4/configure --prefix=$HOME/gcc-4.9.4 --enable-languages=c,c++,fortran,go --disable-multilib
make
# install
make install
# clean up
rm -rf ~/objdir
rm -f ~/gcc-4.9.4.tar.gz
# add to path (you may want to add these lines to $HOME/.bash_profile)
#export PATH=$HOME/gcc-4.9.4/bin:$PATH
#export LD_LIBRARY_PATH=$HOME/gcc-4.9.4/lib:$HOME/gcc-4.9.4/lib64:$LD_LIBRARY_PATH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment