Error during build of CUDA offloading plugin / device RTL

Hi everyone,

I just checked out branch release_70 of LLVM, Clang and OpenMP from git
and tried to build using cmake and make.

Unfortunately I experience an error during the build of the Nvidia CUDA
offloading device RTL:

[ 10%] Building NVCC (Device) object
projects/openmp/libomptarget/deviceRTLs/nvptx/CMakeFiles/omptarget-nvptx.dir/src/omptarget-nvptx_generated_cancel.cu.o
/usr/include/c++/8/type_traits(1049): error: type name is not allowed

/usr/include/c++/8/type_traits(1049): error: type name is not allowed

/usr/include/c++/8/type_traits(1049): error: identifier
"__is_assignable" is undefined

3 errors detected in the compilation of
"/tmp/tmpxft_00005a09_00000000-6_cancel.cpp1.ii".
CMake Error at omptarget-nvptx_generated_cancel.cu.o.Debug.cmake:275
(message):
Error generating file

/scratch/llvm/llvm-latest/llvm-bin/projects/openmp/libomptarget/deviceRTLs/nvptx/CMakeFiles/omptarget-nvptx.dir/src/./omptarget-nvptx_generated_cancel.cu.o

I also see a similar error during the compilation of
omptarget-nvptx_generated_omp_data.cu.o.

I'm running Fedora 28 with kernel version 4.17.7, gcc version 8.1.1 and
nvcc version 9.1.85.

My cmake-configuration is the default configuration, apart from
CMAKE_BUILD_TYPE=Debug, BUILD_SHARED_LIBS=ON and
LIBOMPTARGET_NVPTX_COMPUTE_CAPABILITIES=35,61 (6.1 is the capability of
my device).

Does anyone have some suggestions on how to fix this problem? Do I need
to further change my cmake configuration?

Thanks in advance,

Regards

Lukas

Hi Lukas,

can you try installing and using (via -DLIBOMPTARGET_NVPTX_ALTERNATE_HOST_COMPILER) an older version of GCC? According to Installation Guide Linux :: CUDA Toolkit Documentation, CUDA 9 only supports Fedora 27 with GCC 7, so I think your C++ header files use features that nvcc is not prepared to cope with.

Cheers,
Jonas

Hi Jonas,

thank you very much for your quick reply!

I was indeed able to build the release_70-version of LLVM/Clang/OpenMP
with a different version of OS/GCC (nvcc 9.2.148, gcc 7.3.0, Ubuntu 18.04).

Thanks for your help,

Lukas