Skip to content

[OpenMP] Remove standalone build mode #149878

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

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

Conversation

Meinersbur
Copy link
Member

@Meinersbur Meinersbur commented Jul 21, 2025

Remove all the CMake code for openmp standalone builds. Standalone builds have been superseded by runtimes default build. The runtimes default build can be thought of a standalone build with the standalone boilerplate contained in /runtimes/CMakeLists.txt. There is no need for each runtime to contain the same boilerplate code again.

Builds still using the standalone build via

cmake -S <llvm-project>/openmp ...

can switch over to the runtimes default build using

cmake -S <llvm-project>/runtimes -DLLVM_ENABLE_RUNTIMES=openmp ...

Options that were valid for the standalone build are also valid for default runtimes build, unless handled in explicit if (OPENMP_STANDALONE_BUILD) regions.

The existence of both, standalone builds and runtime default builds, easily leads to confusion such as fixed in #149871. A non-standalone builds does not mean that it is built as part of a bootstrapping-build of LLVM inside the runtimes/runtimes-bins directory, nor does it mean that the compiler it necessarily Clang. Some of the remaining code may have been written with that assumption. However, the purpose of this patch is to only remove the standalone build functionality.

@Meinersbur Meinersbur marked this pull request as ready for review July 22, 2025 15:40
@llvmbot llvmbot added openmp:libomp OpenMP host runtime openmp:libomptarget OpenMP offload runtime labels Jul 22, 2025
@jhuber6
Copy link
Contributor

jhuber6 commented Jul 25, 2025

Doesn't the HIP build still do this? @estewart08

@Meinersbur Meinersbur requested a review from paperchalice July 25, 2025 14:23
@jprotze
Copy link
Collaborator

jprotze commented Jul 25, 2025

It is definitely not the same!
For standalone build, I used to not needing the llvm-project tree. I could build libomp by just downloading the OpenMP release tarball: https://github.com/llvm/llvm-project/releases/download/llvmorg-21.1.0-rc1/openmp-21.1.0-rc1.src.tar.xz

I just realized that this workflow got bricked by #62240

@Meinersbur Meinersbur marked this pull request as draft July 25, 2025 23:32
@Meinersbur
Copy link
Member Author

Meinersbur commented Jul 25, 2025

It is definitely not the same! For standalone build, I used to not needing the llvm-project tree.

This is intended to work with the default runtimes build as well. If it does not work, I will fix it.

Having just one standalone build mode will make it easier to not regress build modes.

I just realized that this workflow got bricked by #62240

It's more than 2 years old?!?

@jprotze
Copy link
Collaborator

jprotze commented Jul 26, 2025

Can we at least document this change in an easily accessible way?
When configuring cmake -S <llvm-project>/openmp ..., cmake should generate a clear message describing the intended way of standalone builds and abort.

@jprotze
Copy link
Collaborator

jprotze commented Jul 26, 2025

The https://github.com/llvm/llvm-project/blob/main/openmp/README.rst also will need major updates. It also doesn't mention that other code than the OpenMP tarball is necessary.

@jprotze
Copy link
Collaborator

jprotze commented Jul 26, 2025

I just realized that this workflow got bricked by #62240

It's more than 2 years old?!?

Myself, I usually build from an llvm-project clone. For using libomp+archer with system-gcc, I usually recommend just downloading the OpenMP tarball. This happens only from time to time. This week, we found that it is broken with latest releases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
openmp:libomp OpenMP host runtime openmp:libomptarget OpenMP offload runtime
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants