ADIOS2: Build error with gcc@9.3.0

George in PPPL reports to me that he is trying to build Adios2 on their unix machine but getting the following error:

[ 35%] Linking C executable ../../../bin/hello_bpWriter_c
cd /p/xgc/Software/src/adios2_build/examples/hello/bpWriter && /usr/pppl/cmake/3.17.1/bin/cmake -E cmake_link_script CMakeFiles/hello_bpWriter_c.dir/link.txt --verbose=1
/usr/pppl/gcc/9.3-pkgs/openmpi-4.0.3/bin/mpicc -O3 -DNDEBUG   CMakeFiles/hello_bpWriter_c.dir/helloBPWriter.c.o  -o ../../../bin/hello_bpWriter_c  -Wl,-rpath,/p/xgc/Software/src/adios2_build/lib64 ../../../lib64/libadios2_c.so.2.6.0 -Wl,-rpath-link,/p/xgc/Software/src/adios2_build/lib64 
/usr/pppl/gcc/9.3.0/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /p/xgc/Software/src/adios2_build/lib64/libadios2_core.so.2: undefined reference to `VTT for std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >@GLIBCXX_3.4.21'
/usr/pppl/gcc/9.3.0/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /p/xgc/Software/src/adios2_build/lib64/libadios2_core.so.2: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::rfind(char const*, unsigned long, unsigned long) const@GLIBCXX_3.4.21'
/usr/pppl/gcc/9.3.0/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /p/xgc/Software/src/adios2_build/lib64/libadios2_core.so.2: undefined reference to `std::iostream_category()@GLIBCXX_3.4.21'
/usr/pppl/gcc/9.3.0/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /p/xgc/Software/src/adios2_build/lib64/libadios2_core.so.2: undefined reference to `std::logic_error::logic_error(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@GLIBCXX_3.4.21'
/usr/pppl/gcc/9.3.0/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /p/xgc/Software/src/adios2_build/lib64/libadios2_core.so.2: undefined reference to `std::thread::_State::~_State()@GLIBCXX_3.4.22'
/usr/pppl/gcc/9.3.0/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: ../../../lib64/libadios2_c.so.2.6.0: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_assign(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@GLIBCXX_3.4.21'
/usr/pppl/gcc/9.3.0/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /p/xgc/Software/src/adios2_build/lib64/libadios2_core.so.2: undefined reference to `__cxa_init_primary_exception@CXXABI_1.3.11'
/usr/pppl/gcc/9.3.0/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: ../../../lib64/libadios2_c.so.2.6.0: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::reserve(unsigned long)@GLIBCXX_3.4.21'
/usr/pppl/gcc/9.3.0/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /p/xgc/Software/src/adios2_build/lib64/libadios2_core.so.2: undefined reference to `std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::_M_mutate(unsigned long, unsigned long, wchar_t const*, unsigned long)@GLIBCXX_3.4.21'
/usr/pppl/gcc/9.3.0/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /p/xgc/Software/src/adios2_build/lib64/libadios2_core.so.2: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::find_last_not_of(char const*, unsigned long, unsigned long) const@GLIBCXX_3.4.21'
/usr/pppl/gcc/9.3.0/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /p/xgc/Software/src/adios2_build/lib64/libadios2_core.so.2: undefined reference to `std::out_of_range::out_of_range(char const*)@GLIBCXX_3.4.21'
/usr/pppl/gcc/9.3.0/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /p/xgc/Software/src/adios2_build/lib64/libadios2_core.so.2: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::resize(unsigned long, char)@GLIBCXX_3.4.21'
/usr/pppl/gcc/9.3.0/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /p/xgc/Software/src/adios2_build/lib64/libadios2_core.so.2: undefined reference to `vtable for std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >@GLIBCXX_3.4.21'
/usr/pppl/gcc/9.3.0/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /p/xgc/Software/src/adios2_build/lib64/libadios2_core.so.2: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_erase(unsigned long, unsigned long)@GLIBCXX_3.4.21'
/usr/pppl/gcc/9.3.0/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /p/xgc/Software/src/adios2_build/lib64/libadios2_core.so.2: undefined reference to `std::runtime_error::runtime_error(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@GLIBCXX_3.4.21'
/usr/pppl/gcc/9.3.0/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /p/xgc/Software/src/adios2_build/lib64/libadios2_core.so.2: undefined reference to `typeinfo for std::ios_base::failure[abi:cxx11]@GLIBCXX_3.4.21'
/usr/pppl/gcc/9.3.0/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /p/xgc/Software/src/adios2_build/lib64/libadios2_core.so.2: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::find_first_not_of(char const*, unsigned long, unsigned long) const@GLIBCXX_3.4.21'
/usr/pppl/gcc/9.3.0/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /p/xgc/Software/src/adios2_build/lib64/libadios2_core.so.2: undefined reference to `std::runtime_error::runtime_error(std::runtime_error&&)@GLIBCXX_3.4.26'

Here is the cmake command he is using:

CC=mpicc CXX=mpicxx FC=mpifort \
cmake \
       -DCMAKE_INSTALL_PREFIX=$INST_PREFIX \
       -DBUILD_SHARED_LIBS=ON \
       -DCMAKE_BUILD_TYPE=Release \
       -DADIOS2_USE_MPI=ON \
       -DADIOS2_USE_ZeroMQ=OFF \
       -DADIOS2_USE_HDF5=OFF \
       -DADIOS2_USE_Python=OFF \
       -DADIOS2_USE_Fortran=ON \
       -DADIOS2_USE_SST=OFF \
       -DADIOS2_USE_BZip2=OFF \
       -DADIOS2_USE_ZFP=OFF \
       -DADIOS2_USE_SZ=OFF \
       -DADIOS2_USE_MGARD=OFF \
       -DADIOS2_USE_PNG=OFF \
       ../ADIOS2

I haven’t seen such error before. Is there anyone can give any quick advice?

Thanks.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 38 (22 by maintainers)

Most upvoted comments

Folks! This issue has been resolved! 😃 Our sysadmin only had to modify and rebuild the MPI wrapper scripts without having to rebuild the whole OpenMPI package. The problem was that the mpicc script, for example, ran the following command: $ mpicc -show gcc -I/usr/pppl/gcc/9.3-pkgs/openmpi-4.0.3/include -pthread -L/usr/lib64 -Wl,-rpath -Wl,/usr/lib64 -Wl,-rpath -Wl,/usr/pppl/gcc/9.3-pkgs/openmpi-4.0.3/lib -Wl,--enable-new-dtags -L/usr/pppl/gcc/9.3-pkgs/openmpi-4.0.3/lib -lmpi Having -L/usr/lib64 -Wl,-rpath -Wl,/usr/lib64 at the link stage forced the loading of CentOS7 GCC-4.8.5 libraries instead of the ones from GCC-9.3.0. Removing it from the wrapper script solved the problem.

Thanks for your help in figuring this out.

Since gcc is producing an executable that references symbol from that newer version of libstdc++, chances are that this library is in fact installed somewhere on the system (probably together with that newer gcc), but it’s not picking up that version, but the standard system version. You can try

find / -name libstdc++.so.\*

to go look for other version of libstdc++.