[C++-sig] install a boost module

David Abrahams dave at boost-consulting.com
Thu Sep 5 21:55:40 CEST 2002


From: "Feng Tian" <ftian at cs.wisc.edu>

> I compiled boost (1.28.0, python 2.2.1, gcc 3.0.2), it seems
> fine.  I also did a bjam test in boost/libs/python/build, 
> which also seems OK.  Now my problem is how do I build/release 
> my own module?  For some certain reason, I have to put my c++ 
> code outside of boost installation dir.



> The following is what I have done.
> 
> 1. Use/modify Jamfile in project.zip, I can compile my code.  
> The result is a .so file in
>     myproject/bin/dsms_common.so/gcc/debug/runtime-link-dynamic/
>     shared-linkable-true/dsms_common.so
> 
> 2. Since dsms_common.so is not in python's library path, I cd to 
> the directory, invoke python, however, 
> import dsms_common
>    reports
> libboost_python.so.1.28.0 cannot open, no such file.
> 
> 3. I found the libboost_python.so.1.28.0 is in a really deep
> directory located in boost/libs/python/build/bin/....
> so I copied the file to the directory with dsms_common.so,
> however, still, import fails.

You need to help the OS to find libboost_python.so.1.28.0 
Usually, that means putting its directory in some environment variable.
If you're running on Linux, that's called LD_LIBRARY_PATH:

    #!/bin/sh
    LD_LIBRARY_PATH=directory/containing/libbpl:$LD_LIBRARY_PATH
    export LD_LIBRARY_PATH


> 4. Now in python, i do
> import libboost_python
>    it reports error
> ImportError: dynamic module does not define init function

That's because libboost_python is not a python module.

>    but now I do
>         import dsms_common
>    it worked!!
> 
> So questions,
> 1. Did I missed some 'make install' step in building/installing boost?
>    It does not seems like the libboost_python.so.1.28.0 is installed in
>    the right place.

No, we don't have an official installation procedure (yet).

> 2. Is there any 'make install' step after I use bjam in my own module?
>    So that a simple 
> import dsms_common
>    in python will be all that I need to do.

Same answer. Sorry.

-----------------------------------------------------------
           David Abrahams * Boost Consulting
dave at boost-consulting.com * http://www.boost-consulting.com





More information about the Cplusplus-sig mailing list