GCC

We need a modern C++17 capable compiler. Our minimum requirements are: GCC 8.5.0, Clang 10.0.1. This section will focus on building a GCC 12.2.1 compiler stack.

Obtain GCC source:

curl -L -O http://mirrors.concertpass.com/gcc/releases/gcc-12.2.1/gcc-12.2.1.tar.gz
tar -xf gcc-12.2.1.tar.gz -C .

Obtain GCC pre-reqs:

cd gcc-12.2.1
./contrib/download_prerequisites

Configure GCC using our recommended arguments, in addition to any optimizations you require:

mkdir gcc-build
cd gcc-build

../configure --prefix=/target/installation/path/gcc-12.2.1 \
--disable-multilib \
--enable-languages=c,c++,fortran,jit \
--enable-checking=release \
--enable-host-shared \
--with-pic

With configure complete (and error free), build and install GCC:


make -j 6
make install

Follow the onscreen instructions on how to make use of your new compiler.