"Speed, it seems to me, provides the one genuinely modern pleasure." --- Aldous Huxley (1894 - 1963)
distcc is a program to distribute compilation of C or C++ code across several machines on a network. distcc should always generate the same results as a local compile, is simple to install and use, and is often significantly faster than a local compile.
Unlike other distributed build systems, distcc does not require all machines to share a filesystem, have synchronized clocks, or to have the same libraries or header files installed.
Compilation is centrally controlled by a client machine, which
is typically the developer's workstation or laptop. The
distcc client runs on this machine, as does make, the
preprocessor, the linker, and other stages of the build
process. Any number of "volunteer" machines help the client
to build the program, by running the compiler and assembler
as required. The volunteer machines run the distccd
daemon which listens on a network socket for requests.
distcc sends the complete preprocessed source code across the
network for each job, so all it requires of the volunteer
machines is that they be running the distccd
daemon,
and that they have an appropriate compiler installed.
distcc is designed to be used with GNU make's parallel-build
feature (-j
). Shipping files across the network takes
time, but few cycles on the client machine. Any files that can
be built remotely are essentially "for free" in terms of client
CPU.
distcc was written by Martin Pool. The design is his own invention.
distcc was inspired by Andrew Tridgell's ccache program.
distcc and the distcc User Manual are copyright (C) 2002 by Martin Pool.
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.
Permission is granted to copy, distribute and/or modify the distcc User Manual under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
distcc is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License and GNU Free Documentation License along with distcc. If not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA, or see http://www.gnu.org/licenses/.
The author understands the GNU GPL to apply to distcc in the following way: you are allowed to use distcc to compile a non-free program, or to call it from a non-free Make, or to call a non-free compiler. However, you may not distribute a modified version of distcc unless you comply with the terms of the GPL: in particular, giving your users access to the source code and the right to redistribute it, and clearly identifying your changes.
If you find distcc useful, I would appreciate you writing an email to tell me.
distcc should only be used on networks where all machines and all users are trusted.
The distcc daemon, distccd
, allows other machines
on the network to run arbitrary commands on the volunteer
machine. Anyone that can make a connection to the volunteer
machine can run essentially any command as the user running
distccd
.
distcc is suitable for use on a small to medium network of friendly developers. It's certainly not suitable for use on a machine connected to the Internet or a large (e.g. university campus) network without firewalling in place.
inetd
or tcpwrappers
can be used to impose
access control rules, but this should be done with an eye to
the possibility of address spoofing.
In summary, the security level is similar to that of old-style network protocols like X11-over-TCP, NFS or RSH.
Four straightforward steps are required to install and use distcc:
distcc
package on the
client and volunteer machines.
distccd
daemon on all volunteer
machines.
DISTCC_HOSTS
environment
variable to indicate which volunteer machines to use.
For example:
DISTCC_HOSTS='angry toey:4202 localhost'
CC
variable or edit Makefiles to prefix
distcc to calls to the C/C++ compiler. For example:
distcc gcc -o hello.o -c hello.c