Source compiler installation
Advantageously, the selected version of easy installation, usually gcc version requirements for
example, mounted gcc
https://mirrors.tuna.tsinghua.edu.cn/gnu/gcc/gcc-9.2.0/gcc-9.2.0.tar. gz
- Download Source Package
You need to have installed wget
wget https://mirrors.tuna.tsinghua.edu.cn/gnu/gcc/gcc-9.2.0/gcc-9.2.0.tar.gz
- Extract the source package
mkdir /data/down
cd /data/down/
tar -xf gcc-9.2.0.tar.gz
- Download dependencies
cd /data/down/gcc-9.2.0
vi contrib/download_prerequisites
base_url='ftp://gcc.gnu.org/pub/gcc/infrastructure/'
->
base_url='http://mirror.linux-ia64.org/gnu/gcc/infrastructure/'
yum -y install bzip2 //解压时需要
bash contrib/download_prerequisites
gmp-6.1.0.tar.bz2: OK
mpfr-3.1.4.tar.bz2: OK
mpc-1.0.3.tar.gz: OK
isl-0.18.tar.bz2: OK
All prerequisites downloaded successfully.
- Generated makefile
./configure --enable-checking=release --enable-languages=c,c++ --disable-multilib --build=x86_64-linux
configure is an executable script, it has many options
--prefix option is to configure the installation path, if you do not configure this option after installation:
the executable file default placed in / usr / local / bin
library files by default in / usr / local / lib
default configuration file in / usr / local / etc
other resource files in / usr / local / report this content share
the configure parameters Detailed:
--prefix = / usr / local / gcc-9.2.0 / all resource files are placed in the path
--enable-checking = release generated by the compiler do additional checks during compilation
--enable-languages = c, c ++ gcc support so that c, c ++
--disable-the multilib compiler does not generate other platform cross compiler executable code
--build = x86_64-linux absence of such the compiler 32
make
make install
Consuming 甚久