| 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> |
| 34 | This document serves as a HOWTO for using distcc with Gentoo. |
34 | This 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> |
| 51 | Distcc is a program designed to distribute compiling tasks across a network to |
51 | Distcc is a program designed to distribute compiling tasks across a network to |
| 52 | participating hosts. It is comprised of a server, <c>distccd</c> and a client |
52 | participating hosts. It is comprised of a server, <c>distccd</c>, and a client |
| 53 | program, <c>distcc</c>. Distcc can work transparently with <uri |
53 | program, <c>distcc</c>. Distcc can work transparently with <uri |
| 54 | link="http://ccache.samba.org">ccache</uri> and Portage with a little work. |
54 | link="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> |
| 64 | If you are planning on using distcc to help you bootstrap a Gentoo installation, |
64 | If you are planning on using distcc to help you bootstrap a Gentoo installation, |
| 65 | make sure you read the part on <uri link="#bootstrapping">Using distcc to |
65 | make sure you read the section <uri link="#bootstrapping">Using distcc to |
| 66 | Bootstrap</uri> which is situated further down in this document. |
66 | Bootstrap</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> |
| 80 | To start off with, to use Distcc all of the computers on your network need to |
80 | In order to use Distcc, all of the computers on your network need to |
| 81 | have the same GCC versions. Mixing 3.3.x (where the x varies) is okay, but |
81 | have the same GCC versions. Mixing 3.3.x (where the x varies) is okay, but |
| 82 | mixing 3.3.x and 3.2.x is not: your programs <b>will</b> have errors in it. |
82 | mixing 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> |
| 92 | There are a couple of options you should know about before you start |
92 | There are a couple of options you should be aware of before you start |
| 93 | installing distcc. |
93 | installing distcc. |
| 94 | </p> |
94 | </p> |
| 95 | |
95 | |
| 96 | <p> |
96 | <p> |
| 97 | Distcc ships with a graphical monitor to monitor tasks that your computer is |
97 | Distcc ships with a graphical monitor to monitor tasks that your computer is |
| 98 | sending away for compilation. If you use Gnome then put 'gnome' in your USE |
98 | sending away for compilation. If you use Gnome then put 'gnome' in your USE |
| 99 | flags. However, if you don't use Gnome and would still like to have the |
99 | flags. However, if you don't use Gnome and would still like to have the |
| 100 | monitor then you should put 'gtk' in your USE flags. |
100 | monitor 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> |
| 114 | Setting up distcc is easy to do with Portage. Execute the following steps on |
114 | Setting up Portage to use distcc is easy. Execute the following steps on |
| 115 | each system that should participate in the distributed compiling: |
115 | each 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> |
| 123 | MAKEOPTS="-jN" |
123 | MAKEOPTS="-jN" |
| 124 | <comment>(Add distcc to your FEATURES variable)</comment> |
124 | <comment>(Add distcc to your FEATURES variable)</comment> |
| 125 | FEATURES="distcc" |
125 | FEATURES="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> |
| 129 | Next 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 |
135 | Use the <c>distcc-config</c> command to set the list of hosts. Here is an example of |
| 131 | some hosts that might be in your list: |
136 | some 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"> |
| 135 | 192.168.0.1 192.168.0.2 192.168.0.3 |
140 | 192.168.0.1 192.168.0.2 192.168.0.3 |
| 136 | 192.168.0.1/2 192.168.0.2 192.168.0.3/10 |
141 | 192.168.0.1/2 192.168.0.2 192.168.0.3/10 |
| 137 | 192.168.0.1:4000/2 192.168.0.2/1 192.168.0.3:3632/4 |
142 | 192.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 |
| 140 | distcc manpage for more details.)</comment> |
145 | distcc manpage for more details.)</comment> |
| 141 | </pre> |
146 | </pre> |
| 142 | |
147 | |
| 143 | <p> |
148 | <p> |
| 144 | It may all look complicated, but in most cases a variant of line 1 or 2 will |
149 | It may all look complicated, but in most cases a variant of line 1 or 2 will |
| 145 | work. |
150 | work. |
| … | |
… | |
| 157 | Since most people won't be using lines 3 or 4, I'll <uri |
162 | Since most people won't be using lines 3 or 4, I'll <uri |
| 158 | link="http://distcc.samba.org/man/distcc_1.html">point you to</uri> the distcc |
163 | link="http://distcc.samba.org/man/distcc_1.html">point you to</uri> the distcc |
| 159 | docs for more information. |
164 | docs for more information. |
| 160 | </p> |
165 | </p> |
| 161 | |
166 | |
| 162 | <p> |
167 | <p> |
| 163 | For instance, to set the first line in the previous example: |
168 | For 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> |
| 171 | Edit <path>/etc/conf.d/distccd</path> to your needs and be sure to set the |
176 | Edit <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> |
| 173 | please see the <uri link="http://distcc.samba.org/security.html">Distcc Security |
|
|
| 174 | Design</uri>. For added security you should also use the <c>--listen</c> |
|
|
| 175 | directive to tell the Distcc daemon what IP to listen on (for multi-homed |
178 | directive to tell the distcc daemon what IP to listen on (for multi-homed |
| 176 | systems). |
179 | systems). More information on distcc security can be found at <uri link="http://distcc.samba.org/security.html">Distcc Security |
|
|
180 | Design</uri>. |
| 177 | </p> |
181 | </p> |
| 178 | |
182 | |
| 179 | <p> |
183 | <p> |
| 180 | Now start the distcc daemon on all the participating computers: |
184 | Now 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> |
| 197 | This is in some cases easier than the Portage setup. What you have to do is |
201 | This is, in some cases, easier than the Portage setup. What you have to do is |
| 198 | update your <c>PATH</c> variable to include <path>/usr/lib/distcc/bin</path> |
202 | update your <c>PATH</c> variable to include <path>/usr/lib/distcc/bin</path> |
| 199 | in front of the directory that contains <c>gcc</c> (<path>/usr/bin</path>). |
203 | in front of the directory that contains <c>gcc</c> (<path>/usr/bin</path>). |
| 200 | However, there is a caveat. If you use ccache you have to put distcc after |
204 | However, there is a caveat. If you use ccache you have to put distcc after |
| 201 | the ccache part: |
205 | the 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> |
| 209 | Then, as you would normally type <c>make</c>, you would type <c>make -jN</c> |
213 | Then, 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 |
| 211 | of computers you are using to compile. For me, I have a dual processor P3 and |
215 | of computers you are using to compile. For me, I have a dual processor P3 and |
| 212 | a K6-2/400 that compiles everything for my desktop (a 1200MHz Athlon |
216 | a 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> |
| 228 | Cross-compiling is using one architecture to build programs for another |
232 | Cross-compiling is using one architecture to build programs for another |
| 229 | architecture. This can be as simple as using an Athlon (i686) to build a |
233 | architecture. This can be as simple as using an Athlon (i686) to build a |
| 230 | program for a K6-2 (i586), or using a Sparc to build a program for a ppc. |
234 | program 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> |
| 240 | If you want to give Cross-compiling a try you can to follow <uri |
244 | If you want to give cross-compiling a try you can to follow <uri |
| 241 | link="http://dev.gentoo.org/~vapier/CROSS-COMPILE-HOWTO">The Cross Compile |
245 | link="http://dev.gentoo.org/~vapier/CROSS-COMPILE-HOWTO">The Cross Compile |
| 242 | HOWTO</uri>; Crossdev is depreciated. |
246 | HOWTO</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> |
| 256 | Boot your new box with a Gentoo Linux LiveCD and follow the <uri |
260 | Boot your new box with a Gentoo Linux LiveCD and follow the <uri |
| 257 | link="/doc/en/handbook/handbook-x86.xml?part=1">installation instructions</uri> |
261 | link="/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> |
| 309 | Run <c>distcc-config --install</c> to setup distcc: |
313 | Run <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> |
| 319 | distcc is now set up to bootstrap! Continue the official installation |
323 | Distcc is now set up to bootstrap! Continue with the official installation |
| 320 | instructions and <e>do not forget</e> to re-emerge distcc after <c>emerge |
324 | instructions and <e>do not forget</e> to re-emerge distcc after <c>emerge |
| 321 | system</c>. This is to make sure that all of the dependencies you want are |
325 | system</c>. This is to make sure that all of the dependencies you want are |
| 322 | installed as well. |
326 | installed as well. |
| 323 | </p> |
327 | </p> |
| 324 | |
328 | |
| 325 | <note> |
329 | <note> |
| 326 | During bootstrap and <c>emerge system</c> Distcc may not appear to be used. |
330 | During bootstrap and <c>emerge system</c> distcc may not appear to be used. |
| 327 | This is expected as some ebuilds do not work well with distcc, so they |
331 | This is expected as some ebuilds do not work well with distcc, so they |
| 328 | intentionally disable it. |
332 | intentionally 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> |