Installing GCC from source on Alpine

Gabriel Fernandez picture Gabriel Fernandez · Jun 22, 2018 · Viewed 16.2k times · Source

While trying to install GCC 6.4.0 on Alpine, I run into:

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

But in /usr/lib, which seems to be the standard lookup directory, I have:

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

What could be wrong?

Answer

Ro. picture Ro. · Feb 1, 2019

The quickest way to install GCC on Alpine Linux is by issuing the following command:

apk add build-base

source: https://wiki.alpinelinux.org/wiki/GCC