用户工具

站点工具


zh:notes:update_gcc

差别

这里会显示出您选择的修订版和当前版本之间的差别。

到此差别页面的链接

两侧同时换到之前的修订记录 前一修订版
后一修订版
前一修订版
zh:notes:update_gcc [2020/08/28 15:42]
pzczxs [Download the Prerequisites]
zh:notes:update_gcc [2022/06/30 11:28] (当前版本)
pzczxs 讨论状态变化了
行 1: 行 1:
-====== Update ​g++ ======+====== Update ​gcc ======
 ===== Operation System ===== ===== Operation System =====
 CentOS 6.8 (64 bits), CentOS 7.6 (64 bits) CentOS 6.8 (64 bits), CentOS 7.6 (64 bits)
行 7: 行 7:
 > wget http://​ftp.gnu.org/​gnu/​gcc/​gcc-10.2.0/​gcc-10.2.0.tar.gz > wget http://​ftp.gnu.org/​gnu/​gcc/​gcc-10.2.0/​gcc-10.2.0.tar.gz
 > tar -zxvf gcc-10.2.0.tgz > tar -zxvf gcc-10.2.0.tgz
 +> rm -f gcc-10.2.0.tgz
 </​code>​ </​code>​
  
行 14: 行 15:
 > ./​contrib/​download_prerequisites > ./​contrib/​download_prerequisites
 </​code>​ </​code>​
 +
 +===== Make and Install =====
 +<code bash>
 +> mkdir gcc-build-10.2.0
 +> cd gcc-build-10.2.0
 +> ../​configure -enable-checking=release -enable-language=c,​c++ -disable-multilib
 +> make -j4 # for multi-core optimization
 +> make install
 +> ls /​usr/​local/​bin | grep gcc # check whether it is installed successfully or not
 +
 +#To restart the operation system,and then check the version. ​
 +> gcc -v
 +</​code>​
 +
 +===== Redirect Link =====
 +<code bash>
 +> strings /​usr/​lib64/​libstdc++.so.6 | grep GLIBC
 +# If "​GLIBCXX_3.4.28"​ is not shown in the list, please run the following commands. ​
 +> find / -name "​libstdc++.so"​
 +> find / -name "​libgomp.so"​
 +
 +# copy the latest library
 +> cd /usr/lib64
 +> cp /​root/​xushuo/​gcc-10.2.0/​gcc-build-10.2.0/​stage1-x86_64-pc-linux-gnu/​libstdc++-v3/​src/​.libs/​libstdc++.so ./
 +> cp /​root/​xushuo/​gcc-10.2.0/​gcc-build-10.2.0/​stage1-x86_64-pc-linux-gnu/​libgomp/​.libs/​libgomp.so ./
 +
 +# delete the old soft link and then create the new one
 +> rm -rf libstdc++.so.6
 +> rm -rf libgomp.so.1
 +> ln -s libstdc++.so libstdc++.so.6
 +> ln -s libgomp.so libgomp.so.1
 +
 +# In this time, "​GLIBCXX_3.4.28"​ should appear.
 +> strings /​usr/​lib64/​libstdc++.so.6 | grep GLIBC
 +</​code>​
 +
 +~~DISCUSSION:​closed~~
zh/notes/update_gcc.1598600539.txt.gz · 最后更改: 2020/08/28 15:42 由 pzczxs