[Cython] libimobiledevice build broken by 0.20b2

2014-01-12 Thread Julian Taylor
Hi,
libimobiledevice cython file fails to build with cython git head and 0.20b2.
It works with older versions, the bad commit in cython is:
commit db5d5a41b852fa32876688198e3d2d46f12de858
Author: Robert Bradshaw 
Date:   Mon Dec 30 22:24:04 2013 -0800

Fix bug when base classes were declared out-of-order.


its parent commit succeeds the build.


the file is:
https://github.com/libimobiledevice/libimobiledevice/blob/master/cython/imobiledevice.pyx

build can be run with
./autogen.sh
./configure --disable-openssl
make CYTHON=/path/to/cython

imobiledevice.c:13521:88: error: 'struct
__pyx_obj_13imobiledevice_MobileSyncClient' has no member named '__pyx_vtab'
imobiledevice.c:13644:88: error: 'struct
__pyx_obj_13imobiledevice_MobileSyncClient' has no member named '__pyx_vtab'
imobiledevice.c:13783:88: error: 'struct
__pyx_obj_13imobiledevice_MobileSyncClient' has no member named '__pyx_vtab'
imobiledevice.c:13906:88: error: 'struct
__pyx_obj_13imobiledevice_MobileSyncClient' has no member named '__pyx_vtab'
imobiledevice.c:14029:88: error: 'struct
__pyx_obj_13imobiledevice_MobileSyncClient' has no member named '__pyx_vtab'
imobiledevice.c:14345:88: error: 'struct
__pyx_obj_13imobiledevice_MobileSyncClient' has no member named '__pyx_vtab'
imobiledevice.c:14468:88: error: 'struct
__pyx_obj_13imobiledevice_MobileSyncClient' has no member named '__pyx_vtab'
imobiledevice.c:14591:88: error: 'struct
__pyx_obj_13imobiledevice_MobileSyncClient' has no member named '__pyx_vtab'
imobiledevice.c:14791:88: error: 'struct
__pyx_obj_13imobiledevice_MobileSyncClient' has no member named '__pyx_vtab'
imobiledevice.c:15046:88: error: 'struct
__pyx_obj_13imobiledevice_MobileSyncClient' has no member named '__pyx_vtab'
imobiledevice.c:26762:89: error: 'struct
__pyx_obj_13imobiledevice_ScreenshotrClient' has no member named
'__pyx_vtab'
imobiledevice.c:53310:4: error: 'struct
__pyx_obj_13imobiledevice_ScreenshotrClient' has no member named
'__pyx_vtab'
imobiledevice.c:53733:4: error: 'struct
__pyx_obj_13imobiledevice_MobileSyncClient' has no member named '__pyx_vtab'


Note, I know neither cython nor imobiledevice, Yaroslav Halchenko just
encountered this issue while testing packages with 0.20b2 in Debian.
Let me know if you need more information.
___
cython-devel mailing list
cython-devel@python.org
https://mail.python.org/mailman/listinfo/cython-devel


[Cython] h5py build broken by 0.20b2

2014-01-12 Thread Julian Taylor
Hi,
a h5py cython file fails to build with cython git head and 0.20b2.
It works with older versions.
This file fails

The offending file seems to be:
https://github.com/h5py/h5py/blob/master/h5py/h5p.pyd

cython h5py/h5p.pyx
Error compiling Cython file:

...
from _objects cimport ObjectID

# --- Base classes ---

cdef class PropID(ObjectID):
""" Base class for all property lists """
   ^

h5py/h5p.pxd:17:4: Executable statement not allowed here
...

it was introduced in cython around this commit:
b6b5152f386ddae503674cc26200a547f3b4c8b0
properly handle expressions at the beginning of func/class/etc. blocks


Is this an intentional change? I did not see anything related in the
CHANGES.rst of the 0.20.x branch.
Please advise if this is a bug/regression in cython or
bug/required-change in h5py.


Note, I know neither cython nor h5py, Yaroslav Halchenko just
encountered this issue while testing packages with 0.20b2 in Debian.
Let me know if you need more information.
___
cython-devel mailing list
cython-devel@python.org
https://mail.python.org/mailman/listinfo/cython-devel


[Cython] remove timestamps from generated source files

