The nb2 program is used to run the user's compiler, or
make, or a compilation script, or any other program that
would be used to compile the user's program. So for instance,
instead of typing
f77 program.f -llapack -lblas
the user would type
nb2 f77 program.f -llapack -lblas
Or instead of typing
make program
the user would type
nb2 make program
nb2 then runs the supplied command in an altered environment,
which has its
PATH variable modified to have a directory prepended
to it. That directory contains
shims which have the same name as
compilers and linkers that
nb2 needs to intercept.
Whenever one of those compilers or linkers is invoked - either directly
from nb2, by make, or by some other compilation tool, the
shim is
run instead of the real compiler. The shim then parses the compiler's
arguments looking for names of libraries that need to be linked in.
If those libraries are not installed on the system, the shim then downloads
them, verifies their signatures, and extracts them into an empty directory.
Finally the real compiler or linker is then run with a modified argument
list that causes the newly-downloaded libraries to be linked in along with
the user's program and any native libraries that are used.
For more information, see the
NetBuild documentation.