Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
7944 Discussions

Intel compiler cannot find libstdc++ include files

Areg_G_
Beginner
1,794 Views

So I am trying to use Intel compiler on SMP to which I have only user access. I tried to compile simple Hello World program, but I am getting the error

icpc: error #10001: could not find directory in which the set of libstdc++ include files resides

The Intel compiler version is 15.0.1.133 and gcc version is 5.2 (although there are older versions as well).  I tried to add the line   -cxxlib=/share/apps/gcc/5.2 to compilation command, but that doesn't help as well. I will just list some command results

$ which gcc

/share/apps/gcc/5.2/bin/gcc

$which icc

/share/apps/intel/composer_xe_2015.1.133/bin/intel64/icc

I have also run the /share/apps/intel/composer_xe_2015.1.133/bin/iccvars.sh intel64 script.

$echo $GXX_ROOT

/share/apps/gcc/5.2/lib/gcc/x86_64-pc-linux-gnu/6.0.0/

 $ g++ -print-search-dirs
install: /share/apps/gcc/5.2/lib/gcc/x86_64-pc-linux-gnu/6.0.0/

There is also older version of the Intel compiler (13.0.1.117), which gives the same result.

Thank you for your help.

Areg Ghazaryan

 

0 Kudos
8 Replies
Yuan_C_Intel
Employee
1,794 Views

Hi, Areg

The GXX_ROOT should be set to the location of gcc binaries, which should be

/share/apps/gcc/5.2/bin/

Instead of the library path: /share/apps/gcc/5.2/lib/gcc/x86_64-pc-linux-gnu/6.0.0/

Could you have a try see if it works?

Thanks.

 

0 Kudos
Areg_G_
Beginner
1,794 Views

Hi, Yolanda

Thank you for your answer. There was a development before your answer. So I have asked about this to system administrator and he installed gcc on usr/bin, after which everything works. I have one question although. So he has installed g++ 4.4.7 on usr/bin, which is old for me, because I am using c++11 features. So as you know from previous post there are newer version of the gcc installed on the system, but on different location. So how can I force icpc to use my desired version gcc libraries (simply by changing GXX_ROOT variable and adding the path of newer version of gcc before usr/bin? ) and also how can I check from intel compiler which libraries it is using.

 

Thanks.

Areg 

0 Kudos
Areg_G_
Beginner
1,794 Views

Ok so I have tried what I wrote previously and I got the same error. As I said previously with 

$which g++

 /usr/bin/g++

and GXX_ROOT unset everything works, but the compiler is 4.4.7. After loading new gcc module

$which g++ 

/share/apps/gcc/5.2/bin/g++

with the following variables

LD_LIBRARY_PATH=/share/apps/gcc/5.2/lib64:/share/apps/gcc/5.2/lib:...

PATH=/share/apps/gcc/5.2/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin

it still works, although I am not sure which libraries icpc is using. If I set GXX_ROOT to

GXX_ROOT=/share/apps/gcc/5.2/bin

I again get the error

 icpc: error #10001: could not find directory in which the set of libstdc++ include files resides

Thanks.

Areg

0 Kudos
Ravi_N_Intel
Employee
1,794 Views

The use of GXX_ROOT overrides potential settings done by calling gcc.  Typically we do not advise to use GXX_ROOT.  If you want to use a different gcc on the system (which is not in the PATH) you can use -gcc-name=<fullpathto>/gcc.  This will tell the Intel® Compiler to trying to configure based on that specific gcc and not the one in the PATH.

0 Kudos
Areg_G_
Beginner
1,794 Views

Hi Ravi,

Here is a quick test, so I wrote this code

#include <iostream>
#include <cstddef>
int main() {
        std::cout << "Hello World!" << std::endl;
        int* x = nullptr;
}

As you know nullptr was added after gcc 4.6, so this should test which gcc version icpc is using.

I check, this program compiles with g++ 5.2 and fails with g++ 4.4.7 as it should. Trying to compile with icpc hello.cpp or icpc -gcc-name=/share/apps/gcc/5.2/bin/gcc hello.cpp fails, which shows that icpc still is using gcc 4.4.7.

Thanks.

Areg

 

0 Kudos
Ravi_N_Intel
Employee
1,794 Views

You probably have a non-standard installation of gcc.

Can you send the output from g++ -v test.cpp  (make sure test.cpp exists)

 

0 Kudos
Areg_G_
Beginner
1,794 Views

