Install gcc-5.3.0 on CentOS 7
2017-04-13 09:20
337 查看
原文
http://lightjameslyy.github.io/2016/04/15/Install-gcc-5-3-0-on-CentOS-7/
old gcc: gcc 4.8.2
source packages: gcc-5.3.0.tar.gz gmp-6.1.0.tar.bz2 mpc-1.0.3.tar.gz mpfr-3.1.3.tar.gz
tar -jxvf gmp-6.1.0.tar.bz2
tar -zxvf mpfr-3.1.3.tar.gz
tar -zxvf mpc-1.0.3.tar.gz
tar -zxvf gcc-5.3.0.tar.gz
NOTICE:
(1) If there are errors such as “Permission denied…”, you need to switch to super user and repeat the process.
(2) The header and library genetated by gmp should already be located under /usr/local/include and /usr/local/lib.
NOTICE:
Don’t forget to change the environment variable $LD_LIBRARY_PATH which is necessary for compiling gcc later.
NOTICE:
while make, I have the following errors:
this means you need to add swap partition, I made it by editing
/etc/sysctl.conf
changing
to
then restart the operating system, continue from make -j2.
add entry:
save and exit.
see whether the version is 5.3.0.
http://lightjameslyy.github.io/2016/04/15/Install-gcc-5-3-0-on-CentOS-7/
1.Preparations
operating system: CentOS 7 64bitold gcc: gcc 4.8.2
source packages: gcc-5.3.0.tar.gz gmp-6.1.0.tar.bz2 mpc-1.0.3.tar.gz mpfr-3.1.3.tar.gz
2.Unzip
change to an appropriate directory (mine is /usr/local) and unzip the 4 packages:tar -jxvf gmp-6.1.0.tar.bz2
tar -zxvf mpfr-3.1.3.tar.gz
tar -zxvf mpc-1.0.3.tar.gz
tar -zxvf gcc-5.3.0.tar.gz
3.Install
3.1.install gmp
> cd /usr/local/gmp-6.1.0 > ./configure > make -j2 > make install -j2
NOTICE:
(1) If there are errors such as “Permission denied…”, you need to switch to super user and repeat the process.
(2) The header and library genetated by gmp should already be located under /usr/local/include and /usr/local/lib.
3.2.install mpfr
> cd /usr/local/mpfr-3.1.3 > ./configure --with-gmp-include=/usr/local/include --with-gmp-lib=/usr/local/lib > make -j2 > make install -j2
3.3.install mpc
> cd /usr/local/mpc-1.0.3 > ./configure > make -j2 > make install -j2 > export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
NOTICE:
Don’t forget to change the environment variable $LD_LIBRARY_PATH which is necessary for compiling gcc later.
3.4.install gcc
> cd /usr/local/gcc-5.3.0 > mkdir build > cd build > ../configure --prefix=/usr/local/gcc --enable-threads=posix --disable-checking --enable-languages=c,c++ --disable-multilib --with-gmp=/usr/local/lib --with-mpfr=/usr/local/lib --with-mpc=/usr/local/lib > make -j2 > make install -j2
NOTICE:
while make, I have the following errors:
...[s-attrtab]... ...[all-stage1-gcc]......[stage1-bubble]... |
/etc/sysctl.conf
changing
vm.swappiness = 0 |
vm.swappiness = 60 |
4.Remove old version
> yum remove gcc > yum remove gcc-c++ > updatedb
5.Link to new version
> cd /usr/bin > ln -s /usr/local/gcc/bin/gcc gcc > ln -s /usr/local/gcc/bin/g++ g++
6.Add man help
> vim /etc/man_db.conf
add entry:
MANDATORY_MANPATH /usr/local/gcc/share/man |
7.Check
> gcc -v
see whether the version is 5.3.0.
相关文章推荐
- 1_oracle_11gr2_install_on_centos_x86_64
- Install Mysql on Centos6.5
- install gcc on osx via brew
- How to install ffmpeg,mp4box,mplayer,mencoder,flvtool2,ffmpeg-php on centos
- 发现问题 解决问题:How to upgrade gcc on CentOS
- install eventlet ,redis,dreque on centos
- Install Google Chrome on Fedora 23/22, CentOS/RHEL 7.1
- Install Python 3 on CentOS 6.5
- install ffmpeg on centos easy
- CentOS install GCC4.8.1
- MonoDevelop 1.0 on CentOS 5 and Fedora: Compiling and Install
- Install Server Backup Manager on CentOS, RHE, and Fedora
- How to install Python 2.7.3 on CentOS 6.2
- g++: command not found的解决 G++没有装或却没有更新 以下方法都可以试试: centos: yum -y update gcc yum -y install gcc+
- Install Hadoop with HDP 2.2 on CentOS 6.5
- How to install innotop and percona tookit on centos
- How to install older version gcc on fedora