|
From: Andrew S. <str...@as...> - 2006-01-19 04:03:23
|
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? |