

Ask HN: Distributed compilation - alexchamberlain

Is there a simple way to compile C/C++ on a remote server? Is this even possible with libraries etc?
======
jgrahamc
You could use: (a) distcc (b) Electric Cloud. distcc relies on make -j which
works up to a point; Electric Cloud is a commercial solution that overcomes
make -j problems.

------
aespinoza
I can't really answer for C/C++ since I have never done it. But I am doing it
currently with C#, there might be things that are similar and might help you
start your research.

We are building a Backend as a service named iKnode and does exactly that but
with C# classes.

The way it works is: 1) Code classes in a browser. 2) Send Code to a Backend
Service, which compiles the code and returns any errors. 3) You can execute
the code and get the response back from the server.

The idea is to wrap everything in a SandBox and then compile using CodeDom
(.Net libraries). But for C/C++, if it is only one class, it is easy, just
call a command line compilation. Capture everything the command line returns
and pull it back to the Browser.

The first thing I can think of, is create an agent that interacts with the
compilation process using system commands. If you are using Windows and Visual
C++ there is a CodeDom extension for managed C++ (C++ CLI).
[http://msdn.microsoft.com/en-
us/library/ms235437(v=vs.80).as...](http://msdn.microsoft.com/en-
us/library/ms235437\(v=vs.80\).aspx)

If you find a way to do it that is easy and useful, please share, I would be
interested in seeing this work.

------
huhtenberg
<http://distcc.org> indeed.

It runs source through the preprocessor locally (this takes care of
external/library dependencies) then offloads the actual compilation to
participating boxes, gathers object files back and finally links them, again
locally.

------
corysama
In an office LAN using MSVC, I've had good experiences with
<http://www.xoreax.com/>

Apparently, they have a make solution as well <http://www.xoreax.com/make.htm>

