Python 2.4 and Visual C++ Express

S

Steve Menard

I will soon have to write start providing Python extensions, in binary
form, for python 2.4, and I have a few questions.

I have Visual C++ 6 installed, which works great for python 2.3.

I do not have access to Visual C++ 2003, which seems to be the compiler
to be used with Python 2.4. Unless I am mistaken, the free command-line
compiler is not a solution, as it cannot produce binaries that
dynamically link the C runtime.

I have downloaded the Visual C++ 2004 "express" from the Microsoft.site.

Now my question is, will I be able to compile Python 2.4 extension if I
use the Visual C++ 2004? And since I will be distributing the extension
for both Python 2.3 and 2.4, will distutil choose the right compiler ?

Before some people mention MingW and Cygnus, I know and use them.
However, for redistributing I feel it safer to use the Microsoft compilers.

Thanks for any help,

Steve
 
M

Mike C. Fletcher

Steve Menard wrote:
....
I do not have access to Visual C++ 2003, which seems to be the
compiler to be used with Python 2.4. Unless I am mistaken, the free
command-line compiler is not a solution, as it cannot produce binaries
that dynamically link the C runtime.

....

See here:
http://www.vrplumber.com/programming/mstoolkit/

for details on how to use the free Toolkit compiler for building 2.4
extensions.

Have fun,
Mike

________________________________________________
Mike C. Fletcher
Designer, VR Plumber, Coder
http://www.vrplumber.com
http://blog.vrplumber.com
 
J

Jive

Are you saying that Python 2.4 will not compile under MS VC++ 6.0? That's
horrifying. Say it isn't so!!! I have just ported Python to an embedded
system using VC++ 6.0. It will always be compiled using 6.0, for two
reasons: 1) I cannot afford the manhours for changing compilers, and 2) Bill
Gates has enough money already, alright? I would hate to think that I am
now stuck at Python 2.3 for eternity.
 
S

Steve Menard

Jive said:
Are you saying that Python 2.4 will not compile under MS VC++ 6.0? That's
horrifying. Say it isn't so!!! I have just ported Python to an embedded
system using VC++ 6.0. It will always be compiled using 6.0, for two
reasons: 1) I cannot afford the manhours for changing compilers, and 2) Bill
Gates has enough money already, alright? I would hate to think that I am
now stuck at Python 2.3 for eternity.

That is not what I am saying. The "what's new in Python" claims python
2.4 will
compile with both versions 6 and 7.1 of Microsoft's compiler.

However, the standard download, that most users will have, will be
compiled using the 7.1. And so any binary packages to be installed on a
2.4 dist will also have to be compiled with 7.1.


Steve
 
J

Jive

Steve Menard said:
That is not what I am saying. The "what's new in Python" claims python
2.4 will
compile with both versions 6 and 7.1 of Microsoft's compiler.

However, the standard download, that most users will have, will be
compiled using the 7.1. And so any binary packages to be installed on a
2.4 dist will also have to be compiled with 7.1.


Steve

Do you mean if I install 2.4, I will have to find VC++ 7.1 versions of all
the extensions
I may be using? If so, that's still borderline horrible, but I guess
Microsoft is the culprit. Annow
for something completely the same.

Will 7.1 extensions work with a Python.exe compiled under 6.0?

In any case, I think it would be a Good Thing if the Pythonistas provided a
download of 2.4
compiled under VC++ 6.0, in addition to the 7.1 one.

I don't suppose it will do any good to rant about Microsoft. I believe it's
been done.
 
M

Mike C. Fletcher

Jive said:
....

Do you mean if I install 2.4, I will have to find VC++ 7.1 versions of all
the extensions
I may be using? If so, that's still borderline horrible, but I guess
Microsoft is the culprit. Annow
for something completely the same.
It has almost always been the case that you must download new extensions
for a new major version of Python. The difference now is that library
developers can use the Free (as-in-beer) MSToolkit compiler to build
7.1-compatible extensions, instead of needing to purchase MSVC++ 6.0.

It's not a particularly elegant process (lots of downloads and a few
setup steps), but IMO it's a *good* thing to finally have no-cost option
for providing extensions on Windows.

That said, I'm not sure this will help you with your embedded platform.
Don't know if the Toolkit compiler will work with whatever Win32
platform runs there, but for general desktops moving to MSVC 7.1 seems
to be a win. However, the Toolkit doesn't come with the ability AFAIK
to build MSVC++ project files, so there will be some pain as developers
become accustomed to exporting makefiles or the equivalent from the
project files to support the Toolkit. Still, marching in the right
direction...

Just MHO,
Mike

________________________________________________
Mike C. Fletcher
Designer, VR Plumber, Coder
http://www.vrplumber.com
http://blog.vrplumber.com
 
S

Steve Menard

Jive said:
Do you mean if I install 2.4, I will have to find VC++ 7.1 versions of all
the extensions
I may be using? If so, that's still borderline horrible, but I guess
Microsoft is the culprit. Annow
for something completely the same.

Will 7.1 extensions work with a Python.exe compiled under 6.0?

In any case, I think it would be a Good Thing if the Pythonistas provided a
download of 2.4
compiled under VC++ 6.0, in addition to the 7.1 one.

I don't suppose it will do any good to rant about Microsoft. I believe it's
been done.

We can rant all we want, but let's be realistic : Version 6.0 is
ancient! It is the version I was using at work almost 8 years ago!

Would you hold that python on Linux should compile with an 8 year old
version of GCC? At one point, a break must happen ...

At least there seems a way to use MS's free 7.1 toolkit to compile,
something that was'nt possible with version 6.

Lastly, about existing extensions. Extension are python version
specific. An extension compiled for python 2.3 will NOT work with python
2.4, no matter what. My guess is that soon after the release of Python
2.4, maintainers of existing packages will distribute them in 2.3 and
2.4 forms. My hope is that distuil will be intelligent enough to chose
the right compiler when both will be present. I am one of those
maintainers, and I do not want to have to jump through hoops to get my
modules to compile ...


Steve
 
P

Paul Moore

Mike C. Fletcher said:
It has almost always been the case that you must download new extensions
for a new major version of Python. The difference now is that library
developers can use the Free (as-in-beer) MSToolkit compiler to build
7.1-compatible extensions, instead of needing to purchase MSVC++ 6.0.

One thing that does nag at me (and I've had no joy getting answers
from the mod_python list so far) is whether a 2.4-compatible version
of mod_python will be possible.

Python 2.4 will be built with the MSVC 7.1 compiler/CRT, but (AFAIK)
Apache is still distributed in binaries built with the MSVC6
compiler/CRT. So it's not clear to me which CRT mod_python should be
built against...

Hoping-it's-all-going-to-just-work-ly y'rs
Paul.
 
T

Tim Peters

[Jive]
....
In any case, I think it would be a Good Thing if the Pythonistas
provided a download of 2.4 compiled under VC++ 6.0, in addition to
the 7.1 one.

That requires someone who cares enough to volunteer the work, or to
fund the work (presuming someone exists who could be convinced to do
the work for pay). For various reasons I, and later Raymond
Hettinger, cared enough to keep the MSVC 6 project files working with
Python 2.4, but nobody voluntered to produce a Windows installer for
2.4 based on MSVC 6. There's no policy against that, but Pythons
don't grow on trees.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,175
Latest member
Vinay Kumar_ Nevatia
Top