[SciPy-user] problem with weave tutorial

Gary Robinson garyrob@mac....
Tue May 27 14:17:44 CDT 2008


I installed scipy yesterday.

  from scipy import weave
  weave.test()

runs fine.

But when I try to run examples in the weave tutorial (http://projects.scipy.org/scipy/scipy/browser/trunk/scipy/weave/doc/tutorial.txt), I get errors. For instance, the tutorial has the following:

        >>> a = 1
        >>> a = weave.inline("return_val = Py::new_reference_to(Py::Int(a+1));",['a'])
        >>> a
        2

But when I try to run it, I get the following error. Can anyone tell me why? This is on OS X 10.5.2.

<weave: compiling>
/Users/garyrob/.python25_compiled/sc_119f07fd9a656915569734d041f6ace92.cpp: In function ‘PyObject* compiled_func(PyObject*, PyObject*)’:
/Users/garyrob/.python25_compiled/sc_119f07fd9a656915569734d041f6ace92.cpp:663: error: ‘Py’ has not been declared
/Users/garyrob/.python25_compiled/sc_119f07fd9a656915569734d041f6ace92.cpp:663: error: ‘Py’ has not been declared
/Users/garyrob/.python25_compiled/sc_119f07fd9a656915569734d041f6ace92.cpp:663: error: ‘Int’ was not declared in this scope
/Users/garyrob/.python25_compiled/sc_119f07fd9a656915569734d041f6ace92.cpp:663: error: ‘new_reference_to’ was not declared in this scope
/Users/garyrob/.python25_compiled/sc_119f07fd9a656915569734d041f6ace92.cpp: In function ‘PyObject* compiled_func(PyObject*, PyObject*)’:
/Users/garyrob/.python25_compiled/sc_119f07fd9a656915569734d041f6ace92.cpp:663: error: ‘Py’ has not been declared
/Users/garyrob/.python25_compiled/sc_119f07fd9a656915569734d041f6ace92.cpp:663: error: ‘Py’ has not been declared
/Users/garyrob/.python25_compiled/sc_119f07fd9a656915569734d041f6ace92.cpp:663: error: ‘Int’ was not declared in this scope
/Users/garyrob/.python25_compiled/sc_119f07fd9a656915569734d041f6ace92.cpp:663: error: ‘new_reference_to’ was not declared in this scope
lipo: can't figure out the architecture type of: /var/folders/S5/S5m9tMBYH-KuPAoCKwCHQE+++TI/-Tmp-//cc59NLL3.out
/Users/garyrob/.python25_compiled/sc_119f07fd9a656915569734d041f6ace92.cpp: In function ‘PyObject* compiled_func(PyObject*, PyObject*)’:
/Users/garyrob/.python25_compiled/sc_119f07fd9a656915569734d041f6ace92.cpp:663: error: ‘Py’ has not been declared
/Users/garyrob/.python25_compiled/sc_119f07fd9a656915569734d041f6ace92.cpp:663: error: ‘Py’ has not been declared
/Users/garyrob/.python25_compiled/sc_119f07fd9a656915569734d041f6ace92.cpp:663: error: ‘Int’ was not declared in this scope
/Users/garyrob/.python25_compiled/sc_119f07fd9a656915569734d041f6ace92.cpp:663: error: ‘new_reference_to’ was not declared in this scope
/Users/garyrob/.python25_compiled/sc_119f07fd9a656915569734d041f6ace92.cpp: In function ‘PyObject* compiled_func(PyObject*, PyObject*)’:
/Users/garyrob/.python25_compiled/sc_119f07fd9a656915569734d041f6ace92.cpp:663: error: ‘Py’ has not been declared
/Users/garyrob/.python25_compiled/sc_119f07fd9a656915569734d041f6ace92.cpp:663: error: ‘Py’ has not been declared
/Users/garyrob/.python25_compiled/sc_119f07fd9a656915569734d041f6ace92.cpp:663: error: ‘Int’ was not declared in this scope
/Users/garyrob/.python25_compiled/sc_119f07fd9a656915569734d041f6ace92.cpp:663: error: ‘new_reference_to’ was not declared in this scope
lipo: can't figure out the architecture type of: /var/folders/S5/S5m9tMBYH-KuPAoCKwCHQE+++TI/-Tmp-//cc59NLL3.out
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/scipy/weave/inline_tools.py", line 339, in inline
    **kw)
  File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/scipy/weave/inline_tools.py", line 447, in compile_function
    verbose=verbose, **kw)
  File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/scipy/weave/ext_tools.py", line 365, in compile
    verbose = verbose, **kw)
  File "/Library/Frameworks/Python.framework/Versions/2.5/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 "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/numpy/distutils/core.py", line 176, in setup
    return old_setup(**new_attr)
  File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/distutils/core.py", line 168, in setup
    raise SystemExit, "error: " + str(msg)
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

Thanks,
Gary
-- 

Gary Robinson
CTO
Emergent Music, LLC
personal email: garyrob@mac.com
work email: grobinson@emergentmusic.com
Company: http://www.emergentmusic.com
Blog:    http://www.garyrobinson.net


More information about the SciPy-user mailing list