[Openmp-commits] [PATCH] D123177: [libomptarget] Add device RTL to regression test dependencies.

Joseph Huber via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Sun Jul 3 15:23:28 PDT 2022


jhuber6 added a comment.

In D123177#3627155 <https://reviews.llvm.org/D123177#3627155>, @dim wrote:

> In D123177#3443809 <https://reviews.llvm.org/D123177#3443809>, @brooks wrote:
>
>> This fails to configure in cmake when enabled as a project.
>>
>>   $ cmake ../llvm -DLLVM_ENABLE_PROJECTS='llvm;clang;lld;openmp'
>>   ...
>>   -- Configuring done
>>   CMake Error at /home/bed22/git/llvm-project/openmp/libomptarget/plugins/amdgpu/CMakeLists.txt:74 (add_dependencies):
>>     The dependency target "omptarget.devicertl.amdgpu" of target
>>     "omptarget.rtl.amdgpu" does not exist.
>>   
>>   
>>   -- Generating done
>>   CMake Generate step failed.  Build files cannot be regenerated correctly.
>>
>> Reverting this commit allows cmake to succeed. The linkage fix in rG2e0cb61570ec <https://reviews.llvm.org/rG2e0cb61570eceff04a18fbcbeb0014ece2b56438> does not fix this issue.
>
> Yes, I just ran into the same issue doing a build of recent llvm with openmp enabled on FreeBSD. The issue is related to a recent change in DeviceRTL, e.g. `openmp/libomptarget/DeviceRTL/CMakeLists.txt` has a block:
>
>   # TODO: This part needs to be refined when libomptarget is going to support
>   # Windows!
>   # TODO: This part can also be removed if we can change the clang driver to make
>   # it support device only compilation.
>   if(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "x86_64")
>     set(aux_triple x86_64-unknown-linux-gnu)
>   elseif(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "ppc64le")
>     set(aux_triple powerpc64le-unknown-linux-gnu)
>   elseif(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "aarch64")
>     set(aux_triple aarch64-unknown-linux-gnu)
>   else()
>     libomptarget_say("Not building DeviceRTL: unknown host arch: ${CMAKE_HOST_SYSTEM_PROCESSOR}")
>     return()
>   endif()
>
> On FreeBSD, `x86_64` is named `amd64` so the CMake configuration stage gives:
>
>   ...
>   -- LIBOMPTARGET: Building DeviceRTL. Using clang from in-tree build
>   -- LIBOMPTARGET: Not building DeviceRTL: unknown host arch: amd64
>
> Apparently the part in this review that adds the `omptarget.devicertl.amdgpu` dependency does not account for this dependency not being available at all?

Does changing it from `x86_64`  to `amd64` resolve the issue on your machine? Easiest solution is probably to check for both. We only need to do this for the bitcode target because it requires calling the clang front-end directly. The clang driver knows the native triple, it's possible we could just parse it out of `clang -v` if nothing else.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D123177



More information about the Openmp-commits mailing list