| 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.10 2003/11/19 05:40:27 swift Exp $ --> |
3 | <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/distcc.xml,v 1.39 2006/12/24 17:54:01 nightmorph 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 | |
| … | |
… | |
| 13 | <mail link="vapier@gentoo.org">Mike Frysinger</mail> |
13 | <mail link="vapier@gentoo.org">Mike Frysinger</mail> |
| 14 | </author> |
14 | </author> |
| 15 | <author title="Editor"> |
15 | <author title="Editor"> |
| 16 | <mail link="erwin@gentoo.org">Erwin</mail> |
16 | <mail link="erwin@gentoo.org">Erwin</mail> |
| 17 | </author> |
17 | </author> |
| 18 | <author title="Reviewer"> |
18 | <author title="Editor"> |
| 19 | <mail link="swift@gentoo.org">Sven Vermeulen</mail> |
19 | <mail link="swift@gentoo.org">Sven Vermeulen</mail> |
|
|
20 | </author> |
|
|
21 | <author title="Editor"> |
|
|
22 | <mail link="pylon@gentoo.org">Lars Weiler</mail> |
| 20 | </author> |
23 | </author> |
| 21 | <author title="Reviewer"> |
24 | <author title="Reviewer"> |
| 22 | <mail link="blubber@gentoo.org">Tiemo Kieft</mail> |
25 | <mail link="blubber@gentoo.org">Tiemo Kieft</mail> |
| 23 | </author> |
26 | </author> |
| 24 | |
|
|
| 25 | <license/> |
|
|
| 26 | |
|
|
| 27 | <version>1.2.4</version> |
|
|
| 28 | <date>October 12, 2003</date> |
|
|
| 29 | |
27 | |
| 30 | <abstract> |
28 | <abstract> |
| 31 | This document serves as a HOWTO for using distcc with Gentoo. |
29 | This document serves as a HOWTO for using distcc with Gentoo. |
| 32 | </abstract> |
30 | </abstract> |
| 33 | |
31 | |
|
|
32 | <!-- The content of this document is licensed under the CC-BY-SA license --> |
|
|
33 | <!-- See http://creativecommons.org/licenses/by-sa/2.5 --> |
|
|
34 | <license/> |
|
|
35 | |
|
|
36 | <version>1.18</version> |
|
|
37 | <date>2006-12-24</date> |
|
|
38 | |
| 34 | <chapter> |
39 | <chapter> |
| 35 | <title>Introduction</title> |
40 | <title>Introduction</title> |
| 36 | <section> |
41 | <section> |
| 37 | <title>What is distcc?</title> |
42 | <title>What is distcc?</title> |
| 38 | <body> |
43 | <body> |
| 39 | |
44 | |
| 40 | <p> |
45 | <p> |
| 41 | Distcc is a program designed to distribute compiling tasks across a network to |
46 | Distcc is a program designed to distribute compiling tasks across a network to |
| 42 | participating hosts. It is comprised of a server, <c>distccd</c> and a client |
47 | participating hosts. It is comprised of a server, <c>distccd</c>, and a client |
| 43 | program, <c>distcc</c>. Distcc can work transparently with <uri |
48 | program, <c>distcc</c>. Distcc can work transparently with <uri |
| 44 | link="http://ccache.samba.org">ccache</uri> and Portage with a little set up. |
49 | link="http://ccache.samba.org">ccache</uri>, Portage, and Automake with a |
|
|
50 | little setup. |
|
|
51 | </p> |
|
|
52 | |
|
|
53 | </body> |
|
|
54 | </section> |
|
|
55 | <section> |
|
|
56 | <title>Using distcc to bootstrap</title> |
|
|
57 | <body> |
|
|
58 | |
|
|
59 | <p> |
|
|
60 | If you are planning on using distcc to help you bootstrap a Gentoo |
|
|
61 | installation, make sure you read the section <uri link="#bootstrapping">Using |
|
|
62 | distcc to Bootstrap</uri>, which is situated further down in this document. |
| 45 | </p> |
63 | </p> |
| 46 | |
64 | |
| 47 | </body> |
65 | </body> |
| 48 | </section> |
66 | </section> |
| 49 | </chapter> |
67 | </chapter> |
| … | |
… | |
| 52 | <title>Setup</title> |
70 | <title>Setup</title> |
| 53 | <section> |
71 | <section> |
| 54 | <title>Dependencies</title> |
72 | <title>Dependencies</title> |
| 55 | <body> |
73 | <body> |
| 56 | |
74 | |
| 57 | <pre caption="Distcc dependencies (2.8 through 2.10)"> |
75 | <p> |
| 58 | >=sys-apps/portage-2.0.46-r11 |
76 | In order to use Distcc, all of the computers on your network need to have the |
| 59 | <codenote>Distcc-2.11 and on require >=sys-apps/portage-2.0.49-r6</codenote> |
77 | same GCC versions. For example, mixing 3.3.x (where the x varies) is okay, but |
| 60 | >=sys-devel/gcc-config-1.3.1 |
78 | mixing 3.3.x with 3.2.x <b>may</b> result in compilation errors or runtime |
| 61 | sys-apps/shadow |
79 | errors. |
| 62 | <codenote>(As of version 2.8 and up until 2.11) And the following optional dependencies when you have <i>gtk</i> in your <i>USE</i> flags</codenote> |
|
|
| 63 | >=x11-libs/gtk+-2.2.1 |
|
|
| 64 | </pre> |
80 | </p> |
| 65 | |
|
|
| 66 | <pre caption="Distcc Dependencies (post 2.11.1)"> |
|
|
| 67 | >=sys-apps/portage-2.0.49-r6 |
|
|
| 68 | >=sys-devel/gcc-config-1.3.1 |
|
|
| 69 | sys-apps/shadow |
|
|
| 70 | <codenote>In this revision you may chose between a Gnome and GTK GUI monitor, they have the following added dependencies</codenote> |
|
|
| 71 | <codenote>For GTK:</codenote> |
|
|
| 72 | >=x11-libs/gtk+-2.0.0 |
|
|
| 73 | >=gnome-base/libglade-2.0.0 |
|
|
| 74 | x11-libs/pango |
|
|
| 75 | <codenote>For Gnome:</codenote> |
|
|
| 76 | >=x11-libs/gtk+-2.0.0 |
|
|
| 77 | >=gnome-base/libglade-2.0.0 |
|
|
| 78 | x11-libs/pango |
|
|
| 79 | >=gnome-base/libgnomeui-2.0.0.0 |
|
|
| 80 | >=gnome-base/libgnome-2.0.0 |
|
|
| 81 | </pre> |
|
|
| 82 | |
81 | |
| 83 | </body> |
82 | </body> |
| 84 | </section> |
83 | </section> |
| 85 | <section> |
84 | <section> |
| 86 | <title>Installing Distcc</title> |
85 | <title>Installing Distcc</title> |
| 87 | <body> |
86 | <body> |
| 88 | |
87 | |
| 89 | <p> |
88 | <p> |
| 90 | Installing Distcc is very easy. Simply set your USE flags and <c>emerge |
89 | There are a couple of options you should be aware of before you start |
| 91 | distcc</c>. But, there's a couple of options you should know about. |
90 | installing distcc. |
| 92 | </p> |
91 | </p> |
| 93 | |
92 | |
| 94 | <p> |
93 | <p> |
| 95 | Distcc ships with a graphical monitor to monitor tasks that your computer is |
94 | Distcc ships with a graphical monitor to monitor tasks that your computer is |
| 96 | sending away for compilation. If you use Gnome then put 'gnome' in your USE |
95 | sending away for compilation. If you use Gnome then put 'gnome' in your USE |
| 97 | flags. However, if you don't use Gnome and would still like to have the |
96 | flags. However, if you don't use Gnome and would still like to have the |
| 98 | monitor then you should put 'gtk' in your USE flags. |
97 | monitor then you should put 'gtk' in your USE flags. |
| 99 | </p> |
98 | </p> |
| 100 | |
99 | |
|
|
100 | <pre caption="Installing distcc"> |
|
|
101 | # <i>emerge distcc</i> |
|
|
102 | </pre> |
|
|
103 | |
|
|
104 | <impo> |
|
|
105 | Remember, you must be sure to install distcc on all of your participating |
|
|
106 | machines. |
|
|
107 | </impo> |
|
|
108 | |
| 101 | </body> |
109 | </body> |
| 102 | </section> |
110 | </section> |
| 103 | <section> |
111 | <section> |
| 104 | <title>Setting up Portage to use Distcc</title> |
112 | <title>Setting up Portage to use Distcc</title> |
| 105 | <body> |
113 | <body> |
| 106 | |
114 | |
| 107 | <p> |
115 | <p> |
| 108 | Setting up distcc is very easy to do with Portage. Follow these simple steps on |
116 | Setting up Portage to use distcc is easy. Execute the following steps on |
| 109 | each computer you want to use distcc on: |
117 | each system that should participate in the distributed compiling: |
| 110 | </p> |
118 | </p> |
| 111 | |
119 | |
| 112 | <pre caption="Integrating Distcc and Portage"> |
120 | <pre caption="Integrating Distcc and Portage"> |
| 113 | # <i>emerge distcc</i> |
121 | # <i>emerge distcc</i> |
| 114 | # <i>nano -w /etc/make.conf</i> |
122 | # <i>nano -w /etc/make.conf</i> |
|
|
123 | <comment>(Set N to a suitable number for your particular setup)</comment> |
|
|
124 | <comment>(A common strategy is setting N as twice the number of total CPUs + 1 |
|
|
125 | available)</comment> |
|
|
126 | MAKEOPTS="-jN" |
|
|
127 | <comment>(Add distcc to your FEATURES)</comment> |
|
|
128 | FEATURES="distcc" |
| 115 | </pre> |
129 | </pre> |
| 116 | |
130 | |
| 117 | <impo> |
131 | </body> |
| 118 | If you use distcc-2.11.1 or greater with >=portage-2.0.49-r6, then all you |
132 | </section> |
| 119 | need to do as far as setup is to set your hosts (see next code block), modify |
133 | <section> |
| 120 | MAKEOPTS in <path>/etc/make.conf</path>, and add 'distcc' to FEATURES in |
134 | <title>Specifying Participating Hosts</title> |
| 121 | <path>/etc/make.conf</path>. |
135 | <body> |
| 122 | </impo> |
|
|
| 123 | |
136 | |
| 124 | <note> |
|
|
| 125 | Edit your FEATURES flags to include "distcc" |
|
|
| 126 | </note> |
|
|
| 127 | |
|
|
| 128 | <note> |
|
|
| 129 | You should also uncomment the PORTAGE_TMPDIR line in |
|
|
| 130 | <path>/etc/make.conf</path>. |
|
|
| 131 | </note> |
|
|
| 132 | |
|
|
| 133 | <note> |
|
|
| 134 | Set <c>DISTCC_DIR=${PORTAGE_TMPDIR}/portage/.distcc</c> near the end of the file |
|
|
| 135 | (last line is okay). |
|
|
| 136 | </note> |
|
|
| 137 | |
|
|
| 138 | <p> |
137 | <p> |
| 139 | Next you have to specify what hosts you want to use. To do this you can use |
|
|
| 140 | the <c>distcc-config</c> command to set the list of hosts. Here is an example |
138 | Use the <c>distcc-config</c> command to set the list of hosts. Here is an |
| 141 | of some hosts that might be in your list: |
139 | example of some hosts that might be in your list: |
| 142 | </p> |
140 | </p> |
| 143 | |
141 | |
| 144 | <pre caption="Examples of host definitions"> |
142 | <pre caption="Examples of host definitions"> |
| 145 | 192.168.0.1 192.168.0.2 192.168.0.3 |
143 | 192.168.0.1 192.168.0.2 192.168.0.3 |
| 146 | 192.168.0.1/2 192.168.0.2 192.168.0.3/10 |
144 | 192.168.0.1/2 192.168.0.2 192.168.0.3/10 |
| 147 | 192.168.0.1:4000/2 192.168.0.2/1 192.168.0.3:3632/4 |
145 | 192.168.0.1:4000/2 192.168.0.2/1 192.168.0.3:3632/4 |
| 148 | @192.168.0.1 @192.168.0.2:/usr/bin/distccd 192.168.0.3 |
146 | @192.168.0.1 @192.168.0.2:/usr/bin/distccd 192.168.0.3 |
|
|
147 | <comment>(There are also several other methods of setting up hosts. See the |
|
|
148 | distcc manpage for more details.)</comment> |
|
|
149 | <comment>If you wish to compile on the local machine you should put 'localhost' |
|
|
150 | in the hosts list. Conversely if you do not wish to use the local machine to |
|
|
151 | compile (which is often the case) omit it from the hosts list. On a slow |
|
|
152 | machine using localhost may actually slow things down. Make sure to test your |
|
|
153 | settings for performance.</comment> |
| 149 | </pre> |
154 | </pre> |
| 150 | |
155 | |
| 151 | <p> |
156 | <p> |
| 152 | It may all look complicated, but in most cases a variant of line 1 or 2 will |
157 | It may all look complicated, but in most cases a variant of line 1 or 2 will |
| 153 | work. An explanation of each line is: Line 1 is just a space-delimited list |
158 | work. |
| 154 | of hosts that will use default everything. Line 2 is a list of hosts that |
|
|
| 155 | specifies the maximum number of jobs (by use of the /N) to send that host at |
|
|
| 156 | any given time (specified with the <c>/n</c>). Since most people won't be |
|
|
| 157 | using lines 3 or 4, I'll <uri link="http://distcc.samba.org/man/distcc_1.html"> |
|
|
| 158 | point you to</uri> the distcc docs for more information. |
|
|
| 159 | </p> |
|
|
| 160 | |
|
|
| 161 | <p> |
159 | </p> |
| 162 | A sample command to set the hosts (for line 1) is: |
160 | |
|
|
161 | <p> |
|
|
162 | Since most people won't be using lines 3 or 4, I'll <uri |
|
|
163 | link="http://distcc.samba.org/man/distcc_1.html">refer to</uri> the distcc |
|
|
164 | docs (man distcc) for more information. |
|
|
165 | </p> |
|
|
166 | |
|
|
167 | <p> |
|
|
168 | For instance, to set the first line in the previous example: |
| 163 | </p> |
169 | </p> |
| 164 | |
170 | |
| 165 | <pre caption="Sample command to set the hosts"> |
171 | <pre caption="Sample command to set the hosts"> |
| 166 | # <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> |
| 167 | </pre> |
173 | </pre> |
| 168 | |
174 | |
| 169 | <p> |
175 | <p> |
| 170 | The final step to integrating distcc into Portage is to re-open your |
176 | Edit <path>/etc/conf.d/distccd</path> to your needs and be sure to set the |
| 171 | <path>/etc/make.conf</path> and edit <c>MAKEOPTS</c> to include <c>-jN</c> |
177 | <c>--allow</c> directive to allow only hosts you trust. For added security, |
| 172 | (where N is an integer). Typically you will want to set this to the total |
178 | you should also use the <c>--listen</c> directive to tell the distcc daemon |
| 173 | number of processors in your network plus one. |
179 | what IP to listen on (for multi-homed systems). More information on distcc |
| 174 | </p> |
180 | security can be found at <uri |
| 175 | |
181 | link="http://distcc.samba.org/security.html">Distcc Security Design</uri>. |
| 176 | <pre caption="Final steps in make.conf"> |
|
|
| 177 | # <i>nano -w /etc/make.conf</i> |
|
|
| 178 | MAKEOPTS=-jN |
|
|
| 179 | </pre> |
182 | </p> |
| 180 | |
183 | |
| 181 | <impo> |
184 | <impo> |
| 182 | Don't forget to start the distcc daemon! <c>/etc/init.d/distccd start</c> |
185 | It is important to use --allow and --listen. Please read the distccd manpage |
|
|
186 | or the above security document for more information. |
| 183 | </impo> |
187 | </impo> |
| 184 | |
188 | |
|
|
189 | |
|
|
190 | <p> |
|
|
191 | Now start the distcc daemon on all the participating computers: |
|
|
192 | </p> |
|
|
193 | |
|
|
194 | <pre caption="Starting the distcc daemon"> |
|
|
195 | <comment>(Add distccd to the default runlevel)</comment> |
|
|
196 | # <i>rc-update add distccd default</i> |
|
|
197 | <comment>(Start the distcc daemon)</comment> |
|
|
198 | # <i>/etc/init.d/distccd start</i> |
|
|
199 | </pre> |
|
|
200 | |
| 185 | </body> |
201 | </body> |
| 186 | </section> |
202 | </section> |
| 187 | <section> |
203 | <section> |
| 188 | <title>Setting up Distcc to Work With Automake</title> |
204 | <title>Setting up Distcc to Work With Automake</title> |
| 189 | <body> |
205 | <body> |
| 190 | |
206 | |
| 191 | <p> |
207 | <p> |
| 192 | This is in some cases easier than the Portage setup. What you have to do is |
208 | This is, in some cases, easier than the Portage setup. What you have to do is |
| 193 | update your <c>PATH</c> environmental variable to include |
209 | update your <c>PATH</c> variable to include <path>/usr/lib/distcc/bin</path> |
| 194 | <path>/usr/lib/distcc/bin</path> before where gcc (<path>/usr/bin</path>). |
210 | in front of the directory that contains <c>gcc</c> (<path>/usr/bin</path>). |
| 195 | However, there is a caveat. If you use ccache you have to put distcc after |
211 | However, there is a caveat. If you use ccache you have to put distcc after |
| 196 | the ccache part. Like so: |
212 | the ccache part: |
| 197 | </p> |
213 | </p> |
| 198 | |
214 | |
| 199 | <pre caption="Setting your path"> |
215 | <pre caption="Setting your path"> |
| 200 | # <i>export PATH="/usr/lib/ccache/bin:/usr/lib/distcc/bin:${PATH}"</i> |
216 | # <i>export PATH="/usr/lib/ccache/bin:/usr/lib/distcc/bin:${PATH}"</i> |
|
|
217 | <comment>(You can put this in your ~/.bashrc or equivalent file to have the PATH |
|
|
218 | set every time you log in)</comment> |
| 201 | </pre> |
219 | </pre> |
| 202 | |
220 | |
| 203 | <p> |
221 | <p> |
| 204 | Then, as you would normally type <c>make</c>, you would type <c>make -jN</c> |
222 | Then, as you would normally type <c>make</c>, you would type <c>make -jN</c> |
| 205 | (where N is an integer). A safe number to use for N varies on your network |
223 | (where N is an integer). The value of N depends on your network and the types |
| 206 | and the types of computers you are using to compile. For me, I have a dual |
224 | of computers you are using to compile. Test your own settings to find the |
| 207 | processor P3 and a K6-2/400 that compile everything for my desktop (a 1200MHz |
225 | number that yields the best performance. |
| 208 | Athlon Thunderbird) and I use -j5. Test your own settings to find the right |
|
|
| 209 | number. |
|
|
| 210 | </p> |
226 | </p> |
| 211 | |
227 | |
| 212 | </body> |
228 | </body> |
| 213 | </section> |
229 | </section> |
| 214 | </chapter> |
230 | </chapter> |
| 215 | |
231 | |
| 216 | <chapter> |
232 | <chapter> |
| 217 | <title>Cross-Compiling</title> |
233 | <title>Cross-Compiling</title> |
| 218 | <section> |
234 | <section> |
| 219 | <title>A Note on Cross-Compiling</title> |
|
|
| 220 | <body> |
235 | <body> |
| 221 | |
236 | |
| 222 | <p> |
237 | <p> |
| 223 | Cross-compiling is using one architecture to build programs for another |
238 | Cross-compiling is using one architecture to build programs for another |
| 224 | architecture. This can be as simple as using an Athlon (i686) to build a |
239 | architecture. This can be as simple as using an Athlon (i686) to build a |
| 225 | program for a K6-2 (i586), or using a Sparc to build a program for a ppc. |
240 | program for a K6-2 (i586), or using a Sparc to build a program for a ppc. This |
|
|
241 | is documented in our <uri link="/doc/en/cross-compiling-distcc.xml">DistCC |
|
|
242 | Cross-compiling Guide</uri>. |
| 226 | </p> |
243 | </p> |
| 227 | |
244 | |
| 228 | </body> |
245 | </body> |
| 229 | </section> |
|
|
| 230 | <section> |
246 | </section> |
| 231 | <title>A Personal Note on Cross-compiling</title> |
|
|
| 232 | <body> |
|
|
| 233 | |
|
|
| 234 | <p> |
|
|
| 235 | I'd love to be able to help out on the Gentoo Cross-compiling effort, but I |
|
|
| 236 | don't have any non-x86 machines. I can create things that work <e>in |
|
|
| 237 | theory</e>, but I have to rely on other people to test what I write. That |
|
|
| 238 | works to an extent, but it's tough. ;-) |
|
|
| 239 | </p> |
|
|
| 240 | |
|
|
| 241 | <p> |
|
|
| 242 | In the near future I hope to acquire a Sparc of some type to put Gentoo on so |
|
|
| 243 | I can play around in-house. |
|
|
| 244 | </p> |
|
|
| 245 | |
|
|
| 246 | </body> |
|
|
| 247 | </section> |
|
|
| 248 | </chapter> |
|
|
| 249 | |
|
|
| 250 | <chapter> |
247 | </chapter> |
|
|
248 | |
|
|
249 | <chapter id="bootstrapping"> |
| 251 | <title>Using Distcc to Bootstrap</title> |
250 | <title>Using Distcc to Bootstrap</title> |
| 252 | <section> |
251 | <section> |
| 253 | <title>Step 1: Setup on New Box</title> |
252 | <title>Step 1: Configure Portage</title> |
| 254 | <body> |
253 | <body> |
| 255 | |
254 | <!-- |
|
|
255 | Note that this will need to become a link to the old 2005.1 networked handbooks |
|
|
256 | once the 2006.0 handbooks are released. Until then, the link can stay. |
|
|
257 | --> |
| 256 | <p> |
258 | <p> |
| 257 | Next, you have to boot your new box with a Gentoo Linux LiveCD and follow all |
259 | Boot your new box with a Gentoo Linux LiveCD and follow the <uri |
| 258 | of the steps up until the bootstrapping. Then proceed with a little preliminary |
260 | link="/doc/en/handbook/handbook-x86.xml?part=1">installation instructions</uri> |
| 259 | setup on the new box. |
261 | up until the bootstrapping part. (See the <uri |
|
|
262 | link="/doc/en/faq.xml#stage12">Gentoo FAQ</uri> for more information about |
|
|
263 | bootstrapping.) Then configure Portage to use distcc: |
| 260 | </p> |
264 | </p> |
| 261 | |
265 | |
| 262 | <pre caption="Preliminary Setup"> |
266 | <pre caption="Preliminary Setup"> |
| 263 | <codenote>Here we add distcc to FEATURES</codenote> |
|
|
| 264 | # <i>nano -w /etc/make.conf</i> |
267 | # <i>nano -w /etc/make.conf</i> |
| 265 | <codenote>Add "distcc" to FEATURES</codenote> |
268 | <comment>(Add distcc to the FEATURES</comment> |
| 266 | <codenote>Modify MAKEOPTS in <path>/etc/make.conf to include -jN (as described above)</path></codenote> |
269 | FEATURES="distcc" |
|
|
270 | <comment>(Modify MAKEOPTS to include -jN, where N is twice the number of CPUs |
|
|
271 | +1 available)</comment> |
|
|
272 | MAKEOPTS="-jN" |
| 267 | </pre> |
273 | </pre> |
| 268 | |
274 | |
| 269 | <p> |
275 | <pre caption="Setting your path"> |
| 270 | Then add the distcc user to your <path>/etc/passwd</path>: |
276 | # <i>export PATH="/usr/lib/ccache/bin:/usr/lib/distcc/bin:${PATH}"</i> |
|
|
277 | </pre> |
|
|
278 | |
|
|
279 | </body> |
|
|
280 | </section> |
|
|
281 | <section> |
|
|
282 | <title>Step 2: Getting Distcc</title> |
|
|
283 | <body> |
|
|
284 | |
| 271 | </p> |
285 | <p> |
|
|
286 | Before the installation of distcc, a user called distcc must be added to the |
|
|
287 | <path>/etc/passwd</path>: |
|
|
288 | </p> |
| 272 | |
289 | |
| 273 | <pre caption="Add the distcc user to /etc/passwd"> |
290 | <pre caption="Create user distcc"> |
| 274 | # <i>echo "distcc:x:240:2:distccd:/dev/null:/bin/false" >>/etc/passwd</i> |
291 | # <i>echo "distcc:x:240:2:distccd:/dev/null:/bin/false" >>/etc/passwd</i> |
| 275 | <codenote>Do not forget the `<i>>></i>'</codenote> |
|
|
| 276 | </pre> |
292 | </pre> |
| 277 | |
293 | |
| 278 | </body> |
294 | <impo> |
| 279 | </section> |
295 | It is important to note that adding users like this is very bad. We only do |
| 280 | <section> |
296 | it here because there is no <c>useradd</c> utility (which you normally use for |
| 281 | <title>Step 2: Getting Distcc</title> |
297 | adding users) yet at this stage of installation. |
| 282 | <body> |
298 | </impo> |
| 283 | |
299 | |
| 284 | <p> |
300 | <p> |
| 285 | Next you will want to issue the following command inside the chroot on the new |
301 | Install distcc: |
| 286 | box. |
|
|
| 287 | </p> |
302 | </p> |
| 288 | |
303 | |
| 289 | <pre caption="Getting Distcc on the new box"> |
304 | <pre caption="Getting Distcc on the new box"> |
| 290 | # <i>emerge --nodeps distcc</i> |
305 | # <i>USE='-*' emerge --nodeps sys-devel/distcc</i> |
| 291 | </pre> |
306 | </pre> |
| 292 | |
307 | |
| 293 | </body> |
308 | </body> |
| 294 | </section> |
|
|
| 295 | <section> |
309 | </section> |
|
|
310 | <section> |
| 296 | <title>Step 3: Setting Up Distcc Itself</title> |
311 | <title>Step 3: Setting Up Distcc</title> |
| 297 | <body> |
312 | <body> |
| 298 | |
313 | |
| 299 | <p> |
314 | <p> |
| 300 | Now set up distcc itself... |
315 | Run <c>distcc-config --install</c> to setup distcc: |
| 301 | </p> |
316 | </p> |
| 302 | |
317 | |
| 303 | <pre caption="Final distcc setup"> |
318 | <pre caption="Final distcc setup"> |
| 304 | # <i>/usr/bin/distcc-config --install</i> |
319 | <comment>(Substitute host1, host2, ... with the IP number(s) of the |
|
|
320 | participating hosts)</comment> |
| 305 | # <i>/usr/bin/distcc-config --set-hosts "localhost host1 host2 host3 ..."</i> |
321 | # <i>/usr/bin/distcc-config --set-hosts "localhost host1 host2 host3 ..."</i> |
|
|
322 | <comment>An example: <i>/usr/bin/distcc-config --set-hosts "localhost |
|
|
323 | 192.168.0.4 192.168.0.6"</i></comment> |
| 306 | </pre> |
324 | </pre> |
| 307 | |
325 | |
| 308 | <p> |
|
|
| 309 | distcc should be set up now to bootstrap! Continue the official install guide, |
|
|
| 310 | and don't forget to re-emerge distcc after <c>emerge system</c>. |
|
|
| 311 | </p> |
326 | <p> |
|
|
327 | Distcc is now set up to bootstrap! Continue with the official installation |
|
|
328 | instructions and <e>do not forget</e> to re-emerge distcc after <c>emerge |
|
|
329 | system</c>. This is to make sure that all of the dependencies you want are |
|
|
330 | installed as well. |
|
|
331 | </p> |
|
|
332 | |
|
|
333 | <note> |
|
|
334 | During bootstrap and <c>emerge system</c> distcc may not appear to be used. |
|
|
335 | This is expected as some ebuilds do not work well with distcc, so they |
|
|
336 | intentionally disable it. |
|
|
337 | </note> |
| 312 | |
338 | |
| 313 | </body> |
339 | </body> |
| 314 | </section> |
340 | </section> |
| 315 | </chapter> |
341 | </chapter> |
| 316 | |
342 | |
| 317 | <chapter> |
343 | <chapter> |
| 318 | <title>Troubleshooting</title> |
344 | <title>Troubleshooting</title> |
| 319 | <section> |
345 | <section> |
| 320 | <title>Mozilla and Xfree</title> |
346 | <title>Some Packages Don't Use Distcc</title> |
| 321 | <body> |
|
|
| 322 | |
|
|
| 323 | <p> |
|
|
| 324 | As you emerge various packages, you'll notice that they aren't being distributed |
|
|
| 325 | (and indeed aren't being built in parallel). This is because the developers of |
|
|
| 326 | Mozilla and Xfree .ebuilds disabled parallel building because it is known to |
|
|
| 327 | cause problems. This isn't necessarily a distcc problem. |
|
|
| 328 | </p> |
|
|
| 329 | |
|
|
| 330 | <p> |
|
|
| 331 | That isn't to say that sometimes distcc will cause a package to fail to compile. |
|
|
| 332 | </p> |
|
|
| 333 | |
|
|
| 334 | </body> |
347 | <body> |
| 335 | </section> |
|
|
| 336 | <section> |
|
|
| 337 | <title>A Mixture of hardened-gcc and non-hardened-gcc Hosts Will Be Faulty</title> |
|
|
| 338 | <body> |
|
|
| 339 | |
348 | |
| 340 | <p> |
|
|
| 341 | With such a long title any explanation here is almost irrelevent. However, if |
|
|
| 342 | you plan to use distcc across hosts that have the <uri |
|
|
| 343 | link="http://www.gentoo.org/proj/en/hardened/etdyn-ssp.xml">PaX/hardened-gcc</uri> |
|
|
| 344 | and some that do not, you will run into problems. |
|
|
| 345 | </p> |
349 | <p> |
| 346 | |
350 | As you emerge various packages, you'll notice that some of them aren't being |
|
|
351 | distributed (and aren't being built in parallel). This may happen because the |
|
|
352 | package's Makefile doesn't support parallel operations or the maintainer of the |
|
|
353 | ebuild has explicitly disabled parallel operations due to a known problem. |
| 347 | <p> |
354 | </p> |
| 348 | The solution requires a little foresight on your part; you have to run |
355 | |
| 349 | <c>hardened-gcc -R</c> on the host that has PaX/hardened-gcc, or you have to |
356 | <p> |
| 350 | enable PaX protections in your kernel and <c>emerge hardened-gcc</c>. Both of |
357 | Sometimes distcc might cause a package to fail to compile. If this happens |
| 351 | which are a good thing to do since for the most part the protections offered |
358 | for you, please <uri link="http://bugs.gentoo.org">report</uri> it to us. |
| 352 | by both packages is a good thing and is transparent to the user. |
|
|
| 353 | </p> |
359 | </p> |
| 354 | |
360 | |
| 355 | </body> |
361 | </body> |
| 356 | </section> |
362 | </section> |
| 357 | <section> |
363 | <section> |
| 358 | <title>Mixed GCC Versions</title> |
364 | <title>Mixed GCC Versions</title> |
| 359 | <body> |
365 | <body> |
| 360 | |
366 | |
| 361 | <p> |
367 | <p> |
| 362 | If you have differing versions of GCC on your hosts, there will likely be very |
368 | If you have different GCC versions on your hosts, there will likely be very |
| 363 | weird problems. The solution is to make certain all hosts have the same GCC |
369 | weird problems. The solution is to make certain all hosts have the same GCC |
| 364 | version. |
370 | version. |
| 365 | </p> |
371 | </p> |
| 366 | |
372 | |
|
|
373 | <p> |
|
|
374 | Recent Portage updates have made Portage use <c>${CHOST}-gcc</c> instead of |
|
|
375 | <c>gcc</c>. This means that if you're mixing i686 machines with other types |
|
|
376 | (i386, i586) you will run into problems. A workaround for this may be to |
|
|
377 | <c>export CC='gcc' CXX='c++'</c> or to put it in <path>/etc/make.conf</path>. |
|
|
378 | </p> |
|
|
379 | |
|
|
380 | <impo> |
|
|
381 | Doing this explicitly redefines some behaviour of Portage and may have some |
|
|
382 | weird results in the future. Only do this if you're mixing CHOSTs. |
|
|
383 | </impo> |
|
|
384 | |
|
|
385 | |
| 367 | </body> |
386 | </body> |
| 368 | </section> |
387 | </section> |
| 369 | </chapter> |
388 | </chapter> |
| 370 | |
389 | |
| 371 | <chapter> |
390 | <chapter> |
| … | |
… | |
| 373 | <section> |
392 | <section> |
| 374 | <title>Distcc Monitors</title> |
393 | <title>Distcc Monitors</title> |
| 375 | <body> |
394 | <body> |
| 376 | |
395 | |
| 377 | <p> |
396 | <p> |
| 378 | Distcc ships with two monitors. The text-based one is always built, it is |
397 | Distcc ships with two monitors. The text-based one is always built and is |
| 379 | called <c>distccmon-text</c>. Running it for the first time can be a bit |
398 | called <c>distccmon-text</c>. Running it for the first time can be a bit |
| 380 | confusing, but it is really quite easy to use. If you run the program with no |
399 | confusing, but it is really quite easy to use. If you run the program with no |
| 381 | parameter it will run once. However, if you pass it a number it will update |
400 | parameter it will run once. However, if you pass it a number it will update |
| 382 | every N seconds, where N is the argument you passed. |
401 | every N seconds, where N is the argument you passed. |
| 383 | </p> |
402 | </p> |
| 384 | |
403 | |
| 385 | <p> |
404 | <p> |
| 386 | The other monitor is only turned on if you enabled <c>gtk</c> or <c>gnome</c> |
405 | The other monitor is only turned on if you enabled <c>gtk</c> or <c>gnome</c> |
| 387 | in your <c>USE</c> flags. This one is GTK+ based and runs in an X environment, |
406 | in your <c>USE</c> flags. This one is GTK+ based, runs in an X environment |
| 388 | and it is quite lovely. |
407 | and it is quite lovely. For Gentoo the GUI monitor has been called |
| 389 | </p> |
408 | <c>distccmon-gui</c> for less confusion. Elsewhere it may be referred to as |
| 390 | |
409 | <c>distccmon-gnome</c>. |
| 391 | <p> |
|
|
| 392 | There is a caveat to using these programs. If you want to monitor any emerge, |
|
|
| 393 | you have to start the monitor like so: |
|
|
| 394 | </p> |
410 | </p> |
| 395 | |
411 | |
| 396 | <pre caption="Starting the monitors"> |
412 | <pre caption="Starting the monitors"> |
|
|
413 | # <i>distccmon-text N</i> |
|
|
414 | <comment>(Or)</comment> |
|
|
415 | # <i>distccmon-gui</i> |
|
|
416 | <comment>To monitor Portage's distcc usage you can use:</comment> |
| 397 | # <i>DISTCC_DIR=/path/to/distccdir distccmon-text N</i> |
417 | # <i>DISTCC_DIR="/var/tmp/portage/.distcc/" distccmon-text N</i> |
| 398 | <codenote>Or you can start the graphical monitor...</codenote> |
418 | <comment>(Or)</comment> |
| 399 | # <i>DISTCC_DIR=/path/to/distccdir distccmon-gnome</i> |
419 | # <i>DISTCC_DIR="/var/tmp/portage/.distcc/" distccmon-gui</i> |
| 400 | </pre> |
420 | </pre> |
| 401 | |
421 | |
| 402 | <impo> |
422 | <impo> |
| 403 | If you are using Portage and used the above example, this will be |
423 | If your distcc directory is elsewhere, change the DISTCC_DIR variable |
| 404 | <c>DISTCC_DIR=/var/tmp/portage/.distcc</c>. |
424 | accordingly. |
| 405 | </impo> |
425 | </impo> |
| 406 | |
426 | |
| 407 | <note> |
|
|
| 408 | If you aren't using Portage you do not need to specify DISTCC_DIR (i.e., just |
|
|
| 409 | type distccmon-text N). |
|
|
| 410 | </note> |
|
|
| 411 | |
|
|
| 412 | </body> |
|
|
| 413 | </section> |
|
|
| 414 | </chapter> |
|
|
| 415 | |
|
|
| 416 | <chapter> |
|
|
| 417 | <title>Future Plans for Distcc and Gentoo</title> |
|
|
| 418 | <section> |
|
|
| 419 | <title>distcc-subnetscan</title> |
|
|
| 420 | <body> |
|
|
| 421 | |
|
|
| 422 | <p> |
|
|
| 423 | <c>distcc-subnetscan</c> is a perl program in development that will scan a |
|
|
| 424 | subnet for hosts that have a participating distcc daemon. Even this will be |
|
|
| 425 | enhanced to test if the daemon on a remote host will conform to a specific |
|
|
| 426 | <c>CHOST</c> setting to make cross-compiling easier. |
|
|
| 427 | </p> |
|
|
| 428 | |
|
|
| 429 | <p> |
|
|
| 430 | The perl script is being kept at <uri link="http://dev.gentoo.org/~lisa/distcc/distcc-subnetscan/distcc-subnetscan.pl"> |
|
|
| 431 | right here</uri> until a more formal home can be found. |
|
|
| 432 | </p> |
|
|
| 433 | |
|
|
| 434 | </body> |
|
|
| 435 | </section> |
|
|
| 436 | <section> |
|
|
| 437 | <title>distcc-config</title> |
|
|
| 438 | <body> |
|
|
| 439 | |
|
|
| 440 | <p> |
|
|
| 441 | <c>distcc-config</c>, the userland configuration tool for distcc is out of date. |
|
|
| 442 | Soon it will be rewritten to be brought up the current version of distcc. |
|
|
| 443 | </p> |
|
|
| 444 | |
|
|
| 445 | </body> |
427 | </body> |
| 446 | </section> |
428 | </section> |
| 447 | </chapter> |
429 | </chapter> |
| 448 | </guide> |
430 | </guide> |