Build error

I am configuring a openmp runtime build this way:

cmake -G Ninja -DCMAKE_BUILD_TYPE=Release

… however I see a build error:

… CCcore-9.3.0/bin/ld:
undefined reference to `std::_Sp_make_shared_tag::_S_eq(std::type_info

Cmake invocation looks fine. It appears the static llvm libraries linked have been built with incompatible c++ flags to the other libraries found on your system.

A few options come to mind. You could pass the flags to disable zlib et al, search for what compiler flag (or maybe libc++ version) corresponds to that symbol and pass the options to the llvm build, or look up how the other libraries were built and change that.

Clang builds are probably tested against the libraries that ship with Linux distributions. The paths in your error message suggest you’re using some other source for them. Maybe a HPC module system of some sort? Can’t see how to debug that from the outside. Maybe contact whoever set up the zlib etc builds.


Hi Jon,
Thanks for taking a look at the logs. By adding the

Following up on myself's post; as of today's main again fails to
build; do you guys prefer the logs posted at bugzilla rather than the

Hi Itaru,

to avoid issues with libstdc++ on systems with environment modules and
all kind of software built with different compilers, I suggest to use
libc++ for C++ code compiled with clang. As long as you don't mix
gcc/clang with a binary or library and also don't pass C++ objects
across libraries, mixing libc++ and libstdc++ in an application should
be just fine.

On Claix we compile clang in two steps:

A minimal bootstrap build, compiled with system gcc.
A full final build, compiled with the bootstrapped clang.

cmake -DCMAKE_C_COMPILER=gcc \
               -DCMAKE_CXX_COMPILER=g++ \
               -DCMAKE_BUILD_TYPE=Release \
               -DLLVM_TARGETS_TO_BUILD=Native \
               "${SRC_DIR}/llvm" || exit 21
make -j8 || exit 22


mkdir -p "${BUILD_DIR_FINAL}"
cmake -DCMAKE_C_COMPILER=clang \
                -DCMAKE_CXX_COMPILER=clang++ \
                -DCMAKE_BUILD_TYPE=Release \
                -DLLVM_LIBDIR_SUFFIX=64 \
                -DLLVM_INSTALL_UTILS=ON \
                -DLLVM_ENABLE_LIBCXX=ON \
                -DCLANG_DEFAULT_CXX_STDLIB=libc++ \
                -DCLANG_OPENMP_NVPTX_DEFAULT_ARCH=sm_60 \
                -DLIBOMP_TSAN_SUPPORT=ON \
                -DLIBOMPTARGET_ENABLE_DEBUG=on \
                -DLLVM_BUILD_DOCS=ON \
                -DLLVM_ENABLE_SPHINX=ON \
                -DSPHINX_OUTPUT_HTML=OFF \
                -DSPHINX_OUTPUT_MAN=ON \
                "${SRC_DIR}/llvm" || exit 31
make -j8 || exit 32
make -j8 install || exit 33


Hi Joachim, all,
Thanks for the complete invocation options that help a lot; while I was thinking can’t we do this in one go? Even we start a clang build with GCC.

I’m currently trying to use Clang module for the 2nd stage build the JURECA admins provide.