Unix Programming - Remote builds

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > January 2004 > Remote builds





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Remote builds
John Eskie

2004-01-23, 4:57 pm

I got a program which I'd like to compile for more platforms.

Lets say I have 3 development machines running Linux, Solaris and Windows
and the same code will compile fine on each of them when calling the
makefile on the specific computer.

Now I want to perform the building of this program from a single machine
which dispatch the job onto the other machines and then collects the
results. Collecting the result can easily be done by having all build
machines copy the output to a shared network directory and put the files in
a specific subdir such as /linux, /win32 and /solaris.

Does there exist any programs like this? I already planned to write my own
but I'd really avoid it if there are some easy solutions for this problem.

Thanks in advance.
-- John


Pascal Bourguignon

2004-01-23, 4:57 pm

"John Eskie" <cyberheg@l115.langkaer.dk> writes:
quote:

> I got a program which I'd like to compile for more platforms.
>
> Lets say I have 3 development machines running Linux, Solaris and Windows
> and the same code will compile fine on each of them when calling the
> makefile on the specific computer.
>
> Now I want to perform the building of this program from a single machine
> which dispatch the job onto the other machines and then collects the
> results. Collecting the result can easily be done by having all build
> machines copy the output to a shared network directory and put the files in
> a specific subdir such as /linux, /win32 and /solaris.
>
> Does there exist any programs like this? I already planned to write my own
> but I'd really avoid it if there are some easy solutions for this problem.



There are cross-compilers but that's not what you're asking.

ProjectBuilder of NeXT and now Xcode of Apple's MacOSX can do this,
but it's not opensource.

Actually, it's really easy to implement: just mount your source
directory at the same place on the tree machines, and run:

for remote in linux win32 solaris ; do
ssh $remote make -C /sources &
done

or put it in the makefile:

all: linux win32 solaris

linux:
ssh linux-host make -C /sources
win32:
ssh win32-host make -C /sources
solaris:
ssh solaris-host make -C /sources

and use:

make -j 3

--
__Pascal_Bourguignon__
http://www.informatimago.com/
John Eskie

2004-01-23, 4:57 pm

Thanks for your suggestions.
quote:

> There are cross-compilers but that's not what you're asking.



Exactly. I also reviewed some but they are really to narrowed down to one
environment e.g. gcc or Windows with VC++.
quote:

> ProjectBuilder of NeXT and now Xcode of Apple's MacOSX can do this,
> but it's not opensource.



What strikes me is that I find programs like Xcode really useless. It's
often that people don't work in only 1 environment and if they do it's not
so often MacOSX. If they would have a solution where you could use your own
clients it would be nice.
quote:

> Actually, it's really easy to implement: just mount your source
> directory at the same place on the tree machines, and run:
>
> for remote in linux win32 solaris ; do
> ssh $remote make -C /sources &
> done
>
> or put it in the makefile:
>
> all: linux win32 solaris
>
> linux:
> ssh linux-host make -C /sources
> win32:
> ssh win32-host make -C /sources
> solaris:
> ssh solaris-host make -C /sources
>
> and use:
>
> make -j 3



This is really a cool solution. I think I will go for that. I use a make
replacement though which does not support parallel builds but I guess I can
live with linear compilation.

If any others know about some readymade programs I'd like to hear.

-- John


Pascal Bourguignon

2004-01-23, 4:57 pm

"John Eskie" <cyberheg@l115.langkaer.dk> writes:
quote:

>
> This is really a cool solution. I think I will go for that. I use a make
> replacement though which does not support parallel builds but I guess I can
> live with linear compilation.
>
> If any others know about some readymade programs I'd like to hear.



Indeed. Most of the compilations end with errors or are needed only on
the development workstation, so instead of:

all: linux win32 solaris

I should have written:

all: linux # (for example)
production : linux win32 solaris


Then if it's a 30s compilation, it does not matter, but if the
compilation is longer than 5 minutes, you'll be happier (or your boss,
I guess you can spend half an hour at the coffee machine) with:

production:
ssh linux-host make -C /sources & \
ssh win32-host make -C /sources & \
ssh solaris-host make -C /sources & wait

(and you may want to add redirections to log the errors).

--
__Pascal_Bourguignon__
http://www.informatimago.com/
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com