[CMake] Tweaking/disabling timeout for "Check for working CXX compiler"

Dmitry Marakasov amdmi3 at amdmi3.ru
Wed Sep 9 15:52:22 EDT 2015


* Michael Enright (michael.enright at gmail.com) wrote:

> > Relevant excerpt:
> >
> > ---
> > <snip>
> >
> >   Process terminated due to timeout
> >
> > <snip>
> >
> > The question is obvious: where is this timeout defined, what value
> > is it set to exactly and is it tunable?
> >
> 
> When you build manually in this setup, does the build actually
> complete?

Of course.

> How long does it take for the compile to complete?

It's still hard to reproduce, however I've emulated it by writing a
Makefile which compiles, then links the test file taken from cmake with
the same compiler and flags as used in the build - essentially the same
thing which cmake does judging from the output.

I've ran this in a loop with package build runing in a parallel to
somehow simulate what's actually hapenning on our build cluster and
measured some times.

Host hardware is Core i7-2600K @ 3.40GHz (4 cores x 2 HT threads)

                            ( min /  avg / max )
              Build on host: 0.00 / 0.00 / 0.43 (fully native)
 ARMv6 jail, host toolchain: 0.03 / 0.27 / 3.76 (what we actually use for cross-builds)
ARMv6 jail, armv6 toolchain: 0.91 / 1.23 / 4.82 (fully emulated)

As you can see, it's not uncommon for the build to take several
seconds, and the timeout as I suspect is somewhere around this
value. I'd suggest to bump it to some arbitrary high value like 60
seconds, which, on one hand, ensures that the build doesn't hand,
on the other tolerates slow hardware and environments.

However, I doubt this solution (enforcing any timeouts by default)
in general, as there's no limit on how slow compilation could be
(slow hardware, emulation, CPU starvation due other tasks and/or
low priority, SIGSTOP etc.).

> It seems to me that if the compile is actually completing then
> worrying about CMake's timeout is worth the trouble.

-- 
Dmitry Marakasov   .   55B5 0596 FF1E 8D84 5F56  9510 D35A 80DD F9D2 F77D
amdmi3 at amdmi3.ru  ..:  jabber: amdmi3 at jabber.ru      http://amdmi3.ru


More information about the CMake mailing list