Issue 23 in pylibtiff: bittools extension fails to compile on Fedora 18 (python 2.7.3, gcc 4.7.2, numpy 1.7.0)

5 views
Skip to first unread message

pyli...@googlecode.com

unread,
Apr 9, 2013, 9:35:04 PM4/9/13
to pylibtif...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 23 by chalkdus...@gmail.com: bittools extension fails to compile
on Fedora 18 (python 2.7.3, gcc 4.7.2, numpy 1.7.0)
http://code.google.com/p/pylibtiff/issues/detail?id=23

I checked out rev. 89 from svn and attempted to build from source in the
usual way (python setup.py build / sudo python setup.py install), but the
build choked on the bittools extension. A log is attached. It looks as
though the problem may be numpy-1.7.0-related. (I just watched someone
successfully install on an Ubuntu 12.04 system with numpy 1.6.2, same gcc
and python.)

Attachments:
buildlog.txt 8.7 KB

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

pyli...@googlecode.com

unread,
Apr 20, 2013, 11:33:38 AM4/20/13
to pylibtif...@googlegroups.com

Comment #1 on issue 23 by jtaylor....@googlemail.com: bittools extension
fails to compile on Fedora 18 (python 2.7.3, gcc 4.7.2, numpy 1.7.0)
http://code.google.com/p/pylibtiff/issues/detail?id=23

it defines #define NPY_NO_DEPRECATED_API which is wrong
it should be:
#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION

though it requires 1.6 API, specifically PyArray_CORDER instead of
NPY_CORDER, so this can't be done.
quickfix is probably to just allow deprecated api by removing the broken
define.

pyli...@googlecode.com

unread,
Apr 23, 2013, 5:49:37 PM4/23/13
to pylibtif...@googlegroups.com

Comment #2 on issue 23 by dho...@gmail.com: bittools extension fails to
compile on Fedora 18 (python 2.7.3, gcc 4.7.2, numpy 1.7.0)
http://code.google.com/p/pylibtiff/issues/detail?id=23

Just for the record book, I am having this same problem. I'm using a Mac
OSX 10.7 with fink (python 2.7.4, numpy 1.7.1, libtiff 4.0.3, pylibtiff
rev89). I will likely have to downgrade to an older numpy. A coworker had
the same problem and here are the specific lines you need to change to get
this patched. Is this a problem in the way pylibtiff is using numpy?

Index: libtiff/src/tif_lzw.c
===================================================================
--- libtiff/src/tif_lzw.c (revision 89)
+++ libtiff/src/tif_lzw.c (working copy)
@@ -45,7 +45,7 @@


#include <Python.h>
-#define NPY_NO_DEPRECATED_API
+//#define NPY_NO_DEPRECATED_API
#define PY_ARRAY_UNIQUE_SYMBOL PyArray_API
#include "numpy/arrayobject.h"

Index: libtiff/src/bittools.c
===================================================================
--- libtiff/src/bittools.c (revision 89)
+++ libtiff/src/bittools.c (working copy)
@@ -1,5 +1,5 @@
#include <Python.h>
-#define NPY_NO_DEPRECATED_API
+// #define NPY_NO_DEPRECATED_API
#define PY_ARRAY_UNIQUE_SYMBOL PyArray_API
#include "numpy/arrayobject.h"

pyli...@googlecode.com

unread,
May 19, 2013, 10:52:21 PM5/19/13
to pylibtif...@googlegroups.com
Updates:
Status: Accepted

Comment #3 on issue 23 by richca...@gmail.com: bittools extension fails to
compile on Fedora 18 (python 2.7.3, gcc 4.7.2, numpy 1.7.0)
http://code.google.com/p/pylibtiff/issues/detail?id=23

I have tried to address this issue in the latest revision (r92).
As far as I can tell, NPY_CORDER is supported as far back as numpy 1.0. I
doubt anyone is still using an older version than this but just in case
I've added a check so it shouldn't break for < v1.0 (at least not for this
reason).
It would be great if anyone experiencing this issue can verify that it is
fixed in this revision.

pyli...@googlecode.com

unread,
May 19, 2013, 11:00:18 PM5/19/13
to pylibtif...@googlegroups.com
Updates:
Status: Fixed

Comment #4 on issue 23 by richca...@gmail.com: bittools extension fails to
compile on Fedora 18 (python 2.7.3, gcc 4.7.2, numpy 1.7.0)
http://code.google.com/p/pylibtiff/issues/detail?id=23

(No comment was entered for this change.)

pyli...@googlecode.com

unread,
May 21, 2013, 6:17:00 AM5/21/13
to pylibtif...@googlegroups.com

Comment #5 on issue 23 by richca...@gmail.com: bittools extension fails to
compile on Fedora 18 (python 2.7.3, gcc 4.7.2, numpy 1.7.0)
http://code.google.com/p/pylibtiff/issues/detail?id=23

OK, so my first effort at a fix didn't work on v1.3. Second effort (r93)
should work better.
Reply all
Reply to author
Forward
0 new messages