• CentOS下编译安装Gcc-4.9


      给公司测试服务器搭环境,手工安装gcc-4.9.0颇费功夫,记录如下。

      1、安装gcc、g++,系统源默认安装版本为4.4.7;

      2、安装依赖包GMP、MPFR、MPC,注意安装顺序;

      3、修改动态库链接路径,加入GMP、MPFR、MPC;

      4、编译安装Gcc-4.9,新创建目录gcc-build来存放Make过程产生文件;

      5、拷贝Gcc-4.9的头文件至目录/usr/include/c++;

      6、修改LD_LIBRARY_PATH、PATH和CPLUS_INCLUDE_PATH,保存到/etc/profile;

      7、建立新的Gcc、G++软连接。

    1yum -y install gcc
        yum -y install gcc-c++
    2mkdir /usr/local/gmp-4.3.2
        ./configure --prefix=/usr/local/gmp-4.3.2/
        make
        make install
    
        mkdir /usr/local/mpfr-2.4.2
        ./configure --prefix=/usr/local/mpfr-2.4.2 --with-gmp=/usr/local/gmp-4.3.2
        make
        make install
    
        mkdir /usr/local/mpc-0.8.1
        ./configure --prefix=/usr/local/mpc-0.8.1 --with-gmp=/usr/local/gmp-4.3.2 --with-mpfr=/usr/local/mpfr-2.4.2
        make
        make install
    3、
        export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/gmp-4.3.2/lib:/usr/local/mpfr-2.4.2/lib:/usr/local/mpc-0.8.1/lib
    4mkdir gcc-bulid
        cd gcc-build
        ../gcc-4.9.0/configure --prefix=/usr/local/gcc-4.9.0 --exec-prefix=/usr/local/gcc --enable-languages=c,c++ --with-gmp=/usr/local/gmp-4.3.2 --with-mpfr=/usr/local/mpfr-2.4.2 --with-mpc=/usr/local/mpc-0.8.1 --disable-multilib
        make
        make install
    5cp -r /usr/local/gcc-4.9.0/include/c++/4.9.0 /usr/include/c++
    6、
        export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/gmp-4.3.2/lib:/usr/local/mpfr-2.4.2/lib:/usr/local/mpc-0.8.1/lib:/usr/local/gcc/lib64
        export PATH=$PATH:/usr/local/gcc/bin
        export CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH:/usr/include/c++/4.9.0:/usr/include/c++/4.9.0/x86_64-unknown-linux-gnu
    7mv gcc gcc-4.4.7
        ln -s /usr/local/gcc/bin/gcc ./gcc
    
        mv g++ g++-4.4.7
        ln -s /usr/local/gcc/bin/g++ g++
  • 相关阅读:
    正则基础之——贪婪与非贪婪模式
    HTML、css2--IE标签整理
    jQuery技术内幕预览版.pdf3
    jQuery技术内幕预览版.pdf2
    HTML5 Canvas核心技术—图形、动画与游戏开发.pdf1
    jQuery技术内幕预览版.pdf1
    白帽子讲Web安全1.pdf
    js的 new image()用法[转]
    css权威指南(下)
    css权威指南(上)
  • 原文地址:https://www.cnblogs.com/crazychris/p/4213029.html
Copyright © 2020-2023  润新知