From: Konrad H. <hi...@cn...> - 2002-12-11 10:37:23
|
Andrea Riciputi <ari...@pi...> writes: > How can I detect at compile time if Numeric is installed or not?? I've > thought something like: > > #ifdef NUMERIC_IS_HERE > #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 = [] try: import Numeric defines.append('NUMERIC_IS_HERE') except ImportError: pass ... Extension("foo", ["foo.c"], define_macros = defines) Konrad. -- ------------------------------------------------------------------------------- Konrad Hinsen | E-Mail: hi...@cn... Centre de Biophysique Moleculaire (CNRS) | Tel.: +33-2.38.25.56.24 Rue Charles Sadron | Fax: +33-2.38.63.15.17 45071 Orleans Cedex 2 | Deutsch/Esperanto/English/ France | Nederlands/Francais ------------------------------------------------------------------------------- |