Rate This Document
Findability
Accuracy
Completeness
Readability

Compiling and Installing GNU 9.1

Procedure

  1. Use PuTTY to log in to the server as the root user.
  2. Run the following commands to decompress the installation package:

    tar -vxf gcc-9.1.0.tar.xz

  3. Run the following command to switch to the directory in which the decompressed files are stored:

    cd gcc-9.1.0/

  4. Run the following command to create the obj directory:

    mkdir obj

  5. Run the following command to go to the obj directory:

    cd obj

  6. 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

  7. 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.