[Numpy-discussion] Is this a bug in numpy.distutils ?

David Cournapeau david at ar.media.kyoto-u.ac.jp
Tue Aug 4 03:54:40 EDT 2009


Dave wrote:
> David Cournapeau <david <at> ar.media.kyoto-u.ac.jp> writes:
>
>   
>> Matthew Brett wrote:
>>     
>>> Hi,
>>>
>>> We are using numpy.distutils, and have run into this odd behavior in windows:
>>>
>>>       
>> Short answer:
>>
>> I am afraid it cannot work as you want. Basically, when you pass an
>> option to build_ext, it does not affect other distutils commands, which
>> are run before build_ext, and need the compiler (config in this case I
>> think). So you need to pass the -c option to every command affected by
>> the compiler (build_ext, build_clib and config IIRC).
>>
>> cheers,
>>
>> David
>>
>>     
>
> I'm having the same problems! Running windows XP, Python 2.5.4 (r254:67916, 
> Dec 23 2008, 15:10:54) [MSC v.1310 32 bit (Intel)].
>
> In my distutils.cfg I've got:
>
> [build]
> compiler=mingw32
>
> [config]
> compiler = mingw32
>
>   

Yes, config files are an alternative I did not mention. I never use them
because I prefer controlling the build on a per package basis, and the
interaction between command line and config files is not always clear.

> python setup.py build build_ext --compiler=mingw32 appeared to work (barring a
> warning: numpy\core\setup_common.py:81: MismatchCAPIWarning) 

The warning is harmless: it is just a reminder that before releasing
numpy 1.4.0, we will need to raise the C API version (to avoid problems
we had in the past with mismatched numpy version). There is no point
updating it during dev time I think.

> but then how do I
> create a .exe installer afterwards? python setup.py bdist_wininst fails with
>  the same error message as before and python setup.py bdist_wininst
> --compiler=mingw32 fails with the message:
> error: option --compiler not recognized
>   

You need to do as follows, if you want to control from the command line:

python setup.py build -c mingw32 bdist_wininst

That's how I build the official binaries .

cheers,

David



More information about the NumPy-Discussion mailing list