[SciPy-user] Compiler problem with Weave

Robert Kern rkern at ucsd.edu
Sun Aug 21 06:49:44 CDT 2005


Ganesh V wrote:

>   "x=empty(25)" worked, but Weave DID NOT. The same problems again. I
>   found that even "inline" doesn't work. It works for ordinary printf
>   statements and other small stuff fine. But not for Numeric arrays
>   that I used. The error of inline also looked similar to the error
>   that I got with "weave.blitz". Is it a problem with the conversion
>   of datatype that is being passed in?
>   
>   On the Website it was put up that weave has been tested only with
>   gcc 2.95. Mine is gcc4. Can that be a problem?

Probably. gcc 4.0 fails to compile quite a lot of C++ code that gcc 3.x
accepts. With the latest CVS of scipy, Python 2.4.1, gcc 3.3 on OS X:

In [1]: a = arange(25)

In [2]: x = empty(25)

In [3]: expr = "x = a*2"

In [4]: weave.blitz(expr)
<weave: compiling>

In [5]: x
Out[5]:
array([ 0,  2,  4,  6,  8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30,
32, 34, 36,
            38, 40, 42, 44, 46, 48])

-- 
Robert Kern
rkern at ucsd.edu

"In the fields of hell where the grass grows high
 Are the graves of dreams allowed to die."
  -- Richard Harter



More information about the SciPy-user mailing list