Monday, April 19, 2004

DistccPPCKnoppix

DistccPPCKnoppix is a Knoppix distribution that contains distcc servers for both Linux x87 and OSX ppc compiling. With it you can utilize your extra x86 computers to build Linux x86 and OSX PPC binaries.

After running across "Building a Darwin cross compiler for use with distcc and fink" and "HOWTO: Use Gentoo Distcc Host to cross-compile for OSX" I quickly set out and build my own cross compiler to speed up my Apple OSX development. Like most people I have more x86 hardware then I do ppc. It didn't take long to get it build and a test distccd server up to show that it was working.

When I compile for Linux x86 I use distccKnoppix to utilize all my spare x86 computers I have lying around. Using the Knoppix Remastering Howto I quickly added the ppc cross compiler to distccKnoppix. Now when it boots two distccd demon's start on separate ports. The default port (3632) has the x86 compiler and the ppc compiler is on port 3633.

Now Apple developers finally have a use for their x86 hardware (that they can admit to). This is also a nice cheap way to speed up OSX compiling and development.

Check out my distcc optimizations article which can help you best utilize distcc.

XCode
I am very unhappy with XCode's distcc options. There is no option in the GUI to not compile on the local machine, the ability to change the order of boxes that compile, or the number of jobs they should run. See my article on optimizing distcc for why these options need to be there. With more then a few boxes compiling I wouldn't bother using XCode at all and follow the below steps for compiling even if it did work within XCode. I would have thought at Apple where they have more then a few boxes they would have relized this themselves! To compile your XCode project use the command line and run:

export DISTCC_HOSTS="remotehost:3633 localhost"
xcodebuild CC=/usr/bin/distcc CPLUSPLUS=/usr/bin/distcc

Unfortunately I don't know how to get xcodebuild to do the equivalent to make -j . Any hints are welcome. Here is another way that converts to make first so you can do the -j:
To compile your XCode project with distccppcknoppix in theory just follow these options:

1) Grab distcc from samba.org and build it and put it in your path ahead of the one Apple give for command line compiling. The one that Apple gives seems to be incompatible. Not 100% this step is required, so it can't hurt to try skipping it, just let me know if it works for you!

2) Use PBTOMAKE to convert the XCode project file into a Makefile. XCode seems to hard code the compiler (/usr/bin/gcc-3.3), bad XCode, bad!

3) If you have distcc installed, hosts specified and masquerading (see distcc docs or example above) setup you should be able to build from the command line.

If anyone can build Apple's version of distcc (download from their website) on x86 Linux (hehe or use distccppcknoppix to build it for x86) let me know and I will make a new cd with rendezvous and it. This will remove the above three steps and make it "seemlessly" integrate.

For detailed information about Distcc, Distccd, installation instructions, and FAQ visit their website at http://distcc.samba.org/

Update: I got on slashdot! Checkout the comments here.

distccPPCKNOPPIX-0.0.9.iso

No comments:

Popular Posts