Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Python (http://www.velocityreviews.com/forums/f43-python.html)
-   -   ctypes CDLL - which paths are searched? (http://www.velocityreviews.com/forums/t586209-ctypes-cdll-which-paths-are-searched.html)

Helmut Jarausch 01-21-2008 05:25 PM

ctypes CDLL - which paths are searched?
 
Hi,

how can I specify the paths to be searched for a dynamic library
to be loaded by ctypes' CDLL class on a Linux system.

Do I have to set os.environment['LD_LIBRARY_PATH'] ?

Many thanks for a hint,
Helmut.

--
Helmut Jarausch

Lehrstuhl fuer Numerische Mathematik
RWTH - Aachen University
D 52056 Aachen, Germany

Thomas Heller 01-21-2008 08:42 PM

Re: ctypes CDLL - which paths are searched?
 
Helmut Jarausch schrieb:
> Hi,
>
> how can I specify the paths to be searched for a dynamic library
> to be loaded by ctypes' CDLL class on a Linux system.
>
> Do I have to set os.environment['LD_LIBRARY_PATH'] ?
>


ctypes passes the argument given to CDLL(path) straight to
the dlopen(3) call, so your system documentation should tell you.

Thomas


Helmut Jarausch 01-22-2008 12:58 PM

Re: ctypes CDLL - which paths are searched?
 
Thomas Heller wrote:
> Helmut Jarausch schrieb:
>> Hi,
>>
>> how can I specify the paths to be searched for a dynamic library
>> to be loaded by ctypes' CDLL class on a Linux system.
>>
>> Do I have to set os.environment['LD_LIBRARY_PATH'] ?
>>

>
> ctypes passes the argument given to CDLL(path) straight to
> the dlopen(3) call, so your system documentation should tell you.
>


Thanks,

but then it's difficult to use CDLL. Setting
os.environ['LD_LIBRARY_PATH'] within the script which
calls CDLL is too late.
What other methods are possible rather than put an explicit
export LD_LIBRARY_PATH=...
before running the script, if I don't want to put the dynamic
library into a standard system library.

Many thanks,
Helmut.



--
Helmut Jarausch

Lehrstuhl fuer Numerische Mathematik
RWTH - Aachen University
D 52056 Aachen, Germany

Helmut Jarausch 01-22-2008 12:58 PM

Re: ctypes CDLL - which paths are searched?
 
Thomas Heller wrote:
> Helmut Jarausch schrieb:
>> Hi,
>>
>> how can I specify the paths to be searched for a dynamic library
>> to be loaded by ctypes' CDLL class on a Linux system.
>>
>> Do I have to set os.environment['LD_LIBRARY_PATH'] ?
>>

>
> ctypes passes the argument given to CDLL(path) straight to
> the dlopen(3) call, so your system documentation should tell you.
>


Thanks,

but then it's difficult to use CDLL. Setting
os.environ['LD_LIBRARY_PATH'] within the script which
calls CDLL is too late.
What other methods are possible rather than put an explicit
export LD_LIBRARY_PATH=...
before running the script, if I don't want to put the dynamic
library into a standard system library.

Many thanks,
Helmut.



--
Helmut Jarausch

Lehrstuhl fuer Numerische Mathematik
RWTH - Aachen University
D 52056 Aachen, Germany

Thomas Heller 01-22-2008 01:42 PM

Re: ctypes CDLL - which paths are searched?
 
Helmut Jarausch schrieb:
> Thomas Heller wrote:
>> Helmut Jarausch schrieb:
>>> Hi,
>>>
>>> how can I specify the paths to be searched for a dynamic library
>>> to be loaded by ctypes' CDLL class on a Linux system.
>>>
>>> Do I have to set os.environment['LD_LIBRARY_PATH'] ?
>>>

>>
>> ctypes passes the argument given to CDLL(path) straight to
>> the dlopen(3) call, so your system documentation should tell you.
>>

>
> Thanks,
>
> but then it's difficult to use CDLL. Setting
> os.environ['LD_LIBRARY_PATH'] within the script which
> calls CDLL is too late.
> What other methods are possible rather than put an explicit
> export LD_LIBRARY_PATH=...
> before running the script, if I don't want to put the dynamic
> library into a standard system library.


I guess you can also use an absolute pathname (but the dlopen(3)
manpage should tell you more. I'm not too familiar with linux).

Thomas



All times are GMT. The time now is 10:43 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.