Re: [CMake] 138% progress when building both all and not-in-all target?

2014-06-23 Thread Brad King
On 06/20/2014 04:24 AM, Ben Pope wrote:
 I've also seen this using the Makefile generator, the bigger problem is 
 that it ends up building the dependencies of those targets in parallel, 
 if there is overlap, it may try to build the same target multiple times 
 simultaneously, which can obviously break the build

This issue is recorded here:

 http://www.cmake.org/Bug/view.php?id=14312

It has been fixed for GNU make in CMake 3.0.

-Brad

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] 138% progress when building both all and not-in-all target?

2014-06-20 Thread Ben Pope

On Friday, June 20, 2014 12:40 PM, Dan Kegel wrote:

Seen in the wild today:

[119%] Building CXX object
CMakeFiles/clownCar.dir/examples_noinst/clownCar.C.o *
...
[138%] Built target examples_noinst

And on another machine, the last report was

[144%] Built target plasmasimple

All were with CMake 2.8.10.2

I see from
http://www.cmake.org/pipermail/cmake/2007-June/014856.html
that this has happened in the past, and how it might happen.

In my case, it happened when I did
make -j4 all examples_noinst

Is the simple act of building the special 'all' target and a
target that uses EXCLUDE_FROM_ALL enough to trigger this
strange behavior?  I haven't checked, but it's a tempting guess.
- Dan

* Not important to this report, but amusing


I've also seen this using the Makefile generator, the bigger problem is 
that it ends up building the dependencies of those targets in parallel, 
if there is overlap, it may try to build the same target multiple times 
simultaneously, which can obviously break the build


The workaround is to add a (cmake) target that depends on the set of 
targets you want to build in parallel.


Ben


--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] 138% progress when building both all and not-in-all target?

2014-06-20 Thread David Cole via CMake

138%
make -j4 all examples_noinst



I've seen this too but never noticed a pattern about when it happens.


Does it always happen when naming more than one target with make -j?

I thought you were not supposed to name more than one target with make 
-j... (but I don't understand fully exactly why that's a bad thing...)


--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] 138% progress when building both all and not-in-all target?

2014-06-20 Thread Leif Walsh
Definitely when using -j, I'm not sure about multiple targets. That would be a 
kind of insane restriction if it were true, I think. 


I also sometimes see dependencies not get satisfied during parallel builds, 
when you say something about parallel multiple target builds that worries me, 
but honestly it's probably that I'm actually missing the deps and just almost 
always get lucky with scheduling. 
-- 
Cheers,
Leif

On Fri, Jun 20, 2014 at 6:02 AM, David Cole dlrd...@aol.com wrote:

 138%
 make -j4 all examples_noinst
 I've seen this too but never noticed a pattern about when it happens.
 Does it always happen when naming more than one target with make -j?
 I thought you were not supposed to name more than one target with make 
 -j... (but I don't understand fully exactly why that's a bad thing...)-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

Re: [CMake] 138% progress when building both all and not-in-all target?

2014-06-20 Thread Dan Kegel
On Fri, Jun 20, 2014 at 3:02 AM, David Cole dlrd...@aol.com wrote:
 138%
 make -j4 all examples_noinst

 I've seen this too but never noticed a pattern about when it happens.

 Does it always happen when naming more than one target with make -j?

 I thought you were not supposed to name more than one target with make -j...
 (but I don't understand fully exactly why that's a bad thing...)

make itself certainly doesn't have a bug along these lines; you can make -j
a hundred targets at once and it won't double-build -- if the Makefile
has proper dependencies.

I could try to demonstrate the problem with a tiny CMakeLists.txt,
but I'm not sure when I'll have time.
- Dan
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] 138% progress when building both all and not-in-all target?

2014-06-20 Thread Leif Walsh
wow


On Fri, Jun 20, 2014 at 10:31 AM, Dan Kegel d...@kegel.com wrote:

 It occurs to me that invoking make on this cmake-generated makefile
 with two targets and -j4 has indeed triggered a more serious problem,
 and the build fails nondeterministically with an internal error in ld
 (presumably because the linker's being invoked twice in parallel on
 the same file?).
 See https://bugs.launchpad.net/ubuntu/+source/binutils/+bug/423756

 On Fri, Jun 20, 2014 at 6:45 AM, Dan Kegel d...@kegel.com wrote:
  On Fri, Jun 20, 2014 at 3:02 AM, David Cole dlrd...@aol.com wrote:
  138%
  make -j4 all examples_noinst
 
  I've seen this too but never noticed a pattern about when it happens.
 
  Does it always happen when naming more than one target with make -j?
 
  I thought you were not supposed to name more than one target with make
 -j...
  (but I don't understand fully exactly why that's a bad thing...)
 
  make itself certainly doesn't have a bug along these lines; you can make
 -j
  a hundred targets at once and it won't double-build -- if the Makefile
  has proper dependencies.
 
  I could try to demonstrate the problem with a tiny CMakeLists.txt,
  but I'm not sure when I'll have time.
  - Dan




