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

Michael Droettboom mdroe at stsci.edu
Tue Jan 3 08:33:14 EST 2012

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).


On 12/28/2011 01:36 PM, Mark Sienkiewicz wrote:
> On 12/25/11 16:25, Tim Jenness wrote:
>> On Sun, Dec 25, 2011 at 6:29 AM, Rahul Patel<rahpatel at ic.sunysb.edu>   wrote:
>>> Ya.... I'm not really comfortable with commenting or changing that out.I
>>> really wish there were some way for this to work.
>> The real fix is for pywcs to be modified so that it does not use a
>> fucntion called wcsset() otherwise this clash is going to continue.
> The problem is actually in the C code for wcslib, the library that pywcs is based on.  wcslib defines a function named wcsset (see pywcs/wcslib/C/wcs.c).  I seem to remember Mike Droettboom telling me that he has to patch wcslib every time he incorporates a new version into pywcs.
> If you are in a hurry to make pywcs work, I can suggest either a hack around the problem (as has been discussed) or use an earlier version of pywcs from before the integration of wcslib-4.8 began.
> I seem to remember that the pywcs that was include in STSCI_PYTHON 2.12 compiled on Windows.  You can download source code for stsci_python from http://www.stsci.edu/resources/software_hardware/stsci_python/current/download and then install only the pywcs package instead of the entire distribution.  Just "cd pywcs ; python setup.py install".
> If it is not urgent, Mike can probably give you a more satisfactory solution when he comes back from the holidays.
> Mark S.
> _______________________________________________
> AstroPy mailing list
> AstroPy at scipy.org
> http://mail.scipy.org/mailman/listinfo/astropy

More information about the AstroPy mailing list