[AstroPy] pywcs 1.10-4.7 install failure on Microsoft Windows

Michael Droettboom mdroe@stsci....
Tue Jan 3 09:30:06 CST 2012


On 01/03/2012 09:21 AM, Jim Vickroy wrote:
> On 1/3/2012 6:33 AM, Michael Droettboom wrote:
>> My apologies that this isn't working for you -- I don't have access to
>> Visual Studio 9.0 to test with, so these sorts of things can fall
>> through the cracks.
>>
>> Mark is right that the old solution involved patching wcslib before
>> shipping it with pywcs.
>>
>> However, as of version 1.10 (which you are using), the solution was to add:
>>
>>       #define wcsset wcsset_
>>
>> on Windows.  This works with the mingw32/cygwin compiler, but apparently
>> failing on the Microsoft compiler.
>>
>> There is an even newer solution in pywcs SVN which defines the following
>> on Windows.  This I believe to work on the Microsoft compilers based on
>> the report of another user:
>>
>> if sys.platform == 'win32':
>>        define_macros.append(('YY_NO_UNISTD_H', None))
>>        define_macros.append(('_CRT_SECURE_NO_WARNINGS', None))
>>        define_macros.append(('_NO_OLDNAMES', None)) # for mingw32
>>        define_macros.append(('NO_OLDNAMES', None)) # for mingw64
>>
>> You can either splice this into your current copy of setup.py, or build
>> from SVN.  Note that building from SVN currently requires having parts
>> of stsci_python installed (notable stsci.tools.stsci_distutils_hack).
>>
>> Mike
> Thanks, Mike.
>
> Could you elaborate on the above patch?  Do I need to import something
> other than sys?  Where is define_macros defined?
Of course -- first day back and I'm whipping through e-mail too quickly ;)

This goes in defsetup.py -- there is already an "if sys.platform == 
'win32'" clause -- you would just need to add the "OLDNAMES" lines to it.

Mike


More information about the AstroPy mailing list