melissa_api.py wrapper assumes the .so file is in the same folder
Problem
The first line of src/api/melissa_api.py
assumes the .so file is stored in the same directory as itself.
melissa_c_api = np.ctypeslib.load_library('libmelissa_api',os.path.join(os.path.dirname(__file__),"libmelissa_api.so"))
However, the libmelisa_api.so
file is created in the install directory, which is a separate directory from the source files. Since this file melissa_api.py
is not copied into that install directory with .so
file, it raises the error:
/usr/lib/python3/dist-packages/numpy/ctypeslib.py in load_library(libname, loader_path)
163 raise
164 ## if no successful return in the libname_ext loop:
--> 165 raise OSError("no file with expected extension")
166
167 ctypes_load_library = deprecate(load_library, 'ctypes_load_library',
OSError: no file with expected extension
The library is imported if I manually specify the full path to libmelissa_api.so
, e.g.:
np.ctypeslib.load_library('libmelissa_api',"/home/robert/melissa/install/lib/libmelissa_api.so")
<CDLL '/home/robert/melissa/install/lib/libmelissa_api.so', handle 3575220 at 0x7f17a7d56b80>
Proposed solution
Copy melissa_api.py
over to install/lib/
folder during the installation process.
Let me know if I am missing and easy install flag or something that already takes care of this.