ctypes CDLL - which paths are searched?

H

Helmut Jarausch

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
 
T

Thomas Heller

Helmut said:
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
 
H

Helmut Jarausch

Thomas said:
Helmut said:
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
 
H

Helmut Jarausch

Thomas said:
Helmut said:
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
 
T

Thomas Heller

Helmut said:
Thomas said:
Helmut said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top