[Numpy-discussion] Detecting Numeric.

Konrad Hinsen hinsen at cnrs-orleans.fr
Wed Dec 11 02:38:04 EST 2002

Andrea Riciputi <ariciputi at pito.com> writes:

> How can I detect at compile time if Numeric is installed or not?? I've
> thought something like:
> #include "Numeric/arrayobject.h"
> #endif

Supposing that you will use distutils for compilation and installation
of your extension module, the solution is easy: your distutils script
can test for Numeric and then add the compiler flag. For example:

   defines = []
       import Numeric
   except ImportError:


   Extension("foo", ["foo.c"], define_macros = defines)

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