[cfe-dev] [LLVMdev] RFC: Upcoming Build System Changes

David A. Greene greened at obbligato.org
Tue Nov 1 13:14:54 PDT 2011


Óscar Fuentes <ofv at wanadoo.es> writes:

> greened at obbligato.org (David A. Greene) writes:
>
>> Óscar Fuentes <ofv at wanadoo.es> writes:
>>
>>> A good measure of how fast a set of Makefile are is to run the build
>>> with all targets up-to-date. Both builds takes a few seconds (3 or so)
>>> on my Linux quad core box. Whatever improvement can be achieved on this
>>> seems pretty insignifant.
>>
>> Oh, it's significant.  When I build the Cray compiler with only non-LLVM
>> stuff changed, the actual compiles (the Cray stuff) finish before the
>> LLVM figures out nothing has changed.  This is a sginificant
>> productivity loss.
>
> How is that? Your compiler builds in less than 3 seconds? (IIRC, the

I have never seen an LLVM up-to-date build take only three seconds.  You
must have a much faster machine than I do.

>> The Cray compiler uses a non-recursive make and so
>> gets tons of parallelism the LLVM build simply can't see because it's
>> recursive.
>
> There is no parallel loss due to recursive calls.

This is absolutely not true.

> The cmake build will happily compile files from different
> libraries/executables as long as there are enough threads available
> and no blocking dependencies. 

But there are blocking dependencies.  They're implicit in the recursive
calls.

> To check, simply run `make -j' and you'll see how dozens of compiler
> processes are started. AFAIR the same applies to the `make' build.

Yes initially, but then it funnels down to 2-3 processes that everything
else waits for.  GenLibDeps (or whatever that thing is called) is a good
example.

>>> Furthermore, recursive make is necessary for automatic generation of
>>> header dependencies, among other things. The makefiles generated by
>>> cmake are "partially" recursive for that reason:
>>
>> Eh?  This is not true.  See for example:
>>
>> http://mad-scientist.net/make/autodep.html
>
> LLVM/Clang uses a lot of generated headers. I think that what that page
> says does not apply to our case.

You said header dependencies.  Generated headers are different than
what's presented in that page.  That page covers header dependencies.

That said, we have generated headers in the Cray compiler and we use
non-recursive make just fine.

                             -Dave




More information about the cfe-dev mailing list