New issue 16 by matej.s...@gmail.com: fails to compile (Windows 7, VS2008,
Python 2.7, numpy 1.6.1)
http://code.google.com/p/pylibtiff/issues/detail?id=16
I run on SVN checkout:
python setup.py install
and got:
libtiff\src\tif_lzw.c(1276) : error C2036: 'void *' : unknown size
reason:
In numpy c interface (see
https://github.com/numpy/numpy/blob/master/numpy/core/include/numpy/ndarraytypes.h)
was changed the return type of PyArray_DATA from void* in 1.6.1. to char*
in current git head revision. PyArray_DATA also changed from macro to
inline function but that should not matter.
Is it possible that pylibtiff works with current numpy from github and not
with last stable numpy release?
I attach patch that allowed me to compile pylibtiff (the functionality is
not tested). Also the installation log is attached.
Attachments:
pylibtiff_compilation_numpy.patch 515 bytes
pylibtiff_install_log.txt 3.8 KB
Comment #1 on issue 16 by pearu.peterson: fails to compile (Windows 7,
VS2008, Python 2.7, numpy 1.6.1)
http://code.google.com/p/pylibtiff/issues/detail?id=16
I have enabled NPY_NO_DEPRECATED_API (see recent commit) in extension
modules and successfully tested compilation both with numpy 1.6.1 and git
head
(under ubuntu with gcc and Python 2.6).
Hopefully this commit will fix the current issue without applying the
provided patch. Let me know how it works with Visual Studio compiler.
I tested the code with SVN trunk and it does not compile.
NPY_NO_DEPRECATED_API was introduced later than 1.6.1 (see ndarraytypes.h
in 1.6.1:
https://github.com/numpy/numpy/blob/v1.6.1/numpy/core/include/numpy/ndarraytypes.h).
Ok, thanks for the testing. The error could be raised because you are using
C++ compiler (which is probably more strict in pointer arithmetics) while
I don't get the error because I was using C compiler. Anyway, the patch
makes sense and I have applied it to svn.
Thanks for the bug report!
And I would say that NPY_NO_DEPRECATED_API is irrelevant. Problematic is
this commit:
https://github.com/numpy/numpy/commit/c135371ea35483b5d557c04bcc57785b3edd9133#numpy/core/include/numpy/ndarraytypes.h
that changes return type of PyArray_DATA.
Thanks!
Comment #6 on issue 16 by pearu.peterson: fails to compile (Windows 7,
VS2008, Python 2.7, numpy 1.6.1)
http://code.google.com/p/pylibtiff/issues/detail?id=16
(No comment was entered for this change.)