[llvm] [flang-rt] Update `test_flang` in CI to use `flang-rt` as one of the projects. (PR #135260)
Daniel Chen via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 11 21:08:54 PDT 2025
DanielCChen wrote:
> > I start to think the proper fix probably should be that we stop building flang-rt as part of the flang project in cmake, and uses standalone runtime premerge build when testing flang or flang-rt changes.
>
> That sounds about right. We need to rework the runtimes build for premerge anyways which has been on my TODO list for a while and something I hope to get too soon.
>
> What are the compiler requirements for flang-rt? From what I can tell it is entirely c++ currently. Does it need ToT clang/flang?
There is some description of how to build it. https://github.com/llvm/llvm-project/tree/main/flang-rt
I copied some here. It doesn't need bootstrap C/C++ compiler, but it needs the Fortran compiler must be flang from the same commit.
```
The compiler to be used can be controlled using CMake's standard mechanisms such as CMAKE_CXX_COMPILER, CMAKE_CXX_COMPILER, and CMAKE_Fortran_COMPILER. CMAKE_Fortran_COMPILER must be flang built from the same Git commit as Flang-RT to ensure they are using the same ABI. The C and C++ compiler 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:
cmake -S <path-to-llvm-project-source>/runtimes \
-GNinja \
-DLLVM_BINARY_DIR=<path-to-llvm-builddir> \
-DCMAKE_Fortran_COMPILER=<path-to-llvm-builddir>/bin/flang \
-DCMAKE_Fortran_COMPILER_WORKS=yes \
-DLLVM_ENABLE_RUNTIMES=flang-rt \
...
```
There is a Fortran intrinsic module in flang-rt that requires Fortran compiler
So for the part of the script that specifies `LLVM_ENABLE_PROJECTS`, are you planning to add `LLVM_ENABLE_RUNTIMES`? That can be used to build and test `compiler-rt` and `flang-rt` as alternative to the standalone build, which could be more straight forward for the premerge build and testing purpose as the driver is already searching the path to the libraries of that build.
https://github.com/llvm/llvm-project/pull/135260
More information about the llvm-commits
mailing list