Intel® C++ Compiler for Linux* - icc/icpc: error: could not find directory in which g++ resides

ID 662835
Updated 12/26/2018
Version Latest
Public

author-image

By

The following error occurs when the Intel® C or C++ Compiler for Linux* is unable to locate the GNU* g++ compiler on the user's system.

The known causes and solutions for this error include:

  • The GNU* g++ compiler is not installed on the system. To correct the condition ensure the g++ compiler is installed on the system.
  • On some non-English Linux OSes:
    • If the GNU specific LANGUAGE environment variable is not set to C. To correct the condition set the LC_LANGUAGE environment variable to C.
      For ksh/bash use: export LANGUAGE=C
      For tcsh/csh use: setenv LANGUAGE C
    • If the LANGUAGE setting above does not help, then try setting the LC_MESSAGES environment variable to C.
      For ksh/bash use: export LC_MESSAGES=C
      For tcsh/csh use: setenv LC_MESSAGES C
    • If the LC_MESSAGES setting above does not help, then try setting the LC_ALL environment variable to C. This setting may have undesired affects on other locale settings. See the Linux manual page for locale for more details.
      For ksh/bash use: export LC_ALL=C
      For tcsh/csh use: setenv LC_ALL C
  • The GNU* g++ compiler is installed in a non-standard location and the GXX_ROOT environment variable is not set. To correct the condition set the GXX_ROOT environment variable to the installation location of the GNU* g++ compiler.

    To determine the installation location for g++ execute the command:

    g++ --print-search-dirs

    Then set the GXX_ROOT environment variable to the location indicated by the €œinstall:€ field from the output of the above command.

    For example:

    If g++ is installed in: /usr/i686-pc-linux-gnu/gcc-bin/3.3/

    GXX_ROOT would be set as follows:

    For ksh/bash use: export GXX_ROOT=/usr/i686-pc-linux-gnu/gcc-bin/3.3/
    For tcsh/csh use: setenv GXX_ROOT /usr/i686-pc-linux-gnu/gcc-bin/3.3/

If none of the above solutions resolves the issue, please visit our Get Help page for support options.