[C++-sig] Re: help building hello world example on Debian

David Abrahams dave at boost-consulting.com
Fri Apr 9 14:16:11 CEST 2004


Faheem Mitha <faheem at email.unc.edu> writes:

> Dear People,
>
> I have spent the last couple of hours trying to understand how to use
> bjam so as to build the `hello world' tutorial example for
> boost-python. I have not succeeded.
>
> I'm running Debian sarge. Debian seems me to want to use boost-python
> 1.30.2

What does that mean, specifically?

> , though I also have 1.31 installed. I have also installed bjam.
>
> The Jamfile from the hello world example appears below. How should I
> modify this to work on my system? Alternatively, I'd be happy with a
> regular Makefile.

Take a clue from the libs/python/example subdirectory of your Boost
installation (I suggest you use 1.31).  

[Joel, the tutorial example is not a very good one in general; people
would like to be able to build extensions outside of their Boost tree.
I think you ought to base the "building" example on the one in
libs/python/example, and use project ids (e.g. @boost) as in that
Jamfile]

> I would prefer not to have to do extensive configuration of other
> files, and I'd also prefer not to have to modify the jamfile if I
> moved it to a different location in the directory hierarchy. Can these
> preferences be satisfied?

Yes; just use your boost-build file to indicate the location of the Boost
project.  

> When running bjam on the script below I get the following. 
>
> bjam
> Unable to load Boost.Build: could not find build system.
> ---------------------------------------------------------
> /home/faheem/wc/boost/example/boost-build.jam attempted to load the
> build system by invoking
>
>    'boost-build ../../../tools/build/v1 ;'

It's very probable from looking at the paths above that the
boost-build.jam file in your example directory ought to say:

     boost-build ../../tools/build/v1 ;

...or you can rewrite it to use an absolute path.  You only need one
boost-build.jam file somewhere in the directory tree above all the
places from which you'll invoke bjam, pointing at your Boost
installation's tools/build/v1 directory; for example, you could put
one at the root of your filesystem and never set it again (not
recommended).

> but we were unable to find "bootstrap.jam" in the specified directory
> or in BOOST_BUILD_PATH (searching
> /home/faheem/wc/boost/example/../../../tools/build/v1,
> /usr/share/boost-build).
>
> I have tried reading the documentation but it seems very complicated
> and I just get more confused. Some guidance would be appreciated.

Please, which docs seem complicated and were confusing you?  We'd
like to improve them.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com





More information about the Cplusplus-sig mailing list