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
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to