CentOS 6.x x86_64 编译安装gcc 4.8.2

下载解压源代码gcc-4.8.2
确保联网情况下,下载依赖的gmp、mpfr、mpc代码
cd gcc-4.8.2
./contrib/download_prerequisites

依次安装在目录/usr/lib64下,prefix指定总体安装目录(设置/usr后会覆盖系统自带gcc)
cd gmp
mkdir build
cd build
../configure  --prefix=/usr  --libdir=/usr/lib64
make -j4 && make install
cd ../../

cd mpfr
mkdir build
cd build
../configure  --prefix=/usr  --libdir=/usr/lib64
make -j4 && make install
cd ../../

cd mpc
mkdir build
cd build
../configure  --prefix=/usr  --libdir=/usr/lib64
make -j4 && make install
cd ../../

配置动态链接目录
touch /etc/ld.so.conf.d/gcc-4.8.2.conf
echo "/usr/lib64" > /etc/ld.so.conf.d/gcc-4.8.2.conf
mkdir build
cd build
../configure  --prefix=/usr   --libdir=/usr/lib64  --disable-multilib --with-system-zlib --enable-languages=c,c++  --disable-checking
make -j4 && make install



你可能感兴趣的:(CentOS 6.x x86_64 编译安装gcc 4.8.2)