[SciPy-dev] Windows build, possible problem with scipy_distutils MinGW support

Pearu Peterson pearu at scipy.org
Mon Jan 12 07:47:11 CST 2004



On Mon, 12 Jan 2004, Brett G. Olivier wrote:

> I have been trying to build scipy on win2k (Python 2.3, scipy cvs ver.
> '0.2.1_252.4501') using MinGW. One problem in the build process is a
> strange call to a program "g" when building the cluster module (the other
> is a problem building the specfun library), a possible solution can be
> found by making a change in scipy_distutils: mingw32_support.py
> 
> As far as the cluster build problem is concerned: compiling scipy with
> "python setup.py build --compiler=mingw32"
> 
> results in the following error:
> 
> "g -shared build\temp.win32-2.3\Release\lib\cluster\src\vq_wrap.o
> -Lc:\python23\libs -Lc:\python23\PCBuild -Lbuild\temp.win32-2.3 -lpython23
> -lrootfind -lc_misc-lcephes -o build\lib.win32-2.3\scipy\cluster\_vq.pyd
> error: command 'g' failed: No such file or directory"
> 
> I have tracked down the probable source of this problem in
> mingw32_support.py:
> 
> Line 96: self.compiler_cxx = 'g++'
> 
> If I understand it correctly MinGW uses python distutils UnixCCompiler
> which in unixccompiler.py has:
> 
> Line 174: if target_lang == "c++" and self.compiler_cxx:
> Line 175:     linker[0] = self.compiler_cxx[0]
> 
> I think this is the source of the phantom "g" call. In mingw32_support.py
> altering Line 96:
> 
> Line 96: self.compiler_cxx = 'g++'
> Line 96: self.compiler_cxx = ['g++']
> 
> seems to sort this problem out.
> 
> I'm not at all sure if this is a proper solution to this problem or not, 
> any comments or questions are more than welcome.

Thanks for tracking this down. I have applied your patch to CVS.
It shouldn't affect pre 2.3 Python versions as their distutils
are not using compiler_cxx.

Thanks,
Pearu



More information about the Scipy-dev mailing list