This is an archive of the discontinued LLVM Phabricator instance.

Moved flang to LLVM_ALL_PROJECTS
Needs ReviewPublic

Authored by pscoro on Jun 29 2023, 9:43 AM.

Details

Summary

If my understanding is correct, when flang was added to llvm-project, it was separated from the other llvm projects (which are all handled in a list called LLVM_ALL_PROJECTS) because it had a higher C++ requirement (C++17 instead of C++11). Supposedly, this discrepancy has since been resolved and flang should be safe to be add to this list. From my testing this seems to have worked without any issues, but I am opening this up to the community to discuss if there are any issues with this move or if this change is wanted.

The motivation for doing this move now is the recent discussions about better supporting Flang's runtime libraries with existing LLVM runtime infrastructure. As a prerequisite, before we can consider stuff like adding flang's runtime to LLVM_ENABLE_RUNTIMES=all, it would make sense to first treat flang like one of "all the llvm projects" (if this can be done without issue)

Diff Detail

Event Timeline

pscoro created this revision.Jun 29 2023, 9:43 AM
Herald added a project: Restricted Project. · View Herald Transcript
Herald added a subscriber: sunshaoce. · View Herald Transcript
pscoro requested review of this revision.Jun 29 2023, 9:43 AM
Herald added a project: Restricted Project. · View Herald Transcript
pscoro edited the summary of this revision. (Show Details)Jun 29 2023, 10:01 AM
mehdi_amini added inline comments.
llvm/CMakeLists.txt
121

Might be useful to keep the LLVM_EXTRA_PROJECTS here and below, even if empty for now? Adding a new project to LLVM could then just reuse this.

nikic added a subscriber: nikic.Nov 15 2023, 1:27 AM

I don't think this is safe to do until the extremely high memory usage requirements for flang compilation are fixed. The last two times I tried enabling the flang project, I had to hard reset my computer afterwards.

As far as I can tell, for safety reasons you currently need to build flang separately, with a different build configuration like -j1.

brad added a subscriber: brad.Mon, Nov 27, 12:19 PM

I don't think this is safe to do until the extremely high memory usage requirements for flang compilation are fixed. The last two times I tried enabling the flang project, I had to hard reset my computer afterwards.

As far as I can tell, for safety reasons you currently need to build flang separately, with a different build configuration like -j1.

I do various builds including Flang and on my VMs I have 24GB plus a bit of swap and 8 CPUs. I can blast through more or less all of the other sub-projects enabled with -j8 or -j9 no problem.

When I hit Flang and it starts running out of memory quick I have to step down to -j3 instead of -j4 to really be on the safe side. Watching the build a lot of the code is taking up 4.5 to 5.5GB of memory per file.