Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to upgrade gcc version to 5.2.0 for centos

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article is about how centos upgrades the gcc version to 5.2.0. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

1. Download the source package

Wget http://mirrors.concertpass.com/gcc/releases/gcc-5.2.0/gcc-5.2.0.tar.bz2

2. Decompression

Tar-jxvf gcc-5.2.0.tar.bz2

3. Enter the extracted directory and install the dependency

Cd gcc-5.2.0./contrib/download_prerequisites

4. Set up a temporary directory to store the intermediate files in the compilation process.

Mkdir gcc-build-5.2.0cd gcc-build-5.2.0../configure-enable-checking=release-enable-languages=c,c++-disable-multilib

5. Installation. This step is very slow. If it is a multi-core server, it is best to add the parameter-J4. 4 represents the number of cpu cores of the installed server. I have installed it here for at least an hour.

Make-J4

6 、 install

Sudo make install

7. View the installed version of libstdc++

Cd / usr/lib64/ll | grep libstdc++

You can see that the latest version is: libstdc++.so.6.0.26

8. Link libstdc++.so.6 to the latest libstdc++.so.6.0.26

Ln-sf libstdc++.so.6.0.26 libstdc++.so.6

9. Check the latest version of gcc. If the version is 5.2.0, then the installation is successful. If it is not successful, you can see that it is already 5.2.0, but gcc is still the old version. At this point, you need to restart the server to work.

Gcc-vg++-v

If you find that gcc is still the old version and Gmail + is the new version, then you need to restart the server

Reboot

10, check the gcc version again

# gcc-vUsing built-in specs.COLLECT_GCC=gccCOLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-unknown-linux-gnu/5.2.0/lto-wrapperTarget: x86_64-unknown-linux-gnuConfigured with:.. / configure-- enable-checking=release-- enable-languages=c,c++-- disable-multilibThread model: posixgcc version 5.2.0 (GCC)

Succeed!

Thank you for reading! This is the end of the article on "how to upgrade the gcc version of centos to 5.2.0". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!

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.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report