I have searched here and Google and can't find the answer to this.
I have a python code (a library) I made and tested that it works. However, I want to compile it to an .so library and still use it in Python scripts (I know some think I'm mad but just humor me a moment...)
I am using Cython3 to do this and it does compile. But if I run it on a system with a different version of python installed (ie. compiled on a system with Python 3.5 and run on a system with Python 3.4) then I get the following error:
_frozen_importlib:321: RuntimeWarning: compiletime version 3.5 of module 'mynewlib' does not match runtime version 3.4
It's essential that these warnings don't pop up every time I run a python script that includes this module (ie. from mynewlib import *)
What if I compiled it on the target system but then the target system's python gets upgraded a point version? Then these errors would only come up again.
Is there a solution to this? Here is the code from my script that compiles the python code:
cython3 -a -3 --lenient $MODULE_NAME.py
gcc -shared -pthread -fPIC -fwrapv -O2 -Wall -fno-strict-aliasing -I/usr/include/python3.5 -o $MODULE_NAME.so
Are there any other command line options I should change? In the gcc line I have -Wall but is there some way I can change that to exclude these python version warnings?
I don't have any problems when including the compiled library in my scripts. The functions all work fine. So it seems I can safely ignore the warnings.
However, there are some instances where I need to get the output of the script and having these warnings spewing out only breaks things.
How do I suppress the warnings?