[Openmp-commits] [clang] [flang] [llvm] [openmp] [OpenMP] Remove LLVM_ENABLE_PROJECTS=openmp build mode (PR #152189)
Michael Kruse via Openmp-commits
openmp-commits at lists.llvm.org
Wed Aug 6 01:30:16 PDT 2025
https://github.com/Meinersbur updated https://github.com/llvm/llvm-project/pull/152189
>From d72ecacb4338043bb3689af86d10b2981d07f988 Mon Sep 17 00:00:00 2001
From: Michael Kruse <llvm-project at meinersbur.de>
Date: Tue, 5 Aug 2025 20:42:04 +0200
Subject: [PATCH 1/2] [openmp] Remove LLVM_ENABLE_PROJECTS=openmp build mode
---
.github/workflows/docs.yml | 4 ++--
flang-rt/README.md | 4 ++--
flang/tools/f18/CMakeLists.txt | 25 ++-----------------------
llvm/CMakeLists.txt | 18 ++++++++++--------
llvm/runtimes/CMakeLists.txt | 7 -------
openmp/docs/ReleaseNotes.rst | 1 +
6 files changed, 17 insertions(+), 42 deletions(-)
diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml
index 3970271e4adbd..315e1deb36bb5 100644
--- a/.github/workflows/docs.yml
+++ b/.github/workflows/docs.yml
@@ -186,10 +186,10 @@ jobs:
steps.docs-changed-subprojects.outputs.openmp_any_changed == 'true' ||
steps.docs-changed-subprojects.outputs.workflow_any_changed == 'true'
run: |
- cmake -B openmp-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS="clang;openmp" -DLLVM_ENABLE_SPHINX=ON ./llvm
+ cmake -B openmp-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_RUNTIMES="openmp" -DLLVM_ENABLE_SPHINX=ON ./runtimes
TZ=UTC ninja -C openmp-build docs-openmp-html
mkdir built-docs/openmp
- cp -r openmp-build/docs/* built-docs/openmp/
+ cp -r openmp-build/openmp/docs/* built-docs/openmp/
- name: Build Polly docs
if: |
steps.docs-changed-subprojects.outputs.polly_any_changed == 'true' ||
diff --git a/flang-rt/README.md b/flang-rt/README.md
index 4fe66a85a269c..eecb7b8cbfdfd 100644
--- a/flang-rt/README.md
+++ b/flang-rt/README.md
@@ -58,8 +58,8 @@ not provide all C-ABI functionality (such as Windows).
cmake -S <path-to-llvm-project-source>/llvm \
-GNinja \
-DCMAKE_BUILD_TYPE=Release \
- -DLLVM_ENABLE_PROJECTS="clang;flang;openmp" \
- -DLLVM_ENABLE_RUNTIMES="compiler-rt;flang-rt" \
+ -DLLVM_ENABLE_PROJECTS="clang;flang" \
+ -DLLVM_ENABLE_RUNTIMES="compiler-rt;flang-rt;openmp" \
...
```
diff --git a/flang/tools/f18/CMakeLists.txt b/flang/tools/f18/CMakeLists.txt
index 546b6acaaf91d..2b44ddd522a99 100644
--- a/flang/tools/f18/CMakeLists.txt
+++ b/flang/tools/f18/CMakeLists.txt
@@ -134,24 +134,7 @@ if (NOT CMAKE_CROSSCOMPILING)
# Special case for omp_lib.mod, because its source comes from openmp/runtime/src/include.
# It also produces two module files: omp_lib.mod and omp_lib_kinds.mod. Compile these
# files only if OpenMP support has been configured.
- if (LLVM_TOOL_OPENMP_BUILD)
- message(STATUS "OpenMP runtime support enabled via LLVM_ENABLE_PROJECTS, building omp_lib.mod")
- set(base ${FLANG_INTRINSIC_MODULES_DIR}/omp_lib)
- add_custom_command(OUTPUT ${base}.mod ${base}_kinds.mod
- COMMAND ${CMAKE_COMMAND} -E make_directory ${FLANG_INTRINSIC_MODULES_DIR}
- COMMAND flang -cpp -fsyntax-only ${opts} -module-dir ${FLANG_INTRINSIC_MODULES_DIR}
- ${CMAKE_BINARY_DIR}/projects/openmp/runtime/src/omp_lib.F90
- DEPENDS flang ${FLANG_INTRINSIC_MODULES_DIR}/iso_c_binding.mod ${CMAKE_BINARY_DIR}/projects/openmp/runtime/src/omp_lib.F90 ${depends}
- )
- add_custom_command(OUTPUT ${base}.f18.mod
- DEPENDS ${base}.mod
- COMMAND ${CMAKE_COMMAND} -E copy ${base}.mod ${base}.f18.mod)
- add_custom_command(OUTPUT ${base}_kinds.f18.mod
- DEPENDS ${base}.mod
- COMMAND ${CMAKE_COMMAND} -E copy ${base}_kinds.mod ${base}_kinds.f18.mod)
- list(APPEND MODULE_FILES ${base}.mod ${base}.f18.mod ${base}_kinds.mod ${base}_kinds.f18.mod)
- install(FILES ${base}.mod ${base}.f18.mod ${base}_kinds.mod ${base}_kinds.f18.mod DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/flang" COMPONENT flang-module-interfaces)
- elseif ("openmp" IN_LIST LLVM_ENABLE_RUNTIMES)
+ if ("openmp" IN_LIST LLVM_ENABLE_RUNTIMES)
message(STATUS "OpenMP runtime support enabled via LLVM_ENABLE_RUNTIMES, assuming omp_lib.mod is built there")
else()
message(WARNING "Not building omp_lib.mod, no OpenMP runtime in either LLVM_ENABLE_PROJECTS or LLVM_ENABLE_RUNTIMES")
@@ -165,11 +148,7 @@ set_target_properties(module_files PROPERTIES FOLDER "Flang/Resources")
# TODO Move this to a more suitable location
# Copy the generated omp_lib.h header file, if OpenMP support has been configured.
-if (LLVM_TOOL_OPENMP_BUILD)
- message(STATUS "OpenMP runtime support enabled via LLVM_ENABLE_PROJECTS, building omp_lib.h")
- file(COPY ${CMAKE_BINARY_DIR}/projects/openmp/runtime/src/omp_lib.h DESTINATION "${CMAKE_BINARY_DIR}/include/flang/OpenMP/" FILE_PERMISSIONS OWNER_READ OWNER_WRITE)
- install(FILES ${CMAKE_BINARY_DIR}/include/flang/OpenMP/omp_lib.h DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/flang/OpenMP")
-elseif ("openmp" IN_LIST LLVM_ENABLE_RUNTIMES)
+if ("openmp" IN_LIST LLVM_ENABLE_RUNTIMES)
message(STATUS "OpenMP runtime support enabled via LLVM_ENABLE_RUNTIMES, assuming omp_lib.h is built there")
else()
message(STATUS "Not copying omp_lib.h, no OpenMP runtime in either LLVM_ENABLE_PROJECTS or LLVM_ENABLE_RUNTIMES")
diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt
index 4c70b98a32f92..0b72a8eeda3c5 100644
--- a/llvm/CMakeLists.txt
+++ b/llvm/CMakeLists.txt
@@ -109,7 +109,7 @@ endif()
# This allows an easy way of setting up a build directory for llvm and another
# one for llvm+clang+... using the same sources.
# These projects will be included when "all" is included in LLVM_ENABLE_PROJECTS.
-set(LLVM_ALL_PROJECTS "bolt;clang;clang-tools-extra;compiler-rt;cross-project-tests;libclc;lld;lldb;mlir;openmp;polly")
+set(LLVM_ALL_PROJECTS "bolt;clang;clang-tools-extra;compiler-rt;cross-project-tests;libclc;lld;lldb;mlir;polly")
if (${CMAKE_SYSTEM_NAME} MATCHES "AIX")
# Disallow 'openmp' as a LLVM PROJECT on AIX as the supported way is to use
# LLVM_ENABLE_RUNTIMES.
@@ -138,6 +138,15 @@ if(NOT "${FOUND_INDEX}" STREQUAL "-1")
list(REMOVE_ITEM LLVM_ENABLE_PROJECTS "pstl")
endif()
+if ("openmp" IN_LIST LLVM_ENABLE_PROJECTS)
+ message(FATAL_ERROR "
+Support for the LLVM_ENABLE_PROJECTS=openmp build mode has been removed. Switch to the bootstrapping build
+ cmake -S <llvm-project>/llvm -B build -DLLVM_ENABLE_PROJECTS=clang -DLLVM_ENABLE_RUNTIMES=openmp
+or to the runtimes default build
+ cmake -S <llvm-project>/runtimes -B build -DLLVM_ENABLE_RUNTIMES=openmp
+")
+endif()
+
foreach(proj ${LLVM_ENABLE_PROJECTS})
if (NOT proj STREQUAL "llvm" AND NOT "${proj}" IN_LIST LLVM_KNOWN_PROJECTS)
MESSAGE(FATAL_ERROR "${proj} isn't a known project: ${LLVM_KNOWN_PROJECTS}. Did you mean to enable it as a runtime in LLVM_ENABLE_RUNTIMES?")
@@ -206,13 +215,6 @@ if ("offload" IN_LIST LLVM_ENABLE_PROJECTS)
"https://openmp.llvm.org/ for building the runtimes.")
endif()
-if ("openmp" IN_LIST LLVM_ENABLE_PROJECTS)
- message(WARNING "Using LLVM_ENABLE_PROJECTS=openmp is deprecated now, and will "
- "become a fatal error in the LLVM 21 release. Please use "
- "-DLLVM_ENABLE_RUNTIMES=openmp or see the instructions at "
- "https://openmp.llvm.org/ for building the runtimes.")
-endif()
-
if ("flang-rt" IN_LIST LLVM_ENABLE_RUNTIMES)
if (NOT "flang" IN_LIST LLVM_ENABLE_PROJECTS)
message(FATAL_ERROR "Flang is not enabled, but is required for the Flang-RT runtime")
diff --git a/llvm/runtimes/CMakeLists.txt b/llvm/runtimes/CMakeLists.txt
index 94a43b96d2188..0721be59aed83 100644
--- a/llvm/runtimes/CMakeLists.txt
+++ b/llvm/runtimes/CMakeLists.txt
@@ -640,13 +640,6 @@ if(build_runtimes)
# We need to add the runtimes as a dependency because compiler-rt can be
# built as part of runtimes and we need the profile runtime for PGO
add_dependencies(clang-bootstrap-deps runtimes)
- # The bootstrap build will attempt to configure the offload runtime
- # before the openmp project which will error out due to failing to
- # find libomp.so. We must add omp as a dependency before runtimes
- # are configured.
- if("openmp" IN_LIST LLVM_ENABLE_PROJECTS AND "offload" IN_LIST LLVM_ENABLE_RUNTIMES)
- add_dependencies(clang-bootstrap-deps omp)
- endif()
endif()
if(LLVM_INCLUDE_TESTS)
diff --git a/openmp/docs/ReleaseNotes.rst b/openmp/docs/ReleaseNotes.rst
index 6c1a46caf1d81..b99947540acd7 100644
--- a/openmp/docs/ReleaseNotes.rst
+++ b/openmp/docs/ReleaseNotes.rst
@@ -27,3 +27,4 @@ Device Runtime
always build support for AMDGPU and NVPTX targets.
- Updated the offloading entry format but retained backwards compatibility with
the old format.
+- The LLVM_ENABLE_PROJECTS=openmp build mode has been removed.
\ No newline at end of file
>From 859064d7d88567e0e8edf52c65095eab185845ab Mon Sep 17 00:00:00 2001
From: Michael Kruse <llvm-project at meinersbur.de>
Date: Wed, 6 Aug 2025 09:49:33 +0200
Subject: [PATCH 2/2] Remove 2 remaining uses
---
clang/utils/analyzer/entrypoint.py | 2 +-
llvm/CMakeLists.txt | 2 +-
llvm/utils/release/build_llvm_release.bat | 3 ++-
3 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/clang/utils/analyzer/entrypoint.py b/clang/utils/analyzer/entrypoint.py
index c8dfc1a9f2ed8..ef8f20c7f0b01 100644
--- a/clang/utils/analyzer/entrypoint.py
+++ b/clang/utils/analyzer/entrypoint.py
@@ -53,7 +53,7 @@ def is_cmake_needed():
CMAKE_COMMAND = (
"cmake -G Ninja -DCMAKE_BUILD_TYPE=Release "
"-DCMAKE_INSTALL_PREFIX=/analyzer -DLLVM_TARGETS_TO_BUILD=X86 "
- '-DLLVM_ENABLE_PROJECTS="clang;openmp" -DLLVM_BUILD_RUNTIME=OFF '
+ '-DLLVM_ENABLE_PROJECTS="clang" -DLLVM_BUILD_RUNTIME=OFF '
"-DCLANG_ENABLE_STATIC_ANALYZER=ON"
)
diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt
index 0b72a8eeda3c5..62b6e89014f48 100644
--- a/llvm/CMakeLists.txt
+++ b/llvm/CMakeLists.txt
@@ -140,7 +140,7 @@ endif()
if ("openmp" IN_LIST LLVM_ENABLE_PROJECTS)
message(FATAL_ERROR "
-Support for the LLVM_ENABLE_PROJECTS=openmp build mode has been removed. Switch to the bootstrapping build
+Support for the LLVM_ENABLE_PROJECTS=openmp build mode has been removed. Please switch to the bootstrapping build
cmake -S <llvm-project>/llvm -B build -DLLVM_ENABLE_PROJECTS=clang -DLLVM_ENABLE_RUNTIMES=openmp
or to the runtimes default build
cmake -S <llvm-project>/runtimes -B build -DLLVM_ENABLE_RUNTIMES=openmp
diff --git a/llvm/utils/release/build_llvm_release.bat b/llvm/utils/release/build_llvm_release.bat
index 3042fc2d77dd1..af6e6ed83eb14 100755
--- a/llvm/utils/release/build_llvm_release.bat
+++ b/llvm/utils/release/build_llvm_release.bat
@@ -165,7 +165,8 @@ set common_cmake_flags=^
-DCMAKE_C_FLAGS="%common_compiler_flags%" ^
-DCMAKE_CXX_FLAGS="%common_compiler_flags%" ^
-DLLVM_ENABLE_RPMALLOC=ON ^
- -DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra;lld;compiler-rt;lldb;openmp"
+ -DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra;lld;compiler-rt;lldb" ^
+ -DLLVM_ENABLE_RUNTIMES="openmp"
if "%force-msvc%" == "" (
where /q clang-cl
More information about the Openmp-commits
mailing list