Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Share your distcc tips
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
sarnold
Developer
Developer


Joined: 28 Nov 2002
Posts: 115
Location: California

PostPosted: Sun Apr 20, 2003 5:14 pm    Post subject: Share your distcc tips Reply with quote

Okay, I think I mostly have it figured out now, but I'm sure some folks could add a few things too. Other than trying to figure out just which settings are current, and how it's different for Gentoo, the biggest problem I had was that distcc seems to stop using the extra hosts once in a while and falls back to local compiles only.

Here's what I learned in the last few days:

Follow the gentoo setup tips on zwelch's page here for the basic portage setup. Emerge distcc and ccache on all the machines you want to participate in the group builds (go ahead and emerge the latest 2.0.1 version of distcc, as it seems to work for me). Then add your DISTCC_HOSTS to make.conf, and set MAKEOPTS="-jN" where N is one more than twice the total number of CPUs used for distcc. And don't forget to add distcc and ccache to the FEATURES list.

You can check /etc/conf.d/distccd for reasonable settings, and add distccd to the default runlevel. Also, in order to get logging working (to a distcc log file instead of syslog) I added a /var/log/distcc directory (user=distcc, group=portage, rwxr-xr-x) and touched the distcc.log file (same ownership and permissions). Then I added the following to the /etc/conf.d/distccd file:
Code:
# set this option to run distccd with extra parameters
# DISTCCD_OPTS="--nice 20"
DISTCCD_OPTS="--log-file /var/log/distcc/distcc.log"


Now, if you start an emerge on one machine, you can check what the helper machines are doing by tailing the /var/log/distcc/distcc.log file on each client.

If you have one slow machine (like my old laptop) and you want to make distcc build everything on the faster machines, then remove localhost from the DISTCC_HOSTS line in make.conf (on the slow machine). Also, you don't need distccd running on the controlling machine (only on the helper machines).

Now, for a kernel compile (or some other non-portage build) you will need to use distcc-config on the controlling machine (not the helper machines) to set DISTCC_HOSTS only; do not set any other distcc-config options. Just type 'distcc-config' for usage. Then for the actual kernel build, type:

Code:
PATH="/usr/lib/distcc/bin:${PATH}" make -jN bzImage


Edit: I forgot the path setting above, which is very important. Otherwise, distcc will not get called... You can also add these in front of PATH if you want a log and/or more verbosity:

DISTCC_VERBOSE=1 DISTCC_LOG=distcc.log

Again, make N equal to 1 more than 2 times the number of CPUs. In my case (for the slow laptop) I used N=5, since I have 2 helper machines with 1 CPU each. According to the latest distcc manual, scheduling extra jobs on Linux is not much overhead, so this seems to be the preferred config.

Here's what I'm still trying to figure out:

In the case of distcc and portage, does the -J setting have any effect on the helper machines at all, or is it strictly the -J setting on the controlling machine?

If one of the helper machines goes off-line during a distributed build (and it stops being used for compile jobs), is there any way to get it back into the build on the fly? Or do I have to start the job over?

Does that even make sense?

What's the best way to configure the number of jobs if one or more helper machines are only intermittently available? Is there any serious penalty for too many parallel jobs?

Has anyone seen the TV-Guide?


Last edited by sarnold on Mon Apr 21, 2003 9:50 pm; edited 1 time in total
Back to top
View user's profile Send private message
rac
Bodhisattva
Bodhisattva


Joined: 30 May 2002
Posts: 6553
Location: Japanifornia

PostPosted: Sun Apr 20, 2003 5:59 pm    Post subject: Re: Share your distcc tips Reply with quote

sarnold wrote:
In the case of distcc and portage, does the -J setting have any effect on the helper machines at all, or is it strictly the -J setting on the controlling machine?
Only on the machine running make - the controlling machine.

Quote:
Is there any serious penalty for too many parallel jobs?
Not "serious". The worst thing that will happen is that you will have extra context switches that cause a bit of overhead, as make tries to do too many things at once. In general, you want every processor to be busy doing one thing. That's the most efficient state of affairs. If each one has more work than that to do, then the time spent switching back and forth between them is wasted. But it shouldn't be a really heavy effect.
_________________
For every higher wall, there is a taller ladder
Back to top
View user's profile Send private message
wick
n00b
n00b


