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