安装包下载地址:
gmp https://gmplib.org
mpr https://www.mpfr.org
mpc http://www.multiprecision.org/mpc
isl http://isl.gforge.inria.fr
gcc http://gnu.askapache.com/gcc
在/home/kylin上传所有安装包
kylin用户执行
1.1安装gmp
cd /home/kylin
sudo apt-get install lzip
lzip -d gmp-6.2.1.tar.lz
tar xvf gmp-6.2.1.tar
cd gmp-6.2.1
mkdir build
cd build
../configure -prefix=/usr/local/gmp-6.2.1
make -j20
sudo make install
1.2安装mpr
cd
tar xzvf mpfr-4.1.0.tar.gz
cd mpfr-4.1.0
mkdir build
cd build
../configure --prefix=/usr/local/mpfr-4.1.0 --with-gmp=/usr/local/gmp-6.2.1
make -j12
sudo make install
1.3安装mpc
cd
tar xzvf mpc-1.2.0.tar.gz
cd mpc-1.2.0
mkdir build
cd build
../configure --prefix=/usr/local/mpc-1.2.0 -with-gmp=/usr/local/gmp-6.2.1 -with-mpfr=/usr/local/mpfr-4.1.0
make -j12
sudo make install
1.4安装isl
sudo apt-get install libgmp3-dev
cd
tar xzvf isl-0.18.tar.gz
cd isl-0.18
mkdir build
cd build
../configure --prefix=/usr/local/isl-0.18 --with-gmp=/usr/local/gmp-6.2.1
make -j12
sudo make install
1.5安装gcc
cd
tar xzvf gcc-6.5.0.tar.gz
cd gcc-6.5.0
mkdir build
cd build
../configure --prefix=/usr/local/gcc-6.5.0 --enable-threads=posix --disable-checking --enable--long-long --with-gmp=/usr/local/gmp-6.2.1 --with-mpfr=/usr/local/mpfr-4.1.0 --with-mpc=/usr/local/mpc-1.2.0 --with-isl=/usr/local/isl-0.18 --disable-multilib
sudo vim /etc/profile
行尾添加
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/gmp-6.2.1/lib:/usr/local/mpfr-4.1.0/lib:/usr/local/mpc-1.2.0/lib
保存退出
source /etc/profile
安装libmpfr.so.6
cd
sudo dpkg -i libmpfr-doc_4.0.2-1_all.deb
sudo cp -p /usr/local/mpfr-4.1.0/lib/libmpfr.so.6 /usr/lib/libmpfr.so.6
sudo cp -p /usr/local/mpfr-4.1.0/lib/libmpfr.so /usr/lib/libmpfr.so
cd /home/kylin/gcc-6.5.0/build
make -j12
sudo make install
cd /usr/bin
sudo rm gcc
sudo rm g++
sudo ln -s /usr/local/gcc-6.5.0/bin/gcc gcc
sudo ln -s /usr/local/gcc-6.5.0/bin/g++ g++
gcc --version
gcc (GCC) 6.5.0
Copyright © 2017 Free Software Foundation, Inc.
本程序是自由软件;请参看源代码的版权声明。本软件没有任何担保;
包括没有适销性和某一专用目的下的适用性担保。