Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Compiling Kernel with Distcc - A HOWTO
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
jehreg
n00b
n00b


Joined: 28 Apr 2002
Posts: 8

PostPosted: Thu Oct 02, 2003 7:22 pm    Post subject: Compiling Kernel with Distcc - A HOWTO Reply with quote

I've been gooffing around with distcc (booting all my machine with a custom LiveCD I've just done, more on this later...) and looking at my emerges zip by....

Then I wondered how much faster a kernel compile would go with distcc.

I could not find a thread in the forums on how do to this, so after a bit of tweaking, voila:

CC="distcc gcc" make -e -j 7 dep
CC="distcc gcc" make -e -j 7 bzImage
make bzImage

The last step is necessary because the compile borks in its last steps if distcc is used (which is when the kernel is all finally linked I think).

Since all the .o files are now compiled, the last "make bzImage" just zooms by and links everything.

Tell me if it works for ya.

Pat
Back to top
View user's profile Send private message
MrWorf
n00b
n00b


Joined: 18 Jan 2003
Posts: 57

PostPosted: Thu Oct 02, 2003 8:46 pm    Post subject: Reply with quote

Haven't done it yet (but I will, rest assured :D ) just a quick note for those not familiar with make but still wanting to give it a try.
The "-j 7" option tells it how many processes to run in parallel.

So, if you have 5-7 cpu:s available (in one machine or over a network, as in the distcc case) "-j 7" is advisable, otherwise, a good hint is to use a value of: <number of cpus> + 1

Which in my case happens to be 5 (3 servers + workstation) ... Now, if we only could make a patch for the kernel emerge that automatically made the kernel compile scripts honour the settings in make.conf :wink:
Back to top
View user's profile Send private message
pilla
Administrator
Administrator


Joined: 07 Aug 2002
Posts: 7692
Location: Pelotas, BR

PostPosted: Thu Oct 02, 2003 9:01 pm    Post subject: Reply with quote

to Documentation, Tips & Tricks
_________________
"I'm just very selective about the reality I choose to accept." -- Calvin
Back to top
View user's profile Send private message
kerframil
l33t
l33t


Joined: 19 Apr 2002
Posts: 712

PostPosted: Tue Oct 14, 2003 7:06 pm    Post subject: Reply with quote

I've always used the following method:
Code:
# make dep && make clean
# export DISTCC_HOSTS="<insert hosts here>"
# make CC="distcc" -j3 bzImage
# make CC="distcc" -j3 modules
# make modules_install
Also, I have been in a few situations where I end up with highly erratic and malfunctioning kernels when using -j5 or higher. So, unless it can be proven that is is absolutely safe now, I would suggest <= -j4.
Back to top
View user's profile Send private message
phattmatt
n00b
n00b


Joined: 01 Jun 2003
Posts: 33

PostPosted: Mon Oct 20, 2003 2:03 pm    Post subject: Reply with quote

Hi all,

Since I like using genkernel I did a quick hack to enable distcc compiling.

WARNING - Insert standard "Please take care, I will not be held responsable" warning here - WARNING

I assume you have disttcc and genkernel installed and working.

Edit the genkernel script (which on my box was found at '/usr/sbin/genkernel', HINT: run 'which genkernel' to check the location)

Find the lines which read:

Code:
        make dep  >/var/log/genkernel.log 2>&1 ||die; eend
       
        make $MAKEOPTS bzImage >/var/log/genkernel.log 2>&1 || die; eend
       
        make $MAKEOPTS modules >/var/log/genkernel.log 2>&1 || die; eend



(HINT: The above lines are in the 'compile()' section)

and add 'CC="distcc"' after the make command word, like so:

Code:
        make CC="distcc" dep  >/var/log/genkernel.log 2>&1 ||die; eend
       
        make $MAKEOPTS CC="distcc" bzImage >/var/log/genkernel.log 2>&1 || die; eend
       
        make $MAKEOPTS CC="distcc" modules >/var/log/genkernel.log 2>&1 || die; eend




Save, and run genkernel. To see if it's working use the distccmon-text command.

I've compiled a grand total of one kernel with this modification (gentoo-sources 2.4.20-r7) which worked fine. This is the extent of my testing.

Good Luck :)

Matt.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
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