Skip to content

Commit c6fefe8

Browse files
MeinersburGeorgeARM
authored andcommitted
Reapply "[Flang] Remove FLANG_INCLUDE_RUNTIME (llvm#124126)"
This reverts commit 27539c3. Retry with new buildbot configuration after master restart. Original message: Remove the FLANG_INCLUDE_RUNTIME option which was replaced by LLVM_ENABLE_RUNTIMES=flang-rt. The FLANG_INCLUDE_RUNTIME option was added in llvm#122336 which disables the non-runtimes build instructions for the Flang runtime so they do not conflict with the LLVM_ENABLE_RUNTIMES=flang-rt option added in llvm#110217. In order to not maintain multiple build instructions for the same thing, this PR completely removes the old build instructions (effectively forcing FLANG_INCLUDE_RUNTIME=OFF). As per discussion in https://discourse.llvm.org/t/buildbot-changes-with-llvm-enable-runtimes-flang-rt/83571/2 we now implicitly add LLVM_ENABLE_RUNTIMES=flang-rt whenever Flang is compiled in a bootstrapping (non-standalone) build. Because it is possible to build Flang-RT separately, this behavior can be disabled using `-DFLANG_ENABLE_FLANG_RT=OFF`. Also see the discussion an implicitly adding runtimes/projects in llvm#123964.
1 parent c6c8b74 commit c6fefe8

File tree

17 files changed

+19
-902
lines changed

17 files changed

+19
-902
lines changed

flang-rt/README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,12 @@ can be any compiler supporting the same ABI.
9191
In addition to the compiler, the build must be able to find LLVM development
9292
tools such as `lit` and `FileCheck` that are not found in an LLVM's install
9393
directory. Use `CMAKE_BINARY_DIR` to point to directory where LLVM has
94-
been built. A simple build configuration might look like the following:
94+
been built. When building Flang as part of a bootstrapping build
95+
(`LLVM_ENABLE_PROJECTS=flang`), Flang-RT is automatically added
96+
unless configured with `-DFLANG_ENABLE_FLANG_RT=OFF`. Add that option to avoid
97+
having two conflicting versions of the same library.
98+
99+
A simple build configuration might look like the following:
95100

96101
```bash
97102
cmake -S <path-to-llvm-project-source>/runtimes \

flang/CMakeLists.txt

Lines changed: 4 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ if (LLVM_ENABLE_EH)
2323
endif()
2424

2525
set(FLANG_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
26-
set(FLANG_RT_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../flang-rt")
2726

2827
# Python is needed for symbol extracting tool
2928
set(LLVM_MINIMUM_PYTHON_VERSION 3.8)
@@ -259,24 +258,10 @@ else()
259258
include_directories(SYSTEM ${MLIR_TABLEGEN_OUTPUT_DIR})
260259
endif()
261260

262-
set(FLANG_INCLUDE_RUNTIME_default ON)
263-
if ("flang-rt" IN_LIST LLVM_ENABLE_RUNTIMES)
264-
set(FLANG_INCLUDE_RUNTIME_default OFF)
265-
endif ()
266-
option(FLANG_INCLUDE_RUNTIME "Build the runtime in-tree (deprecated; to be replaced with LLVM_ENABLE_RUNTIMES=flang-rt)" ${FLANG_INCLUDE_RUNTIME_default})
267-
if (FLANG_INCLUDE_RUNTIME)
268-
if ("flang-rt" IN_LIST LLVM_ENABLE_RUNTIMES)
269-
message(WARNING "Building Flang-RT using LLVM_ENABLE_RUNTIMES. FLANG_INCLUDE_RUNTIME=${FLANG_INCLUDE_RUNTIME} ignored.")
270-
set(FLANG_INCLUDE_RUNTIME OFF)
271-
else ()
272-
message(STATUS "Building Flang-RT in-tree")
273-
endif ()
274-
else ()
275-
if ("flang-rt" IN_LIST LLVM_ENABLE_RUNTIMES)
276-
message(STATUS "Building Flang-RT using LLVM_ENABLE_RUNTIMES")
277-
else ()
278-
message(STATUS "Not building Flang-RT. For a usable Fortran toolchain, either add LLVM_ENABLE_RUNTIMES=flang-rt, or compile a standalone Flang-RT.")
279-
endif ()
261+
if (FLANG_STANDALONE_BUILD)
262+
message(STATUS "Not building Flang-RT. For a usable Fortran toolchain, compile a standalone Flang-RT.")
263+
elseif (NOT "flang-rt" IN_LIST LLVM_ENABLE_RUNTIMES)
264+
message(STATUS "Not building Flang-RT. For a usable Fortran toolchain, either set FLANG_ENABLE_FLANG_RT=ON, add LLVM_ENABLE_RUNTIMES=flang-rt, or compile a standalone Flang-RT.")
280265
endif ()
281266

282267
set(FLANG_TOOLS_INSTALL_DIR "${CMAKE_INSTALL_BINDIR}" CACHE PATH
@@ -510,12 +495,6 @@ if (FLANG_INCLUDE_TESTS)
510495
add_compile_definitions(FLANG_INCLUDE_TESTS=1)
511496
endif()
512497

513-
option(FLANG_CUF_RUNTIME
514-
"Compile CUDA Fortran runtime sources" OFF)
515-
if (FLANG_CUF_RUNTIME)
516-
find_package(CUDAToolkit REQUIRED)
517-
endif()
518-
519498
add_subdirectory(include)
520499
add_subdirectory(lib)
521500
add_subdirectory(cmake/modules)
@@ -526,10 +505,6 @@ if (FLANG_BUILD_TOOLS)
526505
add_subdirectory(tools)
527506
endif()
528507

529-
if (FLANG_INCLUDE_RUNTIME)
530-
add_subdirectory(runtime)
531-
endif ()
532-
533508
if (LLVM_INCLUDE_EXAMPLES)
534509
add_subdirectory(examples)
535510
endif()

flang/cmake/modules/AddFlangOffloadRuntime.cmake

Lines changed: 0 additions & 146 deletions
This file was deleted.

flang/examples/CMakeLists.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
if (FLANG_INCLUDE_RUNTIME)
2-
add_subdirectory(ExternalHelloWorld)
3-
endif ()
41
add_subdirectory(PrintFlangFunctionNames)
52
add_subdirectory(FlangOmpReport)
63
add_subdirectory(FeatureList)

flang/examples/ExternalHelloWorld/CMakeLists.txt

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)