/[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.28 - (show annotations) (download) (as text)
Mon May 23 18:19:59 2005 UTC (8 years, 10 months ago) by swift
Branch: MAIN
Changes since 1.27: +5 -4 lines
File MIME type: application/xml
#93375 - Some users do not know features are separated by whitespace

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.27 2005/01/22 01:24:31 cam Exp $ -->
8
9 <sections>
10
11 <version>1.25</version>
12 <date>2005-05-23</date>
13
14 <section>
15 <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 <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 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 please consult the <path>make.conf</path> man page:
34 </p>
35
36 <pre caption="Consulting the make.conf man page">
37 $ <i>man make.conf</i>
38 </pre>
39
40 <p>
41 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 </p>
44
45 <pre caption="Finding out the FEATURES that are already set">
46 $ <i>emerge --info | grep FEATURES</i>
47 </pre>
48
49 </body>
50 </section>
51 <section>
52 <title>Distributed Compiling</title>
53 <subsection>
54 <title>Using distcc</title>
55 <body>
56
57 <p>
58 <c>distcc</c> is a program to distribute compilations across several, not
59 necessarily identical, machines on a network. The <c>distcc</c> client sends all
60 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 faster compilation time.
63 </p>
64
65 <p>
66 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 </p>
70
71 </body>
72 </subsection>
73 <subsection>
74 <title>Installing distcc</title>
75 <body>
76
77 <p>
78 Distcc ships with a graphical monitor to monitor tasks that your computer is
79 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 </p>
83
84 <pre caption="Installing distcc">
85 # <i>emerge distcc</i>
86 </pre>
87
88 </body>
89 </subsection>
90 <subsection>
91 <title>Activating Portage Support</title>
92 <body>
93
94 <p>
95 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 </p>
100
101 <p>
102 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 </p>
106
107 <pre caption="Configuring distcc to use three available distcc servers">
108 # <i>distcc-config --set-hosts "192.168.1.102 192.168.1.103 192.168.1.104"</i>
109 </pre>
110
111 <p>
112 Don't forget to run the <c>distccd</c> daemon as well:
113 </p>
114
115 <pre caption="Starting the distccd daemons">
116 # <i>rc-update add distccd default</i>
117 # <i>/etc/init.d/distccd start</i>
118 </pre>
119
120 </body>
121 </subsection>
122 </section>
123 <section>
124 <title>Caching Compilation</title>
125 <subsection>
126 <title>About ccache</title>
127 <body>
128
129 <p>
130 <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 </p>
135
136 <p>
137 If you are interested in the ins and outs of ccache, please visit the
138 <uri link="http://ccache.samba.org">ccache homepage</uri>.
139 </p>
140
141 </body>
142 </subsection>
143 <subsection>
144 <title>Installing ccache</title>
145 <body>
146
147 <p>
148 To install <c>ccache</c>, run <c>emerge ccache</c>:
149 </p>
150
151 <pre caption="Installing ccache">
152 # <i>emerge ccache</i>
153 </pre>
154
155 </body>
156 </subsection>
157 <subsection>
158 <title>Activating Portage Support</title>
159 <body>
160
161 <p>
162 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 </p>
165
166 <pre caption="Editing CCACHE_SIZE in /etc/make.conf">
167 CCACHE_SIZE="2G"
168 </pre>
169
170 <p>
171 To check if ccache functions, ask ccache to provide you with its statistics:
172 </p>
173
174 <pre caption="Viewing ccache statistics">
175 # <i>ccache -s</i>
176 </pre>
177
178 </body>
179 </subsection>
180 <subsection>
181 <title>Using ccache for non-Portage C Compiling</title>
182 <body>
183
184 <p>
185 If you would like to use ccache for non-Portage compilations, add
186 <path>/usr/lib/ccache/bin</path> to the beginning of your PATH variable
187 (before <path>/usr/bin</path>). This can be accomplished by editing
188 <path>/etc/profile</path>:
189 </p>
190
191 <pre caption="Editing /etc/profile">
192 PATH="<i>/usr/lib/ccache/bin</i>:${PATH}"
193 </pre>
194
195 </body>
196 </subsection>
197 </section>
198 <section>
199 <title>Binary Package Support</title>
200 <subsection>
201 <title>Creating Prebuilt Packages</title>
202 <body>
203
204 <p>
205 Portage supports the installation of prebuilt packages. Even though Gentoo does
206 not provide prebuilt packages by itself (except for the GRP snapshots) Portage
207 can be made fully aware of prebuilt packages.
208 </p>
209
210 <p>
211 To create a prebuilt package you can use <c>quickpkg</c> if the package is
212 already installed on your system, or <c>emerge</c> with the <c>--buildpkg</c> or
213 <c>--buildpkgonly</c> options.
214 </p>
215
216 <p>
217 If you want Portage to create prebuilt packages of every single package you
218 install, add <c>buildpkg</c> to the FEATURES variable.
219 </p>
220
221 <p>
222 More extended support for creating prebuilt package sets can be obtained with
223 <c>catalyst</c>. For more information on catalyst please read the <uri
224 link="/proj/en/releng/catalyst/reference.xml">Catalyst Reference Manual</uri>
225 and <uri link="/proj/en/releng/catalyst/catalyst-howto.xml">Catalyst
226 Howto</uri>.
227 </p>
228
229 </body>
230 </subsection>
231 <subsection>
232 <title>Installing Prebuilt Packages</title>
233 <body>
234
235 <p>
236 Although Gentoo doesn't provide one, you can create a central repository where
237 you store prebuilt packages. If you want to use this repository, you need to
238 make Portage aware of it by having the PORTAGE_BINHOST variable point to
239 it. For instance, if the prebuilt packages are on ftp://buildhost/gentoo:
240 </p>
241
242 <pre caption="Setting PORTAGE_BINHOST in /etc/make.conf">
243 PORTAGE_BINHOST="ftp://buildhost/gentoo"
244 </pre>
245
246 <p>
247 When you want to install a prebuilt package, add the <c>--getbinpkg</c> option
248 to the emerge command alongside of the <c>--usepkg</c> option. The former tells
249 emerge to download the prebuilt package from the previously defined server
250 while the latter asks emerge to try to install the prebuilt package first before
251 fetching the sources and compiling it.
252 </p>
253
254 <p>
255 For instance, to install <c>gnumeric</c> with prebuilt packages:
256 </p>
257
258 <pre caption="Installing the gnumeric prebuilt package">
259 # <i>emerge --usepkg --getbinpkg gnumeric</i>
260 </pre>
261
262 <p>
263 More information about emerge's prebuilt package options can be found in the
264 emerge man page:
265 </p>
266
267 <pre caption="Reading the emerge man page">
268 $ <i>man emerge</i>
269 </pre>
270
271 </body>
272 </subsection>
273 </section>
274 </sections>

  ViewVC Help
Powered by ViewVC 1.1.20