Skip to content

Commit 83910a4

Browse files
committed
FortranRuntime -> flang-rt
1 parent 011568a commit 83910a4

File tree

255 files changed

+815
-838
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

255 files changed

+815
-838
lines changed

FortranRuntime/test/NonGtestUnit/lit.site.cfg.py.in

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

FortranRuntime/test/Unit/lit.site.cfg.py.in

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

FortranRuntime/test/lit.site.cfg.py.in

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

clang/lib/Driver/ToolChains/CommonArgs.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1291,7 +1291,7 @@ void tools::addOpenMPHostOffloadingArgs(const Compilation &C,
12911291
/// Add Fortran runtime libs
12921292
void tools::addFortranRuntimeLibs(const ToolChain &TC, const ArgList &Args,
12931293
llvm::opt::ArgStringList &CmdArgs) {
1294-
// Link FortranRuntime
1294+
// Link flang_rt
12951295
// These are handled earlier on Windows by telling the frontend driver to
12961296
// add the correct libraries to link against as dependents in the object
12971297
// file.
@@ -1307,7 +1307,7 @@ void tools::addFortranRuntimeLibs(const ToolChain &TC, const ArgList &Args,
13071307
if (AsNeeded)
13081308
addAsNeededOption(TC, Args, CmdArgs, /*as_needed=*/false);
13091309
}
1310-
CmdArgs.push_back("-lFortranRuntime");
1310+
CmdArgs.push_back("-lflang_rt");
13111311
}
13121312
}
13131313

clang/lib/Driver/ToolChains/Flang.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -304,26 +304,26 @@ static void processVSRuntimeLibrary(const ToolChain &TC, const ArgList &Args,
304304
case options::OPT__SLASH_MT:
305305
CmdArgs.push_back("-D_MT");
306306
CmdArgs.push_back("--dependent-lib=libcmt");
307-
CmdArgs.push_back("--dependent-lib=FortranRuntime.static.lib");
307+
CmdArgs.push_back("--dependent-lib=flang_rt.static.lib");
308308
break;
309309
case options::OPT__SLASH_MTd:
310310
CmdArgs.push_back("-D_MT");
311311
CmdArgs.push_back("-D_DEBUG");
312312
CmdArgs.push_back("--dependent-lib=libcmtd");
313-
CmdArgs.push_back("--dependent-lib=FortranRuntime.static_dbg.lib");
313+
CmdArgs.push_back("--dependent-lib=flang_rt.static_dbg.lib");
314314
break;
315315
case options::OPT__SLASH_MD:
316316
CmdArgs.push_back("-D_MT");
317317
CmdArgs.push_back("-D_DLL");
318318
CmdArgs.push_back("--dependent-lib=msvcrt");
319-
CmdArgs.push_back("--dependent-lib=FortranRuntime.dynamic.lib");
319+
CmdArgs.push_back("--dependent-lib=flang_rt.dynamic.lib");
320320
break;
321321
case options::OPT__SLASH_MDd:
322322
CmdArgs.push_back("-D_MT");
323323
CmdArgs.push_back("-D_DEBUG");
324324
CmdArgs.push_back("-D_DLL");
325325
CmdArgs.push_back("--dependent-lib=msvcrtd");
326-
CmdArgs.push_back("--dependent-lib=FortranRuntime.dynamic_dbg.lib");
326+
CmdArgs.push_back("--dependent-lib=flang_rt.dynamic_dbg.lib");
327327
break;
328328
}
329329
}
File renamed without changes.
File renamed without changes.

FortranRuntime/CMakeLists.txt renamed to flang-rt/CMakeLists.txt

