From: Geoffrey H. <ge...@ge...> - 2006-12-19 17:45:48
|
Hi, I'm one of the main developers of the Open Babel project -- a chemistry toolkit library in C++. We're using SWIG for interfaces to Perl and Python and have just expanded into Ruby and Java. Open Babel is a modular library -- it supports over 70 chemistry file formats(!) by individual shared objects which are loaded in as needed. In short, it has its own calls to dlopen(path, RTLD_LAZY). One thing we discovered when writing the Perl and Python bindings with SWIG was that these internal dlopen() calls broke unless we hacked the SWIG output to add something like this: import sys if sys.platform.find(\"linux\") != -1: import dl sys.setdlopenflags(sys.getdlopenflags() | dl.RTLD_GLOBAL) Now I don't code on Linux, so it's hard for me to test these things. I don't know if the problem is that our C++ library should be calling RTLD_LAZY|RTLD_GLOBAL when it loads the format shared objects. -or- That we need some way to set the options when the SWIG interfaces load our library. Any thoughts, suggestions, or critiques would be most welcome. Thanks! -Geoff |