Skip to content
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

[Flang] Remove FLANG_INCLUDE_RUNTIME #124126

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 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 has already been 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
31 changes: 2 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")

if (CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR AND NOT MSVC_IDE)
message(FATAL_ERROR "In-source builds are not allowed. \
Expand Down Expand Up @@ -243,24 +242,8 @@ 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 (NOT "flang-rt" IN_LIST LLVM_ENABLE_RUNTIMES)
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 ()

set(FLANG_TOOLS_INSTALL_DIR "${CMAKE_INSTALL_BINDIR}" CACHE PATH
Expand Down Expand Up @@ -485,12 +468,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 @@ -501,10 +478,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.

43 changes: 0 additions & 43 deletions flang/runtime/CUDA/CMakeLists.txt

This file was deleted.

Loading