Boost logo

Boost-Build :

From: Dirk Griffioen (dirk_at_[hidden])
Date: 2008-02-10 17:46:58

Hi Stefan,

Wha we usualy do is the following:

- add a reference to the boost root in your projects root

after that you can refer to anything in boost in your own project.


a directory structure:


1) the test dir will have 3 files: project-root.jam, boost-build.jam and

*jamfile* - you can use it to define all kinds of shared settings, in it
you will see something like:

use-project /boost : $(ROOT)/boost_1_34_1 ;

project test
  : requirements
     # all your defines & stuff for the platforms you need
  : default-build debug

*project-root.jam* - used to set your $ROOT (and possibly other

path-constant ROOT : . ;

*boost-build.jam* - where the boost-build engine stuff lives (compiler
settings, tools etc):

if $(JAM_VERSION:J="") < 030114
    ECHO "error: Boost.Jam 3.1.14 or later required" ;
    EXIT ;
    JAMFILE = [Jj]amfile ;
    boost-build boost_1_34_1/tools/build/v2 ;

probably this could be done simpeler, but it always worked so far so I
never bothered :)

2) the src dir will also have a file called 'jamfile' and in it you can
now refer to anything in boost:

project src
  : source-location .
  : requirements
  : usage-requirements

lib my_test
  : my_test.cpp


this implies you install the source yourself on your own system (I never
tried the packaged versions - they're ususally behind in release
anyway); and by installing I mean, unzip/tar it somewhere, building is
done autmatically when you refer from your own project (this works for
any 3rd party stuff you need)

we even put boost in our projects svn (direct or by svn:exernal) - so we
control the version we work with, not the packagers :)

it all kind of models a mount point with $ROOT as '/' - you can
move/copy the whole test-dir anywhere on any platform (
supports many) and building it will 'just work ...

if you like it, I could send you a zip with a working setup?


Stefan Arentz wrote:
> I have installed all Boost 1.34.1 packages on an Ubuntu system,
> including bjam and Boost.Build (2.0m11).
> Getting the most simple example from
> to work is a no-brainer.
> But now I want this example to use for example the Boost.Filesystem library.
> What is the proper way to do this on a system like Ubuntu where there
> is no Boost root but instead just installed headers and libraries?
> Can anyone show a minimal Jamroot that depends on a boost library?
> Sorry for the noob questions but the lack of documentation for
> Boost.Build makes it really difficult to do these trivial things.
> S.
> _______________________________________________
> Unsubscribe & other changes:

CodeShop BV
+31 6 411 92 024

Boost-Build list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at