[SciPy-user] weave problem on ubuntu 8.10

Bobby H. Braswell rob.braswell@unh....
Mon Nov 17 09:18:40 CST 2008


Hi-

By coincidence I am trying to get weave working on a new system, I had
previously been using it successfully under OS X with the Fink version
of SciPy. I don't want to distract from Soren's question but when I try
his simple example (or any of my own) using converters.blitz, I get a
very long error message, actually mostly warnings, but it ends like
this:

>>> ravg = weave.inline(code, ['xlen', 'ylen', 'test'],
type_converters=converters.blitz, compiler = 'gcc')
...hundreds of lines...
Traceback (most recent call last):
  File "<stdin>", line 2, in <module>
  File "/usr/lib/python2.5/site-packages/scipy/weave/inline_tools.py",
line 339, in inline
    **kw)
  File "/usr/lib/python2.5/site-packages/scipy/weave/inline_tools.py",
line 447, in compile_function
    verbose=verbose, **kw)
  File "/usr/lib/python2.5/site-packages/scipy/weave/ext_tools.py", line
365, in compile
    verbose = verbose, **kw)
  File "/usr/lib/python2.5/site-packages/scipy/weave/build_tools.py",
line 269, in build_extension
    setup(name = module_name, ext_modules = [ext],verbose=verb)
  File "/usr/lib/python2.5/site-packages/numpy/distutils/core.py", line
184, in setup
    return old_setup(**new_attr)
  File "/usr/lib/python2.5/distutils/core.py", line 168, in setup
    raise SystemExit, "error: " + str(msg)
scipy.weave.build_tools.CompileError: error: Command "g++ -pthread
-fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -fPIC
-I/usr/lib/python2.5/site-packages/scipy/weave
-I/usr/lib/python2.5/site-packages/scipy/weave/scxx
-I/usr/lib/python2.5/site-packages/scipy/weave/blitz
-I/usr/lib/python2.5/site-packages/numpy/core/include
-I/usr/include/python2.5
-c /home/braswell/.python25_compiled/sc_f8b4f30889557b51310ac43eda9472b30.cpp -o /tmp/braswell/python25_intermediate/compiler_a9bbef2f14d61f7aa8f0ba6e068e18c2/home/braswell/.python25_compiled/sc_f8b4f30889557b51310ac43eda9472b30.o" failed with exit status 1

Sorry if this is more of a compiler/Ubuntu problem, I'm not sure about
that. I'd be grateful to hear from someone who has had or not had
problems with Weave on Ubuntu 8.10.

Thanks very much,
Rob

On Mon, 2008-11-17 at 15:40 +0100, Søren Nielsen wrote:

> Can anyone explain why this fails? This piece of code runs perfectly
> using weave.inline and type_converters = blitz..
> 
> Obviously it can't handle 2D arrays anymore. It's just a stupid
> example to illustrate that. 
> 
> Thanks,
> Soren
> 
> CODE :
> ------------------------------------------------------------------------------------------------
> mod = ext_tools.ext_module('ravg_ext')
> 
> test = zeros((5,5))
> xlen = 5
> ylen = 5
>     
> code = """
>          int x, y;
> 
>          for( x = 0; x < xlen; x++)
>          {
>                 for( y = 0; y < ylen; y++)
>                 {
>                     test(x,y) = 2;
>                 }
>          }
> 
>         """
>  
> ravg = ext_tools.ext_function('ravg', code, ['xlen', 'ylen',
> 'test'])    
> mod.add_function(ravg)
> mod.compile(compiler = 'gcc')
> 
> RESULT:
> ------------------------------------------------------------------------------------------------
> C:\Temp\ravg_ext.cpp: In function `PyObject* ravg(PyObject*,
> PyObject*, PyObject*)':
> C:\Temp\ravg_ext.cpp:654: error: `test' cannot be used as a function
> C:\Temp\ravg_ext.cpp:641: warning: unused variable 'Ntest'
> C:\Temp\ravg_ext.cpp:642: warning: unused variable 'Stest'
> C:\Temp\ravg_ext.cpp:643: warning: unused variable 'Dtest'
> 
> Traceback (most recent call last):
>   File "C:\Temp\ravg_extension.py", line 132, in ?
>     build_ravg_extension()
>   File "C:\Temp\ravg_extension.py", line 125, in build_ravg_extension
>     mod.compile(compiler = 'gcc')
>   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
> 184, in setup
>     return old_setup(**new_attr)
>   File "C:\Python24\Lib\distutils\core.py", line 166, in setup
>     raise SystemExit, "error: " + str(msg)
> CompileError: error: Command "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\ravg_ext.cpp -o c:
> \docume~1\ssn\locals~1\temp\ssn\python24_intermediate
> \compiler_894ad5ed761bb51736c6d2b7872dc212\Releas
> 
> _______________________________________________
> SciPy-user mailing list
> SciPy-user@scipy.org
> http://projects.scipy.org/mailman/listinfo/scipy-user
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/scipy-user/attachments/20081117/a509e8f3/attachment.html 


More information about the SciPy-user mailing list