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

Compiler can't find libstdc++.so.5

Derek_Woodman
Beginner
2,087 Views
Hello all,

I just got the intell compiler installed on Fedora 10. I had some trouble installing the compiler because it said I was missing some preequisites. I finally got thouse all installed and have tried to compile one of the sample files. However, I get the following error:

/opt/intel/Compiler/11.1/059/bin/intel64/mcpcom: error while loading shared libraries: libstdc++.so.5: cannot open shared object file: No such file or directory compilation aborted for int_sin.c (code 127)

I know libstdc++.so.5 is installed because that was what the compiler installer was complaining about in the first place. In fact, I can see libstdc++.so.5 in /usr/lib. It is a link to the shared library libstdc++.so.5.0.7 in the same directory. I have varified that /usr/lib is in my $PATH environment variable. Does the compiler not look in these directories or something?

Thanks!!!
0 Kudos
1 Solution
Kevin_D_Intel
Employee
2,087 Views

The sym-link won't work. /usr/lib is the 32-bit version. You mentioned doing things to satisfy the installer.

Did you run: yum install compat-libstdc++-33

If not, then try that. Its my understanding this installs both 32-bit and 64-bit versions.

View solution in original post

0 Kudos
7 Replies
Kevin_D_Intel
Employee
2,087 Views

Depending on your working shell, try to source the icc setup script first (see below) andthen compile.

For bash/sh execute: source /opt/intel/Compiler/11.1/059/bin/iccvars.sh intel64
For csh/tcsh execute: source /opt/intel/Compiler/11.1/059/bin/iccvars.csh intel64
0 Kudos
Derek_Woodman
Beginner
2,087 Views

Depending on your working shell, try to source the icc setup script first (see below) andthen compile.

For bash/sh execute: source /opt/intel/Compiler/11.1/059/bin/iccvars.sh intel64
For csh/tcsh execute: source /opt/intel/Compiler/11.1/059/bin/iccvars.csh intel64

You have to do this before you can even call the compiler, so, yes, I have tried that. But I still get the error above. It can't find that library....
0 Kudos
Kevin_D_Intel
Employee
2,087 Views


The Intel 64 compiler expects /usr/lib64/libstdc++.so.5. Do you have that?

$ ldd /opt/intel/Compiler/11.1/059/bin/intel64/mcpcom
libm.so.6 => /lib64/libm.so.6 (0x0000003d10000000)
libstdc++.so.5 => /usr/lib64/libstdc++.so.5 (0x00002aaaaaad7000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x0000003d14800000)
libc.so.6 => /lib64/libc.so.6 (0x0000003d0fc00000)
libdl.so.2 => /lib64/libdl.so.2 (0x0000003d10400000)
/lib64/ld-linux-x86-64.so.2 (0x0000003d0f400000)

0 Kudos
Derek_Woodman
Beginner
2,087 Views


The Intel 64 compiler expects /usr/lib64/libstdc++.so.5. Do you have that?

$ ldd /opt/intel/Compiler/11.1/059/bin/intel64/mcpcom
libm.so.6 => /lib64/libm.so.6 (0x0000003d10000000)
libstdc++.so.5 => /usr/lib64/libstdc++.so.5 (0x00002aaaaaad7000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x0000003d14800000)
libc.so.6 => /lib64/libc.so.6 (0x0000003d0fc00000)
libdl.so.2 => /lib64/libdl.so.2 (0x0000003d10400000)
/lib64/ld-linux-x86-64.so.2 (0x0000003d0f400000)


Thanks for your quick replies!!

When I run the ldd command, I get this:

ldd /opt/intel/Compiler/11.1/059/bin/intel64/mcpcom
linux-vdso.so.1 => (0x00007fff041ff000)
libm.so.6 => /lib64/libm.so.6 (0x00007f192aea9000)
libstdc++.so.5 => not found
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f192ac92000)
libc.so.6 => /lib64/libc.so.6 (0x00007f192a920000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007f192a71c000)
/lib64/ld-linux-x86-64.so.2 (0x00007f192b12e000)

Is there a way to find out where it is looking for it? With your help I know it is looking in /usr/lib64, but how would I be found out this on my own?

To fix this can I just put a symbolic link in /usr/lib64 that links to libstdc++.so.5 in usr/lib ?

Thanks again!


0 Kudos
Kevin_D_Intel
Employee
2,088 Views

The sym-link won't work. /usr/lib is the 32-bit version. You mentioned doing things to satisfy the installer.

Did you run: yum install compat-libstdc++-33

If not, then try that. Its my understanding this installs both 32-bit and 64-bit versions.
0 Kudos
Derek_Woodman
Beginner
2,087 Views

The sym-link won't work. /usr/lib is the 32-bit version. You mentioned doing things to satisfy the installer.

Did you run: yum install compat-libstdc++-33

If not, then try that. Its my understanding this installs both 32-bit and 64-bit versions.


That you so much! It works now. I'm new to this whole linux thing. Its weird that I had the 32-bit version but not the 64-bit one.

For any other newbies out there that read this posting, you can find out what library to get from yum by exucuting:

yum whatprovides

So I could have done:

yum whatprovides libstdc++.so.5

I did originally do this but it only returned the 32-bit version (compat-libstdc++-33-3.2.3-64.i386). If I would have just dropped off the version and processor type it would have all be just fine. Darn me and my over-specificness.


0 Kudos
Kevin_D_Intel
Employee
2,087 Views

Glad to hear that worked. You must have accidentally requested only the 32-bit version be installed.

repoquery is another handy utility for "listing" the contents of specific packages.

$ repoquery --list compat-libstdc++-33
/usr/lib64/libstdc++.so.5
/usr/lib64/libstdc++.so.5.0.7
/usr/lib/libstdc++.so.5
/usr/lib/libstdc++.so.5.0.7

Using the package name with the .i386 suffix restricts access to only 32-bit

$ repoquery --list compat-libstdc++-33.i386
/usr/lib/libstdc++.so.5
/usr/lib/libstdc++.so.5.0.7

And .x86_64 to only 64-bit

$ repoquery --list compat-libstdc++-33.x86_64
/usr/lib64/libstdc++.so.5
/usr/lib64/libstdc++.so.5.0.7

Perhaps you accidently yum'd with the .i386 extension.


Also, I didn't intend to skirt your earlier questions. I was pressed for time yesterday.

- Is there a way to find out where it is looking for it?

I won't profess expertise in this area, but what I understand is an application (really the run-time linker ld.so or ld-linux.so) searches for dynamic load (.so) libraries based on paths in the LD_LIBRARY_PATH environment variable and cached items associated with dynamic linker run-time bindings (see: ldconfig(8) the -p option prints the cached list). Applications can also be created with built-in added search directories using the ld(1) -rpath dir option.


- With your help I know it is looking in /usr/lib64, but how would I be found out this on my own?

You should not have to because our installer should detect and offer accurate information on dependencies. It appears our 11.1 installer, even for the Intel 64 only package, only checks for and requires libstdc++.so.5 (32-bit). We are now looking at corrections in the next major release, although those might be approved for a future 11.1 update too.

Without that, to determine this probably requires understanding how Linux providers structure the run-time libraries under the 64-bit (e.g. x86_64) distros. Most (Debian 64-bit being an exception) contain 32-bit versions of system libraries in areas named: /lib, /usr/lib and 64-bit versions in areas named: /lib64, /usr/lib64.

Next, you could check the executable type (using file(1)) to determine whether it is 32-bit or 64-bit.

The Intel 32-bit compiler is a 32-bit executable requiring the 32-bit libraries:

$ file /opt/intel/Compiler/11.1/059/bin/ia32/mcpcom
/opt/intel/Compiler/11.1/059/bin/ia32/mcpcom: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.2.5, dynamically linked (uses shared libs), for GNU/Linux 2.2.5, not stripped

$ ldd /opt/intel/Compiler/11.1/059/bin/ia32/mcpcom
linux-gate.so.1 => (0xffffe000)
libm.so.6 => /lib/libm.so.6 (0x00268000)
libstdc++.so.5 => /usr/lib/libstdc++.so.5 (0xf7f1a000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00474000)
libc.so.6 => /lib/libc.so.6 (0x00126000)
libdl.so.2 => /lib/libdl.so.2 (0x00291000)
/lib/ld-linux.so.2 (0x00109000)


And as we saw earlier, our 11.x Intel 64 compiler is a native 64-bit executable requiring 64-bit libraries:

$ file /opt/intel/Compiler/11.1/059/bin/intel64/mcpcom
/opt/intel/Compiler/11.1/059/bin/intel64/mcpcom: ELF 64-bit LSB executable, AMD x86-64, version 1 (SYSV), for GNU/Linux 2.4.0, dynamically linked (uses shared libs), for GNU/Linux 2.4.0, not stripped

$ ldd /opt/intel/Compiler/11.1/059/bin/intel64/mcpcom
libm.so.6 => /lib64/libm.so.6 (0x0000003d10000000)
libstdc++.so.5 => /usr/lib64/libstdc++.so.5 (0x00002aaaaaad7000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x0000003d14800000)
libc.so.6 => /lib64/libc.so.6 (0x0000003d0fc00000)
libdl.so.2 => /lib64/libdl.so.2 (0x0000003d10400000)
/lib64/ld-linux-x86-64.so.2 (0x0000003d0f400000)

So if one (or more) .so is missing like what you showed for libstdc++.so.5 in your earlier ldd output, rely on the type of executable to determine the version needed.

That's my understanding of things. I hope it helps.
0 Kudos
Reply