[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: how to speed up compilation
From:       Stephan Kulow <coolo () itm ! mu-luebeck ! de>
Date:       1999-07-07 15:19:48
[Download RAW message or body]

Werner Trobin wrote:
> 
> Stephan Kulow wrote:
> > > [...]
> > >
> > > If this thought was correct it would be cool if we (yes, Coolo would
> > > have to do it, sorry Coolo) would create a new option (--enable-2).
> > > Instead of creating one huge file (--enable-final) this should create
> > > two files. Each of these files would contain half of the sources.
> > > If you then build it with make MAKE="make -j 2" -j 2 this sould be
> > > somewhat faster because you can use the 2nd CPU, too.
> > > Of course there are disadvantages (e.g. the resulting lib is bigger,
> > > Coolo has to implement, test, fix it,...), but I think it would be
> > > worth the troubles...
> > >
> > Well, I would do it. You just need to send me a testbed system.
> 
> No problem >:) These tests can be done with single-CPU-systems, too.
> 
> > But somehow I'm afraid you have no idea what you just said - I mean,
> > what it would mean for the Makefiles.
> 
> OK. I'll try it again (My English is very poor. If you don't
> understand this "version", I'll send a (private) German mail :)
> 
> At the moment things are quite like this: You configure your
> module (e.g. koffice) with --enable-final. Now you start the
> make-process (a "normal" make, i.e. only one process). Make
> enters a dir (e.g. kpresenter) and creates a file. This file
> is called kpresenter.all_cc.cc (or something like that) and
> this single file contains all the source-files via a simple
> #include. AFAIK making a single file can only be done by one
> process on one CPU (I may be wrong here, as I'm no SMP expert).
> Therefore the other CPU is bored -> no speed gain over one CPU.
> 
> There are two possible solutions for that problem (explanation
> via two simple examples):
> 
> 1) You still want to compile koffice. make enters the kpresenter-
>    directory and starts compiling the kpresenter.all_cc.cc file.
>    If you started make like this: make MAKE="make -j 2" -j 2
>    the other make process waits and does nothing.
>    My question: Is there a possibility (for a Makefile-guru) to
>    compile kpresenter AND kword at the same time? This means:
>    The first make-process enters the kpresenter dir and starts
>    compiling, the 2nd make-process enters the kword dir and
>    does the same... As I can't see any dependencies between
>    kpresenter and kword this should be possible.
How about "make -C kword &; make -C kpresenter"? ;)
> 
> 2) Once again the kpresenter-example. You configure with --enable-
>    final and make enters the kpresenter dir. One CPU compiles the
>    single, huge kpresenter.all_cc.cc.
>    My question: What about creating kpresenter.1st_half_cc.cc and
>    kpresenter.2nd_half_cc.cc instead of kpresenter.all_cc.cc?
>    Each of the two new files contain half of the source-files (via
>    #include, of course). Therefore each CPU compiles one of these
>    two files (at the same time).
> 
> I hope this was a little bit easier to understand. If someone still
> has problems (or wants to correct me!), please, speak up!
> 
Well, I know what you mean. But I doubt that you have the slightest
idea how this would have to be implemented (the later). Actually I
would be impressed if you tell me how the current solution works ;)

I'm not sure how you write Makefiles that 
1. go into subdirs indepently and 
2. build the following subdirs sequently

The current trick is to push all make jobs through one pipe when
you go deeper into the subdirs. Anything else would require a Qt
like "1 big Makefile with all dependencies" solution.

Greetings, Stephan

-- 
As long as Linux remains a religion of freeware fanatics,
Microsoft have nothing to worry about.  
                       By Michael Surkan, PC Week Online

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic