I have a closed-source x86_64 library that I want to access from Python on Linux.
I usually use ctypes for this.
But this library is supplied as an archive (*.a) file. I cannot relink the library into a dynamic *.so because it was compiled without the -fPIC option. ctypes needs the *.so dll.
Besides complaining to the packagers of this library, is there anything else I can do to get it into an *.so? Maybe writing wrapper functions somehow?
Edit:
Trying the answer in https://stackoverflow.com/a/2657390/4323:
gcc -shared -o closed_lib.so -Wl,--whole-archive -fPIC closed_lib.a -Wl,--no-whole-archive
/usr/bin/ld: closed_lib.a(myFFT.o): relocation R_X86_64_32S against `.bss' can not be used when making a shared object; recompile with -fPIC
closed_lib.a(myFFT.o): error adding symbols: Bad value
collect2: error: ld returned 1 exit status
make: *** [closed_lib.so] Error 1