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

Michael Droettboom mdroe@stsci....
Tue Jan 3 11:22:39 CST 2012


Hmm...  Do you have any luck if you remove this from defsetup.py?

if sys.platform in ('win32', 'cygwin'):
     h_file.write("""
#define wcsset wcsset_
""")

Mike

On 01/03/2012 11:32 AM, Jim Vickroy wrote:
> On 1/3/2012 8:30 AM, Michael Droettboom wrote:
>> 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
>> _______________________________________________
>> AstroPy mailing list
>> AstroPy@scipy.org
>> http://mail.scipy.org/mailman/listinfo/astropy
> I added the OLDNAMES lines as above and here is the result:
>
> C:\Projects\pywcs-1.10-4.7>setup.py install
> running install
> running build
> running build_py
> copying lib\svn_version.py ->  build\lib.win32-2.6\pywcs
> running build_ext
> building 'pywcs._pywcs' extension
> c:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo
> /Ox /MD /W3 /GS- /DNDEBUG -DECHO -DWCSTRIG_MACRO -DPYWCS_BUILD
> -D_GNU_SOURCE -DNDEBUG -DYY_NO_UNISTD_H -D_CRT_SECURE_NO_WARNINGS
> -D_NO_OLDNAMES -DNO_OLDNAMES -U
> DEBUG -IC:\Python26\lib\site-packages\numpy\core\include -I.\wcslib\C
> -Iwcslib\C -I.\src -IC:\Python26\include -IC:\Python26\PC
> /Tcwcslib\C\flexed/wcsbth.c
> /Fobuild\temp.win32-2.6\Release\wcslib\C\flexed/wcsbth.obj
> wcsbth.c
> .\wcslib\C\wcs.h(1396) : warning C4030: first formal parameter list
> longer than the second list
> .\wcslib\C\wcs.h(1396) : warning C4028: formal parameter 1 different
> from declaration
> .\wcslib\C\wcs.h(1396) : error C2040: 'wcsset' : 'int (wcsprm *)'
> differs in levels of indirection from 'int (wcsprm *)'
> error: command '"c:\Program Files\Microsoft Visual Studio
> 9.0\VC\BIN\cl.exe"' failed with exit status 2
>
> C:\Projects\pywcs-1.10-4.7>
>
>
>
> _______________________________________________
> AstroPy mailing list
> AstroPy@scipy.org
> http://mail.scipy.org/mailman/listinfo/astropy



More information about the AstroPy mailing list