Ubuntu 22.04升级GCC¶
其实没有必要在 Ubuntu Linux 22.04 上升级GCC,因为发行版提供的 gcc 11.3 已经足够新,支持足够的C feature。不过,我最近在 在SuSE 12 SP5中升级gcc 编译GCC非常缓慢,考虑到服务器是多核处理器性能足够强劲,但是依然没有快速完成编译,显然是编译并行没有搞好。所以我想重新在我的 zcloud
上验证以下并行编译和非并行编译的差异。
编译准备: 安装基本GCC toolchain和扩展工具
sudo apt install build-essential wget m4 flex bison \
libgmp-dev libmpfr-dev libmpc-dev \
textinfo libisl-dev
备注
Ubuntu Linux 的软件包命名规律和 :ref:`redhat_linux 不同:
gmp-devel ==> libgmp-dev
mpfr-devel ==> libmpfr-dev
libmpc-devel ==> libmpc-dev
编译安装GCC:
version=13.2.0
wget http://ftp.tsukuba.wide.ad.jp/software/gcc/releases/gcc-${version}/gcc-${version}.tar.gz
tar xfz gcc-${version}.tar.gz
cd gcc-${version}
./configure --disable-multilib --enable-languages=c,c++
make
sudo make install
备注
GCC编译非常耗时,建议 并行make
在 ./configure
时,我遇到如下提示信息:
...
required isl version is 0.15 or later
*** This configuration is not supported in the following subdirectories:
gnattools gotools target-libada target-libphobos target-zlib target-libbacktrace target-libgfortran target-libgo target-libffi target-libgm2 target-libobjc
(Any other directories should still work fine.)
...
checking for makeinfo... no
/home/huatai/docs/gcc/gcc-13.2.0/missing: 81: makeinfo: not found
...
则需要补充安装:
# textinfo提供makeinfo
# libisl-dev提供isl
sudo apt install texinfo libisl-dev
参考¶
-
isl Library version 0.15 or later. Necessary to build GCC with the Graphite loop optimizations. It can be downloaded from https://gcc.gnu.org/pub/gcc/infrastructure/. If an isl source distribution is found in a subdirectory of your GCC sources named isl, it will be built together with GCC. Alternatively, the --with-isl configure option should be used if isl is not installed in your default library search path.