summaryrefslogtreecommitdiff
path: root/INSTALL
blob: d2f53a3961d17db621faf8e0f2c67f1636bc2d22 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
Installation instructions for distcc                  -*- indented-text -*-

distcc is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version. distcc comes with ABSOLUTELY NO WARRANTY,
for details see the licence.

Please report any problems to distcc@googlegroups.com.


To build: the simple way is to just do

  ./run_all_autoconf.sh    # invokes autoconf and autoheader using
                           # version info in the file version.sh
  ./configure              # creates distcc/config.h and makefiles
  make                     # build

but the recommended way is to build in a different directory tree
than the source tree:

  ./run_all_autoconf.sh
  mkdir obj
  cd obj
  ../configure
  make

Either of these methods will:

 - compile distcc
 - compile Python C extensions

To test:

   make check

To test installation using your own machine as a distcc compilation server:

 - start daemon (in one window):

    distcc/distccd --wizard --allow 127.0.0.1

 - compile (in another):

    DISTCC_POTENTIAL_HOSTS=127.0.0.1 pump BUILDCOMMAND

See the shell script pump in this directory.


Prerequisites
-------------

To build distcc you need

   GNU Make
   A C compiler

You can optionally have

   libpopt

     If this is not found on your system, it will be statically linked in.

   Python >=2.4

     To use the "pump" include server, or to run the test suite with
     "make maintainer-check", or to run the benchmarks.

   linuxdoc SGML tools

     To rebuild the documentation from its SGML source.

   autoconf >=2.5

     To rebuild the configure scripts if you edit configure.ac.

To build the optional GNOME monitor (--with-gnome), you need the
GNOME2 development libraries, and in particular

  gtk+ >=2.0
  libgnome >=2.0
  libgnomeui >= 2.0
  libglade >= 2.0
  libpango

The monitor can also be built without GNOME desktop integration
(--with-gtk), in which case you need only

  gtk+ >=2.0
  libglade >= 2.0


Preliminaries
-------------

distcc can be installed and used without requiring root access.
Adjust directories appropriately when installing.


Compiling distcc
----------------

Note that the default GNU "sysconfdir" is /usr/local/etc.  You may
want to change this to /etc.

  $ ./configure --sysconfdir=/etc

You can set an installation prefix if you want to put distcc in /opt:

  $ ./configure --prefix=/opt/distcc/

distcc needs to be installed on all client and server machines.

If you would like a graphical client-side monitor to show running
jobs, you can choose either --with-gnome or --with-gtk.

If you would like to try running distcc over IPv6, use
--enable-rfc2553.  You must have a reasonably recent operating system
or this is likely to fail in complex ways.


Starting the daemon
-------------------

This stage is only required if you want to run distcc over TCP
sockets, rather than SSH connections.  TCP is faster but less secure
and should only be used on trusted networks.

In TCP mode distccd can run either from inetd or as a standalone
daemon.  Running standalone is recommended.

To run standalone, run a command like this, either from the command
line or from the system startup scripts.

  distccd --daemon

If the daemon is started from an rc script, then make sure that it
sees a PATH setting which can find any compilers installed in
nonstandard directories.

You should create a "distcc" account on server machines so that distcc
can run with minimal privilege.  It is not necessary for this account
to own any files or have a home directory.  If this account doesn't
exist, distccd uses the "nobody" account.

By default distccd writes messages to the "daemon" syslog, which
typically ends up in /var/log/messages or /var/log/daemon.

You can set IP-based access control using the --allow and --listen
options, in either inetd or daemon mode:

  distccd --allow 10.4.20.0/24

distccd does not need to run on machines that will only act as
clients.

See the manual for more information.


Set up the host list
--------------------

On the client machines, store a list of servers names in
~/.distcc/hosts.  If you're using TCP connections, it should look like
this:

  localhost red green blue

For SSH connections

  localhost @red @green @blue

The hosts should be listed in descending order of speed.  localhost
should normally be first, unless it is signficantly slower than
another machine.

The host list also needs ",cpp,lzo" after each host if you're using
pump mode - see README.pump for details.

See the manual for more information.


Create the masquerade directories
---------------------------------

The easiest way to use distcc is in "masquerade" mode, where it is
installed on the path to "catch" calls to the compiler and redirect
them over the network.  Other options are discussed in the manual.

For instance, you could create the directory named /usr/lib/distcc/bin
and populate it with links.

# mkdir /usr/lib/distcc/bin
# cd /usr/lib/distcc/bin
# ln -s ../../../bin/distcc gcc
# ln -s ../../../bin/distcc cc
# ln -s ../../../bin/distcc g++
# ln -s ../../../bin/distcc c++

Do this for all compiler names that you use.

Then, to use distcc, a user just needs to put the directory
/usr/lib/distcc/bin early in the PATH and distcc will handle the rest.

  export PATH=/usr/lib/distcc/bin:$PATH


Use with ccache
---------------

The best way to use is to set up a similar masquerade directory for
ccache, and put it on the path before distcc.

NOTE: Use of ccache is incompatible with use of distcc's "pump" mode.


Complete the survey
-------------------

Once you have distcc working for your own application, please complete
and mail in the survey in survyey.txt.