I'm developing a C++ library, which has python embedded. What I would like to do is to statically link Python library, so that there won't be configuration issues, when I switch to production server. So far, I'm able to link libpython3.5m.a
statically (I had to build Python from sources though, because it seems, that packaged libraries aren't compiled with -fPIC
flag). However, I came to a problem, that it seems, there's no Numpy: When I run application, which uses my library, it prompts me with an error:
ImportError: numpy.core.multiarray failed to import
And this error is caused by import_array1()
macro, that (AFAIK) is used to import the numpy routines to C++. I tried linking libnpymath.a
as well as libnpysort.a
, which I found in numpy build dir, but to no avail. Do you happen to know, if such static linking is possible and how to do it? I guess it should be possible, since numpy is written in C...