第一:安装依赖库
GMP、MPFR、MPC
LINUX error: Building GCC requires GMP 4.2+, MPFR 3.1.0+ and MPC 0.8.0+.
1.1 下载源码并解压
wget -c http://ftp.gnu.org/gnu/mpc/mpc-1.3.1.tar.gz
wget -c http://ftp.gnu.org/gnu/mpfr/mpfr-4.2.1.tar.gz
wget -c http://ftp.gnu.org/gnu/gmp/gmp-6.3.0.tar.gz
tar -zxvf mpc-1.3.1.tar.gz
tar -zxvf mpfr-4.2.1.tar.gz
tar -zxvf gmp-6.3.0.tar.gz
1.2 安装GMP
cd gmp-6.3.0/
./configure --prefix=/home/luyuan/software/bioinfo/install/gmp/6.3.0
make
make install
1.3 安装MPFR
cd mpfr-4.2.1/
./configure --prefix=/home/luyuan/software/bioinfo/install/mpfr --with-gmp=/home/luyuan/software/bioinfo/install/gmp/6.3.0
make
make install
1.4 安装MPC
cd mpc-1.3.1/
./configure --prefix=/home/luyuan/software/bioinfo/install/mpc --with-gmp=/home/luyuan/software/bioinfo/install/gmp/6.3.0 --with-mpfr=/home/luyuan/software/bioinfo/install/mpfr
报如下错误:
checking for MPFR… no
configure: error: libmpfr not found or uses a different ABI.
解决:
设置LIBRARY_PATH
which LIBRARY_PATH
# /usr/lib/x86_64-redhat-linux6E/lib64:
# 修改为:
export LIBRARY_PATH=/usr/lib64
./configure --prefix=/home/luyuan/software/bioinfo/install/mpc --with-gmp=/home/luyuan/software/bioinfo/install/gmp/6.3.0 --with-mpfr=/home/luyuan/software/bioinfo/install/mpfr
make -j 6
make install
第二:GCC安装
2.1 下载GCC源码和解压
gcc官网:http://ftp.gnu.org/gnu/gcc
下载:wget -c http://ftp.gnu.org/gnu/gcc/gcc-14.1.0/gcc-14.1.0.tar.gz
wget -c http://ftp.gnu.org/gnu/gcc/gcc-14.1.0/gcc-14.1.0.tar.gz
tar -zxvf gcc-14.1.0.tar.gz
2.2 配置
cd gcc-14.1.0/
export LD_LIBRARY_PATH=/usr/lib64:/home/luyuan/software/bioinfo/install/mpc/lib:/home/luyuan/software/bioinfo/install/mpfr/lib:/home/luyuan/software/bioinfo/install/gmp/6.3.0/lib:$LD_LIBRARY_PATH
./configure --prefix=/home/luyuan/software/bioinfo/install/gcc/14.1.0
报错:
解决:
./configure --prefix=/home/luyuan/software/bioinfo/install/gcc/14.1.0 --enable-multilib
2.3 编译
make
2.4 安装
make install