[Numpy-discussion] static pointer

Peter Verveer Peter.Verveer at embl-heidelberg.de
Thu May 3 04:32:44 EDT 2001


On Wednesday 02 May 2001 19:39, Konrad Hinsen wrote:
> > If I understand correctly, the addition of the static keyword means that
> > the import_array() function can now only be used by extensions that are
> > defined in a single C source file. I can easily work around this problem,
> > by
>
> True. That's exactly what I pointed out in a previous message in this
> list.
>
> > defining my own api pointer, and using a modified import_array() in my
> > code,
>
> That seems to me the preferred solution.

But this will still fail on OSX, I guess.

> > built ok, and we were formerly not following the instructions in the
> > Python documentation and now we are. And, OS-X now worked. So far so
> > good. If I
>
> And those instructions mention the static keyword for a good reason:
> without it there are problems not only with portability, but also with
> static linking of extension modules.
>
> > Is there a way of institutionalizing your work-around so that others can
> > use it?
>
> I thought about providing a general solution right in the header
> files. The problem is the generation of a unique symbol by
> preprocessor tricks, perhaps somehow based on the module name.
> I don't see how this can be done.
>
> On the other hand, if we accept that the extension module programmer
> has to supply a unique symbol, then it is even easy. This would only
> be necessary for multi-file extension modules. Does that seem like a
> good solution?

That sounds very good. I don't mind providing a symbol name for the pointer 
myself.

> > Wait. I have an idea. Konrad was the one who put all this in. He should
> > be punished for his good deed...(:->
>
> I am even thinking of punishing myself by imposing extra work on me! ;-)
>
> Konrad.

-- 
Dr. Peter J. Verveer
Bastiaens Group
Cell Biology and Cell Biophysics Programme
EMBL
Meyerhofstrasse 1
D-69117 Heidelberg
Germany
Tel. : +49 6221 387245
Fax  : +49 6221 387242
Email: Peter.Verveer at embl-heidelberg.de





More information about the NumPy-Discussion mailing list