Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > ctypes CDLL - which paths are searched?

Reply
Thread Tools

ctypes CDLL - which paths are searched?

 
 
Helmut Jarausch
Guest
Posts: n/a
 
      01-21-2008
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
 
Reply With Quote
 
 
 
 
Thomas Heller
Guest
Posts: n/a
 
      01-21-2008
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

 
Reply With Quote
 
 
 
 
Helmut Jarausch
Guest
Posts: n/a
 
      01-22-2008
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
 
Reply With Quote
 
Helmut Jarausch
Guest
Posts: n/a
 
      01-22-2008
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
 
Reply With Quote
 
Thomas Heller
Guest
Posts: n/a
 
      01-22-2008
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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Segmentation Fault on CDLL reloading Marcus.CM Python 1 08-30-2008 12:38 PM
WindowsXP/ CTypes - How to convert ctypes array to a string? dudeja.rajat@gmail.com Python 0 08-19-2008 10:20 AM
Paths, gentleman, paths Ohad Lutzky Ruby 2 11-07-2006 02:15 AM
RE: [ctypes-users] [Ann] ctypes 0.9.0 released Henk Punt Python 0 07-23-2004 10:34 PM
Convert between Windows style paths and POSIX style paths Noah Python 5 07-11-2003 09:25 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57