LINUX,GCC installation (decompression version) __linux

Source: Internet
Author: User
Tags bz2 gmp
First , before installing GCC, you need to install dependencies:

1, GMP installation:

Download: gmp-6.0.0a.tar.bz2
decompression: Tar jxf gmp-6.0.0a.tar.bz2
cd gmp-6.0.0
./configure--prefix=/usr/local/ gmp-6.0.0 && make make
install

2, MPFR installation:

Download: mpfr-3.1.5.tar.gz
decompression: Tar zxvfv mpfr-3.1.5.tar.gz
cd mpfr-3.1.5
./configure--prefix=/usr/local/ mpfr-3.1.5--with-gmp=/usr/local/gmp-6.0.0 && make make
install

3. MPC Installation:

Download: mpc-1.0.2.tar.gz
decompression: Tar zxvfv mpc-1.0.2.tar.gz
cd mpc-1.0.2
./configure--prefix=/usr/local/ mpc-1.0.2--with-gmp=/usr/local/gmp-6.0.0--with-mpfr=/usr/local/mpfr-3.1.5 && make make
install
second, add to environment variables:
Note the path installed above
export ld_library_path= $LD _library_path:/usr/local/mpc-1.0.2/lib:/usr/local/gmp-5.0.1/lib:/usr/ Local/mpfr-3.1.5/lib
Add configuration:
vi/etc/ld.so.conf
/usr/local/gmp-5.0.1/lib
/usr/local/mpfr-3.1.5/ Lib
/usr/local/mpc-1.0.2/lib
execution:
ldconfig

4, gcc installation:

Download: gcc-4.5.1.tar.gz
decompression: Tar zxvfv gcc-4.5.1.tar.gz
cd gcc-4.5.1
./configure--prefix=/usr/local/ gcc-4.5.1
--enable-threads=posix--disable-checking--disable-multilib
--enable-languages=c,c++,java-- with-gmp=/usr/local/gmp-6.0.0
--with-mpfr=/usr/local/mpfr-3.1.5--with-mpc=/usr/local/mpc-1.0.2 make
# After a long wait ...
Make install

To View the installation path:

Whereis GCC

If there is an old GCC, replace the version:

Ln-s/usr/local/gcc-4.5.1/bin/gcc/usr/bin/gcc
ln-s/usr/local/gcc-4.5.1/bin/g++/usr/bin/g++

View version:

Gcc-v
g++-V
Reference:Http://www.cnblogs.com/chuncn/archive/2010/10/15/1851853.html http://blog.chinaunix.net/uid-26000296-id-4930263.html
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.