Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c15853e

Browse files
authored
[OpenMP] Remove LLVM_ENABLE_PROJECTS=openmp build mode (#176950)
Reapply #152189 and #174963 which were reverted because it broke publish-sphinx-docs and publish-doxygen-docs. The build mode has been deprecated in #136314 and was supposed to be removed in the LLVM 21 release (#136314). OpenMP currently supports 4 build modes: * `cmake <llvm-project>/llvm -DLLVM_ENABLE_PROJECTS=openmp` * `cmake <llvm-project>/llvm -DLLVM_ENABLE_RUNTIMES=openmp` (bootstrapping build) * `cmake <llvm-project>/openmp` (standalone build) * `cmake <llvm-project>/runtimes -DLLVM_ENABLE_RUNTIMES=openmp` (runtimes default/standalone build) Each build mode increased the maintanance overhead since all build modes must continue working and user confusion when there do not (see #151117, #174126, #154117, ...). Let's finally remove it.
1 parent 95ac931 commit c15853e

7 files changed

Lines changed: 19 additions & 43 deletions

File tree

.github/workflows/docs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,10 +186,10 @@ jobs:
186186
steps.docs-changed-subprojects.outputs.openmp_any_changed == 'true' ||
187187
steps.docs-changed-subprojects.outputs.workflow_any_changed == 'true'
188188
run: |
189-
cmake -B openmp-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS="clang;openmp" -DLLVM_ENABLE_SPHINX=ON ./llvm
189+
cmake -B openmp-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_RUNTIMES="openmp" -DLLVM_ENABLE_SPHINX=ON -DLLVM_INCLUDE_TESTS=OFF ./runtimes
190190
TZ=UTC ninja -C openmp-build docs-openmp-html
191191
mkdir built-docs/openmp
192-
cp -r openmp-build/docs/* built-docs/openmp/
192+
cp -r openmp-build/openmp/docs/* built-docs/openmp/
193193
- name: Build Polly docs
194194
if: |
195195
steps.docs-changed-subprojects.outputs.polly_any_changed == 'true' ||

clang/utils/analyzer/entrypoint.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ def is_cmake_needed():
5353
CMAKE_COMMAND = (
5454
"cmake -G Ninja -DCMAKE_BUILD_TYPE=Release "
5555
"-DCMAKE_INSTALL_PREFIX=/analyzer -DLLVM_TARGETS_TO_BUILD=X86 "
56-
'-DLLVM_ENABLE_PROJECTS="clang;openmp" -DLLVM_BUILD_RUNTIME=OFF '
57-
"-DCLANG_ENABLE_STATIC_ANALYZER=ON"
56+
'-DLLVM_ENABLE_PROJECTS="clang" -DLLVM_ENABLE_RUNTIMES="openmp" '
57+
"-DLLVM_BUILD_RUNTIME=OFF -DCLANG_ENABLE_STATIC_ANALYZER=ON"
5858
)
5959

6060

flang-rt/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ not provide all C-ABI functionality (such as Windows).
5858
cmake -S <path-to-llvm-project-source>/llvm \
5959
-GNinja \
6060
-DCMAKE_BUILD_TYPE=Release \
61-
-DLLVM_ENABLE_PROJECTS="clang;flang;openmp" \
62-
-DLLVM_ENABLE_RUNTIMES="compiler-rt;flang-rt" \
61+
-DLLVM_ENABLE_PROJECTS="clang;flang" \
62+
-DLLVM_ENABLE_RUNTIMES="compiler-rt;flang-rt;openmp" \
6363
...
6464
```
6565

flang/tools/f18/CMakeLists.txt

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -135,18 +135,7 @@ if (NOT CMAKE_CROSSCOMPILING)
135135
# Special case for omp_lib.mod, because its source comes from openmp/runtime/src/include.
136136
# It also produces two module files: omp_lib.mod and omp_lib_kinds.mod. Compile these
137137
# files only if OpenMP support has been configured.
138-
if (LLVM_TOOL_OPENMP_BUILD)
139-
message(STATUS "OpenMP runtime support enabled via LLVM_ENABLE_PROJECTS, building omp_lib.mod")
140-
set(base ${FLANG_INTRINSIC_MODULES_DIR}/omp_lib)
141-
add_custom_command(OUTPUT ${base}.mod ${base}_kinds.mod
142-
COMMAND ${CMAKE_COMMAND} -E make_directory ${FLANG_INTRINSIC_MODULES_DIR}
143-
COMMAND flang -cpp -fsyntax-only ${opts} -module-dir ${FLANG_INTRINSIC_MODULES_DIR}
144-
${CMAKE_BINARY_DIR}/projects/openmp/runtime/src/omp_lib.F90
145-
DEPENDS flang ${FLANG_INTRINSIC_MODULES_DIR}/iso_c_binding.mod ${CMAKE_BINARY_DIR}/projects/openmp/runtime/src/omp_lib.F90 ${depends}
146-
)
147-
list(APPEND MODULE_FILES ${base}.mod ${base}_kinds.mod)
148-
install(FILES ${base}.mod ${base}_kinds.mod DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/flang" COMPONENT flang-module-interfaces)
149-
elseif ("openmp" IN_LIST LLVM_ENABLE_RUNTIMES)
138+
if ("openmp" IN_LIST LLVM_ENABLE_RUNTIMES)
150139
message(STATUS "OpenMP runtime support enabled via LLVM_ENABLE_RUNTIMES, assuming omp_lib.mod is built there")
151140
else()
152141
message(WARNING "Not building omp_lib.mod, no OpenMP runtime in either LLVM_ENABLE_PROJECTS or LLVM_ENABLE_RUNTIMES")
@@ -160,11 +149,7 @@ set_target_properties(module_files PROPERTIES FOLDER "Flang/Resources")
160149

161150
# TODO Move this to a more suitable location
162151
# Copy the generated omp_lib.h header file, if OpenMP support has been configured.
163-
if (LLVM_TOOL_OPENMP_BUILD)
164-
message(STATUS "OpenMP runtime support enabled via LLVM_ENABLE_PROJECTS, building omp_lib.h")
165-
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)
166-
install(FILES ${CMAKE_BINARY_DIR}/include/flang/OpenMP/omp_lib.h DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/flang/OpenMP")
167-
elseif ("openmp" IN_LIST LLVM_ENABLE_RUNTIMES)
152+
if ("openmp" IN_LIST LLVM_ENABLE_RUNTIMES)
168153
message(STATUS "OpenMP runtime support enabled via LLVM_ENABLE_RUNTIMES, assuming omp_lib.h is built there")
169154
else()
170155
message(STATUS "Not copying omp_lib.h, no OpenMP runtime in either LLVM_ENABLE_PROJECTS or LLVM_ENABLE_RUNTIMES")

llvm/CMakeLists.txt

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,7 @@ endif()
104104
# This allows an easy way of setting up a build directory for llvm and another
105105
# one for llvm+clang+... using the same sources.
106106
# These projects will be included when "all" is included in LLVM_ENABLE_PROJECTS.
107-
set(LLVM_ALL_PROJECTS "bolt;clang;clang-tools-extra;compiler-rt;cross-project-tests;libclc;lld;lldb;mlir;openmp;polly")
108-
if ("${CMAKE_SYSTEM_NAME}" MATCHES "AIX")
109-
# Disallow 'openmp' as a LLVM PROJECT on AIX as the supported way is to use
110-
# LLVM_ENABLE_RUNTIMES.
111-
list(REMOVE_ITEM LLVM_ALL_PROJECTS openmp)
112-
endif()
107+
set(LLVM_ALL_PROJECTS "bolt;clang;clang-tools-extra;compiler-rt;cross-project-tests;libclc;lld;lldb;mlir;polly")
113108

114109
# The "libc" project, which is not part of "all" projects, could be included in
115110
# LLVM_ENABLE_PROJECTS. It is preferred to include "libc" in
@@ -126,6 +121,15 @@ if( LLVM_ENABLE_PROJECTS STREQUAL "all" )
126121
set( LLVM_ENABLE_PROJECTS ${LLVM_ALL_PROJECTS})
127122
endif()
128123

124+
if ("openmp" IN_LIST LLVM_ENABLE_PROJECTS)
125+
message(FATAL_ERROR "
126+
Support for the LLVM_ENABLE_PROJECTS=openmp build mode has been removed. Please switch to the bootstrapping build
127+
cmake -S <llvm-project>/llvm -B build -DLLVM_ENABLE_PROJECTS=clang -DLLVM_ENABLE_RUNTIMES=openmp
128+
or to the runtimes default build
129+
cmake -S <llvm-project>/runtimes -B build -DLLVM_ENABLE_RUNTIMES=openmp
130+
")
131+
endif()
132+
129133
foreach(proj ${LLVM_ENABLE_PROJECTS})
130134
if (NOT proj STREQUAL "llvm" AND NOT "${proj}" IN_LIST LLVM_KNOWN_PROJECTS)
131135
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?")
@@ -195,13 +199,6 @@ if ("offload" IN_LIST LLVM_ENABLE_PROJECTS)
195199
"https://openmp.llvm.org/ for building the runtimes.")
196200
endif()
197201

198-
if ("openmp" IN_LIST LLVM_ENABLE_PROJECTS)
199-
message(WARNING "Using LLVM_ENABLE_PROJECTS=openmp is deprecated now, and will "
200-
"become a fatal error in a future release. Please use "
201-
"-DLLVM_ENABLE_RUNTIMES=openmp or see the instructions at "
202-
"https://openmp.llvm.org/ for building the runtimes.")
203-
endif()
204-
205202
if ("flang-rt" IN_LIST LLVM_ENABLE_RUNTIMES)
206203
if (NOT "flang" IN_LIST LLVM_ENABLE_PROJECTS)
207204
message(FATAL_ERROR "Flang is not enabled, but is required for the Flang-RT runtime")

llvm/runtimes/CMakeLists.txt

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -700,13 +700,6 @@ if(build_runtimes)
700700
# We need to add the runtimes as a dependency because compiler-rt can be
701701
# built as part of runtimes and we need the profile runtime for PGO
702702
add_dependencies(clang-bootstrap-deps runtimes)
703-
# The bootstrap build will attempt to configure the offload runtime
704-
# before the openmp project which will error out due to failing to
705-
# find libomp.so. We must add omp as a dependency before runtimes
706-
# are configured.
707-
if("openmp" IN_LIST LLVM_ENABLE_PROJECTS AND "offload" IN_LIST LLVM_ENABLE_RUNTIMES)
708-
add_dependencies(clang-bootstrap-deps omp)
709-
endif()
710703
endif()
711704

712705
if(LLVM_INCLUDE_TESTS)

openmp/docs/ReleaseNotes.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,4 @@ Device Runtime
2727
always build support for AMDGPU and NVPTX targets.
2828
- Updated the offloading entry format but retained backwards compatibility with
2929
the old format.
30+
- The LLVM_ENABLE_PROJECTS=openmp build mode has been removed.

0 commit comments

Comments
 (0)