-
Notifications
You must be signed in to change notification settings - Fork 15.3k
[Flang] Move builtin .mod generation into runtimes (Reapply #137828) #169638
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
@jhuber6 Based on the feedback in #137828, I made it easier to build the Fortran modules for nvptx and amdgpu targets. It is now possible to set both FLANG_RT_ENABLE_STATIC and FLANG_RT_ENABLE_SHARED to off, meaning no library is built, only the modules files. This is the default if the target is nvptx or amdgpu. However, this overrides the (experimental) default behavior of #131826. I could not get the gpu_sources to compile since it cannot find include files such as In the spirit off adding |
🐧 Linux x64 Test Results
|
|
Thank you, Michael! The patchs seems to be working on my side (after some adjustments downstream). So it is good to go for the next week merge (once you merge it, I will resolve conflicts on my side). I do not know about the experimental direct GPU build. @jhuber6 can you please comment on Michael's question above? |
|
After working around the CMAKE_Fortran_PREPROCESS_SOURCE failure, openmp-offload-amdgpu-clang-flang is failing with a different problem: The builder is running Fortran+OpenMP offload tests on amdgpu-amd-amdhsa. For these to compile, omp_lib.mod and the builtin modules must be compiled for amdgpu-amd-amdhsa as well.
|
|
One problem with enabling flang-rt on the GPU is that it has a dependency on libc / libc++ on the GPU as well. Maybe there's a way to make it work there just to build the module files? |
This is what FLANG_RT_ENABLE_STATIC=OFF FLANG_RT_ENABLE_SHARED=OFF does. It should only build the .f90 files which have no dependency to libc or libc++ headers, and only builds object libraries, so there is no linking step which would require libc. My question specifically is whether it is OK to make this the default on nvptx/amdgpu targets which this PR currently does. |
Reapplication of #137828.
Draft -- Still to find the cause of the transient CMAKE_Fortran_PREPROCESS_SOURCE buildbot failure