[CMake] makefile to CMakeLists.txt, possible?

Michael Wild themiwi at gmail.com
Thu Sep 2 04:04:09 EDT 2010


On 2. Sep, 2010, at 9:49 , Chiheng Xu wrote:

> On Thu, Sep 2, 2010 at 3:32 PM, Mike McQuaid <mike at mikemcquaid.com> wrote:
>> 
>> On 2 Sep 2010, at 08:15, Chiheng Xu wrote:
>> 
>>> CMake is a very great tool.    But its drawback is also obvious.    It
>>> will consume large amount of time to generate Makefiles every time you
>>> want to build,  especially for ultra large projects.   Building can be
>>> parallelized, but the CMaking, like runing configure scripts, can't be
>>> parallelized.   So, the "caching" of Makefiles seems benefitial  for
>>> current and future mutil-cores systems.
>>> 
>>> Normal developers seldomly touch CMakeLists.txt.  So,  in very rare
>>> condition, you need to regenerate the Makefiles.
>> 
>> That's why the files are cached on your local machine. I've seen some pretty huge CMake projects and I've never seen it take more than a few minutes to generate the Makefiles. I don't see why you have to keep them in version control.
>> 
>> Most projects I've worked on don't keep any generated files in version control, be it from the makefile generator, code generator or binary files.
>> 
> 
> Suppose you have a ultra large project,  it will consume 5 minutes to
> CMake,  2 hours to build serially.  If you have an 64 Cores ccNUMA
> systems, like Xeon 7500 (8 Cores * 8),  theretically, you will have a
> 60+ accelaration in parallel build.  Theretically,  it will consume
> less than 2 minutes to parallelly build, but it will also consume 5
> minutes to serially CMake.  So, If you "cache" the Makefiles, it will
> only consume less than 2 minutes to build.

2 hours serial build? You consider that ultra large? That is medium sized at best. And if it takes 5 minutes to run CMake there must be some pretty inefficient stuff in that CMake code of yours... Also, I really doubt you will get 60+ speedup (due to bottlenecks in your CPU, memory and disk).

And the real problem are not "fresh" builds. They usually take much longer than it takes CMake to run. The problems arise if you  make a small modification, requiring CMake to re-run, but only a few files are being recompiled. Those are the builds that slow a developer down, because that's what he's doing most of the time. You don't build from scratch every time (if you do, don't worry about the time it takes CMake to run...).

Also, consider that maintaining hand-crafted Makefile's would require much more of your time ;-)

My 2c.

Michael


More information about the CMake mailing list