-
Notifications
You must be signed in to change notification settings - Fork 41
Compiling the Python script into native module using Cython #221
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
@Jorgelmh need you to check if using |
} | ||
|
||
PyObject* pGlobals = PyModule_GetDict(pyModule); | ||
auto deepestFile = searchLeafClassName(pGlobals); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Jorgelmh passing pGlobals
here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.. |
Added a build option to compile the Python code into a native module using Cython.