2014-01-13 Thread Julian Taylor
Hi,
Cython currently places timestamps into all its generated C source files.
This may be ok for developers who normally only rebuild files they
changed anyway but it is a major annoyance for distribution packagers
who often have to rebuild software from scratch including re-cythonizing.
The reason this is annoying is that the adding of timestamps breaks
caching of compiler results e.g. with ccache. Due to the size of the
generated files recompiling the full sources normally takes a large
fraction of the build time of packages.

I'm not sure what purpose the timestamps really serve, the version
number also included should be sufficient information in order to deduce
its origin.

Would it be possible to change Cython to stop putting timestamps into
the source?
I would also be happy if the granularity is reduced from seconds to
hours/days or an non-default option to disable it (e.g. an environment
variable).


Additionally I think it might be useful to have a vendor id added to the
version number added to the source files. This would allow easier origin
tracking of files created with distribution patched versions of Cython.
E.g. if Debian patches 0.20 of Cython it puts in

 Generated by Cython 0.20 (Debian revision 3)

Where the vendor id is added via a Distribution patch of the package and
none is emitted for upstream builds.
(CC. Debian maintainer of Cython for comments)

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


Re: [Cython] h5py build broken by 0.20b2

2014-01-13 Thread Julian Taylor
On 13.01.2014 09:26, Stefan Behnel wrote:
> Hi,
> ...
>>
>> it was introduced in cython around this commit:
>> b6b5152f386ddae503674cc26200a547f3b4c8b0
>> properly handle expressions at the beginning of func/class/etc. blocks
>>
>> Is this an intentional change?
> 
> Well, yes, but apparently one with unintended side-effects. :)
> 
> I pushed a proposed quick-fix here, test case pending, so it would be great
> if you or Yaroslav could give it a try.
> 
> https://github.com/cython/cython/commit/279efc20fb8fb0bbcba5922afd010bdd3424e3b5
> 
> Stefan


No, I still get the same error message with cython master
dab03a3cb796646c80d2f which includes the fix attempt.
___
cython-devel mailing list
cython-devel@python.org
https://mail.python.org/mailman/listinfo/cython-devel


Re: [Cython] remove timestamps from generated source files

2014-01-13 Thread Julian Taylor
On 13.01.2014 22:24, Robert Bradshaw wrote:
> The timestamp is in a comment which ccache can strip before looking up
> items in the cache; are you sure this is an issue?

well this is embarrassing, it indeed strips the comments...
The issue was setup.py used a compiler symlink not present in my ccache
folder. I draw wrong conclusions to quickly ...
Sorry for the noise.
___
cython-devel mailing list
cython-devel@python.org
https://mail.python.org/mailman/listinfo/cython-devel


Re: [Cython] h5py build broken by 0.20b2

2014-01-14 Thread Julian Taylor
On Tue, Jan 14, 2014 at 6:32 AM, Robert Bradshaw  wrote:

> I've verified that Stefan's latest fix lets h5py compile.
>
>
confirmed, that the new fix works, I guess it is:
https://github.com/cython/cython/commit/714f5e86b23fee295bb6a05b83a6d1031e0439d7
thanks

there are a bunch of uninitialized use and set-but-unused warnings, but
they are also present in 0.19.
___
cython-devel mailing list
cython-devel@python.org
https://mail.python.org/mailman/listinfo/cython-devel


Re: [Cython] libimobiledevice build broken by 0.20b2

2014-01-14 Thread Julian Taylor
On Tue, Jan 14, 2014 at 9:20 AM, Robert Bradshaw  wrote:

>
>
> Thanks for the report! Looks like it's a bunch of pxi files with class
> definitions that get included, fixed via
>
> https://github.com/cython/cython/commit/27a95b9bdcdc45e95209ec92e546c0e439ecd2c9
>
>
>
confirmed that the cython build now works, thanks
This fix is not in master only the 0.20.x branch. Currently master still
fails.
___
cython-devel mailing list
cython-devel@python.org
https://mail.python.org/mailman/listinfo/cython-devel


[Cython] bytearray tests fail with default unsigned char

2014-01-21 Thread Julian Taylor
hi,
the bytearray tests are broken when chars are unsigned.

tests/run/bytearraymethods.pyx defines following function:
def bytearray_append(b, char c, int i, object o):

