Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Distribute ProjectBuilder builds using 10.2 Apps
This might be obvious to some but I haven't found any hints about it, so here it is. One of Xcode's main features is to be able to distribute builds. Xcode uses a program called distcc / distccd to share / use CPU power between diffrent computers. You can download this program from distcc.samba.org and use it in Project Builder right now!

After you have installed it, open your project in Project Builder, select target settings, expert view, and create one or both of the following entries:
  CC = /usr/local/bin/distcc
  CPLUSPLUS = /usr/local/bin/distcc
Install the distcc package on another Mac, (with the same version of MacOS X Developer Tools), let's call it gammu for this example. If the firewall is turned on on gammu, create a new entry with port number 3632.

Create ~/.distcc/hosts on the first machine, and type in the following:
  gammu
You can list several hosts here like this:
gammu rakis dania somebolloxintel 123.456.789.123
Start building on your own Mac, and use top on both your own Mac and the other to see that most of the workload is taken over by the other Mac. By the way, it helps if the build host is quite a bit faster than your own workstation. Like if you are working on a PowerBook and have the odd Xserve hanging around collecting dust :-). This way, you can get back to fragging while building your massive project.

Has anybody tried to do this with a diffrent build host platform, like HP-UX, Solaris or what have you as the build host? I immagine it's a bit of work to setup and maintain.
    •    
  • Currently 2.25 / 5
  You rated: 2 / 5 (4 votes cast)
 
[3,493 views]  

Distribute ProjectBuilder builds using 10.2 | 5 comments | Create New Account
Click here to return to the 'Distribute ProjectBuilder builds using 10.2' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Distribute ProjectBuilder builds using 10.2
Authored by: mrrivers on Aug 04, '03 11:27:28AM

You can also get distcc (2.5.1-1) via fink.

Gruß
MrRivers



[ Reply to This | # ]
Distribute ProjectBuilder builds using 10.2
Authored by: sderman on Aug 05, '03 04:25:28PM

Note the installation notes say:
--
The hosts should be listed in descending order of speed. localhost
should normally be first, unless it is significantly slower than
another machine.
--

This is cool, I've got it running with a DualGig workstation and my 500mHz laptop doing some network compiling however it seems to be slower in my case.

For my one project 3 dependent targets, it is 40 seconds without distcc and 41 using it to the laptop.

For my other project 4 dependent targets, it is 65-66 seconds with distcc and 66-69 seconds using it to the laptop.

It seems to to get stuck waiting for the laptop to finish compiling a file before it can link.

If I ever get a faster second computer, it will be a good tool, for my setup, it is just technologically neat.



[ Reply to This | # ]
Distribute ProjectBuilder builds using 10.2
Authored by: tomsinclair on Aug 04, '03 11:28:41AM

Very cool! I wondered how XCode did the distributed compiles and it's good to see they're using an open-source tool.

I'd also like to hear about cross-platform distributed compiles with Project Builder, if anyone has tried it. We have several Linux boxes at work (including my desktop PC) and it would be neat if I could just pick up cycles that easily.

As a thought, Knoppix (http://www.knoppix.org), a Linux distro that runs off of a bootable CD has a version that is designed specifically for distributed compiling using distcc. So, in theory, you could burn a bunch of CDs with this, boot some PCs, fire up Project Builder and crank out the code with an ad hoc server farm.

Isn't open source grand?



[ Reply to This | # ]
Distribute ProjectBuilder builds using 10.2
Authored by: buserror on Aug 04, '03 12:29:33PM

I tried to build a cross compiler for OSX that ran on Linux x86, and never managed to do it. The gcc-darwin NEEDS to be built on... darwin only.
That sucks big time, because I have a few linux boxes lying around.

I planned to used disttcc to do distributed builds as early as last year; but apple's gcc is useless. Until they cleanup the build system it's useless.

Related to the article:
+ You don't need ALL the devtools for the distributed builds to work with distcc; you only need the compiler. distcc sends the source already precompiled so you don't need any headers; and the link is done localy so you don't need any special libraries.
+ In projectbuilder you need to set the "Numbe of concurent tasks" do the number of CPUs used in your mini-cluster.



[ Reply to This | # ]
DistCC
Authored by: TheGS on Aug 05, '03 09:18:08AM
I grabbed the source from distcc.samba.org and successfuly compiled and installed it on both my iBook and another machine, both running 10.2.6.

The only problem I had was when I tried to run distccd as a daemon when the current user was root (through the 'sudo' program) -- I did this to try to see what would happen if I set it up as a service in /Library/StartupItems/.

When run like this, distccd tries very hard to become a different user ('distcc', or 'nobody', but definitely not root). When it does this, it tries to give up as many privileges of root as it can before it switches to the desired user. One of the things it changes is the access group list for the process, and this is what caused distccd to exit for me. There is a call to setgroups(), passing 0 and NULL in order to clear out the access group list. The result of this call is an error (invalid parameter), and distccd handles this by spitting out an error message and quitting. Talk about a glass jaw!

My immediate workaround was to #ifdef out the appropriate lines of code in the source.

Works like a charm after that.

[ Reply to This | # ]