[C++-sig] Re: boost.Python/Jam with shared libraries

John Meinel john at johnmeinel.com
Wed Nov 10 16:04:49 CET 2004


Aaron Bentley wrote:
> John Meinel <john <at> johnmeinel.com> writes:
> 
> 
>># You might try this
>>
>>extension pfengine
>>   :# sources
>>     pfengine.cpp
>>   :
>>      <library-path>../.libs
>>      <find-library>panutil
>>      $(BOOST_PYTHON_V2_PROPERTIES)
>>;
>>
> 
> 
> Hi John,
> 
> Fancy meeting you here!
> 

I was surprised to see your name as well, one of the reasons I answered. :)

I don't really recognize your LinkLibraries command. (I've never used it.)

Does this not work:
   <find-library>pdf

I thought that worked for both dynamic and static libraries. The 
alternative in my mind would be
   <library-file>$(LIBPDF_PATH)/libpdf.a

You can either hard code $(LIBPDF_PATH), or what I prefer is to add the 
line:

local LIBPDF_PATH = 'path/to/libpdf' ;
                                     ^---- This space is important

I'm not sure why the space is required, but without it, you get problems.

I'm not a complete guru on Jamfiles. I've just fought my way through a 
lot of boost::python :).

I'm actually thinking about switching to Scons (www.scons.org), as soon 
as a friend of mine finishes porting his work to it, and can give me 
pointers how to move my stuff.

bjam does a lot of nice things, but it syntax is a little arcane to me. 
I feel like the planets have to align, while scons is at least python 
syntax. I haven't thoroughly evaluated it, though. But I know they both 
can do out of tree builds, and support automatic dependency checking.

John
=:->

> The eliminating-spaces route got rid of the errors, but find-library looks
> cleaner.  Thanks.
> 
> So I'm much further along.  Now I'm trying to link in a static file.  It appears
> to work, but then I get "symbol missing".
> 
> ---begin Jamfile---
> project-root ;
> 
> import python ;
> 
> # ----- getting_started2 -------
> 
> # Declare a Python extension called pfengine
> extension pfengine
> :  # sources
>    pfengine.cpp
>    #libraries
> :
>   <library-path>../.libs
>   <find-library>panutil
>   <find-library>pantemplate
>   <find-library>panpdfgen
>   <find-library>pancompile
>   <find-library>panconsult
>   <find-library>panelement
>   <find-library>panlang
>   <find-library>pancore
>   <find-library>panexport
>   <find-library>panreport
>   <find-library>pancgi
>   <find-library>chart
>   <find-library>ecommerce
>   <find-library>icuio
>   <find-library>icudata
>   <find-library>icutoolutil
>   <find-library>icule
>   <find-library>icui18n
> 
>   # requirements and dependencies for Boost.Python extensions
>   <template>@boost/libs/python/build/extension
>   ;
> 
> # Declare a test for the extension module
> boost-python-runtest test2
>     :  # Python test driver
>     test_getting_started2.py
>     # extension modules to use
>     <pyd>pfengine ;
> 
> LinkLibraries pfengine : ../libpdf.a ;
> # arch-tag: ae55dfed-2576-4667-953f-d7d8f777f7c4
> ---end jamfile---
> 
> ---attempt to use---
> 
>>>>import pfengine
> 
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
> ImportError: /home/abentley/programming/.libs/libchart.so.0: undefined symbol:
> PDF_setrgbcolor_fill
> 
> ---
> 
> PDF_setrgbcolor_fill is provided by libpdf.a
> 
> Any help appreciated.
> 
> Aaron
> 
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 256 bytes
Desc: OpenPGP digital signature
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20041110/db5e6f78/attachment.pgp>


More information about the Cplusplus-sig mailing list