[PATCH] D101265: [OpenMP][CMake] Use in-project clang as CUDA->IR compiler.

Shilei Tian via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 25 18:59:10 PDT 2021


tianshilei1992 added a comment.

In D101265#2715749 <https://reviews.llvm.org/D101265#2715749>, @Meinersbur wrote:

> In D101265#2715714 <https://reviews.llvm.org/D101265#2715714>, @tianshilei1992 wrote:
>
>> If OpenMP is built via `LLVM_ENABLE_PROJECTS`, it is *intentional* to build OpenMP w/o using the clang in recent build.
>
> Is this documented somewhere?

You could refer to https://llvm.org/docs/CMake.html for `LLVM_ENABLE_PROJECTS` and https://llvm.org/docs/BuildingADistribution.html for `LLVM_ENABLE_RUNTIMES`.

> Would you require the buildbot to do a stage1 build first for a LLVM_ENABLE_PROJECTS=openmp build?

It depends. If you want offloading feature, then it requires. If you don't want that, it doesn't. I suppose you are building LLVM with GCC. If you're building LLVM with LLVM, offloading support will also be enabled. The idea here is, the OpenMP is built using the same compiler to build LLVM. Basically the OpenMP project will be built in a same way as others. For example, for `LLVM_ENABLE_PROJECTS=clang`, we don't expect to build clang with the "recent built" clang, right? If you need it to be built with the recent build Clang, then `LLVM_ENABLE_RUNTIMES` is for that purpose.

> I don't see a reason for a stage1 build given that using the in-project clang is as simple. OPENMP_TEST_C_COMPILER/OPENMP_TEST_CXX_COMPILER  uses it as well by default.

Why not go with `LLVM_ENABLE_RUNTIMES`? It will build everything needed "all at once" (internally it is not. It first builds all parts except projects in `LLVM_ENABLE_RUNTIMES`, and then automatically invokes CMake configuration of those projects, set corresponding environment variables, and starts the build).

However, another potential direction can be, if we find OpenMP is in `LLVM_ENABLE_PROJECTS`, we "move" it to `LLVM_ENABLE_RUNTIMES`. This could arguably make more sense.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D101265



More information about the llvm-commits mailing list