Joined: 27 Mar 2003
Posts: 35

PostPosted: Sun Apr 20, 2003 11:30 pm    Post subject: Reply with quote

My $0.02:

- DISTCC_HOSTS should be ordered based on the particular machines' ability to compile. Remember that every idle machine that is running distccd provides the capability of running a "free" compile, regardless of its speed. The only time it makes a difference is when you have a make target that has very few source files. Make will wait for the slow machine before pressing on to the next target.

- In /etc/env.d, the CC= and CXX= options are set by the gcc environment options. I commented out the CC= anc CXX= lines in the environment options because I got tired of running unset CC and unset CXX at the command line prior to running emerge.

- Not all packages will build with distcc. It does not provide a clean unattended option for building a system, which is unfortunate because it would really facilitate bringing new boxes online quickly.

- As rac mentioned, there is no serious penalty for too many parallel compiles. However, eventually you'll find the breakeven point and start getting diminishing returns. My parallel option is set as -j15 now. I have 6 uniprocessor and 1 dual processor machines in my distcc build environment (which includes 2x vmware virtual machines running in Windows.) The theoretical maximum speed for my builds should be 7x as fast as a single machine compiling, but I don't get anywhere near that. It's typically around 5x.
Back to top
View user's profile Send private message
Beekster
Apprentice
Apprentice


Joined: 26 Nov 2002
Posts: 268
Location: Sydney

PostPosted: Sun Apr 20, 2003 11:43 pm    Post subject: Reply with quote

An additional question or two - seems like a good place for it:

What happens in the event the machines have different gcc or glibc versions? Or other package relevant to compiling? During the course of upgrading such packages on each machine, they will inevitably vary until they are all done. Can distcc be used to upgrade these packages?
Back to top
View user's profile Send private message
karrots
n00b
n00b


Joined: 06 Mar 2003
Posts: 11
Location: Ogden, Ut

PostPosted: Mon Apr 21, 2003 12:08 am    Post subject: Re: Share your distcc tips Reply with quote

sarnold wrote:
If one of the helper machines goes off-line during a distributed build (and it stops being used for compile jobs), is there any way to get it back into the build on the fly? Or do I have to start the job over?

Does that even make sense?


I use distccd quite often to compile. Many times I will get things started then walk over to my other computer boot it up into Knoppix then run distccd and it joins in when it starts up.

So from my experience the answer to your question is just bring the helper box you took off-line back on-line and as long as its in the DISTCC_HOSTS it will start working away. If you wish to bring a computer into help that was not in your DISTCC_HOSTS variable before starting a build then you need to start the build over again.

Karrots
Back to top
View user's profile Send private message
wick
n00b
n00b


Joined: 27 Mar 2003
Posts: 35

PostPosted: Mon Apr 21, 2003 3:24 am    Post subject: Reply with quote

Quote:
What happens in the event the machines have different gcc or glibc versions? Or other package relevant to compiling? During the course of upgrading such packages on each machine, they will inevitably vary until they are all done. Can distcc be used to upgrade these packages?


I have distcc running on a redhat machine in my build cluster. It's running gcc 3.2. The gentoo machines in my build cluster are all running the most recent gcc (gcc 3.2.2-r2). I've had absolutely no problems compiling with this combination. I wouldn't advise using differing major versions of the compiler, and I even try and keep the minor versions the same as well.

I don't believe the glibc versions will matter at all. Everything is passed through the precompiler before it gets sent over to the worker machine to do the compilations. The only place the linker will run is on the machine you're running the make on.
Back to top
View user's profile Send private message
mmealman
Guru
Guru


Joined: 02 Nov 2002
Posts: 348
Location: Florida

PostPosted: Mon Apr 21, 2003 2:09 pm    Post subject: Reply with quote

What's the major differences between distcc 1.2 and 2.0?
Back to top
View user's profile Send private message
wick
n00b
n00b


Joined: 27 Mar 2003
Posts: 35

PostPosted: Mon Apr 21, 2003 10:54 pm    Post subject: Reply with quote

Quote:
What's the major differences between distcc 1.2 and 2.0?


This is the original developer's roadmap.

http://distcc.samba.org/roadmap.html
Back to top
View user's profile Send private message
Becks
Tux's lil' helper
Tux's lil' helper


Joined: 06 Dec 2002
Posts: 90

