[PATCH] D154869: [Flang] [FlangRT] Implement FlangRT library as solution to Flang's runtime LLVM integration

Paul Scoropan via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 18 08:19:41 PDT 2023


pscoro marked 3 inline comments as done.
pscoro added inline comments.


================
Comment at: flang-rt/CMakeLists.txt:17-23
+# Check if flang-rt is built as a standalone project.
+if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR OR FLANG_RT_STANDALONE_BUILD)
+  project(FlangRT C CXX)
+  set(CMAKE_INCLUDE_CURRENT_DIR ON)
+  set(FLANG_RT_STANDALONE_BUILD TRUE)
+  set_property(GLOBAL PROPERTY USE_FOLDERS ON)
+endif()
----------------
phosek wrote:
> pscoro wrote:
> > vzakhari wrote:
> > > phosek wrote:
> > > > I don't think we should support building FlangRT as a standalone project. We've been moving all runtimes to the runtimes build, the only leftover is compiler-rt and our hope is to address that soon.
> > > Hi @phosek, can you please explain what you mean by "We've been moving all runtimes to the runtimes build"?  Can you please share references to the pipeline for the "runtimes build"?
> > If i understood correctly, i think @phosek is talking about building the flang-rt target directly (`cmake llvm-project/flang-rt`) when he says standalone. Meanwhile a runtimes build is `cmake llvm-project/runtimes -DLLVM_ENABLE_RUNTIMES=flang-rt`. I chose not to change anything yet because I was focused on some other bugs and was waiting for see if anybody else had input on this first. Also, in case my understanding is incorrect @phosek please correct me.
> Yes, that is correct.
I gave this a couple days in case anybody else in the community wanted to voice their opinion but since there was no contradictions, I have removed support for targeting flang-rt directly. Flang-rt is now only buildable via the llvm target or the runtimes target. See documentation for details.


================
Comment at: flang-rt/CMakeLists.txt:41-51
+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
+set(CMAKE_LIBRARY_OUTPUT_DIRECTORY
+  ${CMAKE_BINARY_DIR}/lib)
+set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY
+  ${CMAKE_BINARY_DIR}/lib)
+set(CMAKE_CURRENT_BINARY_DIR ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
+
----------------
phosek wrote:
> None of this should be needed if building in the runtimes build.
I did some further testing and removed the module paths and include statements that were not needed. However, not all of the lines could be removed, clang and flang specific paths/includes were missing so they were left in here.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D154869/new/

https://reviews.llvm.org/D154869



More information about the cfe-commits mailing list