[Distutils] Re: [4suite] Re: Compiling 4Suite 0.10.2beta on Windows

Martin v. Loewis martin@loewis.home.cs.tu-berlin.de
Sat Feb 17 19:23:02 2001


> I tried running bdist_wininst on my linux box, and this failed,
> because "distribution contains extensions and/or C libraries; must
> be compiled on a Windows 32 platform".

This is expected. Distutils *could* look for a cross-compiler, but it
currently doesn't, and likely you don't have one, either.

> So I switched to a Win32 box, and ran bdist_wininst, and it failed
> too because I could non find CL.EXE. What is CL.EXE? I suppose it is
> a compiler, so it is probably the MS compiler from Visual
> Studio. Can anyone confirm this?

That is correct. If you have MSVC installed, it did ask you whether
you wanted to register the path for its binaries. If you did that,
distutils should find cl (which is the compiler proper, I believe)
right away. If you didn't, you'll have to invoke vcvars32.bat first
(or is it vc32vars?).

> Is it possible to use mingw's gcc or cygwin's to build python
> extensions on windows?

I'm not certain what the answer to that question is. Using cygwin is
definitely a bad idea; if anything, mingw is the right approach.

I think Python 2.0 supports building with cygwin. Building extensions
involves a number of issues:

1. I'm not sure whether GNU ld supports MSVC import libraries. That
   may also depend on the MSVC version that was used to create the
   import libraries, and the version of GNU ld that you have. Looking
   at distutils.cygwincompiler, it appears that you have to build your
   own import library first, or that you have to build Python with gcc.

   It would probably be good if some volunteer could provide a mingw
   import library of python20.dll, and if python 2.1 could provide
   such an import library as a battery.

2. I'm not sure whether you can talk distutils into using mingw.  In
   theory, passing --compiler=mingw32 to the build command should work;
   see setup.py build --help-compiler for details.

Regards,
Martin

P.S. Since you originally wanted to know how 4Suite is build: most
likely using MSVC 6, since that is what everybody else uses.