Compiling and Installing GNU 9.1
Procedure
- Use PuTTY to log in to the server as the root user.
- Run the following commands to decompress the installation package:
tar -vxf gcc-9.1.0.tar.xz
- Run the following command to switch to the directory in which the decompressed files are stored:
cd gcc-9.1.0/
- Run the following command to create the obj directory:
mkdir obj
- Run the following command to go to the obj directory:
cd obj
- Run the following command to perform compilation and installation:
../configure --disable-multilib --enable-languages="c,c++,fortran" --prefix=/path/to/GNU --disable-static --enable-shared --with-gmp=/path/to/GMP/gmp-6.1.0 --with-mpfr=/path/to/MPFR/mpfr-3.1.4 --with-mpc=/path/to/MPC/mpc-1.0.3
make
make install
- Run the following command to load environment variables:
export PATH=/path/to/GNU/bin:$PATH
export LD_LIBRARY_PATH=/path/to/GNU/lib64:$LD_LIBRARY_PATH
The following figure shows directory contents when the installation is successful.

Parent topic: Deploying GNU 9.1