Build & Install GCC4.6.3 in CentOS (5.2 & 6.3)

I did not know if you have already installed gmp, mpfr, mpc before build gcc4.6.3, if you did not, please refer to these to build GCC4.6.3:

and you could download all of the packages from my Share_Point or gcc mirror

And you could get all of these scripts(including gcc.4.6.3.conf) from HERE

1. build & install gmp:

tar jxf gmp-4.3.2.tar.bz2 &&cd gmp-4.3.2/

./configure --prefix=/usr/local/gmp

make &&make install

cd ..

2. build & install mpfr:

tar jxf mpfr-2.4.2.tar.bz2 ;cd mpfr-2.4.2/

./configure --prefix=/usr/local/mpfr -with-gmp=/usr/local/gmp

make &&make install

cd ..

3. build & install mpc:

tar xzf mpc-0.8.1.tar.gz ;cd mpc-0.8.1

./configure --prefix=/usr/local/mpc -with-mpfr=/usr/local/mpfr -with-gmp=/usr/local/gmp

make &&make install

cd ..

After build & install these libs, you could start to build & Install gcc4.6.3:

4. build & install gcc4.6.3

tar jxf gcc-4.6.3.tar.bz2 ;cd gcc-4.6.3

./configure --prefix=/usr/local/gcc -enable-threads=posix -disable-checking -disable-multilib -enable-languages=c,c++ -with-gmp=/usr/local/gmp -with-mpfr=/usr/local/mpfr/ -with-mpc=/usr/local/mpc/

if

[ $? -eq 0 ];then

echo "this gcc configure is success"

else

echo "this gcc configure is failed"

fi

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/mpc/lib:/usr/local/gmp/lib:/usr/local/mpfr/lib/

make && make install

[ $? -eq 0 ] && echo install success

5. set up the gcc env:

-- this is really important. or even you successfully built the GCC, you could not build hhvm successfully. the gcc.4.6.3.conf(find it in share point above).

cp gcc.4.6.3.conf /etc/ld.so.conf.d/gcc.4.6.3.conf

ldconfig

mv /usr/bin/gcc /usr/bin/gcc_old

mv /usr/bin/g++ /usr/bin/g++_old

mv /usr/bin/c++ /usr/bin/c++_old

ln -s -f /usr/local/gcc/bin/gcc /usr/bin/gcc

ln -s -f /usr/local/gcc/bin/g++ /usr/bin/g++

ln -s -f /usr/local/gcc/bin/c++ /usr/bin/c++

cp /usr/local/gcc/lib64/libstdc++.so.6.0.16 /usr/lib64/.

mv /usr/lib64/libstdc++.so.6 /usr/lib64/libstdc++.so.6.bak

ln -s -f /usr/lib64/libstdc++.so.6.0.16 /usr/lib64/libstdc++.so.6

6. finished.

you could run gcc --version to check if the current gcc version is gcc4.6.3, and also need to check g++, to see if the version is changed to g++4.6.3 too.

and then you could make your hhvm.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值