I have a big library of C++ code that I have already wrapped in python on Ubuntu, dividing the wrap in different modules and everything works. The problems start when I want to do the same operation on MacOS (M1). First of all, I tried to get swig to produce .dylib libraries instead of the regular .so ones, that I thought are not working with Mac.
Then, I set on my .zshrc file the following variables:
export PYTHONPATH="/Users/myname/Library/FolderOfTheDYLIB"
export DYLD_FALLBACK_LIBRARY_PATH="/Users/myname/Library/FolderOfTheDYLIB"
but when I try to include the python library I get the following error:
ModuleNotFoundError: No module named '_myModule1'
Basically, there is no way to let python find my modules. So, I tried to produce the regular .so libraries instead of the .dylib ones. When I do that, I get this different error:
ImportError: dlopen(/Users/myname/Library/FolderOfTheDYLIB/_myModule1.so, 0x0002): symbol not found in flat namespace (___aarch64_cas8_relax)
That seems to me a compatibility problem with the arch64 architecture.
What can I do?