Re: urgent issue: loading lib under Linux [SEC=UNCLASSIFIED]
"Andrew MacIntyre" <[email protected]>
| Newsgroups | gmane.comp.python.ctypes |
|---|---|
| Message-ID | <[email protected]> |
From: Axel Seibert
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.
Can you use a fully qualified path name?
-------------------------> "These thoughts are mine alone!" <---------
Andrew MacIntyre Operations Branch
tel: +61 2 6219 5356 Communications Infrastructure Division
fax: +61 2 6253 3277 Australian Communications & Media Authority
email: [email protected] http://www.acma.gov.au/
If you have received this email in error, please notify the sender immediately and erase all copies of the email and any attachments to it. The information contained in this email and any attachments may be private, confidential and legally privileged or the subject of copyright. If you are not the addressee it may be illegal to review, disclose, use, forward, or distribute this email and/or its contents.
Unless otherwise specified, the information in the email and any attachments is intended as a guide only and should not be relied upon as legal or technical advice or regarded as a substitute for legal or technical advice in individual cases. Opinions contained in this email or any of its attachments do not necessarily reflect the opinions of ACMA.
------------------------------------------------------------------------------
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