Lines changed: 43 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -6,31 +6,31 @@
66
#
77
#===------------------------------------------------------------------------===#
88
#
9-
# Build instructions for the FortranRuntime library and Fortran modules required
10-
# by programs compiled by Flang. This is file is intended to be included using
11-
# the LLVM_ENABLE_RUNTIMES mechanism.
9+
# Build instructions for the flang-rt library. This is file is intended to be
10+
# included using the LLVM_ENABLE_RUNTIMES mechanism.
1211
#
1312
#===------------------------------------------------------------------------===#
1413

1514
set(LLVM_SUBPROJECT_TITLE "Fortran Runtime")
16-
set(FORTRANRUNTIME_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
17-
set(FORTRANRUNTIME_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}")
15+
set(FLANGRT_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
16+
set(FLANGRT_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}")
1817
set(FLANG_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../flang")
1918

2019
enable_language(Fortran)
2120

2221
list(APPEND CMAKE_MODULE_PATH
23-
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules"
22+
"${FLANGRT_SOURCE_DIR}/cmake/modules"
23+
"${FLANG_SOURCE_DIR}/cmake/modules"
2424
)
25-
include(AddFortranRuntime)
25+
include(AddFlangRT)
2626
include(FlangCommon)
2727

2828

2929
############################
3030
# Build Mode Introspection #
3131
############################
3232

33-
# Setting these variables from an LLVM build is sufficient that FortranRuntime can
33+
# Setting these variables from an LLVM build is sufficient that flang-rt can
3434
# construct the output paths, so it can behave as if it were in-tree here.
3535
set(LLVM_TREE_AVAILABLE OFF)
3636
if (LLVM_LIBRARY_OUTPUT_INTDIR AND LLVM_RUNTIME_OUTPUT_INTDIR AND PACKAGE_VERSION)
@@ -42,46 +42,50 @@ if (LLVM_TREE_AVAILABLE)
4242
# Despite Clang in the name, get_clang_resource_dir does not depend on Clang being added to the build
4343
# flang-new uses the same resource dir as clang.
4444
include(GetClangResourceDir)
45-
get_clang_resource_dir(FORTRANRUNTIME_BUILD_LIB_DIR PREFIX "${LLVM_LIBRARY_OUTPUT_INTDIR}/.." SUBDIR "lib${LLVM_LIBDIR_SUFFIX}")
46-
get_clang_resource_dir(FORTRANRUNTIME_INSTALL_LIB_DIR SUBDIR "lib${LLVM_LIBDIR_SUFFIX}") # No prefix, CMake's install command find the install prefix itself
45+
get_clang_resource_dir(FLANGRT_BUILD_LIB_DIR PREFIX "${LLVM_LIBRARY_OUTPUT_INTDIR}/.." SUBDIR "lib${LLVM_LIBDIR_SUFFIX}")
46+
get_clang_resource_dir(FLANGRT_INSTALL_LIB_DIR SUBDIR "lib${LLVM_LIBDIR_SUFFIX}") # No prefix, CMake's install command find the install prefix itself
4747
else ()
48-
set(FORTRANRUNTIME_BUILD_LIB_DIR "${LLVM_LIBRARY_OUTPUT_INTDIR}")
49-
set(FORTRANRUNTIME_INSTALL_LIB_DIR "lib${LLVM_LIBDIR_SUFFIX}")
48+
set(FLANGRT_BUILD_LIB_DIR "${LLVM_LIBRARY_OUTPUT_INTDIR}")
49+
set(FLANGRT_INSTALL_LIB_DIR "lib${LLVM_LIBDIR_SUFFIX}")
5050
endif ()
5151

5252
if (DEFINED WIN32)
53-
set(FORTRANRUNTIME_BUILD_LIB_DIR "${FORTRANRUNTIME_BUILD_LIB_DIR}/windows")
54-
set(FORTRANRUNTIME_INSTALL_LIB_DIR "${FORTRANRUNTIME_INSTALL_LIB_DIR}/windows")
53+
set(FLANGRT_BUILD_LIB_DIR "${FLANGRT_BUILD_LIB_DIR}/windows")
54+
set(FLANGRT_INSTALL_LIB_DIR "${FLANGRT_INSTALL_LIB_DIR}/windows")
5555
elseif (LLVM_ENABLE_PER_TARGET_RUNTIME_DIR)
56-
set(FORTRANRUNTIME_BUILD_LIB_DIR "${FORTRANRUNTIME_BUILD_LIB_DIR}/${LLVM_TARGET_TRIPLE}")
57-
set(FORTRANRUNTIME_INSTALL_LIB_DIR "${FORTRANRUNTIME_INSTALL_LIB_DIR}/${LLVM_TARGET_TRIPLE}")
56+
set(FLANGRT_BUILD_LIB_DIR "${FLANGRT_BUILD_LIB_DIR}/${LLVM_TARGET_TRIPLE}")
57+
set(FLANGRT_INSTALL_LIB_DIR "${FLANGRT_INSTALL_LIB_DIR}/${LLVM_TARGET_TRIPLE}")
5858
endif ()
5959

6060

6161
#################
6262
# Build Options #
6363
#################
6464

65-
option(FORTRANRUNTIME_INCLUDE_TESTS "Generate build targets for the FortranRuntime unit and regression-tests." "${LLVM_INCLUDE_TESTS}")
66-
67-
set(FORTRANRUNTIME_EXPERIMENTAL_OFFLOAD_SUPPORT "" CACHE STRING "Compile FortranRuntime with GPU support (CUDA or OpenMP)")
68-
set_property(CACHE FORTRANRUNTIME_EXPERIMENTAL_OFFLOAD_SUPPORT PROPERTY STRINGS
69-
""
70-
CUDA
71-
OpenMP)
72-
if (NOT FORTRANRUNTIME_EXPERIMENTAL_OFFLOAD_SUPPORT)
73-
elseif (FORTRANRUNTIME_EXPERIMENTAL_OFFLOAD_SUPPORT STREQUAL "CUDA")
74-
set(FORTRANRUNTIME_LIBCUDACXX_PATH "" CACHE PATH "Path to libcu++ package installation")
75-
option(FORTRANRUNTIME_CUDA_RUNTIME_PTX_WITHOUT_GLOBAL_VARS "Do not compile global variables' definitions when producing PTX library" OFF)
76-
elseif (FORTRANRUNTIME_EXPERIMENTAL_OFFLOAD_SUPPORT STREQUAL "OpenMP")
77-
set(FORTRANRUNTIME_DEVICE_ARCHITECTURES "all" CACHE STRING
65+
# Important: flang-rt user options must be prefixed with "FLANG_RT_". Variables
66+
# with this prefix will be forwarded in bootstrap builds.
67+
68+
option(FLANG_RT_INCLUDE_TESTS "Generate build targets for the flang-rt unit and regression-tests." "${LLVM_INCLUDE_TESTS}")
69+
70+
set(FLANG_RT_EXPERIMENTAL_OFFLOAD_SUPPORT "" CACHE STRING "Compile flang-rt with GPU support (CUDA or OpenMP)")
71+
set_property(CACHE FLANG_RT_EXPERIMENTAL_OFFLOAD_SUPPORT PROPERTY STRINGS
72+
""
73+
CUDA
74+
OpenMP
75+
)
76+
if (NOT FLANG_RT_EXPERIMENTAL_OFFLOAD_SUPPORT)
77+
elseif (FLANG_RT_EXPERIMENTAL_OFFLOAD_SUPPORT STREQUAL "CUDA")
78+
set(FLANG_RT_LIBCUDACXX_PATH "" CACHE PATH "Path to libcu++ package installation")
79+
option(FLANG_RT_CUDA_RUNTIME_PTX_WITHOUT_GLOBAL_VARS "Do not compile global variables' definitions when producing PTX library" OFF)
80+
elseif (FLANG_RT_EXPERIMENTAL_OFFLOAD_SUPPORT STREQUAL "OpenMP")
81+
set(FLANG_RT_DEVICE_ARCHITECTURES "all" CACHE STRING
7882
"List of OpenMP device architectures to be used to compile the Fortran runtime (e.g. 'gfx1103;sm_90')")
7983
else ()
80-
message(FATAL_ERROR "Invalid value '${FORTRANRUNTIME_EXPERIMENTAL_OFFLOAD_SUPPORT}' for FORTRANRUNTIME_EXPERIMENTAL_OFFLOAD_SUPPORT; must be empty, 'CUDA', or 'OpenMP'")
84+
message(FATAL_ERROR "Invalid value '${FLANG_RT_EXPERIMENTAL_OFFLOAD_SUPPORT}' for FLANG_RT_EXPERIMENTAL_OFFLOAD_SUPPORT; must be empty, 'CUDA', or 'OpenMP'")
8185
endif ()
8286

83-
option(FORTRANRUNTIME_ENABLE_CUF "Compile CUDA Fortran runtime sources" OFF)
84-
if (FORTRANRUNTIME_ENABLE_CUF)
87+
option(FLANG_RT_ENABLE_CUF "Compile CUDA Fortran runtime sources" OFF)
88+
if (FLANG_RT_ENABLE_CUF)
8589
find_package(CUDAToolkit REQUIRED)
8690
endif()
8791

@@ -113,9 +117,9 @@ if (WIN32)
113117
ERROR_QUIET
114118
)
115119
if (NOT CXX_COMPILER_PRINT_LIBGCC_PATH_FAILURE AND CXX_COMPILER_PRINT_LIBGCC_PATH_RESULT)
116-
string(STRIP "${CXX_COMPILER_PRINT_LIBGCC_PATH_RESULT}" FORTRANRUNTIME_LIBCALL)
120+
string(STRIP "${CXX_COMPILER_PRINT_LIBGCC_PATH_RESULT}" FLANGRT_LIBCALL)
117121
else ()
118-
set(FORTRANRUNTIME_LIBCALL "")
122+
set(FLANGRT_LIBCALL "")
119123
endif ()
120124
endif ()
121125

@@ -124,17 +128,17 @@ endif ()
124128
# Build Preparation #
125129
#####################
126130

127-
if (FORTRANRUNTIME_EXPERIMENTAL_OFFLOAD_SUPPORT AND FORTRANRUNTIME_INCLUDE_TESTS)
131+
if (FLANG_RT_EXPERIMENTAL_OFFLOAD_SUPPORT AND FLANG_RT_INCLUDE_TESTS)
128132
# If Fortran runtime is built as CUDA library, the linking
129-
# of targets that link FortranRuntime must be done
133+
# of targets that link flang-rt must be done
130134
# with CUDA_RESOLVE_DEVICE_SYMBOLS.
131135
# CUDA language must be enabled for CUDA_RESOLVE_DEVICE_SYMBOLS
132136
# to take effect.
133137
enable_language(CUDA)
134138
endif()
135139

136140

137-
# C++17 required for FortranRuntime, user or other runtimes may override this.
141+
# C++17 is required for flang-rt; user or other runtimes may override this.
138142
# GTest included later also requires C++17.
139143
set(CMAKE_CXX_STANDARD 17 CACHE STRING "C++ standard to conform to")
140144
set(CMAKE_CXX_STANDARD_REQUIRED YES)
@@ -153,9 +157,9 @@ configure_file(cmake/config.h.cmake.in config.h)
153157

154158
add_subdirectory(lib)
155159

156-
if (FORTRANRUNTIME_INCLUDE_TESTS)
160+
if (FLANG_RT_INCLUDE_TESTS)
157161
add_subdirectory(unittests)
158162
add_subdirectory(test)
159163
else ()
160-
add_custom_target(check-FortranRuntime)
164+
add_custom_target(check-flang-rt)
161165
endif()
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)