2013년 10월 3일 목요일

Centos 6.4 에서 gcc 4.8.1 source compile 하기

이용하는 시스템에 관리자 권한이 없다면 소스를 컴파일해서 사용해야 한다.
CentOS에 있는 g++은 C++11을 지원하는 버전이 아니라서 자신의 홈디렉토리에 컴파일해서 사용한다.


iconv-1.14 install
./configure --prefix=$HOME/opt/libiconv-1.14
make -j 12 && make install


gmp-5.1.3 install
./configure --prefix=$HOME/opt/gmp-5.1.3
make -j 12 && make install


ppl-0.12 install
./configure --prefix=$HOME/opt/ppl-0.12 --with-gmp=$HOME/opt/gmp-5.1.3
make -j 12 && make install


cloog-0.16.1 install
./configure --prefix=$HOME/opt/cloog-0.16.1 --with-gmp-prefix=$HOME/opt/gmp-5.1.3


mpfr-3.1.2 install
./configure --prefix=$HOME/opt/mpfr-3.1.2 --with-gmp=$HOME/opt/gmp-5.1.3
make -j 12 && make install


mpc-1.0.1 install
./configure --prefix=$HOME/opt/mpc-1.0.1 --with-mpfr=$HOME/opt/mpfr-3.1.2 --with-gmp=$HOME/opt/gmp-5.1.3
make -j 12 && make install


bash 경우
~/.bashrc
 export ICONV=/home/hkim/opt/libiconv-1.14
export CLOOG=/home/hkim/opt/cloog-0.16.1
export GMP=/home/hkim/opt/gmp-5.1.3
export MPC=/home/hkim/opt/mpc-1.0.1
export MPFR=/home/hkim/opt/mpfr-3.1.2
export PPL=/home/hkim/opt/ppl-0.12
export LD_LIBRARY_PATH=$ICONV/lib:$CLOOG/lib:$GMP/lib:$MPC/lib:$MPFR/lib:$PPL/lib:$LD_LIBRARY_PATH
export PATH=$CLOOG/bin:$PPL/bin:$ICONV/bin:$PATH

또는 csh 경우
~/.cshrc
setenv CLOOG /home/hkim/opt/cloog-0.16.1
setenv ICONV /home/hkim/opt/libiconv-1.14
setenv GMP /home/hkim/opt/gmp-5.1.3
setenv MPC /home/hkim/opt/mpc-1.0.1
setenv MPFR /home/hkim/opt/mpfr-3.1.2
setenv PPL /home/hkim/opt/ppl-0.12
setenv LD_LIBRARY_PATH ${CLOOG}/lib:${GMP}/lib:${MPC}/lib:${MPFR}/lib:${PPL}/lib:${ICONV}/lib:$LD_LIBRARY_PATH

set path=($CLOOG/bin $PPL/bin $ICONV/bin $path .)



gcc-4.8.1 install
./configure --prefix=$HOME/opt/gcc-4.8.1 --disable-cloog-version-check --enable-cloog-backend=isl --enable-gold --enable-languages=c,c++ --enable-lto --enable-libssp --with-ppl=$HOME/opt/ppl-0.12 --with-mpfr=$HOME/opt/mpfr-3.1.2 --with-mpc=$HOME/opt/mpc-1.0.1 --with-gmp=$HOME/opt/gmp-5.1.3 --with-cloog=$HOME/opt/cloog-0.16.1 --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib
make -j 12 && make install


bash 경우
~/.bashrc
export GCC=/home/hkim/opt/gcc-4.8.1
export LD_LIBRARY_PATH=$GCC/lib64:$PPL/lib:$LD_LIBRARY_PATH
export PATH=$GCC/bin:$PATH

또는 csh 경우
~/.cshrc
setenv GCC /home/hkim/opt/gcc-4.8.1
setenv LD_LIBRARY_PATH ${GCC}/lib64:$LD_LIBRARY_PATH
set path=($GCC/bin $path .)

댓글 1개:

  1. 안녕하세요. 자료 잘 보고갑니다.
    정리 정말 잘해놓으셨네요!!
    많은 도움 되었어요 감사합니다

    답글삭제