install gcc on your computer

来源:互联网 发布:阿里云服务器免费试用 编辑:程序博客网 时间:2024/05/16 09:30

mainly from:   https://gcc.gnu.org/wiki/InstallingGCC  

the main steps:

for example: configuring and building gcc-5.3.0 should be as simple as

tar gcc-5.3.0

./contrib/download_prerequisities

cd ..

mkdir objdir

cd objdir

$PWD/../gcc-5.3.0/configure --prefix=/your/install/path/gcc-5.3.0 --enable-languages=c,c++,fortran,go --disable-multilib

make -j 8

make install

------------------------------------------------------------

do soft link, I have installed gcc/g++ 4.8.4

duplicate the original link, for me:   sudo mv /usr/bin/gcc /usr/bin/gcc.back.4.8.4

                                                        sudo mv /usr/bin/g++ /usr/bin/g++.back.4.8.4

build the new link, for me:  sudo ln -s  /your/install/path/gcc-5.3.0/bin/gcc  /usr/bin/gcc

                                           sudo ln -s  /your/install/path/gcc-5.3.0/bin/g++  /usr/bin/g++




0 0
原创粉丝点击