Skip to content

Commit 95d28fe

Browse files
authoredMar 13, 2025··
[Premerge] Add flang-rt (#128678)
Flang's runtime can now be built using LLVM's LLVM_ENABLE_RUNTIMES mechanism, with the intent to remove the old mechanism in #124126. Update the pre-merge builders to use the new mechanism. In the current form, #124126 actually will add LLVM_ENABLE_RUNTIMES=flang-rt implicitly, so no change is strictly needed. I still think it is a good idea to do it explicitly and in advance. On Windows, flang-rt also requires compiler-rt, but which is not building on Windows anyway.
1 parent 786e70f commit 95d28fe

File tree

4 files changed

+31
-8
lines changed

4 files changed

+31
-8
lines changed
 

‎.ci/compute-projects.sh

+19-6
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,14 @@ function compute-projects-to-test() {
1818
shift
1919
projects=${@}
2020
for project in ${projects}; do
21-
echo "${project}"
2221
case ${project} in
2322
lld)
24-
for p in bolt cross-project-tests; do
23+
for p in lld bolt cross-project-tests; do
2524
echo $p
2625
done
2726
;;
2827
llvm)
29-
for p in bolt clang clang-tools-extra lld lldb mlir polly; do
28+
for p in llvm bolt clang clang-tools-extra lld lldb mlir polly; do
3029
echo $p
3130
done
3231
# Flang is not stable in Windows CI at the moment
@@ -36,21 +35,30 @@ function compute-projects-to-test() {
3635
;;
3736
clang)
3837
# lldb is temporarily removed to alleviate Linux pre-commit CI waiting times
39-
for p in clang-tools-extra compiler-rt cross-project-tests; do
38+
for p in clang clang-tools-extra compiler-rt cross-project-tests; do
4039
echo $p
4140
done
4241
;;
4342
clang-tools-extra)
44-
echo libc
43+
for p in clang-tools-extra libc; do
44+
echo $p
45+
done
4546
;;
4647
mlir)
48+
echo mlir
49+
# Flang is not stable in Windows CI at the moment
50+
if [[ $isForWindows == 0 ]]; then
51+
echo flang
52+
fi
53+
;;
54+
flang-rt)
4755
# Flang is not stable in Windows CI at the moment
4856
if [[ $isForWindows == 0 ]]; then
4957
echo flang
5058
fi
5159
;;
5260
*)
53-
# Nothing to do
61+
echo "${project}"
5462
;;
5563
esac
5664
done
@@ -65,6 +73,11 @@ function compute-runtimes-to-test() {
6573
echo $p
6674
done
6775
;;
76+
flang)
77+
for p in flang-rt; do
78+
echo $p
79+
done
80+
;;
6881
*)
6982
# Nothing to do
7083
;;

‎.ci/generate-buildkite-pipeline-premerge

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ fi
7373
# needs while letting them run on the infrastructure provided by LLVM.
7474

7575
# Figure out which projects need to be built on each platform
76-
all_projects="bolt clang clang-tools-extra compiler-rt cross-project-tests flang libc libclc lld lldb llvm mlir openmp polly pstl"
76+
all_projects="bolt clang clang-tools-extra compiler-rt cross-project-tests flang flang-rt libc libclc lld lldb llvm mlir openmp polly pstl"
7777
modified_projects="$(keep-modified-projects ${all_projects})"
7878

7979
linux_projects_to_test=$(exclude-linux $(compute-projects-to-test 0 ${modified_projects}))

‎.ci/monolithic-linux.sh

+10
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \
6565
-D CMAKE_CXX_FLAGS=-gmlt \
6666
-D LLVM_CCACHE_BUILD=ON \
6767
-D MLIR_ENABLE_BINDINGS_PYTHON=ON \
68+
-D FLANG_ENABLE_FLANG_RT=OFF \
6869
-D CMAKE_INSTALL_PREFIX="${INSTALL_DIR}"
6970

7071
echo "--- ninja"
@@ -95,6 +96,9 @@ if [[ "${runtimes}" != "" ]]; then
9596
cmake -S "${MONOREPO_ROOT}/runtimes" -B "${RUNTIMES_BUILD_DIR}" -GNinja \
9697
-D CMAKE_C_COMPILER="${INSTALL_DIR}/bin/clang" \
9798
-D CMAKE_CXX_COMPILER="${INSTALL_DIR}/bin/clang++" \
99+
-D CMAKE_Fortran_COMPILER="${BUILD_DIR}/bin/flang" \
100+
-D CMAKE_Fortran_COMPILER_WORKS=ON \
101+
-D LLVM_BINARY_DIR="${BUILD_DIR}" \
98102
-D LLVM_ENABLE_RUNTIMES="${runtimes}" \
99103
-D LIBCXX_CXX_ABI=libcxxabi \
100104
-D CMAKE_BUILD_TYPE=RelWithDebInfo \
@@ -113,6 +117,9 @@ if [[ "${runtimes}" != "" ]]; then
113117
cmake -S "${MONOREPO_ROOT}/runtimes" -B "${RUNTIMES_BUILD_DIR}" -GNinja \
114118
-D CMAKE_C_COMPILER="${INSTALL_DIR}/bin/clang" \
115119
-D CMAKE_CXX_COMPILER="${INSTALL_DIR}/bin/clang++" \
120+
-D CMAKE_Fortran_COMPILER="${BUILD_DIR}/bin/flang" \
121+
-D CMAKE_Fortran_COMPILER_WORKS=ON \
122+
-D LLVM_BINARY_DIR="${BUILD_DIR}" \
116123
-D LLVM_ENABLE_RUNTIMES="${runtimes}" \
117124
-D LIBCXX_CXX_ABI=libcxxabi \
118125
-D CMAKE_BUILD_TYPE=RelWithDebInfo \
@@ -131,6 +138,9 @@ if [[ "${runtimes}" != "" ]]; then
131138
cmake -S "${MONOREPO_ROOT}/runtimes" -B "${RUNTIMES_BUILD_DIR}" -GNinja \
132139
-D CMAKE_C_COMPILER="${INSTALL_DIR}/bin/clang" \
133140
-D CMAKE_CXX_COMPILER="${INSTALL_DIR}/bin/clang++" \
141+
-D CMAKE_Fortran_COMPILER="${BUILD_DIR}/bin/flang" \
142+
-D CMAKE_Fortran_COMPILER_WORKS=ON \
143+
-D LLVM_BINARY_DIR="${BUILD_DIR}" \
134144
-D LLVM_ENABLE_RUNTIMES="${runtimes}" \
135145
-D LIBCXX_CXX_ABI=libcxxabi \
136146
-D CMAKE_BUILD_TYPE=RelWithDebInfo \

‎flang-rt/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ $ ninja install
124124

125125
## Configuration Option Reference
126126

127-
Flang-RT has the followign configuration options. This is in
127+
Flang-RT has the following configuration options. This is in
128128
addition to the build options the LLVM_ENABLE_RUNTIMES mechanism and
129129
CMake itself provide.
130130

0 commit comments

Comments
 (0)
Please sign in to comment.