[Cython] patch for #655

Robert Bradshaw robertwb at gmail.com
Sat Aug 3 07:36:48 CEST 2013


On Tue, Jul 23, 2013 at 2:25 AM, Felix Salfelder <felix at salfelder.org> wrote:
> On Fri, Jun 28, 2013 at 06:39:45AM +0200, Stefan Behnel wrote:
>> > the only thing that will affect the user (and which i should mention)
>> > is: make uses file extensions to determine file types. particularly, i
>> > have not found a portable hack that allows the use of .pyx for both .c
>> > and .cpp within the scope of one makefile yet...
>>
>> That's unfortunate, but not too serious either.
>
> its bearable, and it's just automake. manually created makefiles are not
> affected. why does cython use .pyx for two different things? what would
> be the canonical extension for C++ cython files? i've chosen to use .pyxx,
> any better options?

Though there are some features only available with C++, I don't
consider this "two different things" as the similarities far, far
outweigh the differences.

>> Hmm, does that mean you either have to create them manually before the
>> first run, and/or you have to manually collect all dependency files for the
>> "include" list? And then keep track of them yourself when you add new files?
>
> my goal is to use autotools for that sort of stuff. but yes, you can
> always do everything manually.
>
>> I suppose you could also use a wildcard file search to build the list of
>> include files?
>
> wildcards are seen as bad [1]. might be a matter of taste, of course.
> with manually created makefiles, you can do what you like best, of
> course.
>
>> > (automake will call the linker seperately, to increase portability or
>> > something)
>
>> If you want this feature to go in, I think you should write up
>> documentation for it, so that other people can actually use it as well.
>
> i have. type cython --help. this should be copied into the manpage, but
> we need to agree on the choice of option names first (and some other
> details, see the push request on github).
>
>> Even writing a correct makefile requires a huge amount of digging into
>> distutils.
>
> makefiles are documented in the make manual of your favourite make
> implementation. I don't know why you would want to dig into distutils.

To expand on what Stefan wrote, distutils automatically figures out
the flags, linker options, headers, etc. to make an extension
compatible with that specific Python on your system, which one would
either have to do manually or "extract" from distutils otherwise.

- Robert


More information about the cython-devel mailing list