-- 
Cheers,
Leif
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

Re: [CMake] 138% progress when building both all and not-in-all target?

2014-06-20 Thread Dan Kegel
It occurs to me that invoking make on this cmake-generated makefile
with two targets and -j4 has indeed triggered a more serious problem,
and the build fails nondeterministically with an internal error in ld
(presumably because the linker's being invoked twice in parallel on
the same file?).
See https://bugs.launchpad.net/ubuntu/+source/binutils/+bug/423756

On Fri, Jun 20, 2014 at 6:45 AM, Dan Kegel d...@kegel.com wrote:
 On Fri, Jun 20, 2014 at 3:02 AM, David Cole dlrd...@aol.com wrote:
 138%
 make -j4 all examples_noinst

 I've seen this too but never noticed a pattern about when it happens.

 Does it always happen when naming more than one target with make -j?

 I thought you were not supposed to name more than one target with make -j...
 (but I don't understand fully exactly why that's a bad thing...)

 make itself certainly doesn't have a bug along these lines; you can make -j
 a hundred targets at once and it won't double-build -- if the Makefile
 has proper dependencies.

 I could try to demonstrate the problem with a tiny CMakeLists.txt,
 but I'm not sure when I'll have time.
 - Dan
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] 138% progress when building both all and not-in-all target?

2014-06-20 Thread Dan Kegel
For what it's worth, that ld error message I ran into does point to
the linker being run twice concurrently with same commandline.
( See also https://bugzilla.redhat.com/show_bug.cgi?id=809122 )

On Fri, Jun 20, 2014 at 7:35 AM, Leif Walsh leif.wa...@gmail.com wrote:
 wow


 On Fri, Jun 20, 2014 at 10:31 AM, Dan Kegel d...@kegel.com wrote:

 It occurs to me that invoking make on this cmake-generated makefile
 with two targets and -j4 has indeed triggered a more serious problem,
 and the build fails nondeterministically with an internal error in ld
 (presumably because the linker's being invoked twice in parallel on
 the same file?).
 See https://bugs.launchpad.net/ubuntu/+source/binutils/+bug/423756

 On Fri, Jun 20, 2014 at 6:45 AM, Dan Kegel d...@kegel.com wrote:
  On Fri, Jun 20, 2014 at 3:02 AM, David Cole dlrd...@aol.com wrote:
  138%
  make -j4 all examples_noinst
 
  I've seen this too but never noticed a pattern about when it happens.
 
  Does it always happen when naming more than one target with make -j?
 
  I thought you were not supposed to name more than one target with make
  -j...
  (but I don't understand fully exactly why that's a bad thing...)
 
  make itself certainly doesn't have a bug along these lines; you can make
  -j
  a hundred targets at once and it won't double-build -- if the Makefile
  has proper dependencies.
 
  I could try to demonstrate the problem with a tiny CMakeLists.txt,
  but I'm not sure when I'll have time.
  - Dan




 --
 Cheers,
 Leif
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] 138% progress when building both all and not-in-all target?

2014-06-19 Thread Leif Walsh
I've seen this too but never noticed a pattern about when it happens. -- 
Cheers,
Leif

On Fri, Jun 20, 2014 at 12:40 AM, Dan Kegel d...@kegel.com wrote:

 Seen in the wild today:
 [119%] Building CXX object
 CMakeFiles/clownCar.dir/examples_noinst/clownCar.C.o *
 ...
 [138%] Built target examples_noinst
 And on another machine, the last report was
 [144%] Built target plasmasimple
 All were with CMake 2.8.10.2
 I see from
 http://www.cmake.org/pipermail/cmake/2007-June/014856.html
 that this has happened in the past, and how it might happen.
 In my case, it happened when I did
make -j4 all examples_noinst
 Is the simple act of building the special 'all' target and a
 target that uses EXCLUDE_FROM_ALL enough to trigger this
 strange behavior?  I haven't checked, but it's a tempting guess.
 - Dan
 * Not important to this report, but amusing
 -- 
 Powered by www.kitware.com
 Please keep messages on-topic and check the CMake FAQ at: 
 http://www.cmake.org/Wiki/CMake_FAQ
 Kitware offers various services to support the CMake community. For more 
 information on each offering, please visit:
 CMake Support: http://cmake.org/cmake/help/support.html
 CMake Consulting: http://cmake.org/cmake/help/consulting.html
 CMake Training Courses: http://cmake.org/cmake/help/training.html
 Visit other Kitware open-source projects at 
 http://www.kitware.com/opensource/opensource.html
 Follow this link to subscribe/unsubscribe:
 http://public.kitware.com/mailman/listinfo/cmake-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake