Update Linux GCC to GCC 4.4.2
First need to prepare required materials: gcc4.4.2 version need to install gmp4.2.0 + and mpfr2.3.0 +, to the site of GMP (http://gmplib.org/fuse download gmp-4.3.1.tar.gz and MPRF sites (http://www.mpfr.org/fuse download mpfr-2.4.2.tar.gz)
1.Install GMP
# Wget ftp://ftp.gmplib.org/pub/gmp-5.0.0/gmp-5.0.0.tar.bz2
# Tar-zxvf gmp-4.3.2.tar.gz
# Cd gmp-4.3.2
#./Configure
# Make
# Make check
This step is used to check whether files do not match or are missing, and then install:
# Make install
2.Install mpfr
# Wget http://www.mpfr.org/mpfr-current/mpfr-2.4.2.tar.gz
# Tar-zxvf mpfr-2.4.2.tar.gz
# Cd mpfr-2.4.2
Configuration:
#./Configure -- With-GMP-include =/usr/local/include -- With-GMP-Lib =/usr/local/lib
# Make
# Make check
Next install:
# Make install
Package into tar.gz, need xz (lzma) support; http://tukaani.org/xz/ provides download
# Make Dist
The preparation is complete. The following describes how to install and update GCC.
3.Compile and install gcc
Download resources GCC source code from the GCC official website (http://gcc.gnu.org/), the current GCC version is gcc-4.4.2.
# Wget ftp://ftp.dti.ad.jp/pub/lang/gcc/releases/gcc-4.4.2/gcc-4.4.2.tar.gz
# Tar xzvf gcc-4.4.2.tar.gz
Create a target directory where the compilation result is stored.
# Mkdir gcc-build
# Cd gcc-build
Configure GCC. Only C and C ++ are selected here.
#.. /Gcc-4.4.2/configure -- enable-shared -- enable-threads = POSIX -- enable-checking = release -- With-system-zlib -- enable-_ cxa_atexit -- disable-libunwind-exceptions -- enable -libgcj-Multifile -- enable-ages = C, c ++, objc, OBJ-C ++ -- With-CPU = generic -- disable-DSSI -- enable-plugin -- prefix =/usr/local/gcc-4.4.2 -- With-GMP =/usr/local --- mpfr =/usr/local
Compile
# Make
Installation requires administrator permissions. For example, you need to use the su command to switch to the root user.
# Make install
Now, the GCC installation is complete.
4.Environment Settings
Point the GCC header file and library file to the new version.
CD $ home
Ls-
Sudo VI. bashrc
Add the following statements to the statement.
Gcchome =/usr/local/gcc-4.4.2
Path = $ gcchome/bin: $ path
LD_LIBRARY_PATH = $ gcchome/lib
Export gcchome path LD_LIBRARY_PATH
5.Test
Reboot to view the GCC version
# Source $ home/. bashrc
# Which gcc
/Usr/local/gcc-4.4.2/bin/GCC
The new GCC path will be displayed as/usr/local/gcc-4.4.2
# Gcc-V
Using built-in specs.
Target: i686-pc-linux-gnu
Configured :.. /gcc-4.4.2/configure -- enable-shared -- enable-threads = POSIX -- enable-checking = release -- With-system-zlib -- enable-_ cxa_atexit -- disable-libunwind-exceptions -- enable -libgcj-Multifile -- enable-ages = C, c ++, objc, OBJ-C ++ -- With-CPU = generic -- disable-DSSI -- enable-plugin -- prefix =/usr/local/gcc-4.4.2 -- With-GMP =/usr/local --- mpfr =/usr/local
Thread model: POSIX
GCC version 4.4.2 (GCC)
The GCC version is 4.4.2.