[Numpy-discussion] libnumarray.h and NO_IMPORT_ARRAY
jmiller at stsci.edu
Tue Oct 8 07:59:04 EDT 2002
Philip Austin wrote:
>We're currently porting several of our boost-wrapped Numeric classes
>to numarray. The routines are spread across several cpp files, and
>**libnumarray_API is needed in each file. In Numeric, we invoke
>import_array() in the module file, to initialize **PyArray_API, and
>def NO_IMPORT_ARRAY in the other files; this produces
>extern void **PyArray_API in those files, and everyone's happy.
>Currently libnumarray.h doesn't implement this -- is there
>another way to compile a multiple file project which
>initializes the API just once?
>Thanks, Phil Austin
>This sf.net email is sponsored by:ThinkGeek
>Welcome to geek heaven.
>Numpy-discussion mailing list
>Numpy-discussion at lists.sourceforge.net
Someone else asked for this recently, and the solution is half-way
implemented in CVS now. I'll finish it this morning so that it works
the way you're used to, but the next "official" numarray release is
still a ways off. So, if you still want to port now, here are the caveats:
1. Numarray CVS was working as of Friday on Windows, Linux, Solaris,
2. Use the "Numeric compatible" portion of the C-API. This API is a
subset of the Numeric API which may cause you trouble. Let me know if
it does. Don't use the "native" NDInfo based APIs because they're
headed for deprecation.
3. The version you'll be working with has not yet been widely used and
may have significant bugs I don't know about. It does pass all its unit
tests on all our platforms.
Todd Miller jmiller at stsci.edu
STSCI / SSB
More information about the NumPy-Discussion