Boost logo

Boost Users :

From: David Abrahams (dave_at_[hidden])
Date: 2004-09-03 11:06:00


"Steven T. Hatton" <hattons_at_[hidden]> writes:

>>From reading the documentation on boost.org, I have gotten the impression I
> don't need to set $BOOST_BUILD_PATH and $BOOST_ROOT.

Correct.

> I'm more than a little confused about how I should use the boost
> libraries. Part of this comes from the fact that it is not clear to
> me exactly where the demarkation is between using the build system
> to build boost, and using it to build my own programs. Some of my
> confusion comes from the appearant change in configuration
> requirements described in the documentation. It is suggested I
> don't need the environment variable used with earlier releases. One
> of these variables is $BOOST_ROOT, which the documentation used as
> an example of how to build boost. That example was exactly what I
> successfully (I believe) build the libraries with.

It doesn't hurt for you to set BOOST_ROOT, as long as you set it
accurately. But you shouldn't need to.
>
> I'm using SuSE Linux 9.1 on a P4 box. Some basic questions are these:
>
> When I downloaded and built boost, I first fetched the source for
> bjam.

Unneccessary, but it shouldn't hurt. The bjam sources are in the
tools/build/jam_src directory of your Boost installation.

> This is the name of the file I downloaded: boost-jam-3.1.10.tgz It
> compiled quite nicely, and I copied the resulting bjam jam mkjambase
> and yyacc to a location in my path.

Why did you copy anything other than bjam?

> Are there anything other things
> such as configuration files I need to reside with the binary
> executables?

No.

> Are there necessary configuration file that I need to
> have visible to these programs, even if they are not colocated?

Not exactly.

http://www.boost.org/tools/build/jam_src/#jambase_replacement

describes the file that bjam expects to see when it starts up. You
might also drop a Jamrules file in the root directory of your own
Boost.Build project (if you use bjam for your own project) that
contains:

  project boost : path/to/boost_1_31_0 ;

But for building from within the Boost tree itself, thes are already
taken care of.

> I then build boost with the command:
>
> bjam --prefix=$BOOST_ROOT "-sTOOLS=gcc" install
>
> after setting my BOOST_ROOT the way I wanted it. That resulted in two
> directories being placed in $BOOST_ROOT/ one is called $BOOST_ROOT/include/
> the other is called $BOOST_ROOT/lib/. Under $BOOST_ROOT/include/ I have
> <path>/boost-1_31/boost/ which contains dozens of header files. I added
> $BOOST_ROOT/include/boost-1_31 to my $INCLUDE_PATH, and
> $BOOST_ROOT/lib to my $LIBRARY_PATH and $LD_LIBRARY_PATH variables. Is this
> the correct way to configure my system to use boost?

Well, yeah, except that using the BOOST_ROOT directory for your
--prefix is probably a bad idea. I would leave the --prefix option
off.

> Is there anything else I need to do in order to compile my programs
> against the boost headers and libraries?

Add the include/ directory to your #include path and the lib/
directory to your library search path?

> Will the boost libraries work as well as other, comperable libraries
> using autotools rather than bjam?
> Are there any special accommodations I need to make in order to use
> boost with the gnu build tools?

I don't know much about those tools, so I can't really say.
Maybe someone else can.

> Do I need to do anything special to use boost with bjam that does not involve
> placing files in my current project directories? For example, do I need to
> provide a global configuration file of some kind? Is it a preferred option,
> even if not strictly required?

No.

> There is much remaining in the source directory where I compiled
> boost. Is that something I need to also put in an accessible place
> on my system?

No.

> If so, what so I need to put where, and how to I
> modify my environment variable to facilitate its use?

-- 
Dave Abrahams
Boost Consulting
http://www.boost-consulting.com

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net