Libs: GNU GCC on Centos6

From Define Wiki
Jump to navigation Jump to search

General Information

Further information on GNU's version of gcc can be found at: http://gcc.gnu.org

Installation notes

Taken from Bath Uni wiki: https://wiki.bath.ac.uk/display/HPC/GNU+gcc Update to reflect Bright Installation process

Version 4.8.1

build and install: gmp, isl, cloog, mpfr, mpc

# gcc-4.8.1
# module list
Currently Loaded Modulefiles:
  1) shared      2) gcc/4.7.2
 
# echo $LD_LIBRARY_PATH
/apps/gnu/gcc/4.7.2/lib64:/apps/gnu/gcc/4.7.2/lib:/apps/gnu/mpc/1.0.1/lib:/apps/gnu/mpfr/3.1.1/lib:/apps/gnu/gmp/5.0.5/lib:/apps/gnu/cloog/0.18.0/lib:/apps/gnu/isl/0.11.1/lib
 
# echo $CPATH
/apps/gnu/mpc/1.0.1/include:/apps/gnu/mpfr/3.1.1/include:/apps/gnu/gmp/5.0.5/include:/apps/gnu/mpc/1.0.1/include:/apps/gnu/cloog/0.18.0/include:/apps/gnu/isl/0.11.1/include
 
 
mkdir build
cd build
 
../configure --prefix=/apps/gnu/gcc/4.8.1 \
            --with-gmp=/apps/gnu/gmp/5.1.1 --with-mpfr=/apps/gnu/mpfr/3.1.2 \
            --with-mpc=/apps/gnu/mpc/1.0.1 --with-cloog=/apps/gnu/cloog/0.18.0 \
            --with-isl=/apps/gnu/isl/0.11.1 --disable-isl-version-check \
            --with-ppl \
            --enable-libada --enable-libssp --enable-build-with-cxx \
            --enable-shared
 
make && make install

Another way

tar xzf gcc-4.8.0.tar.gz
cd gcc-4.8.0
./contrib/download_prerequisites
cd ..
mkdir objdir
cd objdir
$PWD/../gcc-4.8.0/configure --prefix=/opt/gcc-4.8.0 
make
make install

Troubleshooting

In case the AVX2 flags don't work with your gcc compiler make sure you update binutils to the latest version