urgent issue: loading lib under Linux
"Axel Seibert" <[email protected]>
| Newsgroups | gmane.comp.python.ctypes |
|---|---|
| Message-ID | <176A712AB5DB45139AD99996B146CA31@ARS63> |
Dear list!
I've been using ctypes for the past 5 years to run an open sourced project
that wraps libraries from the software vendor BMC. I have this running under
Solaris as well as Windows.
However, I have never been able to get it to run under Linux. Now, some
colleagues have a very urgent requirement to get it to run there. I have
found already a couple of references on the web, e.g. emails to this list,
python bug tracker entries etc. The culprit, so it seems, is that my library
is missing the SONAME entry (LD_LIBRARY_PATH is set correctly). At least
that's in my eyes the reason why ctypes.util.find_library() is failing.
When I call LoadLibrary('libar.so'), I get the following error:
>>> cdll.LoadLibrary("libar.so")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/casa/python/lib/python2.6/ctypes/__init__.py", line 431, in
LoadLibrary
return self._dlltype(name)
File "/home/casa/python/lib/python2.6/ctypes/__init__.py", line 353, in
__init__
self._handle = _dlopen(self._name, mode)
OSError: libar.so: cannot open shared object file: No such file or directory
So, my question basically is: which options do I have?
- Does CDLL (or LoadLibrary) also rely on this function _get_soname()? In
other words, if I hard code in there to return something like a SONAME,
could this help?
- CDLL can take a handle -- is there some way that I can open the file and
hand over that filehandle to CDLL, so that it does not check for SONAME? I
have found no way, but then again, I'm no C specialist...
- any other thoughts?
- and no, changing the lib is not an option.
Thanx a lot in advance for any advice, hints that you can give.
Axel
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
ctypes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ctypes-users