Skip to content

[OpenMP] Fix runtimes default build #149871

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Meinersbur
Copy link
Member

@Meinersbur Meinersbur commented Jul 21, 2025

The default build of openmp (cmake -S <llvm-project>/runtimes -DLLVM_ENABLE_RUNTIMES=openmp) current fails with

CMake Error at /home/meinersbur/src/llvm/flangrt/_src/cmake/Modules/GetClangResourceDir.cmake:17 (string):
  string sub-command REGEX, mode MATCH needs at least 5 arguments total to
  command.
Call Stack (most recent call first):
  /home/meinersbur/src/llvm/flangrt/_src/openmp/CMakeLists.txt:126 (get_clang_resource_dir)

The reason is that because it is not a bootstrapping-build, the clang resource dir that it intends to write files such as omp-tools.h into, is unavailable. Using the Clang resource dir for writing files is conceptually broken, as that dir might be located in /usr/lib/clang/<version>/. Writing to it is only intended in bootstrapping builds where Clang is built alongside openmp.

This patch unifies the identification of being in a bootstrapping built. The same LLVM_TREE_AVAILABLE definition is going to be used in #137828. No reason for each runtime to define its own.

@Meinersbur Meinersbur changed the title [OpenMP] Fix default build [OpenMP] Fix runtimes default build Jul 21, 2025
@Meinersbur Meinersbur marked this pull request as ready for review July 21, 2025 23:24
@Meinersbur Meinersbur requested a review from a team as a code owner July 21, 2025 23:24
@llvmbot llvmbot added cmake Build system in general and CMake in particular openmp:libomp OpenMP host runtime openmp:libomptarget OpenMP offload runtime labels Jul 21, 2025
@Meinersbur Meinersbur requested a review from hahnjo July 22, 2025 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cmake Build system in general and CMake in particular openmp:libomp OpenMP host runtime openmp:libomptarget OpenMP offload runtime
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants