kujira70 / pythonxy

Automatically exported from code.google.com/p/pythonxy
0 stars 0 forks source link

weave support in pythonxy #108

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I downloaded pythonxy 2.1.14 to my windows xp box.
I have already tried quite a few things, to resolve this problem
therefore quite a few frameworks are installed on the xp machine.
I have installed the .net 1.1 framework, the .net 1.1 redistributable
package, the .net 1.1 sdk ( in the hope that this might provide the visual
studio 2003 7.1 compiler that pythonxy asks me to use if I want to build
extensions). I also installed the visual studio 2010 beta thing from
windows. I did not install visual studio 2008 express as several posts on
the internet seem to indicate that the compiler provided by this version is
not compatible with the one that pythonxy wants me to have, though I am not
sure.
Reproduction of the problem:
Write a program:
import scipy.weave
code = """printf ("hello\n");"""
COMPILER="mingw32"
COMPILER="msvc"
scipy.weave.inline(code,verbose=2,compiler=COMPILER)

where COMPILER is either mingw32 or msvc

I do not succeed in compiling with either.
As you can see from the errror outputs below, I do not seem to have
understood the msvc compiler. The program doesn't even find the
msvccompiler even though I have plenty of them lying around, with all my
sdks and .net and visual studio 2020 things installed.
The mingw32 error is more obscure, I don't understand the problem.
I attach the error messages that appear when repeating the compiler command
that throws the error in a file.

Ultimately, I would like port scipy/numpy/c++/pyqt extensions which run 
perfectly on linux to windows. I have also problems using swig which I will
report in another post.
Any help is appreciated.

my distutils.cfg file is the following:
[build]
compiler=mingw32
[build_ext]
compiler=mingw32

when compiling with msvc, the result is:

CompileError: error: Command "g++ -mno-cygwin -O2 -Wall
-IC:\Python25\Lib\site-packages\scipy\weave
-IC:\Python25\Lib\site-packages\scipy\weave\scxx -Inumpy\core\include
-IC:\Python25\include -IC:\Python25\PC -c
c:\dokume~1\bnbn\lokale~1\temp\bnbn\python25_compiled\sc_de9b1454707e3398f3ca6c3
c4448b7bd19.cpp
-o
c:\dokume~1\bnbn\lokale~1\temp\bnbn\python25_intermediate\compiler_08edc7e348e1c
33f63a33ab500aef08e\Release\dokume~1\bnbn\lokale~1\temp\bnbn\python25_compiled\s
c_de9b1454707e3398f3ca6c3c4448b7bd19.o"
failed with exit status 1execfile(r'c:\bnbn\.pydee\.temp.py')
<weave: compiling>
No module named msvccompiler in numpy.distutils; trying from distutils
running build_ext
running build_src
building extension "sc_de9b1454707e3398f3ca6c3c4448b7bd20" sources
No module named msvccompiler in numpy.distutils; trying from distutils
customize MSVCCompiler
customize MSVCCompiler using build_ext
No module named msvccompiler in numpy.distutils; trying from distutils
customize MSVCCompiler
Missing compiler_cxx fix for MSVCCompiler
customize MSVCCompiler using build_ext
building 'sc_de9b1454707e3398f3ca6c3c4448b7bd20' extension
compiling C sources
Traceback (most recent call last):
  File "c:\bnbn\.pydee\.temp.py", line 12, in <module>
    scipy.weave.inline(code,verbose=2,compiler="msvc")
  File "scipy\weave\inline_tools.py", line 335, in inline
    **kw)
  File "scipy\weave\inline_tools.py", line 462, in compile_function
    verbose=verbose, **kw)
  File "scipy\weave\ext_tools.py", line 365, in compile
    verbose = verbose, **kw)
  File "scipy\weave\build_tools.py", line 272, in build_extension
    setup(name = module_name, ext_modules = [ext],verbose=verb)
  File "numpy\distutils\core.py", line 184, in setup
    return old_setup(**new_attr)
  File "C:\Python25\lib\distutils\core.py", line 168, in setup
    raise SystemExit, "error: " + str(msg)
CompileError: error: Python was built with Visual Studio version 7.1, and
extensions need to be built with the same version of the compiler, but it
isn't installed.

when compiling with mingw32, the result is:

<weave: compiling>
running build_ext
running build_src
building extension "sc_de9b1454707e3398f3ca6c3c4448b7bd21" sources
customize Mingw32CCompiler
customize Mingw32CCompiler using build_ext
customize Mingw32CCompiler
customize Mingw32CCompiler using build_ext
building 'sc_de9b1454707e3398f3ca6c3c4448b7bd21' extension
compiling C++ sources
C compiler: g++ -mno-cygwin -O2 -Wall

