clang 9.0.0 + libstdc++ problem

Hello llvm developers!

I am trying to build the OpenMP runtime with clang 9.0.0. The clang compiler fails to find the libstdc++ library.

I specified the pathname, but it does not help.

I had to resort to configuring like this:

cmake -DCMAKE_BUILD_TYPE=Release \

-DCMAKE_INSTALL_PREFIX="/nobackupnfs2/clang-install"\

-DCMAKE_C_COMPILER=/nobackupnfs2/clang-install/bin/clang\

-DCMAKE_CXX_COMPILER=/nobackupnfs2/clang-install/bin/clang++\

-DLIBOMPTARGET_DEP_LIBELF_LIBRARIES:FILEPATH=/usr/lib64/libelf.so.1 \

-DLLVM_LIBSTDCXX:FILEPATH=/usr/lib64/libstdc++.so.6\

-DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN=ON\

-DCLANG_OPENMP_NVPTX_DEFAULT_ARCH=sm_60 \

-DLIBOMPTARGET_NVPTX_COMPUTE_CAPABILITIES=35,60,70 …/llvm-9.0.0.src

Is there a way to tell clang to use the correct library? It complains that the library is too old, but I think it is because it does not find the right one.

Hi Gabriele,

You can set the -DGCC_INSTALL_PREFIX to point to the folder with the desired version of GCC.

The GCC folder you want to point to is the one containing the lib and include folders. I use GCC 6.4.

Thanks a lot,

–Doru

Thanks, Doru.

I have for now installed as below. I will try what you suggested next week!

Hi Doru and all,

I now have an install of clang + OpenMP target-offload using the old toolchain.

The benchmarks build, but when trying to run I get the following error:

pfe25.gjost 89> more sp.A.out.txt

libomptarget fatal error 1: failure of target construct while offloading is mand

atory

I am using a Skylake node with 4 V100 GPUs, using only one of the GPUs. Would you have suggestions on how I can narrow down this issue? Should I rebuild libomp in debug mode?

Thanks in advance and best regards,

Hi Gabriele,

Did you set the CUDA_VISIBLE_DEVICES env var?
If not you should set it to: CUDA_VISIBLE_DEVICES=0,1,2,3

Which CUDA version are you using? Any mismatch between the version used to build Clang and the version used to compile/run the program will lead to such errors.

Are you compiling and running your program on the same machine where you built Clang?

When building Clang I see you have:

-DCLANG_OPENMP_NVPTX_DEFAULT_ARCH=sm_60

you should change that to:

-DCLANG_OPENMP_NVPTX_DEFAULT_ARCH=sm_70

for the V100 GPUs.

In addition you should also use this flag to build Clang:

-DLIBOMPTARGET_NVPTX_COMPUTE_CAPABILITIES=70

Here you can specify several compute capabilities.

Thanks a lot,

–Doru