/[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.21 - (show annotations) (download) (as text)
Sat Oct 23 11:04:27 2004 UTC (9 years, 9 months ago) by swift
Branch: MAIN
Changes since 1.20: +5 -5 lines
File MIME type: application/xml
Fix s/manpage/man page/ for consistency

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

  ViewVC Help
Powered by ViewVC 1.1.20