PostPosted: Wed Apr 23, 2003 7:36 am    Post subject: Reply with quote

Ok, some questions then :)
Is there anyone here who has found an easy way to turn a machine into a distcc-host for compiling ? We have several (around 20) Athlon 1400 machines here running Windows NT. A knoppix cd with installed distcc would be great. Anyone there who has added this feature to knoppix and can explain how he did this ?

Alex
Back to top
View user's profile Send private message
Yarrick
Bodhisattva
Bodhisattva


Joined: 05 Jun 2002
Posts: 304
Location: Malmö, Sweden

PostPosted: Wed Apr 23, 2003 8:36 pm    Post subject: Reply with quote

Becks wrote:
Ok, some questions then :)
Is there anyone here who has found an easy way to turn a machine into a distcc-host for compiling ? We have several (around 20) Athlon 1400 machines here running Windows NT. A knoppix cd with installed distcc would be great. Anyone there who has added this feature to knoppix and can explain how he did this ?

Alex


i also need this! the two people i live with have better computers than me and im thinking of borrowing some cycles while their away :)
Back to top
View user's profile Send private message
versus
n00b
n00b


Joined: 25 Apr 2003
Posts: 4
Location: Siberia, Russia

PostPosted: Fri Apr 25, 2003 12:50 am    Post subject: Reply with quote

Becks wrote:
Ok, some questions then :)

Is there anyone here who has found an easy way to turn a machine into a distcc-host for compiling ? We have several (around 20) Athlon 1400 machines here running Windows NT. A knoppix cd with installed distcc would be great. Anyone there who has added this feature to knoppix and can explain how he did this ?


Alex



latest knoppix has distccd. Too bad it has gcc2 compiler...
Back to top
View user's profile Send private message
sn4ip3r
Guru
Guru


Joined: 14 Dec 2002
Posts: 325
Location: Tallinn, Estonia

PostPosted: Fri Apr 25, 2003 10:51 am    Post subject: Reply with quote

If you want to run distcc on a machine without linux you don't have to use knoppix, because distcc works in cygwin. Ofcourse it means that you have to build a cross-compiler under cygwin which can be quite hard, but there is a guide at http://cvs.gentoo.org/~aiken/cygwin-cross/ and it works, mostly. I had to path gcc and I also had to manually remove a #define flag that enabled the use of mempcpy function (which didn't exist or work).
Back to top
View user's profile Send private message
skwelch
n00b
n00b


Joined: 13 Dec 2002
Posts: 38
Location: NJ, USA

PostPosted: Fri Apr 25, 2003 2:17 pm    Post subject: Great tip Reply with quote

Thanks for the info, this is way easy to setup and totally ends the pain of long compiles. Now I just need to sneek distccd onto other peoples workstations while they're at lunch :twisted:
Back to top
View user's profile Send private message
versus
n00b
n00b


Joined: 25 Apr 2003
Posts: 4
Location: Siberia, Russia

PostPosted: Sat Apr 26, 2003 12:18 pm    Post subject: ok, i've found something interesting... Reply with quote

when searching "distcc" on freshmeat I've found this link

http://www.warwick.ac.uk/~esvld/imageBoot/

Bootable diskette image which loads root filesystem via http/ftp.
Example root filesystem .tar.gz contains gcc 3.2.x + distcc !

gonna try this immediately :)
Back to top
View user's profile Send private message
Zadeh
Tux's lil' helper
Tux's lil' helper


Joined: 31 Oct 2002
Posts: 131

PostPosted: Sun Apr 27, 2003 4:28 am    Post subject: Reply with quote

I've been building cygwin->linux cross compilers for awhile now to use distcc. There is a trivial patch that you need for gcc and libiberty which I'm trying to get backported to the 3.2 branch (already in 3.3) which is here:

http://gcc.gnu.org/ml/gcc/2003-04/msg00538.html

