lfs-uefi: fix efivar-37 FTBFS
[linux_from_scratch_hints.git] / distributed_compiling.txt
blobd52ad470d66b9fab099147ff2af7691ddf6a7f4a
1 AUTHOR: Cedric de Wijs cedric.de.wijs<at>softhome<dot>net
3 DATE: 2004-04-09
5 LICENSE: GNU Public Licence
7 SYNOPSIS: How to install distcc --a free distributed C/C++ compiler system
9 DESCRIPTION:
10 TODO: put some usefull words here
12 ATTACHMENTS:
13 The distcc package, available from:
14 http://distcc.samba.org/ftp/distcc/distcc-2.12.1.tar.bz2 (317,8kB)
17 PREREQUISITES:
18 This hint expect you to have two working lfs systems with the same version of gcc, binutils and glibc, and functional networking
20 HINT:
21 =================
22 TABLE OF CONTENTS
23 =================
25 1 Introduction
26 2 Required Files
27 3 Installation server
28 4 Installation client
29 5 Usage
30 6 Pitfalls
31 7 Recommended reading
33 ===============
34 1 Introduction
35 ===============
37 Compiling sourcecode can take a long time. This hint describes how to install distcc, a tool that can be used to distribute the compiling across multiple machines in a network. 
38 The machine you sit behind and issue the compile from is the client. 
39 The machines who are doing the work are the servers.
40 Every machine can contain both a server and a client
42 This text is based upon the documentation of distcc, written by Martin Pool
44 Estimated build time:           0.20 SBU
45 Estimated required disk space:  5.4 MB
47 =================
48 2. REQUIRED FILES
49 =================
50 The distcc package, available from:
51 http://distcc.samba.org/ftp/distcc/distcc-2.12.1.tar.bz2 (317,8kB)
53 ===============
54 3. Installation
55 ===============
56 To install the package run the following:
58 ./configure --sysconfdir=/etc &&
59 make &&
60 make install
61 =======================
62 3. Configuration server
63 =======================
64 To make distcc run as a server create a new user. Make sure /tmp is writable by that user:
66 useradd distcc
69 To start the daemon use the following command:
71 nice -n 19 distccd --daemon
74 To make distcc start at boottime use this script:
76 cat > /etc/rc.d/init.d/distcc << "EOF"
77 #!/bin/bash
78 source /etc/sysconfig/rc
79 source $rc_functions
80 case "$1" in
81         start)
82                 echo "Starting distributed compile daemon"
83                 nice -n 19 /usr/local/bin/distccd --daemon
84                 ;;
85         stop)
86                 echo "Stopping distributed compile daemon"
87                 killproc /usr/local/bin/distccd
88                 ;;
89         *)
90                 echo "Usage: $0 {start|stop|reload|restart|status}"
91                 exit 1
92                 ;;
93 esac
94 EOF
95 chmod 700 /etc/rc.d/init.d/distcc
97 And make some symlinks to it:
99 cd /etc/rc.d/init.d &&
100 ln -sf ../init.d/distcc ../rc0.d/K00distcc &&
101 ln -sf ../init.d/distcc ../rc2.d/S99distcc &&
102 ln -sf ../init.d/distcc ../rc3.d/S99distcc &&
103 ln -sf ../init.d/distcc ../rc5.d/S99distcc &&
104 ln -sf ../init.d/distcc ../rc6.d/K00distcc
106 =======================
107 4. Configuration client
108 =======================
109 To make distcc run as a client run the following:
111 ./configure --sysconfdir=/etc &&
112 make &&
113 make install
115 To let distcc know who the servers are edit the following file:
117 mkdir ~/.distcc &&
118 cat > /root/.distcc/hosts << "EOF"
119 localhost       #your own machine
120 192.168.0.201   #the first server,
121 192.168.0.202   #and the second server
124 To make sure distcc is found before your real compiler, create some symlinks:
126 ln -s /usr/local/bin/distcc /bin/c++ &&
127 ln -s /usr/local/bin/distcc /bin/cc &&
128 ln -s /usr/local/bin/distcc /bin/g++ &&
129 ln -s /usr/local/bin/distcc /bin/gcc
131 ========
132 5. Usage
133 ========
134 Instead of running the following command:
135 ./configure && make && make install
136 Use these commands:
137 ./configure && make -j 6 && make install
140 Every server can handle three clients per CPU unless otherwise configured, so the above comand can fill two servers.
141 ===========
142 6. Pitfalls
143 ===========
144 Don't use version 1.12. This version contains a bug causing distccd not to run as user distcc. Older and newer versions should work fine
146 ======================
147 7. Recommended reading
148 ======================
149 The documentation included with distcc
151 The following hints:
152 parallelcompiling.txt
155 ACKNOWLEDGEMENTS:
156 The programmer of this utility:
157 Martin Pool <mbp@samba.org>
159 The author of parallelcompiling.txt  
160 Daniel Baumann <daniel.baumann@panthera-systems.net> 
162 CHANGELOG:
163 2004-04-09 Initial release