[CMake] Parallel build & test problem

Marcel Loose loose at astron.nl
Mon May 23 07:39:04 EDT 2011


On Mon, 2011-05-23 at 07:21 -0400, David Cole wrote:
> On Mon, May 23, 2011 at 4:13 AM, Marcel Loose <loose at astron.nl> wrote:
>         Hi all,
>         
>         A colleague of mine reported a bug in our CMake-base build
>         system when
>         doing a parallel build of multiple targets where one of the
>         targets is
>         'test'.
>         
>         <quote>
>                Running 'make -j16 tMutex test' (or any test other than
>         tMutex)
>                for example will result in building tMutex in parallel
>         to
>                testing it.
>         
>                Expected behaviour is first building tMutex, followed
>         by running
>                the tests.
>         </quote>
>         
>         Is this indeed a bug? Either in our build system or in CMake?
>         AFAIK it is not possible to define dependencies between the
>         'test'
>         target and the target to build the test program. Correct?
>         
>         Best regards,
>         Marcel Loose.
>         
>         
>         --
>         Marcel Loose
>         Senior Software Engineer, Computing Group R&D, Astron, the
>         Netherlands
>         
>         _______________________________________________
>         Powered by www.kitware.com
>         
>         Visit other Kitware open-source projects at
>         http://www.kitware.com/opensource/opensource.html
>         
>         Please keep messages on-topic and check the CMake FAQ at:
>         http://www.cmake.org/Wiki/CMake_FAQ
>         
>         Follow this link to subscribe/unsubscribe:
>         http://www.cmake.org/mailman/listinfo/cmake
> 
> To the best of my knowledge you can only do a parallel make of one
> target at a time.
> 
> 
> The best way to do what you want is to do two parallel make runs in
> sequence, like this:
> 
> 
>   make -j16 tMutex
>   make -j16 test
> 
> 
> The test target is defined by CMake, though, and runs all tests.
> 
> 
> HTH,
> David
> 
> 

Hi David,

I vaguely remembered that limitation of 'make' as well, but I couldn't
find any relevant pointers on this, and colleagues questioned this
alleged limitation. Therefore I thought it might be a limitation of
CMake, or maybe I should say: the combination of CMake and make.

Anyway, my response was also to do two separate 'make' calls, one for
each target.

Regards,
Marcel Loose.




More information about the CMake mailing list