On Wed, Jan 27, 2010 at 8:00 PM, Tarek Ziadé <[email protected]> wrote: > On Wed, Jan 27, 2010 at 11:06 AM, David Cournapeau <[email protected]> wrote: > [..] >> I avoid CCompiler functions like the plague in numpy.distutils extensions, >> because their behavior is very platform specific, especially between >> MS compiler and Unix ones, where the attributes are not the same). > > I am not an expert at all in compiling C/C++ for Python, but it seems > that using 'define_macros' works for what was asked.
It does work, but I believe that's kludgy once you have more than a few macros (it cluttered the output, you may end up having too long command lines, etc...). It is also useful to have one config.h which is then included in a myconfig.h which customize some macro depending on config.h, for example to bypass automatic configuration for some special cases. > > So how do you do it in numpy.distutils and why/how is it better or simpler? We just extend the config command with our own functions - nothing particular, mostly duct tape to deal with correct initialization of our own extensions (fortran, etc...). The biggest issue is the different context I have mentioned: you can only configure things in the config command context, which means it cannot affect the setup arguments. Though I guess that's only a problem for big projects. David _______________________________________________ Distutils-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/distutils-sig
