Embedded Python interpreter and sockets

chris.atlee at gmail.com chris.atlee at gmail.com
Fri Nov 18 23:15:53 EST 2005


Hi Jan,

I believe the problem lies with how Houdini uses dlopen() to open your
plugin.  It uses RTLD_LOCAL to load your plugin, which means that all
your plugin's symbols (including the python symbols) are private to
that library.  Subsequent dlopen() calls, including those made by the
python library, won't be able to see any of those symbols.  This
problem isn't unique to Python, or Houdini, it's just a matter of how
dlopen() is being used.

One thing that may work (I just tried here, and it looks like it
does...but it's late on a Friday night, so I may have overlooked
something) is creating a wrapper plugin.  Say you have your plugin
called myplugin.so which links aginst libpython.  Create a new plugin
called myplugin_wrapper.so which exports the same required symbols.
myplugin_wrapper will need to dlopen("myplugin.so", RTLD_GLOBAL), and
then call the real methods inside myplugin.so.  Since myplugin.so is
the one linked against libpython, and it is being loaded with
RTLD_GLOBAL, then the python symbols should be available to other
shared libraries loaded at a future time.

Let me know if this works out!  If you need any help, head on over to
http://www.sidefx.com/forum.

Cheers,
Chris




More information about the Python-list mailing list