From: Lie Ryan on
On 04/16/10 22:09, Robin Becker wrote:
> On 12/04/2010 21:36, Martin v. Loewis wrote:
> ...........
>>
>> If you are planning to build Python extension modules in the next five
>> years, I recommend that you obtain a copy of VS Express, just in case
>> Microsoft removes it from their servers. As mentioned, it's free of
>> charge. When downloading it for later use, it's probably best to get the
>> offline ISO image release, available from
>>
>> http://www.microsoft.com/express/Downloads/#2008-All
> ...........
>
> Is it sufficient to download just the setup program vcsetup.exe or do
> people need to obtain the offline iso which presumably has the full
> content in it.

As I remember it when installing VS Excpress a few years back, the thin
installer is just a download manager so you should get the full
installer if you want to insure yourself from Microsoft pulling the plug
out.
From: Robert Kern on
On 2010-04-16 07:30 AM, Brian Blais wrote:
> On Apr 12, 2010, at 16:36 , Martin v. Loewis wrote:
>
>> If you are planning to build Python extension modules in the next five
>> years, I recommend that you obtain a copy of VS Express
>
> Am I missing something here? I have heard this before, but I have built
> extension modules many times under windows (using Cython) and never once
> used a MS product. I've just had to change a distutils config file to
> use a different compiler (mingw32, directions here:
> http://docs.cython.org/src/tutorial/appendix.html). It seems to work
> fine. What is the basis of this claim that you need MS Visual Studio to
> do it?

Most extensions will work okay when compiled with mingw32. However, mingw32 is
still based on MSVCRT6.dll as its C runtime. You would get errors whenever a
FILE* pointer crosses over the boundary. distutils will tell it to link with the
CRT that Python is currently built with, but some of the headers aren't up to
date for that CRT, so some C++ extensions will not work (a command C++ operation
triggers a table lookup in a static table defined in the CRT, but it differs in
size between versions).

--
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
that is made terrible by our own mad attempt to interpret it as though it had
an underlying truth."
-- Umberto Eco

From: Martin v. Löwis on
Brian Blais wrote:
> On Apr 12, 2010, at 16:36 , Martin v. Loewis wrote:
>
>> If you are planning to build Python extension modules in the next five
>> years, I recommend that you obtain a copy of VS Express
>
> Am I missing something here? I have heard this before, but I have built
> extension modules many times under windows (using Cython) and never once
> used a MS product.

It's fine if your package supports being compiled with Mingw32. A lot of
source code can't be compiled this way, either because gcc doesn't
support some of the MS extensions (in particular wrt. COM), or because
Mingw32 doesn't provide the header files (in particular wrt. C++), or
because linking with a library is necessary that uses the MSVC mangling,
not the g++ one (again, for C++).

Code written in Cython should work fine with gcc indeed.

> It seems to
> work fine. What is the basis of this claim that you need MS Visual
> Studio to do it?

Just try building Mark Hammond's Win32 extensions or PythonWin with
Mingw32 to see for yourself.

Regards,
Martin

From: Martin v. Loewis on
>> Python 2.6, 2.7, and 3.1 are all built with that release (i.e. 2008).
>> Because of another long tradition, Python extension modules must be
>> built with the same compiler version (more specifically, CRT version) as
>> Python itself. So to build extension modules for any of these releases,
>> you need to have a copy of VS 2008 or VS 2008 Express.
>
> Is it too late for Python 2.7 to update to using Visual Studio 2010?

Most definitely. They have switched *again* the way they distribute the
CRT, so major changes to packaging and distutils would be required.

> It is going to be much easier for people to find and install the current
> version of VS than the previous. There is still more than 2 months left
> before 2.7 is planned to be released.

It took us about two years to accommodate the CRT change. This time, it
will be easier, but nowhere near 2 months. I'm skeptical that the switch
to VS 2010 will be ready for 3.2.

Regards,
Martin
From: TerryP on
I've generally found it wise to grab the ISO images for the express
editions collection, and save it somewhere in cold storage.

Never have needed to compile Python on Windows, but some modules only
support older versions (e.g. 2.4 or 2.5), which is irksome. So it's a
good idea to have stuff setup for building extension modules by hand.