Basically all you need to do is
1) Copy all the /lib and /usr/lib files built by glibc and stuff it into a single directory, and copy that and /usr/include/* over to Cygwin. Modify the libc.so linker script to point to the new location of libc.so.6 and libc_nonshared.a in Cygwin.

2) Build binutils in Cygwin with --target=<whatever> as a configure setting. make -j<whatever> && make install

3) Prepend whatever prefix you're using (/usr/local by default) to your PATH. Pass --with-headers=<path to include dir> and --with-libs=<path to lib dir> when configuring gcc. It will copy the include and lib stuff to a subdir in your prefix. make -j<whatever> && make install

I've also built Linux->FreeBSD and Cygwin->FreeBSD cross compilers, but they were more difficult and I've still not worked out all the kinks yet. I've also had a lot of problems trying to get things built in win9x but had few issues with 2k/XP. If anyone can figure out or knows how to get a clean build under win9x I'd appreciate it.
Back to top
View user's profile Send private message
Zadeh
Tux's lil' helper
Tux's lil' helper


Joined: 31 Oct 2002
Posts: 131

PostPosted: Sun Apr 27, 2003 5:01 am    Post subject: Reply with quote

Another thing I forgot to mention.. Instead of logging, I just start up distccd on the servers with --daemon --no-detach --log-stderr and watch them for a bit to make sure they're working. It will print out all thats going on to the "console" with a bunch of "got blahblah from IP# OK. Returned exit status 0" etc. After you confirm it works, you can keep it on that way or just set it and forget it.
Back to top
View user's profile Send private message
Beekster
Apprentice
Apprentice


Joined: 26 Nov 2002
Posts: 268
Location: Sydney

PostPosted: Sun Apr 27, 2003 5:50 am    Post subject: Reply with quote

It would be nice to be able to use distcc early on in the Gentoo build process, say right after the bootstrap script, but an emerge -pe distcc gives quite a dependancy tree:
Code:
# emerge -pev distcc

These are the packages that I would merge, in order:

Calculating dependencies ...done!
[ebuild  N   ] sys-devel/gettext-0.11.5-r1  +nls
[ebuild  N   ] sys-apps/gawk-3.1.2-r3  +nls -build
[ebuild  N   ] sys-libs/zlib-1.1.4-r1
[ebuild  N   ] dev-python/python-fchksum-1.6.1-r1
[ebuild  N   ] sys-apps/bzip2-1.0.2-r2
[ebuild  N   ] sys-apps/debianutils-1.16.7-r1  -static -build
[ebuild  N   ] sys-apps/sed-4.0.7  +nls -static -build
[ebuild  N   ] sys-libs/ncurses-5.3-r1
[ebuild  N   ] app-shells/bash-2.05b-r3  +nls -build
[ebuild  N   ] sys-libs/readline-4.3-r4
[ebuild  N   ] dev-lang/tcl-8.4.2
[ebuild  N   ] media-libs/libpng-1.2.5-r4
[ebuild  N   ] sys-devel/flex-2.5.4a-r5
[ebuild  N   ] sys-libs/db-1.85-r1
[ebuild  N   ] sys-libs/gdbm-1.8.0-r5  +berkdb
[ebuild  N   ] sys-apps/texinfo-4.5  +nls -build
[ebuild  N   ] sys-apps/groff-1.18.1-r2
[ebuild  N   ] sys-apps/cronbase-0.2.1-r2
[ebuild  N   ] sys-apps/man-1.5l-r2
[ebuild  N   ] sys-devel/libperl-5.8.0  +berkdb +gdbm
[ebuild  N   ] dev-lang/perl-5.8.0-r10  +berkdb -doc +gdbm
[ebuild  N   ] dev-perl/ExtUtils-MakeMaker-6.05-r4
[ebuild  N   ] dev-perl/Safe-2.09
[ebuild  N   ] x11-base/opengl-update-1.5
[ebuild  N   ] media-libs/freetype-2.1.4  -doc +zlib -prebuilt
[ebuild  N   ] x11-misc/ttmkfdir-3.0.9
[ebuild  N   ] dev-libs/expat-1.95.6-r1
[ebuild  N   ] sys-devel/binutils-2.13.90.0.20-r1  +nls -bootstrap -build
[ebuild  N   ] sys-devel/gcc-config-1.3.3
[ebuild  N   ] sys-devel/gcc-3.2.2-r2  -static +nls -bootstrap +java -build
[ebuild  N   ] sys-apps/ed-0.2-r3
[ebuild  N   ] media-libs/fontconfig-2.2.0
[ebuild  N   ] app-arch/unzip-5.50-r1
[ebuild  N   ] app-arch/cabextract-0.6
[ebuild  N   ] x11-base/xfree-4.3.0-r2  -3dfx +sse +mmx -3dnow -xml +truetype +nls -cjk -doc
[ebuild  N   ] dev-lang/tk-8.4.2
[ebuild  N   ] dev-lang/python-2.2.2  +readline +tcltk +berkdb -bootstrap
[ebuild  N   ] sys-apps/fileutils-4.1.11  +nls -build
[ebuild  N   ] sys-apps/portage-2.0.47-r10  -build
*** Please update portage to the above version before proceeding.
    Failure to do so may result in failed or improper merges.
    A simple 'emerge -u portage' is sufficient.

[ebuild  N   ] sys-kernel/linux-headers-2.4.19
[ebuild  N   ] sys-apps/baselayout-1.8.6.5  -bootstrap -build
[ebuild  N   ] sys-libs/glibc-2.3.2-r1  +nls -pic -build -nptl
[ebuild  N   ] sys-devel/patch-2.5.4-r4
[ebuild  N   ] sys-devel/libtool-1.4.1-r10
[ebuild  N   ] sys-devel/m4-1.4  +nls
[ebuild  N   ] sys-libs/db-3.2.9-r2
[ebuild  N   ] sys-devel/autoconf-2.57-r1
[ebuild  N   ] sys-apps/miscfiles-1.3-r1
[ebuild  N   ] sys-libs/cracklib-2.7-r6
[ebuild  N   ] dev-libs/glib-1.2.10-r5
[ebuild  N   ] sys-libs/pwdb-0.61-r4
[ebuild  N   ] sys-devel/automake-1.7.2
[ebuild  N   ] sys-libs/pam-0.75-r11  +berkdb
[ebuild  N   ] sys-apps/shadow-4.0.3-r3  -selinux
[ebuild  N   ] dev-libs/popt-1.7-r1  +nls
[ebuild  N   ] sys-devel/distcc-2.0.1


The main entry that sticks out in that list to me is xfree.

distcc's ebuild has only:
Code:
>=sys-apps/portage-2.0.46-r11
>=sys-devel/gcc-config-1.3.1
sys-apps/shadow
dev-libs/popt

listed as dependancies, but my how it grows. The implications of the build and bootstrap use variables escapes me...
Back to top
View user's profile Send private message
Aiken
Apprentice
Apprentice


Joined: 22 Jan 2003
Posts: 239
Location: Toowoomba/Australia

PostPosted: Mon Apr 28, 2003 1:44 am    Post subject: Reply with quote

sn4ip3r wrote:
path gcc and I also had to manually remove a #define flag that enabled the use of mempcpy function (which didn't exist or work).


I am curious about what problems you had. I have not noticed any problems with mempcpy so far. Is this in building the tool chain or using it? I build binutils and gcc under cygwin and glibc under linux. For glibc I use the same prefix that it will get installed in with cygwin. Once it is compiled I copy it to the cygwin environment. That way I don't have to worry about editing files and making sure sym links are correct as if I just copied the linux system glibc.

Recent binutils, glibc 2.3.1, gcc 3.2.2 all compile cleanly this way.

Done this way there should be no reason to use that patch you mentioned. That patch is for if you are building a C only compiler to build glibc locallly. Not for the finall gcc.
Back to top
View user's profile Send private message
Zadeh
Tux's lil' helper
Tux's lil' helper


Joined: 31 Oct 2002
Posts: 131

PostPosted: Mon Apr 28, 2003 1:49 am    Post subject: Reply with quote

The problem is that in several places the build looks for a builtin function, __mempcpy, but none exists on the Cygwin platform, so it needs to be just plain mempcpy.

It's needed if you want to build any cross compiler. See the link to the patch in my previous post.
Back to top
View user's profile Send private message
Aiken
Apprentice
Apprentice


Joined: 22 Jan 2003
Posts: 239
Location: Toowoomba/Australia

PostPosted: Mon Apr 28, 2003 6:15 am    Post subject: Reply with quote

Zadeh wrote:

It's needed if you want to build any cross compiler. See the link to the patch in my previous post.


Are you saying the compiler won't build or work? I had just finished building my 3rd cygwin -> linux compiler before my last post. Did not use any extra patches.

Code:

judy@BAMBAM ~
$ uname -a
CYGWIN_ME-4.90 BAMBAM 1.3.10(0.51/3/2) 2002-02-25 11:14 i686 unknown

judy@BAMBAM ~
$ i686-pc-linux-gnu-g++ -v
Reading specs from /opt/cross-linux//lib/gcc-lib/i686-pc-linux-gnu/3.2.2/specs
Configured with: ./configure --prefix=/opt/cross-linux/ --enable-languages=c,c++ --enable-threads=posix --disable-nls --host=i686-pc-cygwin --target=i686-pc-linux-gnu --with-headers=/opt/cross-linux/i686-pc-linux-gnu/include/
Thread model: posix
gcc version 3.2.2


This is from 1 of 2 windows me machines that I was using to help mine using distccd.
Back to top
View user's profile Send private message
Zadeh
Tux's lil' helper
Tux's lil' helper


Joined: 31 Oct 2002
Posts: 131

PostPosted: Mon Apr 28, 2003 1:13 pm    Post subject: Reply with quote

As far as I know. What version of cygwin? Also, have you checked that __mempcpy is in there? I've seen vanilla 3.2.2 fail for ->linux, ->arm, ->sh, ... with that issue.
Back to top
View user's profile Send private message
Becks
Tux's lil' helper
Tux's lil' helper


Joined: 06 Dec 2002
Posts: 90

PostPosted: Mon Apr 28, 2003 1:34 pm    Post subject: Reply with quote

I had several problems using distcc so far. Some packages can be compiled with disctc, others fail and have to be emerged locally. After setting /unsetting all those needed variables to en-/disable distcc i wrote a dirty little script which helps me.

To install it, do the following:
ACCEPT_KEYWORDS="~x86" emerge distcc (to get the latest version - 2.0.1 at the moment)

run distcc-config, add all the hosts which also run distccd, set the distcc-path and if you want - the distcc-log, but nothing else !

My variables are then set the following way:
CC=gcc
CXX=g++
DCCC_PATH=/usr/lib/distcc/bin
DISTCC_HOSTS='jeannie doom'
DISTCC_LOG=/var/log/distccd
DISTCC_VERBOSE=1
PATH='/usr/kde/3.1/bin:/bin:/usr/bin:/usr/local/bin.........

(The PATH doesn't have /usr/lib/distcc/bin as first entry !)

Don't change anything in make.conf. If you have enabled the following lines - set a # in front of them:
CC=distcc -> #CC=distcc
CXX=g++ -> #CXX=g++
FEATURES="distcc" ->#FEATURES="distcc"

if you have change the MAKEOPTS to something higher than your computer can handle - change it back (normally -j2 is set).

If you run an emerge now, distcc isn't used, everything should be compiled with gcc of your local machine.
Now take the following script:


Code:

#!/bin/bash

echo "generating list..."
emerge -p $1 |grep ebuild|cut -c16- |sed s/-[0-9]/§/ |cut -d'§' -f1 >/tmp/emergelist

echo "packages which need to be updated:"
cat /tmp/emergelist
echo
echo Starting to emerge...
echo " " >/tmp/emergelog
for i in $(cat /tmp/emergelist) ; do
echo $(date) emerging $i >>/tmp/emergelog using distcc...
MAKEOPTS="-j12" FEATURES="distcc" emerge $i
if [ $? = 0 ] ; then
   echo $(date) - emerge succesfull >>/tmp/emergelog
  else
   echo $(date) - distcc failed - trying local emerge now>>/tmp/emergelog
   emerge $i
 fi

if [ $? != 0 ] ; then
  echo $(date) - emerge failed ! >>/tmp/emergelog
  break
 else
   echo $(date) - local emerge succesfull>>/tmp/emergelog
 fi
done


Save it somewhere where you can find it again (f.e. /usr/bin/demerge) and run chmod 755 it. Also change the MAKEOPTS to a value which is good for you.

If you now plan to install a package, just type demerge <packagename> instead of emerge <packagename> - that's all.

The script runs emerge itself, looks which packages have to be rebuilt and runs emerge on each package. During the first try to emerge the package distcc is used, and if it fails the package is compiled uisng the local gcc. If this also fails the script halts.
If you want to see which packages have been compiled using distcc/local gcc, just type cat /tmp/emergelog.


That's all. Use at your own risk *g*. At the moment the script only accepts one package to be emerged, maybe i'm gonna change this when i have some spare time.

Btw - i am no coder or programmer, so the code might be a bit rough. At least it works for me, i emerged gnome from a freshly installed computer. 135 packages emerged withg around 30 of them which had to be compiled locally.

Alex
Back to top
View user's profile Send private message
uziel
n00b
n00b


Joined: 14 Feb 2003
Posts: 32

PostPosted: Wed Apr 30, 2003 1:28 pm    Post subject: distcc & ccache combination / order Reply with quote

Hello there,
I was just wondering in which way and order it would be best to combine distcc and ccache. As I've recently seen, they both work transparently through symlinks named like the compiler they are supposed to call. But that would require a certain "chain" of the directories in $PATH and the $CC / $CXX variables, e.g. $CC pointing to /usr/lib/distcc/bin/gcc and the first directory in $PATH containing a symlink called gcc was the ccache directory. I am therefore a little confused about how to set things up for compilations apart from portage. Which one should come first in the command line, and would it be suitable to simply do a "ccache distcc gcc blah.c" - which would require a modification of e.g. kernel makefiles?

Is there even a difference in function if the order of distcc / ccache is changed?

Sincerely
Chris
_________________
Those who promise their way of freedom and peace still do not understand the meaning of the word...
Back to top
View user's profile Send private message
tecknojunky
Veteran
Veteran


Joined: 19 Oct 2002
Posts: 1937
Location: Montréal

PostPosted: Sat May 03, 2003 9:19 pm    Post subject: Reply with quote

I have just started experimenting with distcc and, so far, altough I still have some learning to do, i discovered that for faster machines it might slow the compile time.

It happenned to me when I added a 486 in the volonteers list. According to the distcc docs, it makes it sound like adding any kind of box is a bonux.

The 486 is simply just to slow for compiling for others. I cam to metaphore it to this: if you have to do the groceries at two different markets, asking a turtle to split the work may make things go slower because the time you finish your part, you realize you would have the turtle hasn't even arrived at the store :wink: .

So this is exactly what happenned to me. It seem there is a lower limit to which a fast machine can ask a slower machine to compile for it. If the machine is too slow, the faster box may wait so long for the slow box to finish that it would have had the time to compile it itself two times over (or more). So, my "fast" machine is a p3 500 and I must guess that for a whoping P4 2.4Ghz, a P1 66Mhz may in fact slow the compile. Or maybe with proper configuration... who knows? You? Tell me.

It is also true that it seem distcc stop delgating after a compile. My only solution, for now, is simply to start another shell, then it works again.

And, yes, some ./configure checks the gcc versions and the distcc wrapping messes that. To date, I got that with two packages, one being libxstl? or something, and the other was mplayer. In both case, it was the DISTCC_VERBOSE that needed to be commented.

Many tips I havent tried in this thread, thanks.
_________________
(7 of 9) Installing star-trek/species-8.4.7.2::talax.
Back to top
View user's profile Send private message
Aiken
Apprentice
Apprentice


Joined: 22 Jan 2003
Posts: 239
Location: Toowoomba/Australia

PostPosted: Sat May 03, 2003 11:20 pm    Post subject: Reply with quote

Zadeh wrote:
As far as I know. What version of cygwin? Also, have you checked that __mempcpy is in there? I've seen vanilla 3.2.2 fail for ->linux, ->arm, ->sh, ... with that issue.


The output of uname from one of the cygwin machines.

$ uname -a
CYGWIN_ME-4.90 BAMBAM 1.3.10(0.51/3/2) 2002-02-25 11:14 i686 unknown

I can easily find the references __mempcpy in the gcc source. I have saved the output of configure and make if you want to have a look at them. The configure stage does shows mempcpy can not be found.



My preference would be not to use machines for distccd that are low powered compared to the host machine. Parts of kde are a good example. Lots of c++ file that take time and memory to compile. The fast machine gives the slower machine a large c++ file to compile, the fast machine can end up sitting idle for quite awhile. The end result could be the build taking a lot longer than it normally would. It depends on the source. I find for a kernel compile adding a celeron 433 to the athlon decreases the build time. Compiling kde I am best off turning the c433 off.

If the host machine is too slow it won't be able to pass out jobs to the faster computers quick enough to keep them busy. You should still end still end up with smaller build times but adding more distccd computers can slow down the build. With my 40MHz sparc I get faster builds only using 1 athlon as a helper compared to using 2.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum