2013년 10월 10일 목요일

glibc downgrade

rpm -Uvh --nodeps --oldpackage /home/glibc-2.12-1.107.el6.x86_64.rpm
rpm -Uvh --nodeps --oldpackage /home/glibc-common-2.12-1.107.el6.x86_64.rpm
rpm -Uvh --nodeps --oldpackage /home/glibc-devel-2.12-1.107.el6.x86_64.rpm
rpm -Uvh --nodeps --oldpackage /home/glibc-headers-2.12-1.107.el6.x86_64.rpm

glibc를 변경할 시 시스템이 불능이 될 수 있으니 패키지 명령어로 하는게 좋음.

2013년 10월 3일 목요일

오래된 커널 삭제

1. 설치된 커널 정보 가져오기
  RedHat : rpm -q kernel > list.txt
  Debain : dpkg --get-selections | grep linux-image | cut -f1 > list.txt

2. list.txt를 수정하여 삭제할 커널만 남겨 놓고 저장한다.

3. 제거
  RedHat : cat list.txt | xargs yum erase
  Debain : cat list.txt | xargs apt-get purge


기본적으로 커널은 5개 버전을 보관한다. 2개로 변경하는 방법
yum install yum-utils
package-cleanup --oldkernels --count=2

또는
/etc/yum.conf
  installonly_limit=2
로 변경

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 .)