[SDL] Parallel build?
sn.ml at bayminer.com
Fri Jan 18 15:00:30 PST 2008
On Thursday 17 January 2008, Bob Pendleton wrote:
> On Thu, 2008-01-17 at 21:10 +0100, Stephane Marchesin wrote:
> > On 1/17/08, Bob Pendleton <bob at pendleton.com> wrote:
> > > With the growing number of multicore machines out there it would
> > > be nice if the SDL make system could fire off multiple compiles
> > > at the same time. Has anyone looked into doing that?
> > you might know about make -j X, or you might not. The cool thing is
> > that it's not SDL-specific. I've made it an alias in my .bashrc
> > long ago.
> Thank you, I thought it was a much more difficult problem than it
> really is. That happens sometimes.
Well just sticking -j X after the make doesn't guarantee parallel
building. It just allow X concurrent makes to exist. If the structure
of the Makefile is serial then parallel building don't do anything.
Well except just a little bit more memory consumption. In reality
though Makefiles are allways at least partially parallel. One can of
course tune the Makefile to allow more concurrent builds.
So the rule is combine files/modules as late as you can and avoid
unnecessary cross referencing. Ie the more the build process resembles
a wide and shallow tree the better it will parallelize.
More information about the SDL