0

We have a huge Cython project that produces lots of dynamic .so libraries when compiled. We would prefer to have a single static .a library instead that could be linked into standalone executable. However I have no clue how to reach the gcc command line options when running cythonize module. I have looked into compilation options here, but any support of gcc tweaking seems completely missing, even if the command line itself is even printed to console during the build.

One of the works around coming to my head is to write a wrapper around gcc command in something like bash, and pretend it to be "gcc" on the command line. It could intercept all calls and drive the gcc own way.

But even if Cython would pick such a bait, looks like rather dirty work around. All I want is a single large .so or .a library rather than many. How could I achieve this?

Audrius Meškauskas
  • 20,936
  • 12
  • 75
  • 93
  • It's a duplicate of this question https://stackoverflow.com/questions/30157363/collapse-multiple-submodules-to-one-cython-extension. I voted to close with the wrong duplicate originally but this one is better (because it actually has an ok solution) – DavidW Jul 10 '19 at 21:32
  • If you are embeding those modules (is it what "stand alone" executable means), then this answer https://stackoverflow.com/a/52670820/5769463 or this tool https://github.com/cython/cython/blob/master/Demos/freeze/README.rst might be interesting. – ead Jul 11 '19 at 05:20

0 Answers0