namit
namit

Reputation: 6957

ImportError: /home/test/test_1.so: wrong ELF class from cython build

I have build .so in cython as the tutorial says( python setup.py build_ext --inplace). On that system where i have build it is working fine; no ImportError; but when i have used it on other system it gives me an error msg as
ImportError: /home/test/test_1.so: wrong ELF class: ELFCLASS32

I think its a mismatch between 32bit and 64bit library; so how can i fix it while cythonizing it???

Upvotes: 1

Views: 6014

Answers (2)

tiago
tiago

Reputation: 23492

You can't share the same binaries in different architectures. But as long as you have python and the required libraries installed on either system, you can just compile the .c file produced by Cython, and don't need to have Cython installed in other machines (ie, convert the .pyx to .c).

Upvotes: 2

Confusion
Confusion

Reputation: 16841

You can't. You need to rebuild the .so on a 64-bit system and make sure you always use the right version on the right system. It is practically impossible for cython to allow 32-bit libraries to be used on a 64-bit system and vice-versa, due to the differences in those architectures. You would have the same problem with e.g. Ruby FFI.

Upvotes: 3

Related Questions