Gentoo Archives: gentoo-user

From: Walter Dnes <waltdnes@××××××××.org>
To: Gentoo Users List <gentoo-user@l.g.o>
Subject: [gentoo-user] [distcc redux] A working distcc setup
Date: Fri, 27 Mar 2015 21:18:59
1 First of all, thanks to everybody who answered my questions, and
2 helped me get it working. Now for the setup. This is a home LAN, so I
3 don't bother with ssh tunneling, etc, which will be necessary if you're
4 going over untrusted links, e.g. the public internet.
6 * The host, IP address, is an over 7 year old Dell
7 Dimension 530 with a Core Duo, running 64-bit Gentoo. It will
8 compile for the client.
10 * The client, IP address, is an ancient Acer netbook,
11 with an Atom CPU so old that it only runs 32-bit mode.
13 *** On the host ***
14 =====================================================================
16 * emerge crossdev
18 * build a toolchain that can compile for the client's architecture...
20 crossdev -S -t <client's CHOST>
22 You need to know what the CHOST variable is in the client's make.conf.
23 e.g. on my netbook CHOST="i686-pc-linux-gnu" so the command would be
25 crossdev -S -t i686-pc-linux-gnu
27 The "-S" tells crossdev to build the latest stable gcc and utilities
28 version. The default (without the "-S") is to build the absolute latest
29 version available, as if gcc and utilities were keyworded. Note that
30 the gcc versions must be essentially the same on the client and the
31 server crossdev toolchain. E.g. for gcc-a.b.c, the 3rd part (the
32 revison # "c") can differ. But if either the major or minor version
33 portions differ, you are guaranteed to have problems.
35 * emerge distcc
37 * edit the DISTCCD_OPTS variable to indicate allowed clients. On my
38 host machine, it's...
40 DISTCCD_OPTS="--port 3632 --log-level notice --log-file /var/log/distccd.log -N 15 --allow"
42 Notes;
43 - The default port is 3632
44 - "N" is the "nice" level.
45 - you can allow multiple addresses, e.g.
46 "--allow --allow" etc.
48 * start up the distccd daemon with the command
49 /etc/init.d/distccd start
51 * optionally set it to come up whenever the machine boots up
52 rc-update add distccd default
54 *** On the client ***
55 =====================================================================
57 specify host(s) in /etc/distcc/hosts e.g. in my case
61 Notes;
62 - you can have multiple entries, using a space as the separator. The
63 leftmost entry will be the preferred host, and any additional entries
64 will have descending priority.
65 - the "/6" is not a CIDR number. It specifies how many simultaneous
66 jobs to send to that server. The optimal number will vary depending
67 on how powerful the server is, and whether it's also being used as a
68 desktop, etc.
69 - The "lzo" entry specifies lzo compression. It is necessary for "pump"
70 mode. You will want pump mode.
71 - The "cpp" entry is also necessary for "pump" mode. You will want pump
72 mode.
74 If you have "distcc distcc-pump" in FEATURES in make.conf, the
75 "emerge" command will transparently invoke pump mode. Without them,
76 builds will be done locally. Does that mean you have to edit your
77 make.conf file each time you switch between local and distcc builds?
78 NO. Remember how you can temporarily modify the USE variable for an
79 emerge like so...
81 USE="foo" emerge bar
83 ...the exact same method works for the FEATURES variable.
85 * do *NOT* put "distcc distcc-pump" directly into FEATURES in make.conf
87 * make an executable script /root/bin/xmerge with 2 lines...
89 #!/bin/bash
90 FEATURES="distcc distcc-pump" emerge ${*}
92 Now compare the outputs of...
93 emerge --info | grep ^FEATURES
94 xmerge --info | grep ^FEATURES
96 aa1 portage # emerge --info | grep ^FEATURES
97 FEATURES="assume-digests binpkg-logs distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
100 aa1 portage # xmerge --info | grep ^FEATURES
101 FEATURES="assume-digests binpkg-logs distcc distcc-pump distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
103 Your FEATURES options will probably differ from mine. The important
104 point is that when launched from the xmerge script, emerge sees the
105 options "distcc distcc-pump" in FEATURES, and transparently uses distcc.
106 When launched directly from the command line, emerge won't see this, and
107 will therefore build locally. In the above example, only the parameter
108 "--info" was passed to xmerge. But you can pass any legal energe
109 parameters to xmerge, e.g.
111 xmerge --changed-use --deep --update @world
113 --
114 Walter Dnes <waltdnes@××××××××.org>
115 I don't run "desktop environments"; I run useful applications


Subject Author
[gentoo-user] Re: [distcc redux] A working distcc setup James <wireless@×××××××××××.com>
Re: [gentoo-user] [distcc redux] A working distcc setup lee <lee@××××××××.de>