How to distribute C/C++ python extension module on Linux?

A

Allen

I have build an extension module PyRPC.so (why not be libPyRPC.so?).
The PyRPC.so uses API in libRPCPacker.so.
How to distribute the PyRPC.so?

I just put PyRPC.so and libRPCPacker.so in the same folder.
And under this folder, run python.
It tells PyRPC module cannot find a method in libRPCPacker.so.
 
D

David Cournapeau

I have build an extension module PyRPC.so (why not be libPyRPC.so?).
The PyRPC.so uses API in libRPCPacker.so.
How to distribute the PyRPC.so?

The simple answer is you can't. Depending on the distribution, the
python interpreter is built differently in an ABI-incompatible way. As
on other platforms, the binary also depends on the python version.

The only real solution is to package it using the native package
manager of the distributions you are interested in supporting (rpm,
deb, etc...); you still have to build the package for all different
combinations, though. Something like the opensuse build service can
help in those situations.
I just put PyRPC.so and libRPCPacker.so in the same folder.
And under this folder, run python.
It tells PyRPC module cannot find a method in libRPCPacker.so.

We need more informations on how you built the extension, and about
the exact error message. Note also that on Linux, by default,
libraries are not looked in the current directory, so it is likely
that PyRPC.so does not look in the libRPCPaker.so in your current
directory, but from another path (you can check how the loader
resolves libraries paths with the command ldd).

David
 

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,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top