Gab*_*dez 4 linux gcc gmp alpine-linux lib
尝试在Alpine上安装GCC 6.4.0时,我遇到了:
checking for the correct version of gmp.h... yes
checking for the correct version of mpfr.h... yes
checking for the correct version of mpc.h... yes
checking for the correct version of the gmp/mpfr/mpc libraries... no
Run Code Online (Sandbox Code Playgroud)
但是在中/usr/lib,这似乎是标准的查找目录,我有:
libgmp.a
libgmp.so
libgmp.so.10
libgmp.so.10.3.2
libmpc.so.3
libmpc.so.3.0.0
libmpfr.so.4
libmpfr.so.4.1.5
Run Code Online (Sandbox Code Playgroud)
有什么事吗
安装所有需要编译的库的最佳方法gcc是使用源目录中的./contrib/download_prerequisites脚本gcc。这将下载支持库并创建符号链接,从而在gcc构建过程中自动构建它们。
在Alpine linux上编译gcc版本的步骤6.4.0是:
apk add --no-cache make build-base
wget https://ftp.gnu.org/gnu/gcc/gcc-6.4.0/gcc-6.4.0.tar.gz
tar -xzvf gcc-6.4.0.tar.gz
cd gcc-6.4.0
./contrib/download_prerequisites
cd ..
mkdir objdir
cd objdir
./../gcc-6.4.0/configure --prefix=$HOME/GCC-6.4.0 --disable-multilib
make all-gcc
make all-target-libgcc
make install-gcc
make install-target-libgcc
Run Code Online (Sandbox Code Playgroud)
在Alpine Linux上安装GCC的最快方法是发出以下命令:
apk add build-base
Run Code Online (Sandbox Code Playgroud)
来源:https : //wiki.alpinelinux.org/wiki/GCC
事实证明,在这种特殊情况下,需要安装 mpc1-dev、gmp-dev 或 mpfr-dev。我错过了 mpc1-dev。
sudo apk add mpc1-dev
Run Code Online (Sandbox Code Playgroud)