Summary of Gcc4.6.0 installation on Fedora13

Source: Internet
Author: User
Tags gmp
-- Gcc4.6.0 has been released not long ago. This is good news, because this log update has several pages, no matter whether it is useful or not. At least, its performance is improved and it is better to use it, this is for sure. The improvements in those features are of course not useful to new users like me, but I also want to try it and install it. * ***** The premise is that the original system must have a compilation tool gcc (old version). If yes, it can only use rpm and cannot be installed from the source code.

-- Gcc4.6.0 has been released not long ago. This is good news, because this log update has several pages, no matter whether it is useful or not. At least, its performance is improved and it is better to use it, this is for sure. The improvements in those features are of course not useful to new users like me, but I also want to try it and install it.

* ***** The premise is that the original system must have a compilation tool gcc (old version). If yes, it can only use rpm and cannot be installed from the source code.

-- Let's talk about the installation method below (many errors have been encountered in this process, and it is finally overcome through constant consulting and disdainful efforts)

First download the gcc4.6.0 tar package (bz2 and gz can be used, bz2 is smaller, because bzip has a higher compression ratio, so it is recommended) (many friends like to use RPM, because it is indeed very convenient, however, this is a general package, that is, the installation cannot be customized, and the path is also the default. This is not a favorite, so I chose the source code for installation)

Decompress the gcc-4.6.0.tar.bz2 with tar-jxvf gcc-4.6.0.tar.bz2 and a gcc-4.6.0 folder to copy this directory to/usr/local/src and

Enter the/usr/local mkdir gcc-4.6.0 (create the gcc installation directory, in fact, can also be in other places, I personally prefer to press the local, easy to manage well)

Cd/usr/local/src (gcc source code package is here) mkdir built-gcc (I create a temporary directory for compilation, which is the same as the source code package. This has many advantages, I will know later. It is not recommended to compile the source code package directly (although this can be done ))

Currently, the gcc configuration phase cannot be started, because the system lacks a library (I have encountered an error before knowing) I would like to declare it first (I do not know what to do with c in the absence of the gmp mpfr MCM three libraries)

Specifically, there are three libraries of the source package on google download unzip and then install them in a directory through compilation (My gmp-5.0.1, mpc-0.9 these three versions of the library respectively as three directories installed in/usr/local/lib, need to be in advance in the directory to create three empty directory gmp-5.0.1, mpfr-3.0.1 mpc-0.9)

Install the command first install gmp (think the first two libraries depend on him)./configure -- prefix =/usr/local/lib/gmp-5.0.1 after make install can be

Then install mpfr (because nmms depends on both gmp and mpfr ). /configure -- prefix =/usr/local/lib/mpfr-3.0.1 -- with-gmp =/usr/local/lib/gmp-5.0.1 after make install

Finally, install the mpc. /configure -- prefix =/usr/local/lib/mpc-0.9 -- with-gmp =/usr/local/lib/gmp-5.0.1 -- with-mpfr =/usr/local/lib/mpfr-3.0.1 after make and install the three dependent libraries. After installation is complete, you can go to the gcc installation.

Cd/usr/local/src/built-gcc (currently an empty directory) after ../gcc-4.6.0/configure -- prefix =

Install mpfr. /configure -- predix =/usr/local/gcc-4.6.0 -- with-gmp =/usr/local/lib/gmp-5.0.1 -- with-mpfr =/usr/local/lib/mpfr-3.0.1

-- With-mpc =/usr/local/lib/mpc-0.9 ready for configuration complete if you want to configure the supported language add configuration item -- enable-language = c, c ++, java (I use these three types)

If you do not write, it will all be supported, so it doesn't matter if you do not write.

* ******************* Do not directly make the following because a database connection path must be specified to avoid errors (I I tried, so pay special attention here)

Enter LD_LIBRARY_PATH =/usr/lcoal/lib/gmp-5.0.1/lib/: usr/local/lib/mpfr-3.0.1/lib/:/usr/local/lib/mpc-0.9/lib/

Then export LD_LIBRARY_PATH

It is best to write these two commands into. bach. rc for later convenience (this environment variable will be used in later compilation)

Okay, you can make it. It takes a long time to check the sub-host performance. (I am a netbook, it takes 7-8 hours to get tired.) Finally, make install will be successfully installed.

However, the input gcc-v is still the original version. This is because the gcc command is called or used. Use which gcc to check the location of the original gcc command.

(Note that the new gcc commands are all under/usr/lcoal/gcc-4.6.0/bin) replace gcc in the which directory with the/usr/local/gcc-4.6.0/bin/gcc symbolic connection, that is, cd to the ln-s gcc/ usr/local/gcc-4.6.0/gcc is enough

Now, try again if gcc-v has been changed to 4.6.0 (the same is true for g ++)

Okay. Write a program. Try the new gcc.

Add chrome installation. You can directly use rpm. It doesn't matter because the/opt directory is installed by default.

Direct rpm-ivh chrome-stable... an error will occur when the lsb needed by error occurs.

Root permission yum install RedHat-lsb for simple networking

You can install rpm again.

After success, I Will unmount yum remove firefox in firefox. Haha.

It's okay to keep it.

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.