[CMake] Why does dependency scanning in version 2.6 seem so slow?

2008-12-03 Thread Senanu Pearson

Hi folks,

Is there a way to speed up the dependency scan in version 2.6?

I recently installed a new Linux OS (Mandriva 2009) which included an 
upgrade to cmake 2.6 (I _think_ I had version 2.4 before). However, when 
I run make (after running "cmake .") it takes a long time (>1min) to do 
the dependency scan. (i.e. the time when the message "Scanning 
dependencies of target foo" is printed) whereas the rest of the build 
takes about 10 seconds. This happens every time I run make but it does 
successfully build (and the "cmake ." step is fast).


The odd thing is that it was almost instantaneous (with essentially the 
same code) under version 2.4 and is almost instantaneous on a (faster) 
mac (again, with the same code).


Is there any way to speed this up without using the "make foo/fast" 
option every time?


Thank you very much for your consideration,
Mark Pearson

(a few more details that might be relevant follow)...
My project is quite simple but makes use of the STL, gnu scientific 
library (gsl) and boost. Specifically, it includes the following:

#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 

#include 
#include 
#include 

#include 
#include 
#include 

___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Why does dependency scanning in version 2.6 seem so slow?

2008-12-03 Thread Eric Noulard
2008/12/3 Senanu Pearson <[EMAIL PROTECTED]>:
> Hi folks,
>
> Is there a way to speed up the dependency scan in version 2.6?
>
> I recently installed a new Linux OS (Mandriva 2009) which included an
> upgrade to cmake 2.6 (I _think_ I had version 2.4 before). However, when I
> run make (after running "cmake .") it takes a long time (>1min) to do the
> dependency scan. (i.e. the time when the message "Scanning dependencies of
> target foo" is printed) whereas the rest of the build takes about 10
> seconds. This happens every time I run make but it does successfully build
> (and the "cmake ." step is fast).

I did not experienced such slow down when going from 2.4 to 2.6
would you be able to try a CMake 2.4 on the same system?

You may

1) download a tarball
http://www.cmake.org/files/v2.4/cmake-2.4.8-Linux-i386.tar.gz
2) untar it somewhere,
3) update you path
4) retry the build.

> The odd thing is that it was almost instantaneous (with essentially the same
> code) under version 2.4 and is almost instantaneous on a (faster) mac
> (again, with the same code).
>

CMake is not the only thing which have changed then:


   - system
   - compiler  --> this may be important.
   - disk speed, cpu, ..;


-- 
Erk
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Why does dependency scanning in version 2.6 seem so slow?

2008-12-03 Thread Bill Hoffman

Senanu Pearson wrote:

Hi folks,

Is there a way to speed up the dependency scan in version 2.6?

I recently installed a new Linux OS (Mandriva 2009) which included an 
upgrade to cmake 2.6 (I _think_ I had version 2.4 before). However, when 
I run make (after running "cmake .") it takes a long time (>1min) to do 
the dependency scan. (i.e. the time when the message "Scanning 
dependencies of target foo" is printed) whereas the rest of the build 
takes about 10 seconds. This happens every time I run make but it does 
successfully build (and the "cmake ." step is fast).


The odd thing is that it was almost instantaneous (with essentially the 
same code) under version 2.4 and is almost instantaneous on a (faster) 
mac (again, with the same code).


Is there any way to speed this up without using the "make foo/fast" 
option every time?


It should not be any slower.   If you do a make VERBOSE=1 you should see 
something like this:


make[3]: Entering directory `/cygdrive/c/hoffman/My Builds/CMake-build26'
"C:/Program Files/CMake 2.6/bin/cmake.exe" -E cmake_depends "Unix 
Makefiles" "C:/hoffman/My Builds/CMake" "C:/hoffman/My 
Builds/CMake/Utilities/cmzlib" "C:/hoffman/My Builds/CMake-build26" 
"C:/hoffman/My Builds/CMake-build26/Utilities/cmzlib" "C:/hoffman/My 
Builds/CMake-build26/Utilities/cmzlib/CMakeFiles/cmzlib.dir/DependInfo.cmake" 
--color=
Dependee "C:/hoffman/My Builds/CMake/Utilities/cmzlib/deflate.c" is 
newer than depender "Utilities/cmzlib/CMakeFiles/cmzlib.dir/deflate.obj".
Clearing dependencies in "C:/hoffman/My 
Builds/CMake-build26/Utilities/cmzlib/CMakeFiles/cmzlib.dir/depend.make".

Scanning dependencies of target cmzlib

Can you send me (off the list) the depend.make, DependInfo.cmake files 
from the slow depend library?


Also, as was suggested please try the binary from the www.cmake.org site 
for linux.  We do use stl, and it can run very slow if it is not 
optimized.


-Bill


___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Why does dependency scanning in version 2.6 seem so slow?

2008-12-04 Thread Alexander Neundorf
On Wednesday 03 December 2008, Senanu Pearson wrote:
> Hi folks,
>
> Is there a way to speed up the dependency scan in version 2.6?
>
> I recently installed a new Linux OS (Mandriva 2009) which included an
> upgrade to cmake 2.6 (I _think_ I had version 2.4 before). However, when

If I remember correctly, I think in some 2.2.x version the dependency scanning 
got slower, but since then has been optimized again (may have been related to 
the makefile generator version 2 or 3).
So maybe if you updated from 2.0 there would be a slowdown, from 2.4 there 
shouldn't be.

Patches to speed it up would of course be welcome :-)
But I'm afraid that won't be very easy.
Maybe it could be multithreaded to scan multiple files at once ?

Alex
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Why does dependency scanning in version 2.6 seem so slow?

2008-12-06 Thread Daniel Nelson

Senanu Pearson wrote:

Is there a way to speed up the dependency scan in version 2.6?


As my cmake projects became larger I noticed that dependency scanning 
became a much larger percentage of my build time.  My project used a 
pre-compiled header, which included parts of boost, Qt, and stl.  This 
caused cmake's dependency scanning to consider every object file to 
include everything in the PCH.  My depends.make grew to be about 10 MB 
each for all ten or so sub-projects in my greater project.


The fix was to use INCLUDE_REGULAR_EXPRESSION to block headers that are 
not going to change from dependency scanning.  Unfortunately you need to 
come up with a regex that matches only files you want to do dependency 
scanning on.  I could never think of one that would work, so instead I 
made some changes to my copy of cmake.  I decided that what I really 
wanted to do is exclude everything from dependency scanning that is 
included using angle brackets, and I added an additional argument to 
INCLUDE_REGULAR_EXPRESSION that would do this.


Once I stopped following <> includes, my build times on a full rebuild 
decreased from about 10 minutes to 8 and the build time of building on 
an unmodified source tree dropped from 1m20s to about 20s.  This is 
something I have meaning to put in as a feature request for along time, 
but just haven't had time.


I should mention that I did this all when using 2.4 and I haven't 
noticed any speed difference with 2.6



___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake