Issue 16 in pylibtiff: fails to compile (Windows 7, VS2008, Python 2.7, numpy 1.6.1)

12 views
Skip to first unread message

pyli...@googlecode.com

unread,
Nov 7, 2011, 1:08:34 PM11/7/11
to pylibtif...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

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

pyli...@googlecode.com

unread,
Nov 7, 2011, 3:19:00 PM11/7/11
to pylibtif...@googlegroups.com
Updates:
Status: Accepted

Comment #1 on issue 16 by pearu.peterson: fails to compile (Windows 7,

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.


pyli...@googlecode.com

unread,
Nov 8, 2011, 3:13:26 AM11/8/11
to pylibtif...@googlegroups.com

Comment #2 on issue 16 by matej.s...@gmail.com: fails to compile (Windows

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).

pyli...@googlecode.com

unread,
Nov 8, 2011, 3:29:34 AM11/8/11
to pylibtif...@googlegroups.com

Comment #3 on issue 16 by pearu.peterson: fails to compile (Windows 7,

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!

pyli...@googlecode.com

unread,
Nov 8, 2011, 3:39:41 AM11/8/11
to pylibtif...@googlegroups.com

Comment #4 on issue 16 by matej.s...@gmail.com: fails to compile (Windows

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.

pyli...@googlecode.com

unread,
Nov 8, 2011, 3:43:44 AM11/8/11
to pylibtif...@googlegroups.com

Comment #5 on issue 16 by matej.s...@gmail.com: fails to compile (Windows

Thanks!

pyli...@googlecode.com

unread,
Nov 8, 2011, 3:49:46 AM11/8/11
to pylibtif...@googlegroups.com
Updates:
Status: Fixed

Comment #6 on issue 16 by pearu.peterson: fails to compile (Windows 7,

(No comment was entered for this change.)

Reply all
Reply to author
Forward
0 new messages