[Numpy-discussion] static void** libnumarray_API

Mathieu Gontier mathieu.gontier at fft.be
Thu Jul 15 06:29:04 EDT 2004


Hello, 

I am developping FEM bendings from a C++ code to Python with Numarray.
So, I have the following problem.

In the distribution file 'libnumarray.h', the variable 'libnumarray_API' is 
defined as a static variable (because of the symbol NO_IMPORT is not 
defined).

Then, I understand that all the examples are implemented in a unique file.

But, in my project, I must edit header files and source files in order to 
solve other problems (like cycle includes). So, I have two different source 
files which use numarray :
	- the file containing the 'init' function which call the function 
'import_libnumarray()' (which initialize 'libnumarray_API')
	- a file containing implementations, more precisely an implementation calling 
numarray functionnalities: with is 'static' state, this 'libnumarray_API' is 
NULL...

I tried to compile NumArray with the symbol 'NO_IMPORT' (see libnumarray.h) in 
order to have an extern variable. But this symbol doesn't allow to import 
numarray in the python environment.

So, does someone have a solution allowing to use NumArray API with 
header/source files ? 

Thanks, 
Mathieu Gontier




More information about the NumPy-Discussion mailing list