[Numpy-discussion] Towards using scons in numpy: 1st step

David Cournapeau cournape@gmail....
Thu Dec 20 19:04:06 CST 2007

On Dec 20, 2007 10:29 AM, Travis E. Oliphant <oliphant@enthought.com> wrote:
> David Cournapeau wrote:
> > Hi,
> >
> > as discussed with some other numpy developers, in particular Travis, I
> > started to prepare my work related to scons for step-by-step merging
> > into the trunk. The first step is done, and is in cleanconfig_rtm
> > branch (rtm for ready to merge).
> >
> > This branch basically:
> >  - avoid introducing new SIZEOF_* like symbols, which are usually used
> > by autotools. Python itself defines some of those, but should not.
> >  - avoid #ifdef/#endif in config.h files: normally, configuration
> > headers should only contains define. This also makes their generation
> > more straightforward, and more compatible with standard build tools
> > (autotools/scons). This is the main goal of the branch
> >
> How did you get around using #ifdef etc?  This concerns me to just
> change it, unless I'm convinced there is no problem.
I don't get around them, I just do not use them inside generated
files. For example, NPY_ALLOW_THREADS is defined in ndarrayobject.h,
now, depending on some values defined in the config headers. Having
#ifdef inside generated files is a bit against the spirit of config
headers, and it makes also more complicated to generate them through
standard tools (neither scons nor autoheader supports this, for

But this is definitely a change which should be reviewed by someone,
because it can break things if done wrong. I tried to be as careful as
possible, but since there are several generators stages involved for
config.h, it is always difficult to be 100 % sure that I have not done
any mistake.


More information about the Numpy-discussion mailing list