<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Ok. I've made a new pywcs release with these changes (among many
others). You may want to update to it if possible.<br>
<br>
Mike<br>
<br>
On 01/04/2012 08:20 PM, Rahul Patel wrote:
<blockquote
cite="mid:CAMe0V1Z5E=cLHS8y9_ZtmQZ2FhR-ezKg4i++yOh3jJYMkr0P7g@mail.gmail.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
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. <br clear="all">
<br>
-----------------------------------------------------------------<br>
<font size="4"><span style="font-family:times new roman,serif">Rahul
I. Patel</span></font><br>
<br>
<a moz-do-not-send="true"
href="mailto:Rahul.Patel.1@stonybrook.edu" target="_blank">Rahul.Patel.1@StonyBrook.edu</a><br>
Department of Physics and Astronomy<br>
State University of New York at Stony Brook<br>
-----------------------------------------------------------------
<div
style="padding:0px;margin-left:0px;margin-top:0px;overflow:hidden;word-wrap:break-word;color:black;font-size:10px;text-align:left;line-height:130%"></div>
<br>
<br>
<br>
<div class="gmail_quote">On Tue, Jan 3, 2012 at 2:15 PM, Michael
Droettboom <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:mdroe@stsci.edu">mdroe@stsci.edu</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
Ok. I'm in the process of getting a Visual Studio environment
set up<br>
here and will let you know what I discover.<br>
<br>
Mike<br>
<div class="HOEnZb">
<div class="h5"><br>
On 01/03/2012 12:54 PM, Jim Vickroy wrote:<br>
> On 1/3/2012 10:22 AM, Michael Droettboom wrote:<br>
>> Hmm... Do you have any luck if you remove this
from defsetup.py?<br>
>><br>
>> if sys.platform in ('win32', 'cygwin'):<br>
>> h_file.write("""<br>
>> #define wcsset wcsset_<br>
>> """)<br>
>><br>
>> Mike<br>
> Unfortunately, the same error trace occurs if the
above line is<br>
> removed. -- jv<br>
><br>
><br>
>> On 01/03/2012 11:32 AM, Jim Vickroy wrote:<br>
>>> On 1/3/2012 8:30 AM, Michael Droettboom
wrote:<br>
>>>> On 01/03/2012 09:21 AM, Jim Vickroy
wrote:<br>
>>>>> On 1/3/2012 6:33 AM, Michael
Droettboom wrote:<br>
>>>>>> My apologies that this isn't
working for you -- I don't have access to<br>
>>>>>> Visual Studio 9.0 to test with,
so these sorts of things can fall<br>
>>>>>> through the cracks.<br>
>>>>>><br>
>>>>>> Mark is right that the old
solution involved patching wcslib before<br>
>>>>>> shipping it with pywcs.<br>
>>>>>><br>
>>>>>> However, as of version 1.10
(which you are using), the solution was to add:<br>
>>>>>><br>
>>>>>> #define wcsset wcsset_<br>
>>>>>><br>
>>>>>> on Windows. This works with the
mingw32/cygwin compiler, but apparently<br>
>>>>>> failing on the Microsoft
compiler.<br>
>>>>>><br>
>>>>>> There is an even newer solution
in pywcs SVN which defines the following<br>
>>>>>> on Windows. This I believe to
work on the Microsoft compilers based on<br>
>>>>>> the report of another user:<br>
>>>>>><br>
>>>>>> if sys.platform == 'win32':<br>
>>>>>>
define_macros.append(('YY_NO_UNISTD_H', None))<br>
>>>>>>
define_macros.append(('_CRT_SECURE_NO_WARNINGS', None))<br>
>>>>>>
define_macros.append(('_NO_OLDNAMES', None)) # for
mingw32<br>
>>>>>>
define_macros.append(('NO_OLDNAMES', None)) # for mingw64<br>
>>>>>><br>
>>>>>> You can either splice this into
your current copy of setup.py, or build<br>
>>>>>> from SVN. Note that building
from SVN currently requires having parts<br>
>>>>>> of stsci_python installed
(notable stsci.tools.stsci_distutils_hack).<br>
>>>>>><br>
>>>>>> Mike<br>
>>>>> Thanks, Mike.<br>
>>>>><br>
>>>>> Could you elaborate on the above
patch? Do I need to import something<br>
>>>>> other than sys? Where is
define_macros defined?<br>
>>>> Of course -- first day back and I'm
whipping through e-mail too quickly ;)<br>
>>>><br>
>>>> This goes in defsetup.py -- there is
already an "if sys.platform ==<br>
>>>> 'win32'" clause -- you would just need to
add the "OLDNAMES" lines to it.<br>
>>>><br>
>>>> Mike<br>
>>>>
_______________________________________________<br>
>>>> AstroPy mailing list<br>
>>>> <a moz-do-not-send="true"
href="mailto:AstroPy@scipy.org">AstroPy@scipy.org</a><br>
>>>> <a moz-do-not-send="true"
href="http://mail.scipy.org/mailman/listinfo/astropy"
target="_blank">http://mail.scipy.org/mailman/listinfo/astropy</a><br>
>>> I added the OLDNAMES lines as above and here
is the result:<br>
>>><br>
>>> C:\Projects\pywcs-1.10-4.7>setup.py
install<br>
>>> running install<br>
>>> running build<br>
>>> running build_py<br>
>>> copying lib\svn_version.py ->
build\lib.win32-2.6\pywcs<br>
>>> running build_ext<br>
>>> building 'pywcs._pywcs' extension<br>
>>> c:\Program Files\Microsoft Visual Studio
9.0\VC\BIN\cl.exe /c /nologo<br>
>>> /Ox /MD /W3 /GS- /DNDEBUG -DECHO
-DWCSTRIG_MACRO -DPYWCS_BUILD<br>
>>> -D_GNU_SOURCE -DNDEBUG -DYY_NO_UNISTD_H
-D_CRT_SECURE_NO_WARNINGS<br>
>>> -D_NO_OLDNAMES -DNO_OLDNAMES -U<br>
>>> DEBUG
-IC:\Python26\lib\site-packages\numpy\core\include
-I.\wcslib\C<br>
>>> -Iwcslib\C -I.\src -IC:\Python26\include
-IC:\Python26\PC<br>
>>> /Tcwcslib\C\flexed/wcsbth.c<br>
>>>
/Fobuild\temp.win32-2.6\Release\wcslib\C\flexed/wcsbth.obj<br>
>>> wcsbth.c<br>
>>> .\wcslib\C\wcs.h(1396) : warning C4030: first
formal parameter list<br>
>>> longer than the second list<br>
>>> .\wcslib\C\wcs.h(1396) : warning C4028:
formal parameter 1 different<br>
>>> from declaration<br>
>>> .\wcslib\C\wcs.h(1396) : error C2040:
'wcsset' : 'int (wcsprm *)'<br>
>>> differs in levels of indirection from 'int
(wcsprm *)'<br>
>>> error: command '"c:\Program Files\Microsoft
Visual Studio<br>
>>> 9.0\VC\BIN\cl.exe"' failed with exit status 2<br>
>>><br>
>>> C:\Projects\pywcs-1.10-4.7><br>
>>><br>
>>><br>
>>><br>
>>>
_______________________________________________<br>
>>> AstroPy mailing list<br>
>>> <a moz-do-not-send="true"
href="mailto:AstroPy@scipy.org">AstroPy@scipy.org</a><br>
>>> <a moz-do-not-send="true"
href="http://mail.scipy.org/mailman/listinfo/astropy"
target="_blank">http://mail.scipy.org/mailman/listinfo/astropy</a><br>
>> _______________________________________________<br>
>> AstroPy mailing list<br>
>> <a moz-do-not-send="true"
href="mailto:AstroPy@scipy.org">AstroPy@scipy.org</a><br>
>> <a moz-do-not-send="true"
href="http://mail.scipy.org/mailman/listinfo/astropy"
target="_blank">http://mail.scipy.org/mailman/listinfo/astropy</a><br>
> _______________________________________________<br>
> AstroPy mailing list<br>
> <a moz-do-not-send="true"
href="mailto:AstroPy@scipy.org">AstroPy@scipy.org</a><br>
> <a moz-do-not-send="true"
href="http://mail.scipy.org/mailman/listinfo/astropy"
target="_blank">http://mail.scipy.org/mailman/listinfo/astropy</a><br>
<br>
_______________________________________________<br>
AstroPy mailing list<br>
<a moz-do-not-send="true" href="mailto:AstroPy@scipy.org">AstroPy@scipy.org</a><br>
<a moz-do-not-send="true"
href="http://mail.scipy.org/mailman/listinfo/astropy"
target="_blank">http://mail.scipy.org/mailman/listinfo/astropy</a><br>
</div>
</div>
</blockquote>
</div>
<br>
</blockquote>
<br>
</body>
</html>