Compiling the Python script into native module using Cython#221
Compiling the Python script into native module using Cython#221davidhjp01 wants to merge 11 commits intoNTNU-IHB:masterfrom
Conversation
| @Jorgelmh need you to check if using |
| } | ||
| | ||
| PyObject* pGlobals = PyModule_GetDict(pyModule); | ||
| auto deepestFile = searchLeafClassName(pGlobals); |
There was a problem hiding this comment.
Inheritance seems to work fine, just tried using the new binaries in component-model and seems to work as expected. I'd still recommend we wait until Lars reviews this part as I'm not sure if it might affect other functionality.
| Is this approach portable? |
Hi Lars, this approach still requires Python runtime and dependencies used by the Python script, but it is to hide the main FMU logic by compiling it into a platform-dependent binary. |
| Yeah, I was thinking about platform portability. So when compiled on e.g. Windows this will only work on another Windows PC. What about Python version compatibility? In any case I think it needs som way of documenting which platform it is compiled for and in worst case throw an error saying this FMU is built for a specific platform. |
| If the above comment could be addressed, we may move forward with this PR. |
| Hi, unfortunately I did not have much time to follow up on this, will do it eventually.. |
# Conflicts: # pythonfmu/builder.py # pythonfmu/pythonfmu-export/src/pythonfmu/PySlaveInstance.cpp

Added a build option to compile the Python code into a native module using Cython.