New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows build in MSVC 2015 #37
Comments
Note that Python 2 and 3 have some constraints about which version of MSVC you can use: you should be using the same version that was used to build the Python interpreter itself in general (though there are some relaxing of this rule with introduction of some somewhat stable ABI in Py 3). |
But we should provide support for all version, in case if somebody is building the interpreter using another MSVC version. In this case it's a matter of one #ifdef, I hope :) |
You wrote:
not entirely: you CANNOT build Python extensions on Windows with another MSVC compiler than the one used to compiled the Python interpreter in general. There are very few exceptions and this is fraught with perils: I was able at time to get a few using MinGW but in general you are likely to experience any kind of issues. This is why MSFT kept and offers a trimmed down version of the MSVC 2008 compiler for Python 2.7. |
Thanks for making this clear. However, Nishant works for Microsoft and was successfully compiled the module with MSVC 2015. So, maybe they're doing something with python itself? I will ask. |
If MSFT can do it then indeed this is possible! Could it be they recompiled Python 2.7 with MSVC 2015? But on Python 3, as fas as I know the game is different as there is some ABI now. |
@WojciechMula It would be great if Nishant could chime in here. |
And FWIW, unless you rebuild Python, MSVC 2015 may make sense only for Python3.5 |
I built it for Python 64-bit 3.5 interpreter. It came as part of Anaconda3 from Continuum. The built module has been working fine. |
@nishantsharma that's great. And yes I would have expected the Python 3.5 and MSVC 2015 combo to work just fine. |
@WojciechMula you did already made the changes you mentioned above #37 (comment) , right? |
@pombredanne not yet |
By the way, you might want to use the following in windows.h: typedef unsigned __int8 uint8_t; I just don't like the non-explicit specification of the number of bits. |
@jableckim Thanks, but is it safe? I mean, are these __intXX types always provided by MSVC? |
Well, Microsoft is known for breaking things now and then but ... this
appears to be standard. As of Tuesday, Nov 29, 2016 this page seems to say
that MS uses these in VS2015 as a documented way to be a bit more portable
across platforms.
https://msdn.microsoft.com/en-us/library/29dh1w7z.aspx
Hope that helps.
MJ
…On Tue, Nov 29, 2016 at 10:55 AM, Wojciech Muła ***@***.***> wrote:
@jableckim <https://github.com/jableckim> Thanks, but is it safe? I mean,
are these __intXX types always provided by MSVC?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#37 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AMKa34axNlIY87qLb_BNTyrIy5oaDceVks5rDHUUgaJpZM4JYYf4>
.
|
@jableckim the thing is that not any MSVC compiler can be used with Python in general. Usually the MSVC compiler used to compile Python itself should be used at least on Python 2. I think things have been relaxed a bit the latest Python 3 with the emergence of a proper ABI... but this is just OTH. |
I'm closing this issue, as it's a duplicate of #51 (where a portable solution was proposed). |
Nishant Sharma has reported that following change is required in windows.h
typedef __int32 int32_t
typedef unsinged __int32 uint32_t
in order to build with the latest MSVC. I'll include it in the next release.
The text was updated successfully, but these errors were encountered: