Re: [Cython] missing cimport in module '.' - bug?

2016-05-13 Thread Stefan Behnel
Christoph Groth schrieb am 03.05.2016 um 16:19:
> The setup.py script of our package "kwant" uses Cython.Build.cythonize.
> Everything works well, except that for pyx files that cimport a module
> from "." an error message is generated.  E.g. for the file
> "kwant/linalg/lapack.pyx" that contains the line
> 
> from . cimport f_lapack
> 
> The following message appears whenever setup.py is run:
> 
> missing cimport in module '.': kwant/linalg/lapack.pyx
> 
> No error message appears for files that cimport only from somewhere else
> than ".", e.g.:
> 
> from .defs cimport gint
> 
> The said messages do not seem to cause any problems, but they are of
> course somewhat of a nuiscance.  They seem to be created by
> Cython.Build.Dependencies.cimported_files().  The culprit seems to be
> the function find_pxd in that module that does not seem to handle
> properly the case when module is ".".

Yes, that's a known problem. It only impacts the dependency collector that
decides if a rebuild is necessary, and which is intentionally kept simple.
It does not have an effect on the compiler itself.

Looks like no-one has worked on this so far, but the correct code is
available in other places (obviously) where the imports are resolved.
Patches welcome.

Stefan

___
cython-devel mailing list
cython-devel@python.org
https://mail.python.org/mailman/listinfo/cython-devel


Re: [Cython] Cygwin: Handling missing C99 long double functions

2016-05-13 Thread Erik Bray
On Thu, May 12, 2016 at 12:55 AM, Greg Ewing
 wrote:
> Erik Bray wrote:
>>
>> A developer who writes some code that
>> happens to use long double isn't going to think themselves "Gosh, I
>> guess I can't accept `long double` here because it may cause Cython to
>> generate code that contains "truncl"
>
>
> Sounds to me like Cython shouldn't be taking it upon
> itself to generate calls to truncl just because long
> double is being used. The programmer should have to
> call it explicitly if that's what they want.

Since it's just a small optimization it could be disabled without
trouble too.  Preferably with a #define that can be set or unset at
compile time.

Best,
Erik
___
cython-devel mailing list
cython-devel@python.org
https://mail.python.org/mailman/listinfo/cython-devel