CentOS6.5 64位GCC从4.4.2升级到4.8.5实录
2017-05-03 10:04
423 查看
http://blog.csdn.net/q229827701/article/details/51492833
gcc-4.8.5.tar.gz,
然后可能用到的有
gmp-4.3.2.tar.bz2,mpfr-3.1.4.tar.bz,mpc-1.0.3.tar.gz,
中途用到的依赖库可能会有
autogen-5.16.2.tar.gz
安装gmp:
./configure &&make &&make install
安装mpfr
./configure --with-gmp=/usr/local/gmp-4.3.2 &&make&&make check&&make install
安装mac
./configure --with-gmp=/usr/local/gmp-4.3.2 --with-mpfr=/usr/local/mpfr-3.1.4&&make&&make check&&make install
安装gcc
[root@ximena gcc-4.8.5]# export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib:/usr/local/mpc-1.0.3/lib:/usr/local/gmp-4.3.2/lib:/usr/local/mpfr-3.1.4/lib
[root@ximena gcc-4.8.5]# ./configure --prefix=/usr/local/gcc-4.8.5 --with-gmp=/usr/local/gmp-4.3.2 --with-mpfr=/usr/local/mpfr-3.1.4 --with-mpc=/usr/local/mpc-1.0.3&&make&&make install
gcc安装时间比较长,如果没有意外的话,出现下面的界面,则说明安装成功
libtool: install: /usr/bin/install -c .libs/libatomic.so.1.0.0 /usr/local/gcc-4.8.5/lib/../lib64/libatomic.so.1.0.0
libtool: install: (cd /usr/local/gcc-4.8.5/lib/../lib64 && { ln -s -f libatomic.so.1.0.0 libatomic.so.1 || { rm -f libatomic.so.1 && ln -s libatomic.so.1.0.0 libatomic.so.1; }; })
libtool: install: (cd /usr/local/gcc-4.8.5/lib/../lib64 && { ln -s -f libatomic.so.1.0.0 libatomic.so || { rm -f libatomic.so && ln -s libatomic.so.1.0.0 libatomic.so; }; })
libtool: install: /usr/bin/install -c .libs/libatomic.lai /usr/local/gcc-4.8.5/lib/../lib64/libatomic.la
libtool: install: /usr/bin/install -c .libs/libatomic.a /usr/local/gcc-4.8.5/lib/../lib64/libatomic.a
libtool: install: chmod 644 /usr/local/gcc-4.8.5/lib/../lib64/libatomic.a
libtool: install: ranlib /usr/local/gcc-4.8.5/lib/../lib64/libatomic.a
libtoo
d0dc
l: finish: PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/sbin" ldconfig -n /usr/local/gcc-4.8.5/lib/../lib64
ldconfig: /usr/local/gcc-4.8.5/lib/../lib64/libstdc++.so.6.0.19-gdb.py is not an ELF file - it has the wrong magic bytes at the start.
----------------------------------------------------------------------
Libraries have been installed in:
/usr/local/gcc-4.8.5/lib/../lib64
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the `LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the `LD_RUN_PATH' environment variable
during linking
- use the `-Wl,-rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to `/etc/ld.so.conf'
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
make[4]: Nothing to be done for `install-data-am'.
make[4]: Leaving directory `/root/download/gcc-4.8.5/x86_64-unknown-Linux-gnu/libatomic'
make[3]: Leaving directory `/root/download/gcc-4.8.5/x86_64-unknown-linux-gnu/libatomic'
make[2]: Leaving directory `/root/download/gcc-4.8.5/x86_64-unknown-linux-gnu/libatomic'
make[1]: Leaving directory `/root/download/gcc-4.8.5'
[root@ximena ~]# gcc11 -v
Using built-in specs.
COLLECT_GCC=gcc11
COLLECT_LTO_WRAPPER=/usr/local/gcc-4.8.5/libexec/gcc/x86_64-unknown-linux-gnu/4.8.5/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ./configure --prefix=/usr/local/gcc-4.8.5 --with-gmp=/usr/local/gmp-4.3.2 --with-mpfr=/usr/local/mpfr-3.1.4 --with-mpc=/usr/local/mpc-1.0.3
Thread model: posix
gcc version 4.8.5 (GCC)
[root@ximena ~]# sudo ln -s /usr/local/gcc-4.8.5/bin/g++ /usr/bin/g++11
[root@ximena ~]# g++11 -v
Using built-in specs.
COLLECT_GCC=g++11
COLLECT_LTO_WRAPPER=/usr/local/gcc-4.8.5/libexec/gcc/x86_64-unknown-linux-gnu/4.8.5/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ./configure --prefix=/usr/local/gcc-4.8.5 --with-gmp=/usr/local/gmp-4.3.2 --with-mpfr=/usr/local/mpfr-3.1.4 --with-mpc=/usr/local/mpc-1.0.3
Thread model: posix
gcc version 4.8.5 (GCC)
ok,至此成功,后面就可以愉快的让服务器支持c++11了
1.资源准备
首先需要准备的资源有gcc-4.8.5.tar.gz,
然后可能用到的有
gmp-4.3.2.tar.bz2,mpfr-3.1.4.tar.bz,mpc-1.0.3.tar.gz,
中途用到的依赖库可能会有
autogen-5.16.2.tar.gz
2.安装顺序
首先gmp-4.3.2.tar.bz2,mpfr-3.1.4.tar.bz,mpc-1.0.3.tar.gz,这三个必须要安装,否则,他会提示错误。如下:安装gmp:
./configure &&make &&make install
安装mpfr
./configure --with-gmp=/usr/local/gmp-4.3.2 &&make&&make check&&make install
安装mac
./configure --with-gmp=/usr/local/gmp-4.3.2 --with-mpfr=/usr/local/mpfr-3.1.4&&make&&make check&&make install
安装gcc
[root@ximena gcc-4.8.5]# export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib:/usr/local/mpc-1.0.3/lib:/usr/local/gmp-4.3.2/lib:/usr/local/mpfr-3.1.4/lib
[root@ximena gcc-4.8.5]# ./configure --prefix=/usr/local/gcc-4.8.5 --with-gmp=/usr/local/gmp-4.3.2 --with-mpfr=/usr/local/mpfr-3.1.4 --with-mpc=/usr/local/mpc-1.0.3&&make&&make install
gcc安装时间比较长,如果没有意外的话,出现下面的界面,则说明安装成功
libtool: install: /usr/bin/install -c .libs/libatomic.so.1.0.0 /usr/local/gcc-4.8.5/lib/../lib64/libatomic.so.1.0.0
libtool: install: (cd /usr/local/gcc-4.8.5/lib/../lib64 && { ln -s -f libatomic.so.1.0.0 libatomic.so.1 || { rm -f libatomic.so.1 && ln -s libatomic.so.1.0.0 libatomic.so.1; }; })
libtool: install: (cd /usr/local/gcc-4.8.5/lib/../lib64 && { ln -s -f libatomic.so.1.0.0 libatomic.so || { rm -f libatomic.so && ln -s libatomic.so.1.0.0 libatomic.so; }; })
libtool: install: /usr/bin/install -c .libs/libatomic.lai /usr/local/gcc-4.8.5/lib/../lib64/libatomic.la
libtool: install: /usr/bin/install -c .libs/libatomic.a /usr/local/gcc-4.8.5/lib/../lib64/libatomic.a
libtool: install: chmod 644 /usr/local/gcc-4.8.5/lib/../lib64/libatomic.a
libtool: install: ranlib /usr/local/gcc-4.8.5/lib/../lib64/libatomic.a
libtoo
d0dc
l: finish: PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/sbin" ldconfig -n /usr/local/gcc-4.8.5/lib/../lib64
ldconfig: /usr/local/gcc-4.8.5/lib/../lib64/libstdc++.so.6.0.19-gdb.py is not an ELF file - it has the wrong magic bytes at the start.
----------------------------------------------------------------------
Libraries have been installed in:
/usr/local/gcc-4.8.5/lib/../lib64
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the `LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the `LD_RUN_PATH' environment variable
during linking
- use the `-Wl,-rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to `/etc/ld.so.conf'
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
make[4]: Nothing to be done for `install-data-am'.
make[4]: Leaving directory `/root/download/gcc-4.8.5/x86_64-unknown-Linux-gnu/libatomic'
make[3]: Leaving directory `/root/download/gcc-4.8.5/x86_64-unknown-linux-gnu/libatomic'
make[2]: Leaving directory `/root/download/gcc-4.8.5/x86_64-unknown-linux-gnu/libatomic'
make[1]: Leaving directory `/root/download/gcc-4.8.5'
3.建立软连接命令
[root@ximena ~]# sudo ln -s /usr/local/gcc-4.8.5/bin/gcc /usr/bin/gcc11[root@ximena ~]# gcc11 -v
Using built-in specs.
COLLECT_GCC=gcc11
COLLECT_LTO_WRAPPER=/usr/local/gcc-4.8.5/libexec/gcc/x86_64-unknown-linux-gnu/4.8.5/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ./configure --prefix=/usr/local/gcc-4.8.5 --with-gmp=/usr/local/gmp-4.3.2 --with-mpfr=/usr/local/mpfr-3.1.4 --with-mpc=/usr/local/mpc-1.0.3
Thread model: posix
gcc version 4.8.5 (GCC)
[root@ximena ~]# sudo ln -s /usr/local/gcc-4.8.5/bin/g++ /usr/bin/g++11
[root@ximena ~]# g++11 -v
Using built-in specs.
COLLECT_GCC=g++11
COLLECT_LTO_WRAPPER=/usr/local/gcc-4.8.5/libexec/gcc/x86_64-unknown-linux-gnu/4.8.5/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ./configure --prefix=/usr/local/gcc-4.8.5 --with-gmp=/usr/local/gmp-4.3.2 --with-mpfr=/usr/local/mpfr-3.1.4 --with-mpc=/usr/local/mpc-1.0.3
Thread model: posix
gcc version 4.8.5 (GCC)
ok,至此成功,后面就可以愉快的让服务器支持c++11了
相关文章推荐
- CentOS6.5 64位GCC从4.4.2升级到4.8.5实录
- 升级centos6.5系统的gcc为4.8.5的简易步骤
- CentOS6.5升级手动安装GCC4.8.2
- CentOS 6.5 升级 GCC 4.9.3
- centos 6.5 升级 gcc
- CentOS6.5手动升级gcc4.8.2
- CentOS 6.5升级GCC 4.9.1
- [心得]给CentOS6.5升级开发工具gcc
- CentOS6.5手动升级gcc4.8.2
- CentOS6.5升级手动安装GCC4.8.2
- centos6.5:gcc 升级(5.2.0)过程记录
- CentOS6.5 从源码编译安装 GCC-4.9.1 全程实录《第一部分:基础知识与准备工作》
- CentOS6.5升级GCC4.8.2
- CentOS6.8升级gcc到4.8.5总结
- centos6.5 gcc 库升级
- Linux中 CentOS 6.5 手动升级gcc到gcc-6.1.0
- centos6.5手动升级gcc到gcc6.1
- centos6.5 gcc升级至4.8
- CentOS 6.5 64位 php从5.3升级5.6
- CentOS6.5升级手动安装GCC4.8.2