/[gentoo]/xml/htdocs/doc/en/distcc.xml
Gentoo

Diff of /xml/htdocs/doc/en/distcc.xml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.23 Revision 1.24
1<?xml version='1.0' encoding="UTF-8"?> 1<?xml version='1.0' encoding="UTF-8"?>
2<!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> 2<!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
3<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/distcc.xml,v 1.23 2004/11/09 11:37:30 swift Exp $ --> 3<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/distcc.xml,v 1.24 2004/12/22 22:43:45 swift Exp $ -->
4 4
5<guide link="/doc/en/distcc.xml"> 5<guide link="/doc/en/distcc.xml">
6 6
7<title>Gentoo Distcc Documentation</title> 7<title>Gentoo Distcc Documentation</title>
8 8
9<author title="Author"> 9<author title="Author">
10 <mail link="lisa@gentoo.org">Lisa Seelye</mail> 10 <mail link="lisa@gentoo.org">Lisa Seelye</mail>
11</author> 11</author>
12 12
13<author title="Editor"> 13<author title="Editor">
14 <mail link="vapier@gentoo.org">Mike Frysinger</mail> 14 <mail link="vapier@gentoo.org">Mike Frysinger</mail>
15</author> 15</author>
16 16
17<author title="Editor"> 17<author title="Editor">
18 <mail link="erwin@gentoo.org">Erwin</mail> 18 <mail link="erwin@gentoo.org">Erwin</mail>
26 <mail link="pylon@gentoo.org">Lars Weiler</mail> 26 <mail link="pylon@gentoo.org">Lars Weiler</mail>
27</author> 27</author>
28 28
29<author title="Reviewer"> 29<author title="Reviewer">
30 <mail link="blubber@gentoo.org">Tiemo Kieft</mail> 30 <mail link="blubber@gentoo.org">Tiemo Kieft</mail>
31</author> 31</author>
32 32
33<abstract> 33<abstract>
34This document serves as a HOWTO for using distcc with Gentoo. 34This document serves as a HOWTO for using distcc with Gentoo.
35</abstract> 35</abstract>
36 36
37<!-- The content of this document is licensed under the CC-BY-SA license --> 37<!-- The content of this document is licensed under the CC-BY-SA license -->
38<!-- See http://creativecommons.org/licenses/by-sa/1.0 --> 38<!-- See http://creativecommons.org/licenses/by-sa/1.0 -->
39<license/> 39<license/>
40 40
41<version>1.9</version> 41<version>1.10</version>
42<date>November 09, 2004</date> 42<date>December 22, 2004</date>
43 43
44<chapter> 44<chapter>
45<title>Introduction</title> 45<title>Introduction</title>
46<section> 46<section>
47<title>What is distcc?</title> 47<title>What is distcc?</title>
48<body> 48<body>
49 49
50<p> 50<p>
51Distcc is a program designed to distribute compiling tasks across a network to 51Distcc is a program designed to distribute compiling tasks across a network to
52participating hosts. It is comprised of a server, <c>distccd</c> and a client 52participating hosts. It is comprised of a server, <c>distccd</c> and a client
53program, <c>distcc</c>. Distcc can work transparently with <uri 53program, <c>distcc</c>. Distcc can work transparently with <uri
54link="http://ccache.samba.org">ccache</uri> and Portage with a little work. 54link="http://ccache.samba.org">ccache</uri> and Portage with a little work.
55</p> 55</p>
56 56
57</body> 57</body>
159docs for more information. 159docs for more information.
160</p> 160</p>
161 161
162<p> 162<p>
163For instance, to set the first line in the previous example: 163For instance, to set the first line in the previous example:
164</p> 164</p>
165 165
166<pre caption="Sample command to set the hosts"> 166<pre caption="Sample command to set the hosts">
167# <i>/usr/bin/distcc-config --set-hosts "192.168.0.1 192.168.0.2 192.168.0.3"</i> 167# <i>/usr/bin/distcc-config --set-hosts "192.168.0.1 192.168.0.2 192.168.0.3"</i>
168</pre> 168</pre>
169 169
170<p> 170<p>
171Edit <path>/etc/conf.d/distccd</path> to your needs and be sure to set the 171Edit <path>/etc/conf.d/distccd</path> to your needs and be sure to set the
172<c>--allow</c> directive to allow only hosts you trust. For more information 172<c>--allow</c> directive to allow only hosts you trust. For more information
173please see the <uri link="http://distcc.samba.org/security.html">Distcc Security 173please see the <uri link="http://distcc.samba.org/security.html">Distcc Security
174Design</uri>. 174Design</uri>. For added security you should also use the <c>--listen</c>
175directive to tell the Distcc daemon what IP to listen on (for multi-homed
176systems).
175</p> 177</p>
176 178
177<p> 179<p>
178Now start the distcc daemon on all the participating computers: 180Now start the distcc daemon on all the participating computers:
179</p> 181</p>
180 182
181<pre caption="Starting the distcc daemon"> 183<pre caption="Starting the distcc daemon">
182<comment>(Add distccd to the default runlevel)</comment> 184<comment>(Add distccd to the default runlevel)</comment>
183# <i>rc-update add distccd default</i> 185# <i>rc-update add distccd default</i>
184<comment>(Start the distcc daemon)</comment> 186<comment>(Start the distcc daemon)</comment>
185# <i>/etc/init.d/distccd start</i> 187# <i>/etc/init.d/distccd start</i>
186</pre> 188</pre>
187 189
188</body> 190</body>
189</section> 191</section>
223<body> 225<body>
224 226
225<p> 227<p>
226Cross-compiling is using one architecture to build programs for another 228Cross-compiling is using one architecture to build programs for another
227architecture. This can be as simple as using an Athlon (i686) to build a 229architecture. This can be as simple as using an Athlon (i686) to build a
228program for a K6-2 (i586), or using a Sparc to build a program for a ppc. 230program for a K6-2 (i586), or using a Sparc to build a program for a ppc.
229</p> 231</p>
230 232
231</body> 233</body>
232</section> 234</section>
233<section> 235<section>
234<title>An Introduction to Cross-compiling</title> 236<title>An Introduction to Cross-compiling</title>
235<body> 237<body>
236 238
237<p> 239<p>
238If you want to give Cross-compiling a try you can emerge the crossdev package. 240If you want to give Cross-compiling a try you can to follow <uri
239I can't support it since I didn't write it, but that's a good way to start 241link="http://dev.gentoo.org/~vapier/CROSS-COMPILE-HOWTO">The Cross Compile
240cross-compiling. 242HOWTO</uri>; Crossdev is depreciated.
241</p> 243</p>
242 244
243</body> 245</body>
244</section> 246</section>
245</chapter> 247</chapter>
246 248
247<chapter id="bootstrapping"> 249<chapter id="bootstrapping">
248<title>Using Distcc to Bootstrap</title> 250<title>Using Distcc to Bootstrap</title>
249<section> 251<section>
250<title>Step 1: Configure Portage </title> 252<title>Step 1: Configure Portage</title>
251<body> 253<body>
252 254
253<p> 255<p>
254Boot your new box with a Gentoo Linux LiveCD and follow the <uri 256Boot your new box with a Gentoo Linux LiveCD and follow the <uri
255link="/doc/en/handbook/handbook-x86.xml?part=1">installation instructions</uri> 257link="/doc/en/handbook/handbook-x86.xml?part=1">installation instructions</uri>
256up until the bootstrapping part. Then configure Portage to use distcc: 258up until the bootstrapping part. Then configure Portage to use distcc:
257</p> 259</p>
258 260
259<pre caption="Preliminary Setup"> 261<pre caption="Preliminary Setup">
260# <i>nano -w /etc/make.conf</i> 262# <i>nano -w /etc/make.conf</i>
261<comment>(Add distcc to the FEATURES variable)</comment> 263<comment>(Add distcc to the FEATURES variable)</comment>
262FEATURES="distcc" 264FEATURES="distcc"
263<comment>(Modify MAKEOPTS to include -jN with N an appropriate integer)</comment> 265<comment>(Modify MAKEOPTS to include -jN with N an appropriate integer)</comment>
264MAKEOPTS="-jN" 266MAKEOPTS="-jN"
265</pre> 267</pre>
271</body> 273</body>
272</section> 274</section>
273<section> 275<section>
274<title>Step 2: Getting Distcc</title> 276<title>Step 2: Getting Distcc</title>
275<body> 277<body>
276 278
277<p> 279<p>
278Before the installation of distcc, a user called distcc must be added to the 280Before the installation of distcc, a user called distcc must be added to the
279<path>/etc/passwd</path>: 281<path>/etc/passwd</path>:
280</p> 282</p>
281 283
282<pre caption="Create user distcc"> 284<pre caption="Create user distcc">
283# <i>echo "distcc:x:240:2:distccd:/dev/null:/bin/false" &gt;&gt; /etc/passwd</i> 285# <i>echo "distcc:x:240:2:distccd:/dev/null:/bin/false" &gt;&gt; /etc/passwd</i>
284</pre> 286</pre>
285 287
288<impo>
289It is important to note that adding users like this is very bad. We only do
290it here because there is no <c>useradd</c> utility (which you normally use for
291adding users) yet at this stage of installation.
292</impo>
293
286<p> 294<p>
287Install distcc: 295Install distcc:
288</p> 296</p>
289 297
290<pre caption="Getting Distcc on the new box"> 298<pre caption="Getting Distcc on the new box">
291# <i>USE='-*' emerge --nodeps distcc</i> 299# <i>USE='-*' emerge --nodeps sys-devel/distcc</i>
292</pre> 300</pre>
293 301
294</body> 302</body>
295</section> 303</section>
296<section> 304<section>
297<title>Step 3: Setting Up Distcc</title> 305<title>Step 3: Setting Up Distcc</title>
298<body> 306<body>
299 307
300<p> 308<p>
301Run <c>distcc-config</c> to setup distcc: 309Run <c>distcc-config --install</c> to setup distcc:
302</p> 310</p>
303 311
304<pre caption="Final distcc setup"> 312<pre caption="Final distcc setup">
305<comment>(Substitute host1, host2, ... with the IP number(s) of the participating hosts)</comment> 313<comment>(Substitute host1, host2, ... with the IP number(s) of the participating hosts)</comment>
306# <i>/usr/bin/distcc-config --set-hosts "localhost host1 host2 host3 ..."</i> 314# <i>/usr/bin/distcc-config --set-hosts "localhost host1 host2 host3 ..."</i>
307<comment>An example: <i>/usr/bin/distcc-config --set-hosts "localhost 192.168.0.4 192.168.0.6"</i></comment> 315<comment>An example: <i>/usr/bin/distcc-config --set-hosts "localhost 192.168.0.4 192.168.0.6"</i></comment>
308</pre> 316</pre>
309 317
310<p> 318<p>
311distcc is now set up to bootstrap! Continue the official installation 319distcc is now set up to bootstrap! Continue the official installation
312instructions and <e>don't forget</e> to re-emerge distcc after <c>emerge 320instructions and <e>do not forget</e> to re-emerge distcc after <c>emerge
313system</c>. This is to make sure that all of the dependencies you want are 321system</c>. This is to make sure that all of the dependencies you want are
314installed as well. 322installed as well.
315</p> 323</p>
316 324
317<note> 325<note>
318During bootstrap and <c>emerge system</c> Distcc may not appear to be used. 326During bootstrap and <c>emerge system</c> Distcc may not appear to be used.
319This is expected as some ebuilds do not work well with distcc, so they 327This is expected as some ebuilds do not work well with distcc, so they
320intentionally disable it. 328intentionally disable it.
321</note> 329</note>
322 330
323</body> 331</body>
324</section> 332</section>
325</chapter> 333</chapter>
326 334
327<chapter> 335<chapter>
361enable PaX protections in your kernel and <c>emerge hardened-gcc</c>. Both of 369enable PaX protections in your kernel and <c>emerge hardened-gcc</c>. Both of
362which are a good thing to do since for the most part the protections offered 370which are a good thing to do since for the most part the protections offered
363by both packages is a good thing and is transparent to the user. 371by both packages is a good thing and is transparent to the user.
364</p> 372</p>
365 373
366</body> 374</body>
367</section> 375</section>
368<section> 376<section>
369<title>Mixed GCC Versions</title> 377<title>Mixed GCC Versions</title>
370<body> 378<body>
371 379
372<p> 380<p>
373If you have different GCC versions on your hosts, there will likely be very 381If you have different GCC versions on your hosts, there will likely be very
374weird problems. The solution is to make certain all hosts have the same GCC 382weird problems. The solution is to make certain all hosts have the same GCC
375version. 383version.
384</p>
385
386<p>
387Recent Portage updates have made Portage use <c>${CHOST}-gcc</c> instead of
388<c>gcc</c>. This means that if you're mixing i686 machines with other types
389(i386, i586) you will run into problems. A workaround for this may be to
390<c>export CC='gcc' CXX='c++'</c> or to put it in <path>/etc/make.conf</path>,
391but that needs testing. If it works for you please email me,
392<mail link="lisa@gentoo.org">Lisa Seelye</mail>.
376</p> 393</p>
377 394
378</body> 395</body>
379</section> 396</section>
380</chapter> 397</chapter>
381 398
382<chapter> 399<chapter>
383<title>Distcc Extras</title> 400<title>Distcc Extras</title>
384<section> 401<section>
385<title>Distcc Monitors</title> 402<title>Distcc Monitors</title>
386<body> 403<body>
387 404
388<p> 405<p>
389Distcc ships with two monitors. The text-based one is always built and is 406Distcc ships with two monitors. The text-based one is always built and is
390called <c>distccmon-text</c>. Running it for the first time can be a bit 407called <c>distccmon-text</c>. Running it for the first time can be a bit

Legend:
Removed from v.1.23  
changed lines
  Added in v.1.24

  ViewVC Help
Powered by ViewVC 1.1.20