[SciPy-user] problem with weave tutorial

Hoyt Koepke hoytak@gmail....
Tue May 27 15:01:31 CDT 2008


There's a couple things wrong here, and I think this is from an old
version that is completely wrong now.

First, the correct namespace is py, not Py.  Second, I think a lot of
the type conversion is handled automatically with py::object, i.e. the
following works:

a = weave.inline("return_val = py::object(a+1);",['a'])

however, return_val is a py::object already, so

a = weave.inline("return_val = a+1;", ['a'])

also works.  My general experience with weave is that you hardly ever
need to explicitly work with py:: stuff unless you're doing stuff with
lists, dicts, tuples, etc.  It's almost never needed for ints and
simple types.  I don't know why this isn't in the tutorial; it seems
that's pretty out of date.

Perhaps a more efficient way to learn weave is simply to look at the
examples in the scipy/weave/examples directory.  There are quite a few
there and they all work. :-)

--Hoyt





On Tue, May 27, 2008 at 12:41 PM, James Phillips <zunzun@zunzun.com> wrote:
> At the very bottom of the long, long list of errors and warnings is:
>
> scipy.weave.build_tools
>>
>> .CompileError: error: Command "g++ -arch ppc -arch i386 -isysroot
>> /Developer/SDKs/MacOSX10.4u.sdk -fno-strict-aliasing -Wno-long-double
>> -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -O3
>> -I/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/scipy/weave
>> -I/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/scipy/weave/scxx
>> -I/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/numpy/core/include
>> -I/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -c
>> /Users/garyrob/.python25_compiled/sc_119f07fd9a656915569734d041f6ace92.cpp
>> -o
>> /var/folders/S5/S5m9tMBYH-KuPAoCKwCHQE+++TI/-Tmp-/garyrob/python25_intermediate/compiler_0ce8a1fa01e8914c0a4825c7c67de6c6/Users/garyrob/.python25_compiled/sc_119f07fd9a656915569734d041f6ace92.o"
>> failed with exit status 1
>
> You can try from a command prompt or user shell the actual command to the
> compiler from that error message:
>
> g++ -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u
>>
>> .sdk -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd
>> -fno-common -dynamic -DNDEBUG -g -O3
>> -I/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/scipy/weave
>> -I/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/scipy/weave/scxx
>> -I/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/numpy/core/include
>> -I/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -c
>> /Users/garyrob/.python25_compiled/sc_119f07fd9a656915569734d041f6ace92.cpp
>> -o
>> /var/folders/S5/S5m9tMBYH-KuPAoCKwCHQE+++TI/-Tmp-/garyrob/python25_intermediate/compiler_0ce8a1fa01e8914c0a4825c7c67de6c6/Users/garyrob/.python25_compiled/sc_119f07fd9a656915569734d041f6ace92.o
>
> and see what the compiler tells you.
>
>      James Phillips
>      http://zunzun.com
>
>
> 2008/5/27 Gary Robinson <garyrob@mac.com>:
>>
>> I installed scipy yesterday...
>
> _______________________________________________
> SciPy-user mailing list
> SciPy-user@scipy.org
> http://projects.scipy.org/mailman/listinfo/scipy-user
>
>



-- 
+++++++++++++++++++++++++++++++++++
Hoyt Koepke
UBC Department of Computer Science
http://www.cs.ubc.ca/~hoytak/
hoytak@gmail.com
+++++++++++++++++++++++++++++++++++


More information about the SciPy-user mailing list