GCC 4.9 compilation experience

Source: Internet
Author: User
Tags gmp

Because c ++ doesn't want to use boost directly, some of the latest C ++ standards have already been merged, so it's better to use C ++ directly.


Therefore, you need to compile GCC 4.9. The latest version is 4.9.1.


I have already installed a lot of dependencies through yum. I found that ISL and cloog cannot be installed through yum, downloaded and installed. When GCC and configure are used, I found that cloog 17 or 18.0 is required, I installed version 18.1, and configure failed. Come on with the installation documentation. Reference: callback:

1. Prepare the environment (GCC compiler)
Centos 1, 6.3
CAT/proc/version
Linux version 2.6.32-279. el6.x86 _ 64 ([email protected]) (GCC version 4.4.6 20120305 (Red Hat 4.4.6-4) (GCC) #1 SMP Fri Jun 22 12:19:21 UTC 2012
GCC -- version
GCC (GCC) 4.4.6 20120305 (Red Hat 4.4.6-4)

2. Prepare files
Gcc-4.9.0.tar.gz
Official website (http://gcc.gnu.org/) download:

Ftp://mirrors.kernel.org/gnu/gcc/gcc-4.9.0/gcc-4.9.0.tar.gz

Http://gcc.petsads.us/releases/


3. Installation Steps
3.1. Unzip the gcc-4.9.0.tar.gz
Get the directory gcc-4.9.0 and go to the directory
# Tar-xvzf gcc-4.9.0.tar.gz
# Cd gcc-4.9.0

3.2. Download the compilation preparation File
It mainly requires the following library files (the complete version is required to download all files)
Mpfr = mpfr-2.4.2
Gmp-4.3.2 GMP =
PC = mpc-0.8.1
Isl = isl-0.12.2
Cloog = cloog-0.18.1
Run./contrib/download_prerequisites
If the compilation machine cannot access the Internet, open the text file download_prerequisites and
After the dependent library is downloaded, place it in the specified directory, comment out the download command, and execute again
Contrib/download_prerequisites: Decompress the related files and create a link.
# Vi contrib/download_prerequisites
Comment on wget-related content, manually download these files back, copy to the working directory gcc-4.9.0.
#./Contrib/download_prerequisites

3.3. Create a compilation directory and compile and install the Directory
# Mkdir ../gcc-build-4.9.0

# CD ../gcc-build-4.9.0

# ../Gcc-4.9.0/configure -- prefix =/usr/local/gcc-4.9.0 -- enable-stage1-checking = release -- enable-stage1-languages = C, C ++, go


In the source code directory, run this command: (this may not be valuable. Please continue to read it)

./Contrib/download_prerequisites


Some errors are prompted. The above Errors still exist, and:/usr/bin/ld: cannot find crt1.o: no such file or directory. Install the 32-bit Library: Yum install libxtst. i686 libxulrunner. i686.

The result is still incorrect. Add the "-- enable-multilib" option during compilation as prompted:

../Gcc-4.9.1/configure -- prefix =/usr/local/gcc-4.9.1 -- enable-stage1-checking = release -- enable-stage1-languages = C, C ++, Java, go -- enable-multilib, successful

Make

A lot of errors occurred during make. Try to solve this problem and use -- disable-multilib in the end.


Next, refer to www.owent.net/2014/04/linux-compilation and installation -gcc-4-9.html,

Still need to compile binutils, configure said can not find isl, think of a variety of methods, and finally enter the isl source code directory, gcc-4.9.1/contrib/ISL, configure & make install. Configure -- prefix =... on the Internet. I didn't use this method.

When making GDB 7.8, add the options -- With-Python, yum-y install Python-devel Based on the introduction in the owenet.net document. Added the python debugging function.




GCC 4.9 compilation experience

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.