[Cook] Distcc and Cook

Jerry Pendergraft jerry at endocardial.com
Wed Feb 16 02:22:52 EST 2005


OK then the simple solution is to do
 parallel_rsh = distcc_wrap;

and distcc_wrap is:
#!/bin/sh
host=$1; shift
exec distcc $*

For a longer explanation .. in case it helps.
Cook can do parallel builds or remote builds or parallel remote builds.
To do that there are multiple settings you use to get the effect you want.
The first is parallel_rsh which tells cook what command to execute.
Next is parallel_hosts in which you list available hosts.
Next is host-binding which you put on recipes for which you want
finer control over which remote hosts are used.
And there is parallel_jobs which is equivalent to -p command line argument.

Without a host-binding line cook will select (round robin) from your
parallel_hosts list. That appears to be what is happening for you.

In most of my projects I build in parallel for multiple architectures and
multiple compilers so for any given command the architecture is a
necessary argument. That is done by using a host-binding setting in a 
recipe like:
%1/obj/%2/%3.o: [match_mask %%0%3.c   [prog_sources]]
    host-binding %1_C

So the command generated is [parallel_rsh] <arch>_C
And my parallel_rsh is set to cook_rsh which implements a a multi host
multi architecture load balancing process.
See the man page for cook_rsh for some examples of those setups.
The aegis distribution contains cook_rsh.

Hope that helps.
-- 
Jerry Pendergraft                        jerry.pendergraft at endocardial.com
Endocardial Solutions                    voice: 651-523-6935
1350 Energy Lane, Suite 110                fax: 651-644-7897
St Paul, MN 55108-5254                  mobile: 651-491-0163

On Tue, 15 Feb 2005, Simon Clift wrote:

> On Mon, 2005-02-14 at 21:16 -0600, Jerry Pendergraft wrote:
> > Not at all familiar with distcc but probably the step you missed is:
> > parallel_rsh = distcc [any other args]
> 
> 
> Hmm... but then cook tries to generate command lines like:
> 
>   distcc computer26 gcc -c foo.c
> 
> using a parallel_hosts variable that I set.  I need cook to
> generate simple
> 
>   distcc -c foo.c
> 
> or
> 
>   distcc gcc -c foo.c
> 
> lines, just several threads at once.  DistCC takes care of
> distributing the load over the various "volunteer" clients
> you list in its configuration files.
> 
> I'd hoped that cook would be fooled into thinking I had, in
> effect, a multi- processor box.
> 
> 




More information about the Cook-users mailing list