/[gentoo]/xml/htdocs/doc/en/handbook/hb-working-features.xml
Gentoo

Contents of /xml/htdocs/doc/en/handbook/hb-working-features.xml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.29 - (hide annotations) (download) (as text)
Sat Jul 2 11:04:02 2005 UTC (9 years, 4 months ago) by swift
Branch: MAIN
Changes since 1.28: +9 -8 lines
File MIME type: application/xml
#90459 - Correct location for distcc path handling

1 swift 1.10 <?xml version='1.0' encoding='UTF-8'?>
2     <!DOCTYPE sections SYSTEM "/dtd/book.dtd">
3    
4 swift 1.1 <!-- The content of this document is licensed under the CC-BY-SA license -->
5 swift 1.29 <!-- See http://creativecommons.org/licenses/by-sa/2.5 -->
6 swift 1.1
7 swift 1.29 <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-working-features.xml,v 1.28 2005/05/23 18:19:59 swift Exp $ -->
8 swift 1.1
9     <sections>
10 swift 1.23
11 swift 1.29 <version>1.26</version>
12     <date>2005-07-02</date>
13 swift 1.23
14 swift 1.1 <section>
15 swift 1.19 <title>Portage Features</title>
16     <body>
17    
18     <p>
19     Portage has several additional features that makes your Gentoo experience even
20     better. Many of these features rely on certain software tools that improve
21     performance, reliability, security, ...
22     </p>
23    
24     <p>
25     To enable or disable certain Portage features you need to edit
26 swift 1.28 <path>/etc/make.conf</path>'s <c>FEATURES</c> variable which contains the
27     various feature keywords, separated by white space. In several cases you
28 swift 1.19 will also need to install the additional tool on which the feature relies.
29     </p>
30    
31     <p>
32     Not all features that Portage supports are listed here. For a full overview,
33 swift 1.21 please consult the <path>make.conf</path> man page:
34 swift 1.19 </p>
35    
36 swift 1.21 <pre caption="Consulting the make.conf man page">
37 swift 1.19 $ <i>man make.conf</i>
38     </pre>
39    
40     <p>
41 cam 1.27 To find out what FEATURES are default set, run <c>emerge --info</c> and search
42     for the FEATURES variable or grep it out:
43 swift 1.19 </p>
44    
45     <pre caption="Finding out the FEATURES that are already set">
46 cam 1.27 $ <i>emerge --info | grep FEATURES</i>
47 swift 1.19 </pre>
48    
49     </body>
50     </section>
51     <section>
52     <title>Distributed Compiling</title>
53 swift 1.1 <subsection>
54 swift 1.19 <title>Using distcc</title>
55 swift 1.1 <body>
56    
57 swift 1.2 <p>
58 swift 1.19 <c>distcc</c> is a program to distribute compilations across several, not
59 swift 1.2 necessarily identical, machines on a network. The <c>distcc</c> client sends all
60 swift 1.19 necessary information to the available distcc servers (running <c>distccd</c>)
61     so they can compile pieces of source code for the client. The net result is a
62 swift 1.2 faster compilation time.
63     </p>
64    
65     <p>
66 swift 1.19 You can find more information about <c>distcc</c> (and how to have it work
67     with Gentoo) in our <uri link="/doc/en/distcc.xml">Gentoo Distcc
68     Documentation</uri>.
69 swift 1.2 </p>
70    
71 swift 1.1 </body>
72     </subsection>
73     <subsection>
74 swift 1.19 <title>Installing distcc</title>
75 swift 1.1 <body>
76    
77 swift 1.2 <p>
78     Distcc ships with a graphical monitor to monitor tasks that your computer is
79 swift 1.19 sending away for compilation. If you use Gnome then put 'gnome' in your USE
80     variable. However, if you don't use Gnome and would still like to have the
81     monitor then you should put 'gtk' in your USE variable.
82 swift 1.2 </p>
83    
84 swift 1.19 <pre caption="Installing distcc">
85 swift 1.2 # <i>emerge distcc</i>
86     </pre>
87    
88 swift 1.1 </body>
89     </subsection>
90     <subsection>
91     <title>Activating Portage Support</title>
92     <body>
93    
94 swift 1.2 <p>
95 swift 1.19 Add <c>distcc</c> to the FEATURES variable inside <path>/etc/make.conf</path>.
96     Next, edit the MAKEOPTS variable to your liking. A known guideline is to fill in
97     "-jX" with X the number of CPUs that run <c>distccd</c> (including the current
98     host) plus one, but you might have better results with other numbers.
99 swift 1.2 </p>
100    
101     <p>
102 swift 1.19 Now run <c>distcc-config</c> and enter the list of available distcc servers. For
103     a simple example we assume that the available DistCC servers are 192.168.1.102
104     (the current host), 192.168.1.103 and 192.168.1.104 (two "remote" hosts):
105 swift 1.2 </p>
106    
107 swift 1.19 <pre caption="Configuring distcc to use three available distcc servers">
108 swift 1.3 # <i>distcc-config --set-hosts "192.168.1.102 192.168.1.103 192.168.1.104"</i>
109     </pre>
110    
111     <p>
112 swift 1.19 Don't forget to run the <c>distccd</c> daemon as well:
113 swift 1.3 </p>
114    
115 swift 1.19 <pre caption="Starting the distccd daemons">
116     # <i>rc-update add distccd default</i>
117 swift 1.3 # <i>/etc/init.d/distccd start</i>
118     </pre>
119    
120 swift 1.1 </body>
121     </subsection>
122     </section>
123     <section>
124 swift 1.19 <title>Caching Compilation</title>
125 swift 1.1 <subsection>
126 swift 1.19 <title>About ccache</title>
127 swift 1.1 <body>
128    
129 swift 1.4 <p>
130 swift 1.19 <c>ccache</c> is a fast compiler cache. When you compile a program, it will
131     cache intermediate results so that, whenever you recompile the same program, the
132     compilation time is greatly reduced. In common compilations this can result in 5
133     to 10 times faster compilation times.
134 swift 1.4 </p>
135    
136     <p>
137 swift 1.19 If you are interested in the ins and outs of ccache, please visit the
138 swift 1.4 <uri link="http://ccache.samba.org">ccache homepage</uri>.
139     </p>
140    
141 swift 1.1 </body>
142     </subsection>
143     <subsection>
144 swift 1.4 <title>Installing ccache</title>
145 swift 1.1 <body>
146    
147 swift 1.4 <p>
148 swift 1.19 To install <c>ccache</c>, run <c>emerge ccache</c>:
149 swift 1.4 </p>
150    
151     <pre caption="Installing ccache">
152     # <i>emerge ccache</i>
153     </pre>
154    
155 swift 1.1 </body>
156     </subsection>
157     <subsection>
158 swift 1.19 <title>Activating Portage Support</title>
159 swift 1.1 <body>
160 swift 1.4
161     <p>
162 swift 1.19 Open <path>/etc/make.conf</path> and add <c>ccache</c> to the FEATURES variable.
163     Next, add a new variable called CCACHE_SIZE and set it to "2G":
164 swift 1.4 </p>
165    
166     <pre caption="Editing CCACHE_SIZE in /etc/make.conf">
167     CCACHE_SIZE="2G"
168     </pre>
169    
170     <p>
171 swift 1.20 To check if ccache functions, ask ccache to provide you with its statistics:
172 swift 1.4 </p>
173    
174     <pre caption="Viewing ccache statistics">
175     # <i>ccache -s</i>
176     </pre>
177 swift 1.1
178     </body>
179     </subsection>
180 swift 1.12 <subsection>
181 swift 1.19 <title>Using ccache for non-Portage C Compiling</title>
182 swift 1.12 <body>
183    
184     <p>
185     If you would like to use ccache for non-Portage compilations, add
186 swift 1.19 <path>/usr/lib/ccache/bin</path> to the beginning of your PATH variable
187 swift 1.29 (before <path>/usr/bin</path>). This can be accomplished by editing
188     <path>/etc/env.d/00basic</path>, which is the first environment file that
189     defines the <c>PATH</c> variable:
190 swift 1.12 </p>
191    
192 swift 1.29 <pre caption="Editing /etc/env.d/00basic">
193     PATH="<i>/usr/lib/ccache/bin</i>:/opt/bin"
194 swift 1.12 </pre>
195    
196     </body>
197     </subsection>
198 swift 1.1 </section>
199     <section>
200 swift 1.19 <title>Binary Package Support</title>
201 swift 1.1 <subsection>
202 swift 1.19 <title>Creating Prebuilt Packages</title>
203 swift 1.1 <body>
204    
205 swift 1.2 <p>
206 swift 1.19 Portage supports the installation of prebuilt packages. Even though Gentoo does
207     not provide prebuilt packages by itself (except for the GRP snapshots) Portage
208     can be made fully aware of prebuilt packages.
209 swift 1.2 </p>
210    
211     <p>
212 swift 1.19 To create a prebuilt package you can use <c>quickpkg</c> if the package is
213     already installed on your system, or <c>emerge</c> with the <c>--buildpkg</c> or
214     <c>--buildpkgonly</c> options.
215 swift 1.2 </p>
216    
217     <p>
218 swift 1.19 If you want Portage to create prebuilt packages of every single package you
219     install, add <c>buildpkg</c> to the FEATURES variable.
220 swift 1.2 </p>
221    
222     <p>
223 swift 1.19 More extended support for creating prebuilt package sets can be obtained with
224     <c>catalyst</c>. For more information on catalyst please read the <uri
225 neysx 1.22 link="/proj/en/releng/catalyst/reference.xml">Catalyst Reference Manual</uri>
226     and <uri link="/proj/en/releng/catalyst/catalyst-howto.xml">Catalyst
227 swift 1.19 Howto</uri>.
228 swift 1.2 </p>
229 swift 1.6
230 swift 1.5 </body>
231     </subsection>
232     <subsection>
233 swift 1.19 <title>Installing Prebuilt Packages</title>
234 swift 1.5 <body>
235    
236     <p>
237 swift 1.19 Although Gentoo doesn't provide one, you can create a central repository where
238     you store prebuilt packages. If you want to use this repository, you need to
239     make Portage aware of it by having the PORTAGE_BINHOST variable point to
240     it. For instance, if the prebuilt packages are on ftp://buildhost/gentoo:
241 swift 1.5 </p>
242    
243 swift 1.19 <pre caption="Setting PORTAGE_BINHOST in /etc/make.conf">
244     PORTAGE_BINHOST="ftp://buildhost/gentoo"
245 swift 1.5 </pre>
246    
247     <p>
248 swift 1.19 When you want to install a prebuilt package, add the <c>--getbinpkg</c> option
249     to the emerge command alongside of the <c>--usepkg</c> option. The former tells
250     emerge to download the prebuilt package from the previously defined server
251     while the latter asks emerge to try to install the prebuilt package first before
252     fetching the sources and compiling it.
253 swift 1.5 </p>
254    
255 swift 1.7 <p>
256 swift 1.19 For instance, to install <c>gnumeric</c> with prebuilt packages:
257 swift 1.7 </p>
258    
259 swift 1.19 <pre caption="Installing the gnumeric prebuilt package">
260     # <i>emerge --usepkg --getbinpkg gnumeric</i>
261 swift 1.7 </pre>
262    
263 swift 1.5 <p>
264 swift 1.19 More information about emerge's prebuilt package options can be found in the
265 swift 1.21 emerge man page:
266 swift 1.5 </p>
267    
268 swift 1.21 <pre caption="Reading the emerge man page">
269 swift 1.19 $ <i>man emerge</i>
270 swift 1.2 </pre>
271 swift 1.1
272     </body>
273     </subsection>
274     </section>
275     </sections>

  ViewVC Help
Powered by ViewVC 1.1.20