Fwd: [distcc] how to get separate compile tasks

Fergus Henderson fergus at google.com
Mon Mar 23 16:24:41 GMT 2009


On Mon, Mar 23, 2009 at 12:01 PM, <ibaker at mail.cern.ch> wrote:

> On Mon, 23 Mar 2009, Yanchun Wang wrote:
>
>  Thank you for your answer. Then if i send a same command, for example
>> "make
>> –j4 CC=distcc –f makefile.x86_linux",
>> to all servers over the LAN, (and the program source files to be compiled
>> are stored on a shared disk. )
>> Servers call these commands. Then distributed multithreading compiling can
>> be realized. Correct?
>>
>>
> No.  When distcc is invoked it translates what follows as options to gcc
> (with a few exceptions).  So in the above case "–f makefile.x86_linux" will
> be parsed and analysed by distcc as compiler options.


Minor correction: in the above command line, "make –j4 CC=distcc –f
makefile.x86_linux", the "-f makefile.x86_linux" will be interpreted by
"make" as an option to "make", not as part of the definition of the "CC"
variable, so it won't be passed to distcc.

But your other statements are entirely correct:


> distcc doesn't work that way.  A client uses one makefile to distribute
> individual compilation jobs (which include the files and the compiler
> options etc) to several build servers (one job is processed by one server),
> concurrency is controlled through make's -j option.
>
> If you invoke:
>
> make -j4 CC=distcc
>
> from within your build directory (the man page details other ways distcc
> can be invoked), then distcc should distribute jobs to your build servers
> (assuming everything has been set up correctly).
>

Yanchun, note that you should set the DISTCC_HOSTS environment variable to
the names of the servers that distcc will distribute the jobs to.

-- 
Fergus Henderson <fergus at google.com>
-------------- next part --------------
HTML attachment scrubbed and removed


More information about the distcc mailing list