[C++-sig] num_util question

Charles Leung cleung at eos.ubc.ca
Tue Nov 25 22:04:03 CET 2003


Hi Olivier,

I believe it's actually a requirement from Numeric that to write extension
module in C++ involving NumPy, you must define a PY_ARRAY_UNIQUE_SYMBOL
inorder to use NumPy features in extension module that is implemented
across multiple source files. We just happened to pick the name
PyArrayHandle.  The short answer is...

for every source file that includes <num_util.h> (other than the one where
 the BOOST_PYTHON_MODULE macro is defined), put:

#define PY_ARRAY_UNIQUE_SYMBOL PyArrayHandle
#define NO_IMPORT_ARRAY

for the source file that actually uses the BOOST_PYTHON_MODULE macro, put:

#define PY_ARRAY_UNIQUE_SYMBOL PyArrayHandle

I hope this helps, please let me know if it works out.
Charles

> Hi,
>
> When trying to use the num_util and I have an ImportError :
>
> undefined symbol: PyArrayHandle
>
> Is someone have an idea ?
>
> Thanks.
>
> Olivier Ravard
>
> [image]
> [image]
> [image]
>
> NovaGrid S.A.
>
> olivier.ravard at novagrid.com
> WEB : http://www.novagrid.com
> TEL/FAX : 02 23 23 62 32
> _______________________________________________
> C++-sig mailing list
> C++-sig at python.org
> http://mail.python.org/mailman/listinfo/c++-sig
>





More information about the Cplusplus-sig mailing list