Ubuntu users are all lazy. They have never compiled GCC or anything, and have sudo permissions. Therefore, it is easy to update Shenma. Now I am using a self-improvement 3000 server, and it is no longer sudoers. What a compiler is really like. After several days of hard work, I finally got the c and c ++ compilers of GCC4.x, which is enough for my own use. System Version: $ head-n1/etc/issueredhatemediiselinuxasrelease
Ubuntu users are all lazy. They have never compiled GCC or anything, and have sudo permissions. Therefore, it is easy to update Shenma. Now I am using a self-improvement 3000 server, and it is no longer sudoers. What a compiler is really like. After several days of hard work, I finally got the c and c ++ compilers of GCC 4.x, which is just enough for my own use.
System Version:
$ Head-n 1/etc/issue
Red Hat Enterprise Linux AS release 4 (Nahant Update 6)
GCC version:
$ Gcc-v
Reading specs from/usr/lib/gcc/x86_64-RedHat-linux/3.4.6/specs
Configured :.. /configure -- prefix =/usr -- mandir =/usr/share/man -- infodir =/usr/share/info -- enable-shared -- enable-threads = posix -- disable-checking -- with-system-zlib -- enable-_ cxa_atexit -- disable-libunwind-exceptions -- enable-java-awt = gtk -- host = x86_64-redhat-linux
Thread model: posix
Gcc version 3.4.6 20060404 (Red Hat 3.4.6-9)
----------------- Nonsense split line -----------------
Installation and compilation process:
1. Prerequisites for compiling GCC 4.x:
A. GMP 4.3.2 or above (GNU Multiple Precision Library (GMP ))
B. MPFR 2.4.2 or above
C. MPC 0.8.1Y or above
D.Xz (version unknown, but this program is required)
E. others)
2. Prepare the compilation environment: first compile GMP, then compile MPFR, finally compile the MPC, and install XZ.
A. Download GMP: http://ftp.tsukuba.wide.ad.jp/software/gmp/gmp-5.0.0.tar.bz2(I chose a server in Japan, and the speed is quite fast)
B. decompress and install GMP
$ Bzcat gmp * | tar xvf-
$ Cd gmp *
$./Configure -- prefix = $ HOME/local # Installation file path, which is the local folder under the user
$ Make-j 8 # Multi-core compilation parameter-j number is the number of cores
$ Make install
C. Download MPFR: http://ftp.tsukuba.wide.ad.jp/software/mpfr/mpfr-2.4.2.tar.bz2 (this is the least version)
D. decompress and install MPFR.
$ Bzcat mpfr * | tar xvf-
$ Cd mpfr *
$./Configure -- with-gmp-include = $ HOME/local/include -- with-gmp-lib = $ HOME/local/lib -- prefix = $ HOME/local # MPFR compilation requires GMP, so you need to specify the location of GMP, otherwise it will be compiled in white.
$ Make-j 8
$ Make install
E. Download The http://ftp.tsukuba.wide.ad.jp/software/mpc/mpc-0.9.tar.gz
F. decompress and install MCM
$ Tar xzf MCM *
$ Cd MCM *
$./Configure -- prefix = $ HOME/local -- with-gmp = $ HOME/local -- with-mpfr = $ HOME/local
$ Make-j 8
$ Make install