How to install GCC higher version in alternative directory 3


One easy way to install GCC higher version (which supports C++ 11 standard) in alternative directory (meaning without root privilege) is as follows:

  • Download the latest GCC from http://gcc.gnu.org/
  • Untar the package
  • If you don’t have prerequisites for GCC (http://gcc.gnu.org/install/prerequisites.html), you need to the following steps:
    • Go to the source directory.
    • Do “contrib/download_prerequisites”.
  • Create a new directory called “gcc-build” peer to the source directory.
  • In “gcc-build”, perform “../gcc-XXX/configure –prefix=YYY”
  • Do “make” and “make install”
  • Add “YYY/lib” or “YYY/lib64” into your LD_LIBRARY_PATH and LD_RUN_PATH

Leave a comment

Your email address will not be published. Required fields are marked *

3 thoughts on “How to install GCC higher version in alternative directory