Skip to content
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

Could be python version #188

Open
wants to merge 122 commits into
base: master
Choose a base branch
from
Open

Conversation

richardicooper
Copy link
Member

Pull request for eventual merge - don't do it yet.

This version works with gnu compilers on Windows. Requires python libraries to be installed at hardcoded path at the moment. Testing only. Python script output is copied to CRYSTALS output.
1. Tidy up
2. Find app pyembed folder
3. Prefix stderr output with red colour.
Add embeddable MSVC python dist to precomp. I've added an import library so that MinGW gcc can link it. For future reference, this was generated in two steps:

gendef python38.dll
dlltool -d python38.def -D python38.dll -llibpython38.a

Both tools are part of Msys/MinGW.

Added matching python headers (v3.8.1) to the folder python-headers-win
Remove python lib finds from CMakelists, but add local set of python headers (python-win-headers) for function definitions.
Attempt to copy .py files from script to script - not working yet.
python.c : dynamically load python dll from pyembed (and use python libs from there). This is more work, but reduces a breakable dependency. Note we can't use INCREF and DECREF macros in the c code here due to dependencies on variables in the DLL (which is loaded on request). We can simulate INCREF with Py_BuildValue call - hopefully the only leaking references (2 here) will be cleaned up after each script call by Finalize - if not need to find a workaround.
Don't reinitialze python every time - memory leaks.
Rename python.c to cpp (for intel build ease)
Use PyRun_SimpleFile instead of PyImport_Import as the latter only executes code on first import.
Not Linux version yet.
Test outputs look more stable.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant