[Nestedvm] Parallel build script

reddtape at gmail.com reddtape at gmail.com
Thu Feb 12 00:34:20 EST 2009


Hi folks,

I thought I'd share my parallel build script for NestedVM.  The current
makefile doesn't work very well with parallel builds (-j #) because of
certain dependencies (compile depends on patch depends on download).

-j generally makes things build a bit faster on SMP systems (e.g.
multiprocessor, multicore, or hyperthreading).  It may also have a
positive effect on non-SMP systems, but nobody's too sure.  I've seen
recommendations to have about twice as many jobs as you have processors,
but after a certain ratio, there's diminishing returns.  Keep in mind
that parallel builds usually require more memory.

Requirements:

darcs is in the PATH.
bash -- you might be able to get away with just using sh, but I'm not
sure.
The other prerequisites for NestedVM, such as make, gcc.  On SunOS
systems, you should replace "make" with gmake.

Breaks:

Nothing that I know of so far.

Adjustments:

You need darcs in the path.  You probably need to change make to gmake
for SunOS.  Modify -j# to an appropriate number of jobs; if you have an
8-way SMP system, you can change -j4 to -j8.  Generally, a safe choice
is -j(number_of_processors), provided you have a lot of memory.

Script:

#!/bin/bash
darcs get http://nestedvm.ibex.org/
pushd nestedvm.ibex.org/upstream
make -j4 tasks/download_binutils tasks/download_busybox
tasks/download_gcc tasks/download_gcc-c++ tasks/download_gcc-core
tasks/download_gcc-g77 tasks/download_newlib tasks/download_zlib
make -j4 tasks/extract_binutils tasks/extract_gcc tasks/extract_newlib
make -j4 tasks/patch_binutils tasks/patch_gcc tasks/patch_newlib
make -j2 tasks/extract_darcs_classgen tasks/extract_darcs_gcclass
make -j2 tasks/build_darcs_classgen tasks/build_darcs_gcclass
make -j8 tasks/build_gcc
popd
pushd nestedvm.ibex.org
make
popd

Happy building!

-R.T.



More information about the Nestedvm mailing list