this gets converted to an effective __Pyx_PyInt_AsUnsignedChar which
then errors out when -1 is passed in.
chars are unsigned like they are by default on arm, s390x and powerpc.
This causes a couple build failures in debian:
https://buildd.debian.org/status/package.php?p=cython
https://buildd.debian.org/status/fetch.php?pkg=cython&arch=armel&ver=0.20-1&stamp=1390316252

the tests can be fixed by adding signed char to the interface.

to reproduce on x86 with gcc (note the -funsigned-char to change the
default):

cython tests/run/bytearraymethods.pyx
gcc -funsigned-char bytearraymethods.c -fPIC $(python-config --includes)
$(python-config --libs) -shared -O2 -o bytearraymethods.so

python -c "import doctest; import bytearraymethods;
doctest.testmod(bytearraymethods)"

Traceback (most recent call last):
  File "", line 1, in 
NameError: name 'bytearraymethods' is not defined
root@ubuntu:/# python -c "import doctest; import bytearraymethods;
doctest.testmod(bytearraymethods)"
**
File "bytearraymethods.so", line ?, in
bytearraymethods.__test__.bytearray_append (line 202)
Failed example:
b = bytearray_append(b, -1, ord('y'), ord('z'))  # doctest: +ELLIPSIS
Expected:
Traceback (most recent call last):
ValueError: ...
Got:
Traceback (most recent call last):
  File "/usr/lib/python2.7/doctest.py", line 1315, in __run
compileflags, 1) in test.globs
  File "", line 1, in 
b = bytearray_append(b, -1, ord('y'), ord('z'))  # doctest:
+ELLIPSIS
  File "bytearraymethods.pyx", line 202, in
bytearraymethods.bytearray_append (bytearraymethods.c:1339)
def bytearray_append(bytearray b, char c, int i, object o):
OverflowError: can't convert negative value to char
**

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


[Cython] 0.20 tests fail with python3.4b2

2014-01-24 Thread Julian Taylor
hi,

with python3.4b2 numpy_memoryview.acquire_release_cycle fails
looking at the source the test should be disabled, but its still run.

This might be a py3.4 change to doctest, but I know nothing about
doctest, so I wanted to check first if you know something about this.
Interestingly py3.4 runs 64 tests, while python3.3 only runs 32.
the __test__ variable contains the same functions in both python
versions (acquire_release is not in it)

==
FAIL: acquire_release_cycle (numpy_memoryview)
Doctest: numpy_memoryview.acquire_release_cycle
--
Traceback (most recent call last):
  File "/usr/lib/python3.4/doctest.py", line 2187, in runTest
raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for
numpy_memoryview.acquire_release_cycle
  File
"/tmp/buildd/cython-0.20/build/work-dir/memoryview/c/numpy_memoryview/numpy_memoryview.cpython-34m.so",
line unknown line number, in acquire_release_cycle

--
File
"/tmp/buildd/cython-0.20/build/work-dir/memoryview/c/numpy_memoryview/numpy_memoryview.cpython-34m.so",
line ?, in numpy_memoryview.acquire_release_cycle
Failed example:
acquire_release_cycle(a)
Expected:
deallocated!
Got nothing
___
cython-devel mailing list
cython-devel@python.org
https://mail.python.org/mailman/listinfo/cython-devel


Re: [Cython] License information on each individual files

2014-07-18 Thread Julian Taylor
On 19.07.2014 00:12, Nathaniel Smith wrote:
> On Fri, Jul 18, 2014 at 10:53 PM, Robert Bradshaw  > wrote:
> 
> On Fri, Jul 18, 2014 at 2:28 PM, Nathaniel Smith  > wrote:
> 
> On Fri, Jul 18, 2014 at 10:13 PM, Sturla Molden
> mailto:sturla.mol...@gmail.com>> wrote:
> > Benjamin Lerman mailto:q...@chromium.org>>
> wrote:
> >
> >>  Would cython accept to add such a copyright header on its files?
> >
> > You want to display the Apache licence in every single file,
> even those
> > with utility C code?
> 
> It's annoying, but a pretty standard request. Debian once made me do
> this for some package or another (forget which) before they would
> distribute it, though obviously that rule is inconsistently applied.
> Still, it's pretty trivial and has real-world consequences, so why
> reject a patch like this?
> 
> 
> Debian currently distributes Cython without these headers. 
> 
> 
> Yes, they're inconsistent, as I noted.
>  

