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