Boost logo

Boost-Build :

Subject: Re: [Boost-build] order of include directories in python extension
From: John Reid (j.reid_at_[hidden])
Date: 2011-02-23 10:40:19


On 22/02/11 22:19, Gevorg Voskanyan wrote:
> John Reid wrote:
>> Sorry I spoke too soon. It is not working. Compiling is fine. At runtime
>> I get:
>>
>> ImportError:
>> /home/john/Dev/MyProjects/PyICL/bin/gcc-4.4.3/debug/_pyicl_dynamic.so:
>> undefined symbol: _Py_RefTotal
>>
>> I imagine this is something to do with getting the boost.python usage
>> requirements wrong. Does anyone have a better solution to this problem
>> than hard-coding all the usage requirements?
>
>
> I have created an example which should put you on the track. Please see below,
> and don't hesitate to come back if you have questions.

Thanks a lot.

>
> lib a : a.cpp : : :<include>foo<define>bar<link>static:<define>static_macro
> <include>duplicate ;
>
> import targets : generate-from-reference ;
> import property-set ;
> import project ;
>
> rule collect_usage_reqs ( target_ref : properties * )
> {
> local result = [ generate-from-reference $(target_ref) : [ project.current ] : [
> property-set.create $(properties) ] ] ;
> local ps = $(result[1]) ;
> return [ $(ps).raw ] ;
> }
>
> lib b : :<conditional>@a_usage_reqs ;
> lib c : :<link>static<conditional>@a_usage_reqs ;
>
> rule a_usage_reqs ( properties * )
> {
> local result = [ collect_usage_reqs a : $(properties) ] ;
> ECHO $(result) ;
> return $(result) ;
> }
>
> lib no_duplicate : :<conditional>@no_dup_a_usage_reqs ;
>
> import set ;
>
> rule no_dup_a_usage_reqs ( properties * )
> {
> local reqs = [ a_usage_reqs $(properties) ] ;
> local result = [ set.difference $(reqs) :<include>duplicate ] ;
> ECHO "After filtering:" ;
> ECHO $(result) ;
> ECHO ;
> return $(result) ;
> }

I've had a look through this and I think I can more or less guess what's
going on where. It seems like the "a" target and the
"<include>duplicate" are hard-coded into the rules. Would it be possible
to make these arguments? I really don't know enough about
bjam/boost.build to say myself without a lot of trial and error.

For the time being, I've created symbolic links to my include
directories that are in the correct alphabetic order. This is doing the
job for me. If I have time, I will come back and try your example.

Thanks,
John.


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