[Openmp-commits] [clang] [flang] [llvm] [openmp] [Flang][OpenMP] Move builtin .mod generation into runtimes (PR #137828)
Michael Kruse via Openmp-commits
openmp-commits at lists.llvm.org
Tue Apr 29 09:20:34 PDT 2025
Meinersbur wrote:
While I appreciate the review, it is not yet in the state that warants one. It is still in an experimentation stage, so I did not yet care about formatting. There are also a lot of changes in here that will eventually not be needed.
Goals are:
1. Currently modules files are expected at `$prefix/include/flang/*.mod` where prefix is the parent of `bin` where flang is located. It should be in `$prefix/lib/clang/finclude/<triple>/*.h`, i.e. the resource directory since mod-files are specific to the version of flang, and distinct for each target triple since the mod files can be different for each target. Necessary for cross-compilation. In addition to the CMake code, the flang driver code needs to change as well because it hardcodes `$path/../include/flang`.
2. Use cmake to build the module files within the `flang-rt/` runtime. The LLVM_ENABLE_RUNTIMES system handles which target triples to build and Flang being available. CMake should care about the build dependencies. Have to change the driver again to tell it where to emit the module files.
3. Use the same mechanism as above to build `omp_lib.mod` and `omp_lib_kinds.mod`, but in the `openmp/` runtime. Since in the same CMake builddir, CMake will ensure dependencies already.
4. This means flang-rt (and openmp) is necessary to be compiled before running flang's tests which require those module files. Flang's OpenMP tests already require openmp's modules to be compiled, it will be no different to flang-rt's builtin modules.
Sounds relatively simple, but there have been many small issues, starting with CMake's misspelling of CMAKE_Fortran_BUILDING_INSTRINSIC_MODULES.
https://github.com/llvm/llvm-project/pull/137828
More information about the Openmp-commits
mailing list