Boost logo

Boost-Build :

From: David Abrahams (dave_at_[hidden])
Date: 2005-02-14 09:43:12


Vladimir Prus <ghost_at_[hidden]> writes:

> On Friday 11 February 2005 19:19, David Abrahams wrote:
>
>> > The 'python-extension' rule must arrange for Boost.Python
>> > to be linked with the created python extension.
>>
>> Well the Boost.Python library isn't required for all Python
>> extensions; just the ones built with, er, Boost.Python ;-)
>
> In V1, "python-extension" creates Boost.Python extension ;-)

I'm not sure that should be the case in v2. In v1 we didn't have
usage-requirements to help us.

>> > I see two approaches
>> > to find Boost.Python
>> >
>> > - Just grep relatively to BOOST_BUILD_PATH, like boostbook does
>> >
>> > - Allows the user specify explicit location.
>> >
>> > I think it's best to allow both approaches:
>> >
>> > # Tries to find Boost.Python form BOOST_BUILD_PATH
>> > using python : 2.3 ;
>> >
>> > # Explicit 'using bpl' specifies the location of Boost.Python
>> > using python : 2.3 ;
>> > using bpl : /home/ghost/Work/boost/libs/python ;
>> >
>> > Comments?
>>
>> I'm highly confused. Why isn't bpl just like any other library?
>>
>> You just use the standard ways of referring to either prebuilt or
>> project-based libraries. No?
>
> It's possible, but might not be desirable. There are two approaches:
>
>
> 1.
>
> python-extension getting_started :
> getting_started.cpp /boost/python//boost_python ;
>
> 2.
>
> python-extension getting_started :
> getting_started.cpp ;
>
> In the first case, you explicitly specify the location of Boost.Python. In the
> second case, it's implicitly added by the 'python-extension' rule (and must
> be configured previously).
>
> The second approach is more user-friendly, IMO. What do you think?

Well, it's true, but what if you need to use multiple versions of
boost.python for some reason?

What if the user-config wants to specify a prebuilt Boost.Python but
the user wants to test Boost.Python from CVS?

My suggestion:

Do a base layer that allows you to build python extensions of any
kind, gaining the maximum amount of possible leverage from existing
mechanisms such as usage-requirements. Build a tool for python
itself, that declares the appropriate library aliases and
corresponding usage-requirements. Set up the usage-requirements for
the Boost.Python library.

_Then_ write down a few use-cases. If you find you still want another
layer of abstraction for reasons of convenience, think about making
special rules and a configurable toolset for Boost.Python.

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

Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk