[Numpy-discussion] Numeric on OS X - Anyone get it to work ?

Konrad Hinsen hinsen at cnrs-orleans.fr
Wed Apr 18 08:55:15 EDT 2001

> All I did was insert a

That works only if all symbols are globally visible, which is not true
on most platforms.

Does anyone know how shared libraries work in detail under MacOS X?
Many systems allow the main executable (Python in our case) to choose
what symbols are globally visible. Making changes at this level looks
like the best solution to me, if possible.

A simple solution would be to change line 262 in Numeric/arrayobject.h from

    void **PyArray_API;


    static void **PyArray_API;

This would break all client modules that consist of more than one
source code file and make array-related calls in more than the main
file. We have no such modules in the current NumPy, but there might of
course be third-party modules out there that are affected.

Another solution would be to add 

   #define PyArray_API PyArray_API_umath

in module umath just before including arrayobject.h, and add similar
lines to other client modules. But this would require a modification
to all client modules, including third-party modules, to make them
work under MacOS.

Konrad Hinsen                            | E-Mail: hinsen at cnrs-orleans.fr
Centre de Biophysique Moleculaire (CNRS) | Tel.: +33-
Rue Charles Sadron                       | Fax:  +33-
45071 Orleans Cedex 2                    | Deutsch/Esperanto/English/
France                                   | Nederlands/Francais

More information about the NumPy-Discussion mailing list