-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
12.0.0-rc1 build error for device runtime #48502
Comments
Even, when I manually add -I${BUILD_DIR}/include/c++/v1/ to make sure, that clang uses the just configured stdlib.h, I get the same compiler errors. .... |
Hiding the lines for NVPTX helps to avoid the error: --- a/libcxx/include/stdlib.h -#if !(defined(_AIX) || defined(sun)) With this patch and manually specifying the include directory, the compile error is gone. I just don't know to which libomptarget cmake file I would need to add the include_directories command, which makes sure that the compiler uses the new stdlib.h |
Can you check if https://reviews.llvm.org/D95928 fixes this? |
Will that patch be backported to release-12? |
And yes, your patch resolves this issue. |
It's not obvious to me that including stdlib.h in a target region is well defined. In particular, it contains things that don't work on the target (like this bug report), and glibc doesn't seem to have feature macros for nvptx. Alternatives to patching clang, to fix this bug, seem to be:
Application code might still want to include stdlib in a target region and have it work, but perhaps that could be postponed for now? |
Is backporting https://reviews.llvm.org/D95928 still OK? |
I think so. Though, I'm waiting for review on that one and the one before. |
*** Bug llvm/llvm-bugzilla-archive#48933 has been marked as a duplicate of this bug. *** |
Merged: 0d14528 |
Extended Description
Building the just tagged 12.0.0-rc1, I still cannot compile LLVM including libomptarget. The build aborts with the following error, I build OpenMP as runtime, therefore the newly built clang is used:
FAILED: projects/openmp/libomptarget/deviceRTLs/nvptx/loop.cu-cuda_80-sm_70.bc
cd ${BUILD_DIR}/projects/openmp/libomptarget/deviceRTLs/nvptx && clang -S -x c++ -target nvptx64 -Xclang -emit-llvm-bc -Xclang -aux-triple -Xclang x86_64-unknown-linux-gnu -fopenmp -fopenmp-cuda-mode -Xclang -fopenmp-is-device -D__CUDACC__ -I${SOURCE_DIR}/openmp/libomptarget/deviceRTLs -I${SOURCE_DIR}/openmp/libomptarget/deviceRTLs/nvptx/src -DOMPTARGET_NVPTX_DEBUG=0 -Xclang -target-cpu -Xclang sm_70 -D__CUDA_ARCH__=700 -Xclang -target-feature -Xclang +ptx42 -DCUDA_VERSION=8000 ${SOURCE_DIR}/openmp/libomptarget/deviceRTLs/common/src/loop.cu -o loop.cu-cuda_80-sm_70.bc
In file included from ${SOURCE_DIR}/openmp/libomptarget/deviceRTLs/common/src/loop.cu:16:
In file included from ${SOURCE_DIR}/openmp/libomptarget/deviceRTLs/common/omptarget.h:18:
In file included from ${SOURCE_DIR}/openmp/libomptarget/deviceRTLs/common/debug.h:31:
In file included from ${SOURCE_DIR}/openmp/libomptarget/deviceRTLs/common/device_environment.h:16:
In file included from ${SOURCE_DIR}/openmp/libomptarget/deviceRTLs/nvptx/src/target_impl.h:18:
${SYSTEM}/clang/11.0.0/bin/../include/c++/v1/stdlib.h:128:10: error: '__builtin_fabsl' requires 128 bit size 'long double' type support, but device 'nvptx64' does not support it
return __builtin_fabsl(__lcpp_x);
^
${SYSTEM}/clang/11.0.0/bin/../include/c++/v1/stdlib.h:128:10: note: '__builtin_fabsl' defined here
${SYSTEM}/clang/11.0.0/bin/../include/c++/v1/stdlib.h:128:10: error: '__builtin_fabsl' requires 128 bit size 'long double' type support, but device 'nvptx64' does not support it
return __builtin_fabsl(__lcpp_x);
^
${SYSTEM}/clang/11.0.0/bin/../include/c++/v1/stdlib.h:128:10: note: '__builtin_fabsl' defined here
${SYSTEM}/clang/11.0.0/bin/../include/c++/v1/stdlib.h:128:26: error: '__lcpp_x' requires 128 bit size 'long double' type support, but device 'nvptx64' does not support it
return __builtin_fabsl(__lcpp_x);
^
${SYSTEM}/clang/11.0.0/bin/../include/c++/v1/stdlib.h:127:17: note: '__lcpp_x' defined here
abs(long double __lcpp_x) _NOEXCEPT {
^
3 errors generated.
The text was updated successfully, but these errors were encountered: