I created a python package on a Unix system compiling several fortran function and writing a few python lines as a wrapper.
this module works just fine on that Unix machine. Since it requires being connected I am trying to make it available on my MAC.
The module contains a .so file that on unix I can import as
import _mymodule
Following this I managed to read the shared object
mymodule = importlib.import_module(__name__,'_mymodule.so')
If I run
dir(mymodule)
['builtins', 'doc', 'file', 'name', 'package', 'spec']
which is not the contenct I get if I run from Terminal:
nm -gDC _mymodule.so
Now how can I use the functions inside it? or just simply list them? I can list the function inside it using
I would like to do something like
data = _mymodule.myfunction(param1,param2)
I also tried ctypes
lib_mymodule = CDLL('_mymodule.so')
with this result
OSError: dlopen(_mymodule.so, 6): no suitable image found. Did find: _mymodule.so: unknown file type, first eight bytes: 0x7F 0x45 0x4C 0x46 0x02 0x01 0x01 0x00