In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly shows you "how to compile and install GCC under CentOS6.8", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn how to compile and install GCC under CentOS6.8 "this article.
With regard to the default version number of GCC installed under CentOS via yum, CentOS 5 is 4.1.2 CentOS 6 is 4.4.7 CentOS 7 is 4.8.3.
In many cases, a high version of GCC is required to compile and install software, otherwise an error will be reported.
So how do you upgrade the version of GCC?
The first step is to confirm the GCC version number you upgraded to.
Currently, the latest version of GCC is 5.2, while CentOS 7 still uses it, so I chose to upgrade to 4.8.5 for compatibility reasons.
GCC official website: https://gcc.gnu.org
The following step by step to compile and install GCC 4.8.5, it is important to note that before compiling and installing GCC, the system must first install the old version of GCC and dependent libraries through yum.
You also need to install libgcc.i686 glibc-devel.i686 if you are compiling on an x86room64 system.
Yum install-y gcc texinfo-tex flex zip libgcc.i686 glibc-devel.i686
Note: compile and install GCC memory is not less than 1GB PowerSwap is not less than 1GB, the minimum hard disk is not less than 10GB, otherwise it is very likely to report an error to exit.
After compilation and installation, the directory gcc-4.8.5 will be as many as 5GB.
1. Download the source code
Wget ftp://ftp.gnu.org/gnu/gcc/gcc-4.8.5/gcc-4.8.5.tar.gz
2. Download the dependency package
Compiling and installing GCC depends on the mpc,mpfr,gmp package. Fortunately, the GCC source code comes with scripts that make it easy to download dependency packages.
Tar zxf gcc-4.8.5.tar.gz cd gcc-4.8.5. / contrib/download_prerequisites
Compile and install
# cd gcc-4.8.1
#. / gcc-4.8.1/configure--prefix=/usr/local/gcc-4.8.1-enable-languages=c,c+
Prefix=/usr/local/gcc-4.8.1 indicates the path to configure the installation. If you do not specify the installation path, the execution file will be placed under / usr/local/bin by default to facilitate maintenance. When you need to uninstall, you can delete the directory directly.
Enable-languages indicates the installation language, and here it means to install only c and C++
Compile
When the preparation is complete, you can compile.
# make
This process is about 2 hours or so, if you report an error midway, prompt fatal error:gnu/stubs-32,No such file or directory. The following figure is shown:
Run the following command, and then recompile
# yum-y install glibc-devel.i686-- setopt=protected_multilib=false
# make
The above is all the contents of the article "how to compile and install GCC under CentOS6.8". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.