It is inconsistent but still encouraged.
As a debian maintainer I much appreciate when the files all contain
copyright statements, it simplifies one of the most time consuming part
of packaging, making sure all the copyrights are in order.
Per file copyright headers allow automated tools to quickly classify a
source tree and make it easier to find the files that need more detailed
checking.


> 
> 
> I am curious why a licence in a top level directory that explicitly
> states it applies to everything in that directory is not
> sufficiently clear. What about auto-generated files? What about
> binary blobs? All 1000+ test files? 
> 
> http://www.apache.org/dev/apply-license.html#copy-per-file
> 
> 
> That link is about sticking a copy of the apache license text in every
> file, this is about having a few line header saying "This is part of
> Cython, copyright Cython devs, released under Apache-2, see LICENSE.txt
> for details".

Yes you only need to include a short header not the full license.
The recommended header is in the APPENDIX section:
http://www.apache.org/licenses/LICENSE-2.0
___
cython-devel mailing list
cython-devel@python.org
https://mail.python.org/mailman/listinfo/cython-devel


Re: [Cython] Cython bugfix release

2014-07-21 Thread Julian Taylor
I haven't tried it but its possibly related to the C locale the debian
builders use. Try with LC_ALL=C

@Yaroslav if this the the case, the workaround would be building with
LC_ALL=C.UTF-8

On 21.07.2014 19:46, Robert Bradshaw wrote:
> I wasn't able to reproduce this myself, which is why I haven't done
> anything about it yet...
> 
> 
> On Sat, Jul 19, 2014 at 9:39 PM, Yaroslav Halchenko
> mailto:li...@onerussian.com>> wrote:
> 
> that was quite an underwhelming response,  now it is "official"
> https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=755340
> and I haven't had yet a chance to recheck master... anyone has a clue
> before I start digging?
> 
> On Thu, 19 Jun 2014, Yaroslav Halchenko wrote:
> 
> > and the same issue in current(ish) master:
> 
> > ==
> > ERROR: test_all (Cython.Debugger.Tests.TestLibCython.TestAll)
> > --
> > Traceback (most recent call last):
> >   File
> 
> "/tmp/buildd/cython-0.20.2+git216-ga96882e/Cython/Debugger/Tests/TestLibCython.py",
> line 280, in test_all
> > sys.stderr.write(errmsg)
> > UnicodeEncodeError: 'ascii' codec can't encode characters in
> position 21001-21004: ordinal not in range(128)
> 
> > --
> > Ran 8348 tests in 2674.102s
> 
> 
> 
> > On Wed, 18 Jun 2014, Yaroslav Halchenko wrote:
> 
> > > FWIW -- 0.20.2 was just uploaded to Debian sid, thus should be
> available
> > > to Debian folks soon too
> 
> > > while trying 0.20.1 across debian/ubuntus I ran into this failure
> 
> > >
> ==
> > > ERROR: test_all (Cython.Debugger.Tests.TestLibCython.TestAll)
> > >
> --
> > > Traceback (most recent call last):
> > >   File
> "/tmp/buildd/cython-0.20.2/Cython/Debugger/Tests/TestLibCython.py",
> line 281, in test_all
> > > sys.stderr.write(errmsg)
> > > UnicodeEncodeError: 'ascii' codec can't encode characters in
> position 18851-18854: ordinal not in range(128)
> 
> > > on debian wheezy i386.  it didn't happen on amd64 and on both
> architectures
> > > under debian jessie (testing) and it seemed to happen while
> testing with
> > > python2.6
> 
> > > On Mon, 16 Jun 2014, Robert Bradshaw wrote:
> 
> > > > I just pushed another bugfix release for the 0.20.x line,
> available on
> > > > github, cython.org , or and pypi.
> 
> > > > == Features added ==
> 
> > > > * Some optimisations for set/frozenset instantiation.
> > > > * Support for C++ unordered_set and unordered_map.
> 
> > > > == Bugs fixed ==
> 
> > > > * Access to attributes of optimised builtin methods (e.g.
> > > > [].append.__name__) could fail to compile.
> > > > * Memory leak when extension subtypes add a memory view as
> attribute
> > > > to those of the parent type without having Python object
> attributes or
> > > > a user provided dealloc method.
> > > > * Compiler crash on readonly properties in "binding" mode.
> > > > * Auto-encoding with c_string_encoding=ascii failed in Py3.3.
> > > > * Crash when subtyping freelist enabled Cython extension types
> with
> > > > Python classes that use __slots__.
> > > > * Freelist usage is restricted to CPython to avoid problems
> with other
> > > > Python implementations.
> > > > * Memory leak in memory views when copying overlapping,
> contiguous slices.
> > > > * Format checking when requesting non-contiguous buffers from
> > > > cython.array objects was disabled in Py3.
> > > > * C++ destructor calls in extension types could fail to
> compile in clang.
> > > > * Buffer format validation failed for sequences of strings in
> structs.
> > > > * Docstrings on extension type attributes in .pxd files were
> rejected.
> 
> > > > == Contributors ==
> 
> > > > Andreas van Cranenburgh
> > > > Ian Bell
> > > > Lars Buitinck
> > > > Martin Quarda
> > > > Mikhail Korobov
> > > > Robert Bradshaw
> > > > Stefan Behnel
> > > > ___
> > > > cython-devel mailing list
> > > > cython-devel@python.org 
> > > > https://mail.python.org/mailman/listinfo/cython-devel
> --
> Yaroslav O. Halchenko, Ph.D.
> http://neuro.debian.net http://www.pymvpa.org http://www.fail2ban.org
> Research Scientist,Psychological and Brain Sciences Dept.
> Dartmouth College, 419 Moore Hall, Hinman Box 6207, Hanover, NH 03755
> Phone: +1 (603) 646-9834   
> Fax: +1 (603) 646-1419 
>

