[Numpy-discussion] New SVN (>1939) requires a rebuild of extension modules

Andrew Straw strawman at astraw.com
Wed Jan 18 20:04:03 CST 2006


Travis Oliphant wrote:

>
> Just in case you missed the note in the middle of another message.
>
> The SVN version of NumPy has a few new C-API calls and requires a 
> rebuild of extension modules.  If you get mysterious segfaults all of 
> a sudden, you haven't recompiled...
>
> -Travis
>

Hi Travis,

I have an idea that might prevent people from accidentally getting 
mysterious errors due to mixing extensions compiled against different 
versions of numpy. Basically, the idea is that a version number is 
changed every time the C API changes. This version number is stored in 
each extension module at compile time, and at run time, each module init 
function that calls import_array() will trigger a test against the 
version number of the numpy core.

I've implemented my idea in the included patch, and, as far as I can 
tell, it actually works. This is based on using the NDARRAY_VERSION 
define in arrayobject.h, which I'm completely unsure if this is a 
suitable use for. Furthermore, there's a lot going on that I don't 
understand in this part of the numpy code. Thus, I consider my patch 
only a proof of concept and hope you (or someone) will take this idea, 
perhaps the patch, and run with it. I hope this prevents many headaches 
in the future...

What do you think?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: API_version.patch
Type: text/x-patch
Size: 3071 bytes
Desc: not available
Url : http://projects.scipy.org/pipermail/numpy-discussion/attachments/20060118/e5dc26bf/attachment.bin 


More information about the Numpy-discussion mailing list