[SciPy-user] weave inline compile error

Michael ODonnell odonnems@yahoo....
Wed Nov 28 13:47:00 CST 2007

I have been trying to use scipy.weave.inline on Windows XP via cygwin. Ultimately, I need to use weave.inline for compiling c++ code nested in python program. However, I have been extremely unsuccessful at getting this to work. I recently posted some errors on this site, which are subject under "weave and compiler install help". Basically, I have not been able to find out anything else, but let me summarize:

First, I am using these versions, but note I have tried to use the most recent stable release of python enthought:
I created a distutils.cfg file specifying 

wxPython2.8-win32-unicode-  and wxPython2.8-win32-docs-demos-
As well as a couple other packages
cygwin: setup.exe (current)
mingw-install-20060210.tar (MSYS) and MinGW-5.1.3.exe (I read online that these do not work with 2.4.1 so I am focusing with cygwin)

An example of weave that I am trying to get to work is:
a = 1
weave.inline('printf("%d\\n",a);',['a'], verbose=2, type_converters=converters.blitz, compiler='gcc') #I have tried numerous versions of this

The error seems to be in the code written in the numpy\distutils\exec_command.py:
s,o = exec_command(cmd)

The best I can tell, is that the code is trying to execute the above command wich is failing to write output to s,o.  These  variables are then written to files, which cannot be read. The program jumps around between exec_command and _exec_command. I don't know python well enough to know what is causing the error. It appears to me that the code is being compiled, but this one line is not working. I also tried running the script written by exec_command.py directly (commented out the os.remove() in exec_command.py, but this did not work. It did help me identify that the problem is with s and o variables.

Does anyone have any thoughts on what I should try to do. I appreciate any suggestions and ideas one can provide.


Here is an example of my errors:
running build_ext
running build_src
building extension "sc_552cccf5dbf4f6eadd273cdcbd5860525" sources
customize Mingw32CCompiler
customize Mingw32CCompiler using build_ext
customize Mingw32CCompiler
customize Mingw32CCompiler using build_ext
building 'sc_552cccf5dbf4f6eadd273cdcbd5860525' extension
compiling C++ sources
C compiler: g++ -mno-cygwin -O2 -Wall

compile options: '-IC:\Python24\lib\site-packages\scipy\weave -IC:\Python24\lib\site-packages\scipy\weave\scxx -IC:\Python24\lib\site-packages\numpy\core\include -IC:\Python24\include -IC:\Python24\PC -c'
g++ -mno-cygwin -O2 -Wall -IC:\Python24\lib\site-packages\scipy\weave -IC:\Python24\lib\site-packages\scipy\weave\scxx -IC:\Python24\lib\site-packages\numpy\core\include -IC:\Python24\include -IC:\Python24\PC -c c:\temp\Michael\python24_compiled\sc_552cccf5dbf4f6eadd273cdcbd5860525.cpp -o c:\temp\Michael\python24_intermediate\compiler_c8350d870e6c54e8f29dd7094c2bfb45\Release\temp\michael\python24_compiled\sc_552cccf5dbf4f6eadd273cdcbd5860525.o
Traceback (most recent call last):
  File "C:\Python24\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript
    exec codeObject in __main__.__dict__
  File "C:\Documents and Settings\Michael\Application Data\ESRI\ArcToolbox\scripts\test_weave.py", line 251, in ?
  File "C:\Documents and Settings\Michael\Application Data\ESRI\ArcToolbox\scripts\test_weave.py", line 205, in main
    weave.inline('printf("%d\\n",a);',['a'], verbose=2, type_converters=converters.blitz)  #, compiler = 'gcc', verbpse=2, type_converters=converters.blitz, auto_downcast=0) #'msvc' or 'gcc' or 'mingw32'
  File "C:\Python24\Lib\site-packages\scipy\weave\inline_tools.py", line 338, in inline
    auto_downcast = auto_downcast,
  File "C:\Python24\Lib\site-packages\scipy\weave\inline_tools.py", line 447, in compile_function
    verbose=verbose, **kw)
  File "C:\Python24\Lib\site-packages\scipy\weave\ext_tools.py", line 365, in compile
    verbose = verbose, **kw)
  File "C:\Python24\Lib\site-packages\scipy\weave\build_tools.py", line 269, in build_extension
    setup(name = module_name, ext_modules = [ext],verbose=verb)
  File "C:\Python24\Lib\site-packages\numpy\distutils\core.py", line 176, in setup
    return old_setup(**new_attr)
  File "C:\Python24\lib\distutils\core.py", line 159, in setup
    raise SystemExit, error
CompileError: error: c:\temp\tmpgnzrbr\buunmb.txt: No such file or directory

Be a better pen pal. 
Text or chat with friends inside Yahoo! Mail. See how.  http://overview.mail.yahoo.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/scipy-user/attachments/20071128/d4243ba8/attachment.html 

More information about the SciPy-user mailing list