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

List:       kde-devel
Subject:    Re: how to speed up compilation
From:       Werner Trobin <wtrobin () carinthia ! com>
Date:       1999-07-07 15:03:20
[Download RAW message or body]

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.

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!

Werner

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

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