/usr/lib64/libstdc++.so.6 too old?

Currently Loaded Modules:

  1. usc 3) pmix/3.1.3 5) openblas/0.3.8
  2. gcc/8.3.0 4) openmpi/4.0.2 6) anaconda3/2019.10

I was able to compile my code but during runtime following errors show up,

/usr/lib64/libstdc++.so.6: version CXXABI_1.3.9' not found /usr/lib64/libstdc++.so.6: version GLIBCXX_3.4.21’ not found

% strings /usr/lib64/libstdc++.so.6 |grep CXXABI

CXXABI_1.3
CXXABI_1.3.1
CXXABI_1.3.2
CXXABI_1.3.3
CXXABI_1.3.4
CXXABI_1.3.5
CXXABI_1.3.6
CXXABI_1.3.7
CXXABI_TM_1

Hi,

Based on the information provided above it looks your app is trying to use system libraries to run. It should work if you use our gcc 8.3.0 module.

# gcc/8.3.0 module loaded    
$ strings $GCC_ROOT/lib64/libstdc++.so.6 | grep CXXABI
CXXABI_1.3
CXXABI_1.3.1
CXXABI_1.3.2
CXXABI_1.3.3
CXXABI_1.3.4
CXXABI_1.3.5
CXXABI_1.3.6
CXXABI_1.3.7
CXXABI_1.3.8
CXXABI_1.3.9
CXXABI_1.3.10
CXXABI_1.3.11
CXXABI_TM_1
CXXABI_FLOAT128
CXXABI_1.3
CXXABI_1.3.11
CXXABI_1.3.2
CXXABI_1.3.6
CXXABI_FLOAT128
CXXABI_1.3.9
CXXABI_1.3.1
CXXABI_1.3.5
CXXABI_1.3.8
CXXABI_1.3.4
CXXABI_TM_1
CXXABI_1.3.7
CXXABI_1.3.10
CXXABI_1.3.3

You might have to modify your Makefile to use gcc and g++ instead of /usr/bin/gcc and /usr/bin/g++

If that doesn’t work, can you share the steps you followed to build your app or provide a link to the documentation?

The executable was compiled and linked with mpicc instead of gcc.

$ mpicc --showme:link
-fexceptions -pthread -L/spack/apps/linux-centos7-x86_64/gcc-8.3.0/hwloc-1.11.11-enjcz6lbwjrfbpzeskhst3ie3bn5gpv5/lib -L/spack/apps/linux-centos7-x86_64/gcc-8.3.0/ucx-1.8.0-o6fhjkqszinevp3soi5szm76tkw3tjl2/lib -L/spack/apps/linux-centos7-x86_64/gcc-8.3.0/zlib-1.2.11-dp3wfr26pumq5x4dltujahr4qse4agnk/lib -L/usr/lib64 -Wl,-rpath -Wl,/spack/apps/linux-centos7-x86_64/gcc-8.3.0/hwloc-1.11.11-enjcz6lbwjrfbpzeskhst3ie3bn5gpv5/lib -Wl,-rpath -Wl,/spack/apps/linux-centos7-x86_64/gcc-8.3.0/ucx-1.8.0-o6fhjkqszinevp3soi5szm76tkw3tjl2/lib -Wl,-rpath -Wl,/spack/apps/linux-centos7-x86_64/gcc-8.3.0/zlib-1.2.11-dp3wfr26pumq5x4dltujahr4qse4agnk/lib -Wl,-rpath -Wl,/usr/lib64 -Wl,-rpath -Wl,/spack/apps/linux-centos7-x86_64/gcc-8.3.0/openmpi-4.0.2-ipm3dnvlbtxawpi4ifz7jma6jgr7mexq/lib -L/spack/apps/linux-centos7-x86_64/gcc-8.3.0/openmpi-4.0.2-ipm3dnvlbtxawpi4ifz7jma6jgr7mexq/lib -lmpi

mpicc is picking up the system lib

Hello,

Before running the make or cmake command for your code build, can you issue the following command:
export LD_PRELOAD=/spack/apps/gcc/8.3.0/lib64/libstdc++.so.6

Then run make/cmake.

That would just be a work around. mpicc should not be picking up the system library if it was
suppose to be built with gcc-8.3.0.

It is not a workaround- it is a valid build method. That is why LD_PRELOAD exists. If you need your build to find a specific library, then you use LD_PRELOAD. Using mpicc is a wrapper for the gcc-8.3.0 compiler, so it is gcc-8.3.0 that is picking up the system library. Anyways, I will bake the “workaround” into the gcc-8.3.0 module lua file to avoid having any build process pick-up the /usr/lib64 system library.