问题
I have multiple .pyx files, is there a way to import them into a single pyx file and compile that file into a shared library, instead of having to compile 15 independent modules?
回答1:
At the moment, it seems the only way is to create a master .pyx
file that uses include
directives to create a monolithic .C file.
See project structure for wrapping many c++ classes in cython to a single shared object.
来源:https://stackoverflow.com/questions/8772966/how-can-i-merge-multiple-cython-pyx-files-into-a-single-linked-library