Intel® C++ Compiler for Linux* - Error while loading shared libraries: [shared lib]: cannot open shared object

If this error message references an Intel shared runtime library, such as, then this implies that the Linux* loader was not able to locate the library. First check that you have the Intel lib directory in your LD_LIBRARY_PATHenvironment variable. However, this can still be a problem when running a program where a new shell is created to run the program (such as MPICH). To fix this problem, link the Intel provided libraries statically with the -static-libcxa (for 10.x compiler and earlier versions only) or -static-intel flags or add the -rpathlinker option so the executables can find the libraries at runtime, for example:

icpc test.cpp -Xlinker -rpath -Xlinker <path to Intel libraries>

Path to Intel libraries depends on where you install the Intel compiler. The default paths to Intel libraries look like
9.1 compiler for IA-32: /opt/intel/cc/9.1/lib
9.1 compiler for Intel 64: /opt/intel/cce/9.1/lib
10.1.017 compiler for IA-32: /opt/intel/cc/10.1.017/lib
10.1.017 compiler for Intel 64: /opt/intel/cce/10.1.017/lib
11.0.069 compiler for IA-32: /opt/intel/Compiler/11.0/069/lib/ia32
11.0.069 compiler for Intel 64: /opt/intel/Compiler/11.0/069/lib/intel64

Note that anyone using a binary compiled with the -rpath option will need those libs to exist in that directory path as well, so you may have to redistribute the Intel provided libraries with your application.

For more complete information about compiler optimizations, see our Optimization Notice.

1 comment

Rhys Ulerich's picture

Is there some way to deduce the necessary paths by invoking the compiler?

Better, is there a way to have the compiler add the proper RPATH automatically?

Presumably the compiler must know the installed library locations to provide -static-intel flag functionality.

Add a Comment

Have a technical question? Visit our forums. Have site or software product issues? Contact support.