[Numpy-discussion] proper way to test Numpy version in C/C++

Ghislain Vaillant ghisvail at gmail.com
Fri Feb 28 09:31:11 EST 2014

Hi everyone,

I have got code for some python wrappers of a scientific library which
needs to support both Numpy 1.6 and later versions.

The build of the wrapper (using swig) stopped working because of the
deprecated API introduced in v1.7. The error only concerns the renaming of
some macros from NPY_XXX to NPY_ARRAY_XXX. I was thinking to just check for
the Numpy version at build time and add corresponding #define to provide
the necessary renaming in case the build is done with Numpy v1.6.

How can I robustly test for Numpy's version API in C ?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20140228/d4f239a1/attachment.html>

More information about the NumPy-Discussion mailing list