Re: [Cython] aritmetic with arrays in Cython

2014-08-05 Thread Julian Taylor
On 04.08.2014 21:11, Ian Henriksen wrote:
> Hi all,
> I noticed that some time ago there was a pull request
> (https://github.com/cython/cython/pull/144) open that was trying to
> implement basic arithmetic operations with arrays. This seems to have
> also been proposed in CEP 518
> (https://github.com/cython/cython/wiki/enhancements-simd). What is the
> status on this?
> 
> This is a feature I'd really like to see in Cython. I'd be happy to help
> with it, though I don't currently know enough about the internals of
> Cython to do it without some guidance. What would be the best way to do
> this? I've had three ideas thus far that might allow something like this
> to work, but I'd really like to get some second opinions before I get
> too far with any of them.
> 
> 1. Make these array operations available as a part of Cython's memory
> view objects.
> 
> 2. Write a Cython wrapper around a NumPy-like C++
> library. https://github.com/ContinuumIO/libdynd seems to be a good
> candidate, though I'm not as familiar with it. (This doesn't strike me
> as something that would be a part of the main Cython project, but it
> could be a good way to make this sort of functionality available. It
> seems like a good way to avoid a lot of duplicate work though.)
> 
> 3. Write a Fortran backend for Cython that uses Fortran's arrays
> wherever memory views are used.
> (This could be a bit crazy, but with the iso_c_binding module, it might
> be possible. It could also allow better optimizations for arrays to be
> applied by the compiler.)
> 
> What would be the best way to go about this?
> 

4. Use numpy itself. numpy since 1.8 has vectorized base math functions,
though for large arrays you have to apply manual blocking and inplace
operations to see significant gains. That is where cython can help.
Possibly numpy is also open to expose the raw data buffer functions in
its api to make blocking more efficient.



signature.asc
Description: OpenPGP digital signature
___
cython-devel mailing list
cython-devel@python.org
https://mail.python.org/mailman/listinfo/cython-devel


Re: [Cython] aritmetic with arrays in Cython

2014-08-08 Thread Julian Taylor
On 08.08.2014 19:36, Stefan Behnel wrote:
> Hi,
> 
> please don't top-post.
> 
> Ian Henriksen schrieb am 08.08.2014 um 18:47:
>> I'd like to work on it. That was why I asked. It's been bothering me for
>> some time that we don't have this feature yet. This will take me some time
>> though since I'm not at all familiar with Cython's internals. I've used it
>> in relatively small settings for speeding up array operations and wrapping
>> external functions, but I've never had occasion to dig through much of what
>> it does internally. Some help navigating Cython's internals would be
>> greatly appreciated.
> 
> Here's a little intro.
> 
> https://github.com/cython/cython/wiki/HackerGuide#getting-started
> 
> I recommend to start by writing a simple test that does some integer
> arithmetic and enable code generation traces for AST nodes in the generated
> C code. "cython -a" should make this quite navigable.
> 
> 
>> I'll also have to take some time to become more familiar with eigen itself.
>> Most of my work has used numpy arrays.
>>
>> Eigen seems to be ideal for this since it allows us to offload the
>> expression analysis to another package where it is already
>> well-implemented. It looks like they have an array class for n-dimensional
>> array operations as well. My guess is that that would allow a fairly
>> natural translation from memory views to eigen arrays.
> 
> You should dig into the code that Ceygen uses for the mapping. That's most
> likely the best start you can get.
> 
> 
>> Would it be more helpful for me to start working on Cython bindings for
>> eigen, or to work on adding this directly as a part of Cython? Where should
>> I look in Cython's source code to do that? What kinds of modifications
>> would be necessary?
> 
> My guess is that this is best implemented with a set of matrix specific AST
> nodes for the arithmetic operators. There is a recursive tree processing
> phase in Cython's pipeline called "AnalyseExpressionsTransform" or type
> analysis, where it figures out what variables reference memory views, what
> the result type of an arithmetic expression is, etc. This phase can easily
> replace nodes by returning new nodes from the analyse_types() methods of
> AST nodes. Currently, arithmetic with memory views is not allowed, so this
> needs to be enabled in the corresponding NumBinopNode AST subclasses
> (AddNode, MatMulNode, etc. in ExprNodes.py). Write a test and debug it to
> see where it fails.

If someone wants to work on an ast transformer for array expressions I
would not restrict its output to something ceygen can parse but also numpy.
E.g. transforming:

cpdef whateverfunction(double[:] a, float[:] b):
return a + a * b + .5

to

cpdef whateverfunction(double[:] a, float[:] b):
bs = 1
r = empty_like(a)
for i in range(0, a.size, bs):
u = min(i + bs, a.size)
r[i:u] = a[i:u] * b[i:u]
r[i:u] += a[i:u]
r[i:u] += 0.5
return r

this is already very efficient in numpy.
___
cython-devel mailing list
cython-devel@python.org
https://mail.python.org/mailman/listinfo/cython-devel


[Cython] git master fails to compile scipy

2015-10-10 Thread Julian Taylor via cython-devel
hi,
since ab78f93b3ffa88183a0d2aae6b692e394c51f860 scipy does not build anymore:
the failing file is:
https://github.com/scipy/scipy/blob/master/scipy/sparse/csgraph/_reordering.pyx

error:
Traceback (most recent call last):
  File "/usr/bin/cython", line 8, in 
main(command_line = 1)
  File
"/tmp/local/lib/python2.7/site-packages/Cython-0.24.0a0-py2.7-linux-x86_64.egg/Cython/Compiler/Main.py",
line 704, in main
result = compile(sources, options)
  File
"/tmp/local/lib/python2.7/site-packages/Cython-0.24.0a0-py2.7-linux-x86_64.egg/Cython/Compiler/Main.py",
line 679, in compile
return compile_multiple(source, options)
  File
"/tmp/local/lib/python2.7/site-packages/Cython-0.24.0a0-py2.7-linux-x86_64.egg/Cython/Compiler/Main.py",
line 657, in compile_multiple
result = run_pipeline(source, options, context=context)
  File
"/tmp/local/lib/python2.7/site-packages/Cython-0.24.0a0-py2.7-linux-x86_64.egg/Cython/Compiler/Main.py",
line 487, in run_pipeline
err, enddata = Pipeline.run_pipeline(pipeline, source)
  File
"/tmp/local/lib/python2.7/site-packages/Cython-0.24.0a0-py2.7-linux-x86_64.egg/Cython/Compiler/Pipeline.py",
line 365, in run_pipeline
data = phase(data)
  File
"/tmp/local/lib/python2.7/site-packages/Cython-0.24.0a0-py2.7-linux-x86_64.egg/Cython/Compiler/Pipeline.py",
line 53, in generate_pyx_code_stage
module_node.process_implementation(options, result)
  File
"/tmp/local/lib/python2.7/site-packages/Cython-0.24.0a0-py2.7-linux-x86_64.egg/Cython/Compiler/ModuleNode.py",
line 118, in process_implementation
self.generate_c_code(env, options, result)
  File
"/tmp/local/lib/python2.7/site-packages/Cython-0.24.0a0-py2.7-linux-x86_64.egg/Cython/Compiler/ModuleNode.py",
line 349, in generate_c_code
self.body.generate_function_definitions(env, code)
  File
"/tmp/local/lib/python2.7/site-packages/Cython-0.24.0a0-py2.7-linux-x86_64.egg/Cython/Compiler/Nodes.py",
line 436, in generate_function_definitions
stat.generate_function_definitions(env, code)
  File
"/tmp/local/lib/python2.7/site-packages/Cython-0.24.0a0-py2.7-linux-x86_64.egg/Cython/Compiler/Nodes.py",
line 436, in generate_function_definitions
stat.generate_function_definitions(env, code)
  File
"/tmp/local/lib/python2.7/site-packages/Cython-0.24.0a0-py2.7-linux-x86_64.egg/Cython/Compiler/FusedNode.py",
line 785, in generate_function_definitions
stat.generate_function_definitions(env, code)
  File
"/tmp/local/lib/python2.7/site-packages/Cython-0.24.0a0-py2.7-linux-x86_64.egg/Cython/Compiler/Nodes.py",
line 3068, in generate_function_definitions
FuncDefNode.generate_function_definitions(self, env, code)
  File
"/tmp/local/lib/python2.7/site-packages/Cython-0.24.0a0-py2.7-linux-x86_64.egg/Cython/Compiler/Nodes.py",
line 1935, in generate_function_definitions
self.generate_function_body(env, code)
  File
"/tmp/local/lib/python2.7/site-packages/Cython-0.24.0a0-py2.7-linux-x86_64.egg/Cython/Compiler/Nodes.py",
line 1691, in generate_function_body
self.body.generate_execution_code(code)
  File
"/tmp/local/lib/python2.7/site-packages/Cython-0.24.0a0-py2.7-linux-x86_64.egg/Cython/Compiler/Nodes.py",
line 442, in generate_execution_code
stat.generate_execution_code(code)
  File
"/tmp/local/lib/python2.7/site-packages/Cython-0.24.0a0-py2.7-linux-x86_64.egg/Cython/Compiler/UtilNodes.py",
line 321, in generate_execution_code
self.body.generate_execution_code(code)
  File
"/tmp/local/lib/python2.7/site-packages/Cython-0.24.0a0-py2.7-linux-x86_64.egg/Cython/Compiler/Nodes.py",
line 6419, in generate_execution_code
self.body.generate_execution_code(code)
  File
"/tmp/local/lib/python2.7/site-packages/Cython-0.24.0a0-py2.7-linux-x86_64.egg/Cython/Compiler/Nodes.py",
line 442, in generate_execution_code
stat.generate_execution_code(code)
  File
"/tmp/local/lib/python2.7/site-packages/Cython-0.24.0a0-py2.7-linux-x86_64.egg/Cython/Compiler/Nodes.py",
line 5865, in generate_execution_code
if_clause.generate_execution_code(code, end_label, is_last=i == last)
  File
"/tmp/local/lib/python2.7/site-packages/Cython-0.24.0a0-py2.7-linux-x86_64.egg/Cython/Compiler/Nodes.py",
line 5908, in generate_execution_code
self.body.generate_execution_code(code)
  File
"/tmp/local/lib/python2.7/site-packages/Cython-0.24.0a0-py2.7-linux-x86_64.egg/Cython/Compiler/Nodes.py",
line 442, in generate_execution_code
stat.generate_execution_code(code)
  File
"/tmp/local/lib/python2.7/site-packages/Cython-0.24.0a0-py2.7-linux-x86_64.egg/Cython/Compiler/Nodes.py",
line 4800, in generate_execution_code
self.generate_assignment_code(code)
  File
"/tmp/local/lib/python2.7/site-packages/Cython-0.24.0a0-py2.7-linux-x86_64.egg/Cython/Compiler/Nodes.py",
line 5091, in generate_assignment_code
self.lhs.generate_assignment_code(self.rhs, code)
  File
"/tmp/local/lib/python2.7/site-packages/Cython-0.24.0a0-py2.7-linux-x86_64.egg/Cython/Compiler/ExprNodes.py",
line 3897, in generate_assignment_code
self.generate_

Re: [Cython] git master fails to compile scipy

2015-10-11 Thread Julian Taylor via cython-devel
thanks,
another file fails too:
https://github.com/scipy/scipy/blob/master/scipy/sparse/csgraph/_shortest_path.pyx

Error compiling Cython file:

...
for k from csr_indptr[j] <= k < csr_indptr[j + 1]:
w12 = csr_weights[k]
ind_k = csr_indices[k]
d2 = dist_matrix[i, ind_k]
if d1 + w12 < d2:
dist_matrix[i, ind_k] = d2 = d1 + w12
   ^


scipy/sparse/csgraph/_shortest_path.pyx:798:56: Compiler crash in
AnalyseExpressionsTransform

ModuleNode.body = StatListNode(_shortest_path.pyx:12:0)
StatListNode.stats[17] = StatListNode(_shortest_path.pyx:770:5)
StatListNode.stats[0] = CFuncDefNode(_shortest_path.pyx:770:5,
args = [...]/6,
modifiers = [...]/0,
visibility = u'private')
File 'Nodes.py', line 430, in analyse_expressions:
StatListNode(_shortest_path.pyx:777:4,
is_terminator = True)
File 'Nodes.py', line 6370, in analyse_expressions:
ForFromStatNode(_shortest_path.pyx:786:4,
relation1 = u'<=',
relation2 = u'<')
File 'Nodes.py', line 430, in analyse_expressions:
StatListNode(_shortest_path.pyx:787:8)
File 'Nodes.py', line 6370, in analyse_expressions:
ForFromStatNode(_shortest_path.pyx:790:8,
relation1 = u'<=',
relation2 = u'<')
File 'Nodes.py', line 430, in analyse_expressions:
StatListNode(_shortest_path.pyx:791:12)
File 'Nodes.py', line 6370, in analyse_expressions:
ForFromStatNode(_shortest_path.pyx:791:12,
relation1 = u'<=',
relation2 = u'<')
File 'Nodes.py', line 430, in analyse_expressions:
StatListNode(_shortest_path.pyx:792:16)
File 'Nodes.py', line 6370, in analyse_expressions:
ForFromStatNode(_shortest_path.pyx:793:16,
relation1 = u'<=',
relation2 = u'<')
File 'Nodes.py', line 430, in analyse_expressions:
StatListNode(_shortest_path.pyx:794:20)
File 'Nodes.py', line 5853, in analyse_expressions:
IfStatNode(_shortest_path.pyx:797:20)
File 'Nodes.py', line 5899, in analyse_expressions:
IfClauseNode(_shortest_path.pyx:797:23)
File 'Nodes.py', line 430, in analyse_expressions:
StatListNode(_shortest_path.pyx:798:24)
File 'Nodes.py', line 4787, in analyse_expressions:
CascadedAssignmentNode(_shortest_path.pyx:798:56,
assignment_overloads = [...]/0)
File 'Nodes.py', line 5157, in analyse_types:
CascadedAssignmentNode(_shortest_path.pyx:798:56,
assignment_overloads = [...]/0)

Compiler crash traceback from this point on:
  File
"/tmp/local/lib/python2.7/site-packages/Cython-0.24.0a0-py2.7-linux-x86_64.egg/Cython/Compiler/Nodes.py",
line 5157, in analyse_types
overloaded = lhs.type.is_cpp_class and env.lookup_operator('=',
[lhs, self.rhs])
AttributeError: 'NoneType' object has no attribute 'is_cpp_class'


On 11.10.2015 07:30, Robert Bradshaw wrote:
> Thanks for the report. This should be fixed with
> https://github.com/cython/cython/commit/eef2bc650945d69158e888653a2f8bd6bbad3db3
> 
> On Sat, Oct 10, 2015 at 2:11 PM, Julian Taylor via cython-devel
>  wrote:
>> hi,
>> since ab78f93b3ffa88183a0d2aae6b692e394c51f860 scipy does not build anymore:
>> the failing file is:
>> https://github.com/scipy/scipy/blob/master/scipy/sparse/csgraph/_reordering.pyx
>>

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