Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fails to compile (Windows 7, VS2008, Python 2.7, numpy 1.6.1) #16

Closed
GoogleCodeExporter opened this issue Aug 5, 2015 · 6 comments
Closed

Comments

@GoogleCodeExporter
Copy link

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.

Original issue reported on code.google.com by matej.s...@gmail.com on 7 Nov 2011 at 6:07

Attachments:

@GoogleCodeExporter
Copy link
Author

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.

Original comment by pearu.peterson on 7 Nov 2011 at 8:18

  • Changed state: Accepted

@GoogleCodeExporter
Copy link
Author

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

Original comment by matej.s...@gmail.com on 8 Nov 2011 at 8:12

@GoogleCodeExporter
Copy link
Author

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!

Original comment by pearu.peterson on 8 Nov 2011 at 8:28

@GoogleCodeExporter
Copy link
Author

And I would say that NPY_NO_DEPRECATED_API is irrelevant. Problematic is this 
commit: 
https://github.com/numpy/numpy/commit/c135371ea35483b5d557c04bcc57785b3edd9133#n
umpy/core/include/numpy/ndarraytypes.h that changes return type of PyArray_DATA.

Original comment by matej.s...@gmail.com on 8 Nov 2011 at 8:38

@GoogleCodeExporter
Copy link
Author

Thanks!

Original comment by matej.s...@gmail.com on 8 Nov 2011 at 8:38

@GoogleCodeExporter
Copy link
Author

Original comment by pearu.peterson on 8 Nov 2011 at 8:48

  • Changed state: Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant