I can't attach the exact code but would be happy to provide something simple that has the same issue.  I'll post something here when I can get to it.<div>- Tom<br><br><div class="gmail_quote">On Tue, Oct 9, 2012 at 10:52 AM, Bill Spotz <span dir="ltr"><<a href="mailto:wfspotz@sandia.gov" target="_blank">wfspotz@sandia.gov</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Tom, Charles,<br>
<br>
If you discuss this further, be sure to CC me.<br>
<br>
-Bill Spotz<br>
<div><div class="h5"><br>
On Oct 9, 2012, at 8:50 AM, Charles R Harris wrote:<br>
<br>
> Hi Tom,<br>
><br>
> On Tue, Oct 9, 2012 at 8:30 AM, Tom Krauss <<a href="mailto:thomas.p.krauss@gmail.com">thomas.p.krauss@gmail.com</a>> wrote:<br>
> Hi,<br>
><br>
> I've been happy to use numpy.i for generating SWIG interfaces to C++.<br>
><br>
> For a while, I've noticed this warning while compiling:<br>
> /Users/tkrauss/projects/dev_env/lib/python2.7/site-packages/numpy-1.8.0.dev_f2f0ac0_20120725-py2.7-macosx-10.8-x86_64.egg/numpy/core/include/numpy/npy_deprecated_api.h:11:2: warning: #warning "Using deprecated NumPy API, disable it by #defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION"<br>


><br>
> and today tried to get rid of the warning.<br>
><br>
> So, in numpy.i, I followed the warning's advice.  I added the # def here:<br>
><br>
> %{<br>
> #ifndef SWIG_FILE_WITH_INIT<br>
> #  define NO_IMPORT_ARRAY<br>
> #endif<br>
> #include "stdio.h"<br>
> #define NPY_NO_DEPRECATED_API  NPY_1_7_API_VERSION<br>
> #include <numpy/arrayobject.h><br>
> %}<br>
><br>
> SWIG was happy, but when compiling the C++ wrapper, there were many warnings followed by many errors.  The warnings were for redefinition of NPY_MIN_BYTE and similar.  The errors were for all kinds of stuff, excerpt here:<br>


> native_wrap.cpp:3632: error: ‘PyArray_NOTYPE’ was not declared in this scope<br>
> native_wrap.cpp:3633: error: cannot convert ‘PyObject*’ to ‘const PyArrayObject*’ for argument ‘1’ to ‘int PyArray_TYPE(const PyArrayObject*)’<br>
> native_wrap.cpp: At global scope:<br>
> native_wrap.cpp:3877: error: ‘intp’ has not been declared<br>
> native_wrap.cpp: In function ‘int require_fortran(PyArrayObject*)’:<br>
> native_wrap.cpp:3929: error: ‘struct tagPyArrayObject’ has no member named ‘nd’<br>
> native_wrap.cpp:3933: error: ‘struct tagPyArrayObject’ has no member named ‘flags’<br>
> native_wrap.cpp:3933: error: ‘FARRAY’ was not declared in this scope<br>
> native_wrap.cpp:20411: error: ‘struct tagPyArrayObject’ has no member named ‘data’<br>
><br>
> It looks like there is a new C API for numpy, and the version of numpy.i that I have doesn't use it.<br>
><br>
> Is there a new version of numpy.i available (or in development) that works with the new API?  Short term it will just get rid of a warning but I am interested in a good long term solution in case I need to upgrade numpy.<br>


><br>
><br>
> In the long term we would like to hide the ndarray internals, essentially making them private. There are still some incomplete areas, f2py and, apparently, numpy.i. Your feedback here is quite helpful and if you have some time we can try to get this straightened out. Could you attach the code you are trying to interface? If you have a github account you could also set up a branch where we could work on this.<br>


><br>
> Chuck<br>
</div></div>> _______________________________________________<br>
> NumPy-Discussion mailing list<br>
> <a href="mailto:NumPy-Discussion@scipy.org">NumPy-Discussion@scipy.org</a><br>
> <a href="http://mail.scipy.org/mailman/listinfo/numpy-discussion" target="_blank">http://mail.scipy.org/mailman/listinfo/numpy-discussion</a><br>
<br>
** Bill Spotz                                              **<br>
** Sandia National Laboratories  Voice: (505)845-0170      **<br>
** P.O. Box 5800                 Fax:   (505)284-0154      **<br>
** Albuquerque, NM 87185-0370    Email: <a href="mailto:wfspotz@sandia.gov">wfspotz@sandia.gov</a> **<br>
<br>
<br>
_______________________________________________<br>
NumPy-Discussion mailing list<br>
<a href="mailto:NumPy-Discussion@scipy.org">NumPy-Discussion@scipy.org</a><br>
<a href="http://mail.scipy.org/mailman/listinfo/numpy-discussion" target="_blank">http://mail.scipy.org/mailman/listinfo/numpy-discussion</a><br>
</blockquote></div><br></div>