[SciPy-dev] newscipy segfaults fixed!
oliphant at ee.byu.edu
Tue Oct 18 18:25:37 CDT 2005
Pearu Peterson wrote:
>On Tue, 18 Oct 2005, Travis Oliphant wrote:
>>Pearu Peterson wrote:
>>>The segfaults in newcore hava now a fix in SVN. Currently scipy.test()
>>>gives more than 200 errors, but they should go away as soon as newscipy
>>>packages have been ported to newcore.
>>Did you find a fix for the PyArray_FromDims problem? I have not had
>>time to track this down, but can later.
>Yes, it turns out that if a source file like fortranobject.c uses newcore,
>some function must call import_array() to set PyArray_API. I did that by
>introducing init_fortranobject() function that only calls import_array()
>and the extension module calls init_fortranobject() from the module init
>function. This was not needed in Numeric.
That's because Numeric had PyArray_API not static, as you pointed out.
>Hmm, may be PyArray_API should not be defined as static. Is there a reason
>that PyArray_API must be defined static?
I'm not sure. There may be a better way to do this. Using static
PyArray_API is the way the Python manual suggests.
However, it does mean you can't have a "library" source file that gets
called from an extension module.
I guess that's what fortranobject.c is doing?
I'm not against changing it.
More information about the Scipy-dev