[Openmp-commits] [PATCH] D101509: An attempt to abandon omptarget out-of-tree builds.

Wei Wang via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Mon May 10 18:34:20 PDT 2021


weiwang added a comment.

In D101509#2749429 <https://reviews.llvm.org/D101509#2749429>, @vzakhari wrote:

> In D101509#2749382 <https://reviews.llvm.org/D101509#2749382>, @weiwang wrote:
>
>> We are getting build errors internally with this change. They are all related to libomptarget. Our internal build script uses gcc to build llvm.
>>
>> One example:
>>
>>   [108/122] Generating target_impl.gfx700.bc
>>   FAILED: projects/openmp/libomptarget/deviceRTLs/amdgcn/target_impl.gfx700.bc
>>   cd /data/users/wangwei/tp2/llvm-build/platform009/build_nopic/projects/openmp/libomptarget/deviceRTLs/amdgcn && /data/users/wangwei/tp2/llvm-build/platform009/build_nopic/bin/clang-13 -xc++ -c -std=c++14 -ffreestanding -target amdgcn-amd-amdhsa -emit-llvm -Xclang -aux-triple -Xclang x86_64-unknown-linux-gnu -fopenmp -fopenmp-cuda-mode -Xclang -fopenmp-is-device -D__AMDGCN__ -Xclang -target-cpu -Xclang gfx700 -fvisibility=default -Wno-unused-value -nogpulib -O2 -I/home/wangwei/local/llvm-project/openmp/libomptarget/deviceRTLs/amdgcn/src -I/home/wangwei/local/llvm-project/openmp/libomptarget/deviceRTLs/common/include -I/home/wangwei/local/llvm-project/openmp/libomptarget/deviceRTLs /home/wangwei/local/llvm-project/openmp/libomptarget/deviceRTLs/amdgcn/src/target_impl.hip -o target_impl.gfx700.bc
>>   /home/wangwei/local/llvm-project/openmp/libomptarget/deviceRTLs/amdgcn/src/target_impl.hip:185:25: error: use of undeclared identifier '__UINT64_C'
>>     lo = (uint32_t)(val & UINT64_C(0x00000000FFFFFFFF));
>>                           ^
>>   /home/wangwei/fbsource/fbcode/third-party2/gcc/9.x/centos7-native/3bed279/lib/gcc/x86_64-redhat-linux-gnu/9.x/include/stdint-gcc.h:254:21: note: expanded from macro 'UINT64_C'
>>   #define UINT64_C(c) __UINT64_C(c)
>>                       ^
>>   /home/wangwei/local/llvm-project/openmp/libomptarget/deviceRTLs/amdgcn/src/target_impl.hip:186:26: error: use of undeclared identifier '__UINT64_C'
>>     hi = (uint32_t)((val & UINT64_C(0xFFFFFFFF00000000)) >> 32);
>>                            ^
>>   /home/wangwei/fbsource/fbcode/third-party2/gcc/9.x/centos7-native/3bed279/lib/gcc/x86_64-redhat-linux-gnu/9.x/include/stdint-gcc.h:254:21: note: expanded from macro 'UINT64_C'
>>   #define UINT64_C(c) __UINT64_C(c)
>>                       ^
>>   2 errors generated.
>
> Hello @weiwang, thank you for reporting this.  Can you please provide some details how to reproduce it?
>
> One strange thing is that the pre-built `/data/users/wangwei/tp2/llvm-build/platform009/build_nopic/bin/clang-13` includes `stdint-gcc.h`, where it takes the definition for `UINT64_C`.  In my builds `clang` takes the definition from its own `lib/clang/13.0.0/include/stdint.h`.

Thanks for the quick response. It may not be easily reproducible since the build script that triggers this sets up its own environment. This is part of the company's internal build system. During my local try, clang built clang always works, but the build script uses gcc to build clang. Maybe gcc would insert its own library headers into search path, and this could cause some confusing about the order of include paths? But again, we have always used gcc to build clang, and it never had issue until now. I am not sure how this change would change anything.

> If you do not need `libomptarget` for your package, you may pass `-DOPENMP_ENABLE_LIBOMPTARGET=OFF` to cmake.

With `-DOPENMP_ENABLE_LIBOMPTARGET=OFF`, the error is gone. I'll check internally to see if libomptarget can be disabled. Meanwhile, it would still be great to know what went wrong.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D101509/new/

https://reviews.llvm.org/D101509



More information about the Openmp-commits mailing list