[SciPy-dev] Cython and large generated .c files

Dag Sverre Seljebotn dagss@student.matnat.uio...
Sun Nov 8 13:57:11 CST 2009


David Cournapeau wrote:
> Pauli Virtanen wrote:
>>
>> I think Cython has some pre-made distutils hooks to make this less
>> painless. I don't know how nicely they work with numpy.distutils,
>> however...
>>
>
> Should not be too hard to support it.
>
>> I agree that things may get annoying if we decide to avoid this in the
>> long run, if the number of Cython-based extensions starts to grow.
>>
>
> Is size really a problem ? I am a bit worried about adding cython as a
> build requirement. We have already enough problems as it is, adding a
> requirement can only make things worse.

What mpi4py does is have a simple script "cythonize" which runs Cython on
all pyx files in the tree. Then:

 - Generated C files are NOT checked into version control
 - Generated C files ARE shipped with tarball source downloads (i.e.
cythonize is run on Lisandro's computer after exporting from revision
control). So endusers building from source do not need Cython.

Obviously setup.py etc. can be tailored to run cythonize if the C files
are older than the pyx files etc. I think this sounds like the solutions
with least drawbacks.

Dag Sverre



More information about the Scipy-dev mailing list