Skip to content

[Flang] Remove FLANG_INCLUDE_RUNTIME #124126

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
7 changes: 6 additions & 1 deletion flang-rt/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,12 @@ can be any compiler supporting the same ABI.
In addition to the compiler, the build must be able to find LLVM development
tools such as `lit` and `FileCheck` that are not found in an LLVM's install
directory. Use `CMAKE_BINARY_DIR` to point to directory where LLVM has
been built. A simple build configuration might look like the following:
been built. When building Flang as part of a bootstrapping build
(`LLVM_ENABLE_PROJECTS=flang`), Flang-RT is automatically added
unless configured with `-DFLANG_ENABLE_FLANG_RT=OFF`. Add that option to avoid
having two conflicting versions of the same library.

A simple build configuration might look like the following:

```bash
cmake -S <path-to-llvm-project-source>/runtimes \
Expand Down
33 changes: 4 additions & 29 deletions flang/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ if (LLVM_ENABLE_EH)
endif()

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

# Python is needed for symbol extracting tool
set(LLVM_MINIMUM_PYTHON_VERSION 3.8)
Expand Down Expand Up @@ -259,24 +258,10 @@ else()
include_directories(SYSTEM ${MLIR_TABLEGEN_OUTPUT_DIR})
endif()

set(FLANG_INCLUDE_RUNTIME_default ON)
if ("flang-rt" IN_LIST LLVM_ENABLE_RUNTIMES)
set(FLANG_INCLUDE_RUNTIME_default OFF)
endif ()
option(FLANG_INCLUDE_RUNTIME "Build the runtime in-tree (deprecated; to be replaced with LLVM_ENABLE_RUNTIMES=flang-rt)" ${FLANG_INCLUDE_RUNTIME_default})
if (FLANG_INCLUDE_RUNTIME)
if ("flang-rt" IN_LIST LLVM_ENABLE_RUNTIMES)
message(WARNING "Building Flang-RT using LLVM_ENABLE_RUNTIMES. FLANG_INCLUDE_RUNTIME=${FLANG_INCLUDE_RUNTIME} ignored.")
set(FLANG_INCLUDE_RUNTIME OFF)
else ()
message(STATUS "Building Flang-RT in-tree")
endif ()
else ()
if ("flang-rt" IN_LIST LLVM_ENABLE_RUNTIMES)
message(STATUS "Building Flang-RT using LLVM_ENABLE_RUNTIMES")
else ()
message(STATUS "Not building Flang-RT. For a usable Fortran toolchain, either add LLVM_ENABLE_RUNTIMES=flang-rt, or compile a standalone Flang-RT.")
endif ()
if (FLANG_STANDALONE_BUILD)
message(STATUS "Not building Flang-RT. For a usable Fortran toolchain, compile a standalone Flang-RT.")
elseif (NOT "flang-rt" IN_LIST LLVM_ENABLE_RUNTIMES)
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.")
endif ()

set(FLANG_TOOLS_INSTALL_DIR "${CMAKE_INSTALL_BINDIR}" CACHE PATH
Expand Down Expand Up @@ -501,12 +486,6 @@ if (FLANG_INCLUDE_TESTS)
add_compile_definitions(FLANG_INCLUDE_TESTS=1)
endif()

option(FLANG_CUF_RUNTIME
"Compile CUDA Fortran runtime sources" OFF)
if (FLANG_CUF_RUNTIME)
find_package(CUDAToolkit REQUIRED)
endif()

add_subdirectory(include)
add_subdirectory(lib)
add_subdirectory(cmake/modules)
Expand All @@ -517,10 +496,6 @@ if (FLANG_BUILD_TOOLS)
add_subdirectory(tools)
endif()

if (FLANG_INCLUDE_RUNTIME)
add_subdirectory(runtime)
endif ()

if (LLVM_INCLUDE_EXAMPLES)
add_subdirectory(examples)
endif()
Expand Down
146 changes: 0 additions & 146 deletions flang/cmake/modules/AddFlangOffloadRuntime.cmake

This file was deleted.

3 changes: 0 additions & 3 deletions flang/examples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
if (FLANG_INCLUDE_RUNTIME)
add_subdirectory(ExternalHelloWorld)
endif ()
add_subdirectory(PrintFlangFunctionNames)
add_subdirectory(FlangOmpReport)
add_subdirectory(FeatureList)
9 changes: 0 additions & 9 deletions flang/examples/ExternalHelloWorld/CMakeLists.txt

This file was deleted.

Loading