Build Python as static library with won't include basic modules

73 views Asked by At

I am trying to get the ultimate performance in my application based on python.

I am already using Cython and everything works compiling it in C++. I am even able to pack everything with PyInstaller and binary dist works. Now I want to reduce the overhead of interactions between Python DLL and my module PYDs (modules compiled from C++). To achieve this I want to link both my app C++ cythonized modules and Python built as a static library with LTO enabled.

I already went to MSYS package recipe and was able to create the static python library. However, I noticed the basic modules are missing in that binary (like _ssl, etc). Those modules are still built as PYDs which reference a Python DLL instead of being included in libpython3.11.a

Is there exist any method to embed those modules in the static library?

This is related to this question, but it is outdated: Static python build missing modules

0

There are 0 answers