/[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 - (hide annotations) (download) (as text)
Mon May 23 18:19:59 2005 UTC (9 years, 3 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 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     <!-- See http://creativecommons.org/licenses/by-sa/1.0 -->
6    
7 swift 1.28 <!-- $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 swift 1.1
9     <sections>
10 swift 1.23
11 swift 1.28 <version>1.25</version>
12     <date>2005-05-23</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     (before <path>/usr/bin</path>). This can be accomplished by editing
188 swift 1.26 <path>/etc/profile</path>:
189 swift 1.12 </p>
190    
191 swift 1.26 <pre caption="Editing /etc/profile">
192     PATH="<i>/usr/lib/ccache/bin</i>:${PATH}"
193 swift 1.12 </pre>
194    
195     </body>
196     </subsection>
197 swift 1.1 </section>
198     <section>
199 swift 1.19 <title>Binary Package Support</title>
200 swift 1.1 <subsection>
201 swift 1.19 <title>Creating Prebuilt Packages</title>
202 swift 1.1 <body>
203    
204 swift 1.2 <p>
205 swift 1.19 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 swift 1.2 </p>
209    
210     <p>
211 swift 1.19 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 swift 1.2 </p>
215    
216     <p>
217 swift 1.19 If you want Portage to create prebuilt packages of every single package you
218     install, add <c>buildpkg</c> to the FEATURES variable.
219 swift 1.2 </p>
220    
221     <p>
222 swift 1.19 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 neysx 1.22 link="/proj/en/releng/catalyst/reference.xml">Catalyst Reference Manual</uri>
225     and <uri link="/proj/en/releng/catalyst/catalyst-howto.xml">Catalyst
226 swift 1.19 Howto</uri>.
227 swift 1.2 </p>
228 swift 1.6
229 swift 1.5 </body>
230     </subsection>
231     <subsection>
232 swift 1.19 <title>Installing Prebuilt Packages</title>
233 swift 1.5 <body>
234    
235     <p>
236 swift 1.19 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 swift 1.5 </p>
241    
242 swift 1.19 <pre caption="Setting PORTAGE_BINHOST in /etc/make.conf">
243     PORTAGE_BINHOST="ftp://buildhost/gentoo"
244 swift 1.5 </pre>
245    
246     <p>
247 swift 1.19 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 swift 1.5 </p>
253    
254 swift 1.7 <p>
255 swift 1.19 For instance, to install <c>gnumeric</c> with prebuilt packages:
256 swift 1.7 </p>
257    
258 swift 1.19 <pre caption="Installing the gnumeric prebuilt package">
259     # <i>emerge --usepkg --getbinpkg gnumeric</i>
260 swift 1.7 </pre>
261    
262 swift 1.5 <p>
263 swift 1.19 More information about emerge's prebuilt package options can be found in the
264 swift 1.21 emerge man page:
265 swift 1.5 </p>
266    
267 swift 1.21 <pre caption="Reading the emerge man page">
268 swift 1.19 $ <i>man emerge</i>
269 swift 1.2 </pre>
270 swift 1.1
271     </body>
272     </subsection>
273     </section>
274     </sections>

  ViewVC Help
Powered by ViewVC 1.1.20