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

Rahul Patel rahpatel at ic.sunysb.edu
Wed Jan 4 20:20:41 EST 2012


So, I added the last two "oldnames" lines to the defsetup.py module, just
as you said Mike. There is a "win32" check for sys so I added that under
there. After it finished, I was able to import pywcs without any errors. I
haven't tested it or anything as I'm still learning all this, but I imagine
a successful import into Ipython indicates that it installed correctly.

-----------------------------------------------------------------
Rahul I. Patel

Rahul.Patel.1 at StonyBrook.edu <Rahul.Patel.1 at stonybrook.edu>
Department of Physics and Astronomy
State University of New York at Stony Brook
-----------------------------------------------------------------



On Tue, Jan 3, 2012 at 2:15 PM, Michael Droettboom <mdroe at stsci.edu> wrote:

> Ok.  I'm in the process of getting a Visual Studio environment set up
> here and will let you know what I discover.
>
> Mike
>
> On 01/03/2012 12:54 PM, Jim Vickroy wrote:
> > On 1/3/2012 10:22 AM, Michael Droettboom wrote:
> >> 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
> > Unfortunately, the same error trace occurs if the above line is
> > removed.  -- jv
> >
> >
> >> 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 at 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 at scipy.org
> >>> http://mail.scipy.org/mailman/listinfo/astropy
> >> _______________________________________________
> >> AstroPy mailing list
> >> AstroPy at scipy.org
> >> http://mail.scipy.org/mailman/listinfo/astropy
> > _______________________________________________
> > AstroPy mailing list
> > AstroPy at scipy.org
> > http://mail.scipy.org/mailman/listinfo/astropy
>
> _______________________________________________
> AstroPy mailing list
> AstroPy at scipy.org
> http://mail.scipy.org/mailman/listinfo/astropy
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/astropy/attachments/20120104/ccb6428e/attachment.html>


More information about the AstroPy mailing list