Re: [C++-sig] Re: Embedded Python plus module loading
My problem means boost.build doesn't know how to
embedded Python program. I can add that same line "import sha" to /libs/python/test/embedding.cpp, build it with 'bjam embedding', and the test fails to run properly.
According to the ld manual page I need to use --export-dynamic to expose symbols coming from static parts of my binary (like
boost.build likes to link to) to dynamic libraries
modules. Or I can just dynamically link libpython
I haven't sufficiently decoded boost.build to figure out how to change the library search path to prefer the dynamically loaded Python library xor add the linker option --export-dynamic, I would
I've never used bjam but the following link may be of help. http://www.python.org/moin/boost.python/BuildingExtensions you can try scons as well, which I found to be easier to use. Regards, Joseph H. Yao On Mon, Mar 21, 2005 at 12:35:33PM -0500, Daniel Holth wrote: properly link my the static libpython like imported python prefer to just
dynamically link libpython and it would be nice to keep boost's handy Python version finder.
Thanks for any help,
Daniel Holth _______________________________________________ C++-sig mailing list C++-sig@python.org http://mail.python.org/mailman/listinfo/c++-sig
__________________________________ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/
Yao Heling <yaoheling@yahoo.com> writes:
I've never used bjam but the following link may be of help.
Unfortunately, both that Wiki page and the Boost.Python tutorial are a little out-of-date. While that procedure will work, it's awkward to build from within the Boost tree. A much better set of instructions can be found by looking at libs/python/example/ in your Boost installation. Start with the README file, and then follow the comments in the files it references. Joel, can you look into updating the tutorial so that it reflects the availability of cross-module building? Mike, it would be good to get the Wiki updated as well. In fact, I have a real concern about the cost of maintaining what looks like duplicate information in the Wiki and the official tutorial. I just had to fix a link to the tutorial in the Wiki, but this redundancy seems like a bad idea overall. Mike, I'd be happy to make you a co-maintainer of the tutorial, so that any time you wanted to add something, you could do so. Then we could replace the Wiki pages with a link to the tutorial. Make sense? -- Dave Abrahams Boost Consulting www.boost-consulting.com
On Tue, 2005-03-22 at 10:04 -0500, David Abrahams wrote:
Yao Heling <yaoheling@yahoo.com> writes:
I've never used bjam but the following link may be of help.
Unfortunately, both that Wiki page and the Boost.Python tutorial are a little out-of-date. While that procedure will work, it's awkward to build from within the Boost tree. A much better set of instructions can be found by looking at libs/python/example/ in your Boost installation. Start with the README file, and then follow the comments in the files it references.
That is certainly unfortunate. As you can see, for some reason posting my questions to this list helps me to figure out the solution for myself. My solution to the symbol resolution problem is to remove /usr/lib/python2.3/config/ (where the static libpython lives) from the library search path. Right now I just edit boost's python.jam but I'm sure there is a way to do this without doing that. Without static libpython in the search path, my program happily links with the shared libpython in /usr/lib, all symbols are resolved, my embedded Python does what it is supposed to do. Thanks all, Daniel Holth
participants (3)
-
Daniel Holth -
David Abrahams -
Yao Heling