-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinstall_gcc.sh
60 lines (45 loc) · 1.64 KB
/
install_gcc.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/usr/bin/bash
echo "Start install GCC 9.2.0"
yum install gcc gcc-c++ -y
yum install bzip2 -y
rm -rf /home/root/temp_install/gcc-9.2.0.tar.gz /home/root/temp_install/gcc-9.2.0
mkdir -p /home/root/temp_install
cd /home/root/temp_install
wget https://ftp.gnu.org/gnu/gcc/gcc-9.2.0/gcc-9.2.0.tar.gz
tar -xvf gcc-9.2.0.tar.gz
cd gcc-9.2.0
./contrib/download_prerequisites
rm -rf /usr/local/gmp-6.1.0
mkdir /usr/local/gmp-6.1.0
cd /usr/local/gmp-6.1.0/
/home/root/temp_install/gcc-9.2.0/gmp-6.1.0/configure --prefix=/usr/local/gmp-6.1.0
make
make install
yum install gmp -y
yum install gmp-devel -y
rm -rf /usr/local/mpfr-3.1.4
mkdir /usr/local/mpfr-3.1.4
cd /usr/local/mpfr-3.1.4
/home/root/temp_install/gcc-9.2.0/mpfr-3.1.4/configure --prefix=/usr/local/mpfr-3.1.4 --with-gmp=/usr/local/gmp-6.1.0
make
make install
yum install mpfr -y
yum install mpfr-devel -y
rm -rf /usr/local/mpc-1.0.3
mkdir /usr/local/mpc-1.0.3
cd /usr/local/mpc-1.0.3
/home/root/temp_install/gcc-9.2.0/mpc-1.0.3/configure --prefix=/usr/local/mpc-1.0.3 --with-gmp=/usr/local/gmp-6.1.0/ --with-mpfr=/usr/local/mpfr-3.1.4/
make
make install
yum install libmpc -y
yum install libmpc-devel -y
export LD_LIBRARY_PATH="/usr/local/mpc-1.0.3/lib;/usr/local/mpfr-3.1.4/lib;/usr/local/gmp-6.1.0/lib"
rm -rf /usr/local/gcc-9.2.0
mkdir /usr/local/gcc-9.2.0
cd /usr/local/gcc-9.2.0
/home/root/temp_install/gcc-9.2.0/configure --prefix=/usr/local/gcc-9.2.0 -enable-threads=posix -disable-checking -disable-multilib -enable-languages=c,c++ --with-gmp=/usr/local/gmp-6.1.0 --with-mpfr=/usr/local/mpfr-3.1.4 --with-mpc=/usr/local/mpc-1.0.3
make
make install
echo "end install GCC 9.2.0"
gcc --version
g++ --version