Skip to content

[OpenMP] Fix LLVM_ENABLE_PROJECTS=openmp build #151117

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

Merged
merged 1 commit into from
Aug 5, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions openmp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ endif()
include(GNUInstallDirs)

if (OPENMP_STANDALONE_BUILD)
set(LLVM_TREE_AVAILABLE False)

# CMAKE_BUILD_TYPE was not set, default to Release.
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
Expand Down Expand Up @@ -48,6 +50,15 @@ if (OPENMP_STANDALONE_BUILD)
set(CMAKE_CXX_STANDARD_REQUIRED NO)
set(CMAKE_CXX_EXTENSIONS NO)
else()
# Usually <llvm-project>/runtimes/CMakeLists.txt sets LLVM_TREE_AVAILABLE and
# we assume it is not available otherwise. The exception is that we are in an
# LLVM_ENABLE_PROJECTS=openmp build, the LLVM tree is actually available.
# Note that this build mode has been deprecated.
# See https://github.com/llvm/llvm-project/issues/124014
if (NOT LLVM_RUNTIMES_BUILD AND "openmp" IN_LIST LLVM_ENABLE_PROJECTS)
set(LLVM_TREE_AVAILABLE True)
endif ()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not an expert in build infrastructure of OpenMP in LLVM, but if we say the mode is deprecated, then why should we continue making changes in the code and keep supporting it? Let's update the documents and fully deprecate LLVM_ENABLE_PROJECTS=openmp?

Copy link
Member Author

@Meinersbur Meinersbur Jul 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deprecation is just a notice that it is going to be removed to encourage users to move away from it. Until it really is removed, is should still work (or why would one keep non-working code around?).


set(OPENMP_ENABLE_WERROR ${LLVM_ENABLE_WERROR})

# When building in tree we install the runtime according to the LLVM settings.
Expand Down
Loading