CentOS下編譯安裝Gcc 4 9

2022-05-10 02:17:53 字數 1880 閱讀 5212

給公司測試伺服器搭環境,手工安裝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++軟連線。

1

yum -y install

gccyum -y install

gcc-c++2、

mkdir /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

install3、

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/lib4、

mkdir

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

install5、

cp -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

7、

mvgcc

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++

gcc4安裝mysql linux 安裝mysql

1.安裝mysql5.6依存包 root localhost src yum y install make gcc c cmake bison devel ncurses devel libaio root localhost src yum install libaio libaio devel ...

安裝在ubuntu12 04上安裝gcc4 8

因為gcc4.8支援最新的c 11標準,所有開始c 11標準系列學習前,請按照gcc4.8,方便邊學習邊寫 練習。sudo add apt repository ppa ubuntu toolchain r test sudo apt get update sudo apt get install ...

CentOS下編譯安裝gcc 4 9 0

由於編譯nodejs 5.1需要4.7以上版本的gcc,而centos自帶的gcc版本只有4.3,因此需要手動編譯安裝。所有操作都預設由root使用者執行。wget tar zxvf gcc 4.9.0.tar.gz cd gcc 4.9.0 contrib download prerequisit...