自学内容网 自学内容网

ubuntu20.04中编译安装gcc 9.2.0

ubuntu20.04中编译安装gcc 9.2.0,步骤如下:

#install compile dependence libraries

1:$ sudo apt install libgmp-dev libisl-dev libmpc-dev libmpfr-dev

# install gcc 9.2.0

# download source code

2:$ wget http://ftp.gnu.org/gnu/gcc/gcc-9.2.0/gcc-9.2.0.tar.xz

# uncompress

3:$ tar -xJvf gcc-9.2.0.tar.xz

4:$ cd gcc-9.2.0

5:$ mkdir build && cd build

# configure

6:$ ../configure -prefix=/usr/local/gcc-9.2 -enable-checking=release -enable-languages=c,c++ --disable-multilib --disable-libsanitizer

PS: 我电脑默认的编译配置是32位和64位,但是32位的dev lib不齐全,最好关掉32位,--disable-multilib

关闭 sanitizer模块,否则编译不过

# compile with multi thread

7:$ make -j4

# install

8:$ sudo make install


原文地址:https://blog.csdn.net/csdnlg112/article/details/143945768

免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!