Yes Ravi you are right, I checked with other versions of gcc (above 4.8) and it worked. Only this one is not working and it is non-standard installation. Anyway here is g++ -v hello.cpp results, but I will not use this version anyway and will stick with other versions

Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/share/apps/gcc/5.2/libexec/gcc/x86_64-pc-linux-gnu/6.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ./configure --prefix=/share/apps/gcc/5.2 --enable-languages=c,c++,fortran
Thread model: posix
gcc version 6.0.0 20150922 (experimental) (GCC) 
COLLECT_GCC_OPTIONS='-std=c++11' '-v' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
 /share/apps/gcc/5.2/libexec/gcc/x86_64-pc-linux-gnu/6.0.0/cc1plus -quiet -v -D_GNU_SOURCE hello.cpp -quiet -dumpbase hello.cpp -mtune=generic -march=x86-64 -auxbase hello -std=c++11 -version -o /tmp/ccBt71gV.s
GNU C++11 (GCC) version 6.0.0 20150922 (experimental) (x86_64-pc-linux-gnu)
        compiled by GNU C version 6.0.0 20150922 (experimental), GMP version 4.3.2, MPFR version 2.4.2, MPC version 0.8.1
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
ignoring nonexistent directory "/share/apps/gcc/5.2/lib/gcc/x86_64-pc-linux-gnu/6.0.0/../../../../x86_64-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /share/apps/gcc/5.2/lib/gcc/x86_64-pc-linux-gnu/6.0.0/../../../../include/c++/6.0.0
 /share/apps/gcc/5.2/lib/gcc/x86_64-pc-linux-gnu/6.0.0/../../../../include/c++/6.0.0/x86_64-pc-linux-gnu
 /share/apps/gcc/5.2/lib/gcc/x86_64-pc-linux-gnu/6.0.0/../../../../include/c++/6.0.0/backward
 /share/apps/gcc/5.2/lib/gcc/x86_64-pc-linux-gnu/6.0.0/include
 /usr/local/include
 /share/apps/gcc/5.2/include
 /share/apps/gcc/5.2/lib/gcc/x86_64-pc-linux-gnu/6.0.0/include-fixed
 /usr/include
End of search list.
GNU C++11 (GCC) version 6.0.0 20150922 (experimental) (x86_64-pc-linux-gnu)
        compiled by GNU C version 6.0.0 20150922 (experimental), GMP version 4.3.2, MPFR version 2.4.2, MPC version 0.8.1
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
Compiler executable checksum: 70fc86f6b5143686e07e07028fe4a916
COLLECT_GCC_OPTIONS='-std=c++11' '-v' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
 as -v --64 -o /tmp/ccrcmp7r.o /tmp/ccBt71gV.s
GNU assembler version 2.20.51.0.2 (x86_64-redhat-linux) using BFD version version 2.20.51.0.2-5.36.el6 20100205
COMPILER_PATH=/share/apps/gcc/5.2/libexec/gcc/x86_64-pc-linux-gnu/6.0.0/:/share/apps/gcc/5.2/libexec/gcc/x86_64-pc-linux-gnu/6.0.0/:/share/apps/gcc/5.2/libexec/gcc/x86_64-pc-linux-gnu/:/share/apps/gcc/5.2/lib/gcc/x86_64-pc-linux-gnu/6.0.0/:/share/apps/gcc/5.2/lib/gcc/x86_64-pc-linux-gnu/
LIBRARY_PATH=/share/apps/gcc/5.2/lib/gcc/x86_64-pc-linux-gnu/6.0.0/:/share/apps/gcc/5.2/lib/gcc/x86_64-pc-linux-gnu/6.0.0/../../../../lib64/:/lib/../lib64/:/usr/lib/../lib64/:/share/apps/gcc/5.2/lib/gcc/x86_64-pc-linux-gnu/6.0.0/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-std=c++11' '-v' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
 /share/apps/gcc/5.2/libexec/gcc/x86_64-pc-linux-gnu/6.0.0/collect2 --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 /usr/lib/../lib64/crt1.o /usr/lib/../lib64/crti.o /share/apps/gcc/5.2/lib/gcc/x86_64-pc-linux-gnu/6.0.0/crtbegin.o -L/share/apps/gcc/5.2/lib/gcc/x86_64-pc-linux-gnu/6.0.0 -L/share/apps/gcc/5.2/lib/gcc/x86_64-pc-linux-gnu/6.0.0/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/share/apps/gcc/5.2/lib/gcc/x86_64-pc-linux-gnu/6.0.0/../../.. /tmp/ccrcmp7r.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /share/apps/gcc/5.2/lib/gcc/x86_64-pc-linux-gnu/6.0.0/crtend.o /usr/lib/../lib64/crtn.o

Thank you for your help.

Areg

0 Kudos
Judith_W_Intel
Employee
1,794 Views

 

I think you may need to use -gxx-name not -gcc-name since you are using icpc not icc.

0 Kudos
Reply