/[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.24 Revision 1.25
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.24 2004/12/22 22:43:45 swift Exp $ --> 3<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/distcc.xml,v 1.25 2005/01/16 16:23:30 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>
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.10</version> 41<version>1.10</version>
42<date>December 22, 2004</date> 42<date>2005-01-16</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>
58</section> 58</section>
59<section> 59<section>
60<title>Using distcc to bootstrap</title> 60<title>Using distcc to bootstrap</title>
61<body> 61<body>
62 62
63<p> 63<p>
64If you are planning on using distcc to help you bootstrap a Gentoo installation, 64If you are planning on using distcc to help you bootstrap a Gentoo installation,
65make sure you read the part on <uri link="#bootstrapping">Using distcc to 65make sure you read the section <uri link="#bootstrapping">Using distcc to
66Bootstrap</uri> which is situated further down in this document. 66Bootstrap</uri>, which is situated further down in this document.
67</p> 67</p>
68 68
69</body> 69</body>
70</section> 70</section>
71</chapter> 71</chapter>
72 72
73<chapter> 73<chapter>
74<title>Setup</title> 74<title>Setup</title>
75<section> 75<section>
76<title>Dependencies</title> 76<title>Dependencies</title>
77<body> 77<body>
78 78
79<p> 79<p>
80To start off with, to use Distcc all of the computers on your network need to 80In order to use Distcc, all of the computers on your network need to
81have the same GCC versions. Mixing 3.3.x (where the x varies) is okay, but 81have the same GCC versions. Mixing 3.3.x (where the x varies) is okay, but
82mixing 3.3.x and 3.2.x is not: your programs <b>will</b> have errors in it. 82mixing 3.3.x and 3.2.x <b>will</b> result in your programs having errors in them.
83</p> 83</p>
84 84
85</body> 85</body>
86</section> 86</section>
87<section> 87<section>
88<title>Installing Distcc</title> 88<title>Installing Distcc</title>
89<body> 89<body>
90 90
91<p> 91<p>
92There are a couple of options you should know about before you start 92There are a couple of options you should be aware of before you start
93installing distcc. 93installing distcc.
94</p> 94</p>
95 95
96<p> 96<p>
97Distcc ships with a graphical monitor to monitor tasks that your computer is 97Distcc ships with a graphical monitor to monitor tasks that your computer is
98sending away for compilation. If you use Gnome then put 'gnome' in your USE 98sending away for compilation. If you use Gnome then put 'gnome' in your USE
99flags. However, if you don't use Gnome and would still like to have the 99flags. However, if you don't use Gnome and would still like to have the
100monitor then you should put 'gtk' in your USE flags. 100monitor then you should put 'gtk' in your USE flags.
101</p> 101</p>
102 102
103<pre caption="Installing distcc"> 103<pre caption="Installing distcc">
104# <i>emerge distcc</i> 104# <i>emerge distcc</i>
105</pre> 105</pre>
106 106
107</body> 107</body>
108</section> 108</section>
109<section> 109<section>
110<title>Setting up Portage to use Distcc</title> 110<title>Setting up Portage to use Distcc</title>
111<body> 111<body>
112 112
113<p> 113<p>
114Setting up distcc is easy to do with Portage. Execute the following steps on 114Setting up Portage to use distcc is easy. Execute the following steps on
115each system that should participate in the distributed compiling: 115each system that should participate in the distributed compiling:
116</p> 116</p>
117 117
118<pre caption="Integrating Distcc and Portage"> 118<pre caption="Integrating Distcc and Portage">
119# <i>emerge distcc</i> 119# <i>emerge distcc</i>
120# <i>nano -w /etc/make.conf</i> 120# <i>nano -w /etc/make.conf</i>
121<comment>(Set N to a suitable number for your particular setup)</comment> 121<comment>(Set N to a suitable number for your particular setup)</comment>
122<comment>(A common heuristic strategy is twice the number of total CPUs + 1)</comment> 122<comment>(A common heuristic strategy is twice the number of total CPUs + 1)</comment>
123MAKEOPTS="-jN" 123MAKEOPTS="-jN"
124<comment>(Add distcc to your FEATURES variable)</comment> 124<comment>(Add distcc to your FEATURES variable)</comment>
125FEATURES="distcc" 125FEATURES="distcc"
126</pre> 126</pre>
127 127
128</body>
129</section>
130<section>
131<title>Specifying Participating Hosts</title>
132<body>
133
128<p> 134<p>
129Next you have to specify what hosts you want to use. Use the
130<c>distcc-config</c> command to set the list of hosts. Here is an example of 135Use the <c>distcc-config</c> command to set the list of hosts. Here is an example of
131some hosts that might be in your list: 136some hosts that might be in your list:
132</p> 137</p>
133 138
134<pre caption="Examples of host definitions"> 139<pre caption="Examples of host definitions">
135192.168.0.1 192.168.0.2 192.168.0.3 140192.168.0.1 192.168.0.2 192.168.0.3
136192.168.0.1/2 192.168.0.2 192.168.0.3/10 141192.168.0.1/2 192.168.0.2 192.168.0.3/10
137192.168.0.1:4000/2 192.168.0.2/1 192.168.0.3:3632/4 142192.168.0.1:4000/2 192.168.0.2/1 192.168.0.3:3632/4
138@192.168.0.1 @192.168.0.2:/usr/bin/distccd 192.168.0.3 143@192.168.0.1 @192.168.0.2:/usr/bin/distccd 192.168.0.3
139<comment>(There are also several other methods of setting up hosts. See the 144<comment>(There are also several other methods of setting up hosts. See the
140distcc manpage for more details.)</comment> 145distcc manpage for more details.)</comment>
141</pre> 146</pre>
142 147
143<p> 148<p>
144It may all look complicated, but in most cases a variant of line 1 or 2 will 149It may all look complicated, but in most cases a variant of line 1 or 2 will
145work. 150work.
157Since most people won't be using lines 3 or 4, I'll <uri 162Since most people won't be using lines 3 or 4, I'll <uri
158link="http://distcc.samba.org/man/distcc_1.html">point you to</uri> the distcc 163link="http://distcc.samba.org/man/distcc_1.html">point you to</uri> the distcc
159docs for more information. 164docs for more information.
160</p> 165</p>
161 166
162<p> 167<p>
163For instance, to set the first line in the previous example: 168For instance, to set the first line in the previous example:
164</p> 169</p>
165 170
166<pre caption="Sample command to set the hosts"> 171<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> 172# <i>/usr/bin/distcc-config --set-hosts "192.168.0.1 192.168.0.2 192.168.0.3"</i>
168</pre> 173</pre>
169 174
170<p> 175<p>
171Edit <path>/etc/conf.d/distccd</path> to your needs and be sure to set the 176Edit <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 177<c>--allow</c> directive to allow only hosts you trust. For added security, you should also use the <c>--listen</c>
173please see the <uri link="http://distcc.samba.org/security.html">Distcc Security
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 178directive to tell the distcc daemon what IP to listen on (for multi-homed
176systems). 179systems). More information on distcc security can be found at <uri link="http://distcc.samba.org/security.html">Distcc Security
180Design</uri>.
177</p> 181</p>
178 182
179<p> 183<p>
180Now start the distcc daemon on all the participating computers: 184Now start the distcc daemon on all the participating computers:
181</p> 185</p>
182 186
183<pre caption="Starting the distcc daemon"> 187<pre caption="Starting the distcc daemon">
184<comment>(Add distccd to the default runlevel)</comment> 188<comment>(Add distccd to the default runlevel)</comment>
185# <i>rc-update add distccd default</i> 189# <i>rc-update add distccd default</i>
186<comment>(Start the distcc daemon)</comment> 190<comment>(Start the distcc daemon)</comment>
187# <i>/etc/init.d/distccd start</i> 191# <i>/etc/init.d/distccd start</i>
188</pre> 192</pre>
189 193
190</body> 194</body>
191</section> 195</section>
192<section> 196<section>
193<title>Setting up Distcc to Work With Automake</title> 197<title>Setting up Distcc to Work With Automake</title>
194<body> 198<body>
195 199
196<p> 200<p>
197This is in some cases easier than the Portage setup. What you have to do is 201This is, in some cases, easier than the Portage setup. What you have to do is
198update your <c>PATH</c> variable to include <path>/usr/lib/distcc/bin</path> 202update your <c>PATH</c> variable to include <path>/usr/lib/distcc/bin</path>
199in front of the directory that contains <c>gcc</c> (<path>/usr/bin</path>). 203in front of the directory that contains <c>gcc</c> (<path>/usr/bin</path>).
200However, there is a caveat. If you use ccache you have to put distcc after 204However, there is a caveat. If you use ccache you have to put distcc after
201the ccache part: 205the ccache part:
202</p> 206</p>
203 207
204<pre caption="Setting your path"> 208<pre caption="Setting your path">
205# <i>export PATH="/usr/lib/ccache/bin:/usr/lib/distcc/bin:${PATH}"</i> 209# <i>export PATH="/usr/lib/ccache/bin:/usr/lib/distcc/bin:${PATH}"</i>
206</pre> 210</pre>
207 211
208<p> 212<p>
209Then, as you would normally type <c>make</c>, you would type <c>make -jN</c> 213Then, as you would normally type <c>make</c>, you would type <c>make -jN</c>
210(where N is an integer). The value of N depends on your network and the types 214(where N is an integer). The value of N depends on your network and the types
211of computers you are using to compile. For me, I have a dual processor P3 and 215of computers you are using to compile. For me, I have a dual processor P3 and
212a K6-2/400 that compiles everything for my desktop (a 1200MHz Athlon 216a K6-2/400 that compiles everything for my desktop (a 1200MHz Athlon
221<chapter> 225<chapter>
222<title>Cross-Compiling</title> 226<title>Cross-Compiling</title>
223<section> 227<section>
224<title>A Note on Cross-Compiling</title> 228<title>A Note on Cross-Compiling</title>
225<body> 229<body>
226 230
227<p> 231<p>
228Cross-compiling is using one architecture to build programs for another 232Cross-compiling is using one architecture to build programs for another
229architecture. This can be as simple as using an Athlon (i686) to build a 233architecture. This can be as simple as using an Athlon (i686) to build a
230program for a K6-2 (i586), or using a Sparc to build a program for a ppc. 234program for a K6-2 (i586), or using a Sparc to build a program for a ppc.
231</p> 235</p>
232 236
233</body> 237</body>
234</section> 238</section>
235<section> 239<section>
236<title>An Introduction to Cross-compiling</title> 240<title>An Introduction to Cross-Compiling</title>
237<body> 241<body>
238 242
239<p> 243<p>
240If you want to give Cross-compiling a try you can to follow <uri 244If you want to give cross-compiling a try you can to follow <uri
241link="http://dev.gentoo.org/~vapier/CROSS-COMPILE-HOWTO">The Cross Compile 245link="http://dev.gentoo.org/~vapier/CROSS-COMPILE-HOWTO">The Cross Compile
242HOWTO</uri>; Crossdev is depreciated. 246HOWTO</uri>; Crossdev is deprecated.
243</p> 247</p>
244 248
245</body> 249</body>
246</section> 250</section>
247</chapter> 251</chapter>
248 252
249<chapter id="bootstrapping"> 253<chapter id="bootstrapping">
250<title>Using Distcc to Bootstrap</title> 254<title>Using Distcc to Bootstrap</title>
251<section> 255<section>
252<title>Step 1: Configure Portage</title> 256<title>Step 1: Configure Portage</title>
253<body> 257<body>
254 258
255<p> 259<p>
256Boot your new box with a Gentoo Linux LiveCD and follow the <uri 260Boot your new box with a Gentoo Linux LiveCD and follow the <uri
257link="/doc/en/handbook/handbook-x86.xml?part=1">installation instructions</uri> 261link="/doc/en/handbook/handbook-x86.xml?part=1">installation instructions</uri>
304<section> 308<section>
305<title>Step 3: Setting Up Distcc</title> 309<title>Step 3: Setting Up Distcc</title>
306<body> 310<body>
307 311
308<p> 312<p>
309Run <c>distcc-config --install</c> to setup distcc: 313Run <c>distcc-config --install</c> to setup distcc:
310</p> 314</p>
311 315
312<pre caption="Final distcc setup"> 316<pre caption="Final distcc setup">
313<comment>(Substitute host1, host2, ... with the IP number(s) of the participating hosts)</comment> 317<comment>(Substitute host1, host2, ... with the IP number(s) of the participating hosts)</comment>
314# <i>/usr/bin/distcc-config --set-hosts "localhost host1 host2 host3 ..."</i> 318# <i>/usr/bin/distcc-config --set-hosts "localhost host1 host2 host3 ..."</i>
315<comment>An example: <i>/usr/bin/distcc-config --set-hosts "localhost 192.168.0.4 192.168.0.6"</i></comment> 319<comment>An example: <i>/usr/bin/distcc-config --set-hosts "localhost 192.168.0.4 192.168.0.6"</i></comment>
316</pre> 320</pre>
317 321
318<p> 322<p>
319distcc is now set up to bootstrap! Continue the official installation 323Distcc is now set up to bootstrap! Continue with the official installation
320instructions and <e>do not forget</e> to re-emerge distcc after <c>emerge 324instructions and <e>do not forget</e> to re-emerge distcc after <c>emerge
321system</c>. This is to make sure that all of the dependencies you want are 325system</c>. This is to make sure that all of the dependencies you want are
322installed as well. 326installed as well.
323</p> 327</p>
324 328
325<note> 329<note>
326During bootstrap and <c>emerge system</c> Distcc may not appear to be used. 330During bootstrap and <c>emerge system</c> distcc may not appear to be used.
327This is expected as some ebuilds do not work well with distcc, so they 331This is expected as some ebuilds do not work well with distcc, so they
328intentionally disable it. 332intentionally disable it.
329</note> 333</note>
330 334
331</body> 335</body>
332</section> 336</section>
333</chapter> 337</chapter>
334 338
335<chapter> 339<chapter>
336<title>Troubleshooting</title> 340<title>Troubleshooting</title>
337<section> 341<section>
338<title>Mozilla and Xfree</title> 342<title>Mozilla and Xfree</title>
339<body> 343<body>
340 344
341<p> 345<p>

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

  ViewVC Help
Powered by ViewVC 1.1.20