compile options: '-IC:\Python25\Lib\site-packages\scipy\weave
-IC:\Python25\Lib\site-packages\scipy\weave\scxx -Inumpy\core\include
-IC:\Python25\include -IC:\Python25\PC -c'
g++ -mno-cygwin -O2 -Wall -IC:\Python25\Lib\site-packages\scipy\weave
-IC:\Python25\Lib\site-packages\scipy\weave\scxx -Inumpy\core\include
-IC:\Python25\include -IC:\Python25\PC -c
c:\dokume~1\bnbn\lokale~1\temp\bnbn\python25_compiled\sc_de9b1454707e3398f3ca6c3
c4448b7bd21.cpp
-o
c:\dokume~1\bnbn\lokale~1\temp\bnbn\python25_intermediate\compiler_08edc7e348e1c
33f63a33ab500aef08e\Release\dokume~1\bnbn\lokale~1\temp\bnbn\python25_compiled\s
c_de9b1454707e3398f3ca6c3c4448b7bd21.o
c:\dokume~1\bnbn\lokale~1\temp\bnbn\python25_compiled\sc_de9b1454707e3398f3ca6c3
c4448b7bd21.cpp:
In function `PyObject* compiled_func(PyObject*, PyObject*)':
c:\dokume~1\bnbn\lokale~1\temp\bnbn\python25_compiled\sc_de9b1454707e3398f3ca6c3
c4448b7bd21.cpp:660:
error: missing terminating " character
c:\dokume~1\bnbn\lokale~1\temp\bnbn\python25_compiled\sc_de9b1454707e3398f3ca6c3
c4448b7bd21.cpp:661:
error: missing terminating " character
c:\dokume~1\bnbn\lokale~1\temp\bnbn\python25_compiled\sc_de9b1454707e3398f3ca6c3
c4448b7bd21.cpp:663:
error: expected primary-expression before '}' token
c:\dokume~1\bnbn\lokale~1\temp\bnbn\python25_compiled\sc_de9b1454707e3398f3ca6c3
c4448b7bd21.cpp:663:
error: expected `;' before '}' token
Traceback (most recent call last):
  File "c:\bnbn\.pydee\.temp.py", line 12, in <module>
    scipy.weave.inline(code,verbose=2,compiler="mingw32")
  File "scipy\weave\inline_tools.py", line 335, in inline
    **kw)
  File "scipy\weave\inline_tools.py", line 462, in compile_function
    verbose=verbose, **kw)
  File "scipy\weave\ext_tools.py", line 365, in compile
    verbose = verbose, **kw)
  File "scipy\weave\build_tools.py", line 272, in build_extension
    setup(name = module_name, ext_modules = [ext],verbose=verb)
  File "numpy\distutils\core.py", line 184, in setup
    return old_setup(**new_attr)
  File "C:\Python25\lib\distutils\core.py", line 168, in setup
    raise SystemExit, "error: " + str(msg)
CompileError: error: Command "g++ -mno-cygwin -O2 -Wall
-IC:\Python25\Lib\site-packages\scipy\weave
-IC:\Python25\Lib\site-packages\scipy\weave\scxx -Inumpy\core\include
-IC:\Python25\include -IC:\Python25\PC -c
c:\dokume~1\bnbn\lokale~1\temp\bnbn\python25_compiled\sc_de9b1454707e3398f3ca6c3
c4448b7bd21.cpp
-o
c:\dokume~1\bnbn\lokale~1\temp\bnbn\python25_intermediate\compiler_08edc7e348e1c
33f63a33ab500aef08e\Release\dokume~1\bnbn\lokale~1\temp\bnbn\python25_compiled\s
c_de9b1454707e3398f3ca6c3c4448b7bd21.o"
failed with exit status 1

Original issue reported on code.google.com by bjrnfrd...@gmail.com on 25 Jul 2009 at 7:06

Attachments:

GoogleCodeExporter commented 9 years ago
I comment my own post.
There is a typo : 
"visual studio 2020 things"
should be 
"visual studio 2010 things"
I also ran
distutils.ccompiler.show_compilers()
and it did show msvc as a compiler.
Although I am not sure what that means, as it also showed 
intel and intele which are certainly not installed.

Original comment by bjrnfrd...@gmail.com on 25 Jul 2009 at 7:19

GoogleCodeExporter commented 9 years ago
There was an error in your code.
For example, with the following code, it works:
code = 'printf("hello");'

Original comment by pierre.raybaut on 29 Mar 2010 at 3:04