Wednesday, June 3, 2015

[Rocks Cluster]: updating gcc, gfortran on my front end

updating gcc, gfortran on my front end


You never ever ever want to "upgrade" gcc on your machine to something 
other than the version distributed with your OS. That is just asking for 
trouble.

Here are exact instructions to get gcc/4.6.2 installed assuming you are 
root in a bash shell.

cd /tmp
mkdir gcc
cd gcc
wget http://www.mpfr.org/mpfr-current/mpfr-3.1.0.tar.gz
wget ftp://ftp.gmplib.org/pub/gmp-4.3.2/gmp-4.3.2.tar.gz
wget http://www.multiprecision.org/mpc/download/mpc-0.9.tar.gz
wget http://ftp.gnu.org/gnu/gcc/gcc-4.6.2/gcc-4.6.2.tar.gz

tar zxf mpfr-3.1.0.tar.gz
tar zxf gmp-4.3.2.tar.gz
tar zxf gcc-4.6.2.tar.gz
tar zxf mpc-0.9.tar.gz

cd gmp-4.3.2
./configure --prefix=/share/apps/gcc/4.6.2
make
make install

cd ../mpfr-3.1.0
./configure --prefix=/share/apps/gcc/4.6.2 --with-gmp=/share/apps/gcc/4.6.2
make
make install

cd ../mpc-0.9
./configure --prefix=/share/apps/gcc/4.6.2 --with-mpfr=/share/apps/gcc/4.6.2 --with-gmp=/share/apps/gcc/4.6.2
make
make install

cd ../gcc-4.6.2
export LD_LIBRARY_PATH=/share/apps/gcc/4.6.2/lib:/share/apps/gcc/4.6.2/lib64
mkdir obj
cd obj
../configure --prefix=/share/apps/gcc/4.6.2 --with-mpfr=/share/apps/gcc/4.6.2 --with-gmp=/share/apps/gcc/4.6.2 --enable-languages="c,c++,fortran"
make
make install

Then just make sure you prefix your PATH with /share/apps/gcc/4.6.2/bin 
and have your LD_LIBRARY_PATH configured as above to pick up the shared 
libraries.


No comments: