Boost logo

Boost-Build :

Subject: Re: [Boost-build] Best way to interactively use python extension without installing anything
From: John Reid (j.reid_at_[hidden])
Date: 2009-07-19 08:19:43


You can set up tests in your Jamfile like so:

python-extension _sandbox
        : # sources
                src/python/python_sandbox.cpp
                /boost/python//boost_python
     ;
bpl-test sandbox_test
        :
                python/test_sandbox.py
                _sandbox
        ;

then if you do:
bjam -d+2

it will show you the commands it uses to run the test including the
values of LD_LIBRARY_PATH and PYTHONPATH.

So either use the scripted tests or if you want to do things
interactively use the values from bjam -d+2

John.

Sebastian wrote:
> Hi all,
> I'm at the moment trying to wrap a c++ project but have some conceptual
> problems I will explain using the standard boost::python example.
> When I build the "quickstart" project with the command "bjam test"
> everything works as expected - all tests pass. However, when I try to
> use this extension module interactively - by switching to
> bin/gcc-4.4.0/debug where the extension library "extending.so" lives,
> starting up the python interpreter and typing "import extending" - I
> get the error message:
>
> "ImportError: libboost_python-gcc44-d-1_39.so.1.39.0: cannot open shared
> object file: No such file or directory".
>
> The reason for this is obviously that libboost_python is not in the
> dynamic link path. The command "ldd extending.so" gives me:
>
> ...
> libboost_python-gcc44-d-1_39.so.1.39.0 => not found
> ...
>
> Of course this can be easily corrected by setting the LD_LIBRARY_PATH to
> the right directory. But this is a little tedious for bigger projects,
> where a lot of libraries have to be loaded. Is there some way to let
> bjam use hard coded links (with linker option -R) or let bjam set the
> right LD_LIBRARY_PATH when building debug mode? Or has anyone a better
> idea how to test extensions interactively and without installing everything?
>
> Thanks for any answers,
> Sebastian
> _______________________________________________
> Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build
>


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