/[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.20 - (hide annotations) (download) (as text)
Sat Oct 23 11:02:06 2004 UTC (9 years, 10 months ago) by swift
Branch: MAIN
Changes since 1.19: +2 -2 lines
File MIME type: application/xml
Fix english grammer issues

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.20 <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-working-features.xml,v 1.19 2004/10/21 10:31:20 swift Exp $ -->
8 swift 1.1
9     <sections>
10     <section>
11 swift 1.19 <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> manpage:
29     </p>
30    
31     <pre caption="Consulting the make.conf manpage">
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 swift 1.1 <subsection>
49 swift 1.19 <title>Using distcc</title>
50 swift 1.1 <body>
51    
52 swift 1.2 <p>
53 swift 1.19 <c>distcc</c> is a program to distribute compilations across several, not
54 swift 1.2 necessarily identical, machines on a network. The <c>distcc</c> client sends all
55 swift 1.19 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 swift 1.2 faster compilation time.
58     </p>
59    
60     <p>
61 swift 1.19 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 swift 1.2 </p>
65    
66 swift 1.1 </body>
67     </subsection>
68     <subsection>
69 swift 1.19 <title>Installing distcc</title>
70 swift 1.1 <body>
71    
72 swift 1.2 <p>
73     Distcc ships with a graphical monitor to monitor tasks that your computer is
74 swift 1.19 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 swift 1.2 </p>
78    
79 swift 1.19 <pre caption="Installing distcc">
80 swift 1.2 # <i>emerge distcc</i>
81     </pre>
82    
83 swift 1.1 </body>
84     </subsection>
85     <subsection>
86     <title>Activating Portage Support</title>
87     <body>
88    
89 swift 1.2 <p>
90 swift 1.19 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 swift 1.2 </p>
95    
96     <p>
97 swift 1.19 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 swift 1.2 </p>
101    
102 swift 1.19 <pre caption="Configuring distcc to use three available distcc servers">
103 swift 1.3 # <i>distcc-config --set-hosts "192.168.1.102 192.168.1.103 192.168.1.104"</i>
104     </pre>
105    
106     <p>
107 swift 1.19 Don't forget to run the <c>distccd</c> daemon as well:
108 swift 1.3 </p>
109    
110 swift 1.19 <pre caption="Starting the distccd daemons">
111     # <i>rc-update add distccd default</i>
112 swift 1.3 # <i>/etc/init.d/distccd start</i>
113     </pre>
114    
115 swift 1.1 </body>
116     </subsection>
117     </section>
118     <section>
119 swift 1.19 <title>Caching Compilation</title>
120 swift 1.1 <subsection>
121 swift 1.19 <title>About ccache</title>
122 swift 1.1 <body>
123    
124 swift 1.4 <p>
125 swift 1.19 <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 swift 1.4 </p>
130    
131     <p>
132 swift 1.19 If you are interested in the ins and outs of ccache, please visit the
133 swift 1.4 <uri link="http://ccache.samba.org">ccache homepage</uri>.
134     </p>
135    
136 swift 1.1 </body>
137     </subsection>
138     <subsection>
139 swift 1.4 <title>Installing ccache</title>
140 swift 1.1 <body>
141    
142 swift 1.4 <p>
143 swift 1.19 To install <c>ccache</c>, run <c>emerge ccache</c>:
144 swift 1.4 </p>
145    
146     <pre caption="Installing ccache">
147     # <i>emerge ccache</i>
148     </pre>
149    
150 swift 1.1 </body>
151     </subsection>
152     <subsection>
153 swift 1.19 <title>Activating Portage Support</title>
154 swift 1.1 <body>
155 swift 1.4
156     <p>
157 swift 1.19 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 swift 1.4 </p>
160    
161     <pre caption="Editing CCACHE_SIZE in /etc/make.conf">
162     CCACHE_SIZE="2G"
163     </pre>
164    
165     <p>
166 swift 1.20 To check if ccache functions, ask ccache to provide you with its statistics:
167 swift 1.4 </p>
168    
169     <pre caption="Viewing ccache statistics">
170     # <i>ccache -s</i>
171     </pre>
172 swift 1.1
173     </body>
174     </subsection>
175 swift 1.12 <subsection>
176 swift 1.19 <title>Using ccache for non-Portage C Compiling</title>
177 swift 1.12 <body>
178    
179     <p>
180     If you would like to use ccache for non-Portage compilations, add
181 swift 1.19 <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 swift 1.12 </p>
185    
186 swift 1.19 <pre caption="Editing /etc/env.d/00basic">
187     PATH="/usr/local/bin:/opt/bin<i>:/usr/lib/ccache/bin</i>"
188 swift 1.12 </pre>
189    
190     </body>
191     </subsection>
192 swift 1.1 </section>
193     <section>
194 swift 1.19 <title>Binary Package Support</title>
195 swift 1.1 <subsection>
196 swift 1.19 <title>Creating Prebuilt Packages</title>
197 swift 1.1 <body>
198    
199 swift 1.2 <p>
200 swift 1.19 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 swift 1.2 </p>
204    
205     <p>
206 swift 1.19 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 swift 1.2 </p>
210    
211     <p>
212 swift 1.19 If you want Portage to create prebuilt packages of every single package you
213     install, add <c>buildpkg</c> to the FEATURES variable.
214 swift 1.2 </p>
215    
216     <p>
217 swift 1.19 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 swift 1.2 </p>
224 swift 1.6
225 swift 1.5 </body>
226     </subsection>
227     <subsection>
228 swift 1.19 <title>Installing Prebuilt Packages</title>
229 swift 1.5 <body>
230    
231     <p>
232 swift 1.19 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 swift 1.5 </p>
237    
238 swift 1.19 <pre caption="Setting PORTAGE_BINHOST in /etc/make.conf">
239     PORTAGE_BINHOST="ftp://buildhost/gentoo"
240 swift 1.5 </pre>
241    
242     <p>
243 swift 1.19 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 swift 1.5 </p>
249    
250 swift 1.7 <p>
251 swift 1.19 For instance, to install <c>gnumeric</c> with prebuilt packages:
252 swift 1.7 </p>
253    
254 swift 1.19 <pre caption="Installing the gnumeric prebuilt package">
255     # <i>emerge --usepkg --getbinpkg gnumeric</i>
256 swift 1.7 </pre>
257    
258 swift 1.5 <p>
259 swift 1.19 More information about emerge's prebuilt package options can be found in the
260     emerge manpage:
261 swift 1.5 </p>
262    
263 swift 1.19 <pre caption="Reading the emerge manpage">
264     $ <i>man emerge</i>
265 swift 1.2 </pre>
266 swift 1.1
267     </body>
268     </subsection>
269     </section>
270     </sections>

  ViewVC Help
Powered by ViewVC 1.1.20