Artem Selivanov
Artem Selivanov

Reputation: 1957

How to compile cython module for multiple platforms on windows?

Is there way to compile specified cython files for multiple platforms? If so, how to do it?

I need compile module for linux and windows both by one tool (also would be nice if this also can be compiled to other popular platforms).

This is distutils' settings?

Upvotes: 5

Views: 2938

Answers (1)

mgc
mgc

Reputation: 5443

I'm not sure that it will completely answer your question but if you want to distribute a python package (containing c/cython code) to various platform you can use some continuous integration services to build wheels on specific platforms and then distribute them.

For example you can use Travis CI (for Linux and OS X) and Appveyor (for Windows) to build your project (on a set of chosen python versions), then update the created wheels alongside the code of your package to PyPI.

After that, an user doing pip install your_package will fetch the wheel of your project and so avoid compilation.

Python documentation about wheels
Python documentation about supporting windows thanks to appveyor

Upvotes: 2

Related Questions