[PATCH] D84022: [flang] Fix multi-config generator builds.

David Truby via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 31 09:02:50 PDT 2020


DavidTruby added a comment.

> Out-of-tree builds are four times faster than in-tree builds. Since I build flang every time I review a change, I do several builds a day (in addition to the builds I do for my own work). Thus, this change significantly degrades my productivity.

If the in-tree incremental builds are slow, that seems like a cmake bug; there shouldn't be any difference in performance between the two. Unless you're not rebuilding the LLVM changes each time, which in the general case won't work especially as we get closer integration between flang and LLVM.

> You say "You could possibly add if statements ...". Are you implying that you do not plan to amend your change to allow out-of-tree builds in addition to supporting multi-config generator builds?

My understanding is that in general in LLVM out-of-tree builds are considered a "best effort" feature that isn't guaranteed to work. In the flang case they aren't defended by buildbots and so people won't get notified when their patches break them (as I was not notified here).
I personally don't do out of tree builds and so it would be difficult for me to fix this breakage without being able to reproduce it. I can provide some more concrete pointers on here about what a potential fix might look like though:

Around the changes in CMakeLists.txt files, add:

  if(FLANG_STANDALONE_BUILD) 
     // old code
  else()
    // new code
  endif()

In lit.site.cfg.py add:

  if @FLANG_STANDALONE_BUILD@:
    config.flang_llvm_tools_dir = "@CMAKE_BINARY_DIR@/bin"
  else:
    config.flang_llvm_tools_dir = config.llvm_tools_dir

And in lit.cfg.py change config.llvm_tools_dir to config.flang_llvm_tools_dir

I believe this should change the behaviour back to how it was before for out-of-tree but keep the fixes for in-tree builds.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D84022/new/

https://reviews.llvm.org/D84022



More information about the llvm-commits mailing list