Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Compile on fast machine, run on slow machine?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
TalkieToaster
n00b
n00b


Joined: 05 Feb 2003
Posts: 12

PostPosted: Tue Oct 28, 2003 9:05 pm    Post subject: Compile on fast machine, run on slow machine? Reply with quote

I've scoured the forums for about half an hour, and I haven't seen precisely this question yet, so here goes:

I have a Gentoo-based desktop machine (Athlon XP 2400+, 768MB RAM) and a much less powerful machine that I plan to build into an arcade-style cabinet and run MAME on (Pentium 2/233, 64MB RAM).
Obviously, it wouldn't be much fun building the whole system on the P2 machine, so I'd like to compile a Pentium 2-optimized system on my desktop and create a tarball that I can just squirt straight across to the weaker machine. Once that's up and running, I'd also like to be able to maintain a separate portage tree on my desktop, so I can grab updates, compile binary packages and copy them across for installation.

I figure I can't follow the normal install procedure, as I assume things will start breaking when I start trying to run Intel-targeted binaries on my Athlon.

Does anyone know of a relatively straightforward way to do this with portage? Failing that, I'm willing to consider not optimizing for P2 (i.e. build a generic i386 system instead which should run without problems on my Athlon) but that's losing some of the benefits of using Gentoo in the first place.
Or should I try a different distribution? (I used to be a Debian man before defecting to the Gentoo camp, so that'd be my second choice)

If anyone can shed any light on this, it'd be much appreciated.

Cheers,
_________________
- TT
Given that God is infinite, and that the universe is also infinite, would you like a toasted teacake?
Back to top
View user's profile Send private message
DrACoNuS
Tux's lil' helper
Tux's lil' helper


Joined: 03 Oct 2002
Posts: 116
Location: Edmonton, Alberta, Canada

PostPosted: Tue Oct 28, 2003 9:43 pm    Post subject: Reply with quote

Distcc is great for gentoo follow this howto and only add the hostname of your fast machine to the make.conf on your slow machine. That will do all the linking (optimizations etc) on the slow machine but all the compiling will be done remotely on the fast machine :D neat isnt it?

http://www.gentoo.org/doc/en/distcc.xml
_________________
Is that a huge bandwidth or are you just happy to see me?
Back to top
View user's profile Send private message
tdombrow
n00b
n00b


Joined: 28 Oct 2003
Posts: 12
Location: Texas

PostPosted: Wed Oct 29, 2003 1:28 am    Post subject: Reply with quote

Ditto what DrACoNuS says - distcc - AND HEED HIS MESSAGE about only putting the fast machines hostname in make.conf.

I tried the same thing, but I put the "slowmachine fastmachine" in make.conf and most of the compiles happened on the slow machine, which was taking forever. I learned the hard way to keep the "slowmachine" out. According to the distcc docs, if you want to use more than one machine for compilation, you should put the fastest machines first in the list - but if there is that much disparity between machines, I'd just leave it out.

Todd D.
Back to top
View user's profile Send private message
rhat
n00b
n00b


Joined: 28 Oct 2003
Posts: 64
Location: Pittsburgh

PostPosted: Wed Oct 29, 2003 2:30 am    Post subject: Reply with quote

Speaking of remote compilation, is there a way to break compliation down so that it can be efficiently spread over a cluster? I only ask because I'm in the process of building an openMosix cluster, and I thought it would be handy if I could make the entire cluster work on a compile rather than just a few nodes.
Back to top
View user's profile Send private message
cyrillic
Watchman
Watchman


Joined: 19 Feb 2003
Posts: 7313
Location: Groton, Massachusetts USA

PostPosted: Wed Oct 29, 2003 4:55 am    Post subject: Reply with quote

TalkieToaster wrote:
I figure I can't follow the normal install procedure, as I assume things will start breaking when I start trying to run Intel-targeted binaries on my Athlon.

Actually, -march=pentium2 binaries will run perfectly on an athlon-xp. I've used my athlon-xp machine to build a stage4 tarball for my pentium3 laptop (I saved a lot of time too).

Using distcc also works nicely, but be careful to have matching versions of gcc on all of your machines or the binaries can sometimes get messed-up.
Back to top
View user's profile Send private message
TalkieToaster
n00b
n00b


Joined: 05 Feb 2003
Posts: 12

PostPosted: Wed Oct 29, 2003 11:15 am    Post subject: Reply with quote

Thanks guys, that's excellent. I'll take a look at distcc straight away.

Thanks again,
_________________
- TT
Given that God is infinite, and that the universe is also infinite, would you like a toasted teacake?
Back to top
View user's profile Send private message
qubex
Tux's lil' helper
Tux's lil' helper


Joined: 06 Mar 2003
Posts: 133
Location: Portland

PostPosted: Fri Oct 31, 2003 6:33 pm    Post subject: Reply with quote

rhat wrote:
Speaking of remote compilation, is there a way to break compliation down so that it can be efficiently spread over a cluster? I only ask because I'm in the process of building an openMosix cluster, and I thought it would be handy if I could make the entire cluster work on a compile rather than just a few nodes.


Yes and no - for compilation, distcc is far better than openMosix (now). The problem is that compilation does have many processes - but they are generally composed of multiple gcc compiling small .c files. The end result is that openMosix (as a load balancer) thinks that these processes should not be migrated as the end result is it takes more time to migrate them then it does to just compile them (this is actually true in most cases) - unless of course you're compiling KDE or other large-ish c++ files....

You can get around this by increasing make -jx to something like -j15 (or some other astronomically high number) which has the effect of bogging down your machine and forcing it to offload processes.

Not a good solution - you can use distcc while openMosix is going. Much better and cleaner (and you'll have less compilation errors - openMosix always gives me problems when running emerge or compiling X.)
_________________
Yes.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo 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