[Scipy-tickets] [SciPy] #496: weave not detecting numpy complex scalar (and perhaps other numpy) data types.

SciPy scipy-tickets@scipy....
Tue Dec 30 15:24:16 CST 2008


#496: weave not detecting numpy complex scalar (and perhaps other numpy) data
types.
-------------------------+--------------------------------------------------
 Reporter:  eric         |        Owner:  eric 
     Type:  defect       |       Status:  new  
 Priority:  normal       |    Milestone:  0.7.0
Component:  scipy.weave  |      Version:       
 Severity:  normal       |   Resolution:       
 Keywords:               |  
-------------------------+--------------------------------------------------
Comment (by jguyer):

 I don't know whether it's related or not, but I'm getting weave failures
 for non-complex numpy scalars, too:
 {{{
 #!python

 In [1]: import numpy

 In [2]: from scipy import weave

 In [3]: # this works

 In [4]: a = float(4.)

 In [5]: weave.inline("""-a;""", ['a'])

 In [6]: # this doesn't

 In [7]: b = numpy.float64(4.)

 In [8]: weave.inline("""-b;""", ['b'])
 <weave: compiling>
 /Users/guyer/.python25_compiled/sc_10b0723c9885e560f2d43325cd25f1e53.cpp:
 In function ‘PyObject* compiled_func(PyObject*, PyObject*)’:
 /Users/guyer/.python25_compiled/sc_10b0723c9885e560f2d43325cd25f1e53.cpp:663:
 error: ambiguous overload for ‘operator-’ in ‘-b’
 /Users/guyer/.python25_compiled/sc_10b0723c9885e560f2d43325cd25f1e53.cpp:663:
 note: candidates are: operator-(int) <built-in>
 /Users/guyer/.python25_compiled/sc_10b0723c9885e560f2d43325cd25f1e53.cpp:663:
 note:                 operator-(float) <built-in>
 /Users/guyer/.python25_compiled/sc_10b0723c9885e560f2d43325cd25f1e53.cpp:663:
 note:                 operator-(double) <built-in>
 /Users/guyer/.python25_compiled/sc_10b0723c9885e560f2d43325cd25f1e53.cpp:
 In function ‘PyObject* compiled_func(PyObject*, PyObject*)’:
 /Users/guyer/.python25_compiled/sc_10b0723c9885e560f2d43325cd25f1e53.cpp:663:
 error: ambiguous overload for ‘operator-’ in ‘-b’
 /Users/guyer/.python25_compiled/sc_10b0723c9885e560f2d43325cd25f1e53.cpp:663:
 note: candidates are: operator-(int) <built-in>
 /Users/guyer/.python25_compiled/sc_10b0723c9885e560f2d43325cd25f1e53.cpp:663:
 note:                 operator-(float) <built-in>
 /Users/guyer/.python25_compiled/sc_10b0723c9885e560f2d43325cd25f1e53.cpp:663:
 note:                 operator-(double) <built-in>
 lipo: can't figure out the architecture type of:
 /var/folders/kF/kF4nCVfY2RWCI++1YoH0LU+++TM/-Tmp-//ccrSB4mt.out
 /Users/guyer/.python25_compiled/sc_10b0723c9885e560f2d43325cd25f1e53.cpp:
 In function ‘PyObject* compiled_func(PyObject*, PyObject*)’:
 /Users/guyer/.python25_compiled/sc_10b0723c9885e560f2d43325cd25f1e53.cpp:663:
 error: ambiguous overload for ‘operator-’ in ‘-b’
 /Users/guyer/.python25_compiled/sc_10b0723c9885e560f2d43325cd25f1e53.cpp:663:
 note: candidates are: operator-(int) <built-in>
 /Users/guyer/.python25_compiled/sc_10b0723c9885e560f2d43325cd25f1e53.cpp:663:
 note:                 operator-(float) <built-in>
 /Users/guyer/.python25_compiled/sc_10b0723c9885e560f2d43325cd25f1e53.cpp:663:
 note:                 operator-(double) <built-in>
 /Users/guyer/.python25_compiled/sc_10b0723c9885e560f2d43325cd25f1e53.cpp:
 In function ‘PyObject* compiled_func(PyObject*, PyObject*)’:
 /Users/guyer/.python25_compiled/sc_10b0723c9885e560f2d43325cd25f1e53.cpp:663:
 error: ambiguous overload for ‘operator-’ in ‘-b’
 /Users/guyer/.python25_compiled/sc_10b0723c9885e560f2d43325cd25f1e53.cpp:663:
 note: candidates are: operator-(int) <built-in>
 /Users/guyer/.python25_compiled/sc_10b0723c9885e560f2d43325cd25f1e53.cpp:663:
 note:                 operator-(float) <built-in>
 /Users/guyer/.python25_compiled/sc_10b0723c9885e560f2d43325cd25f1e53.cpp:663:
 note:                 operator-(double) <built-in>
 lipo: can't figure out the architecture type of:
 /var/folders/kF/kF4nCVfY2RWCI++1YoH0LU+++TM/-Tmp-//ccrSB4mt.out
 ---------------------------------------------------------------------------
 CompileError                              Traceback (most recent call
 last)

 /Users/guyer/Documents/research/FiPy/trunkClean/<ipython console> in
 <module>()

 /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-
 packages/scipy/weave/inline_tools.pyc in inline(code, arg_names,
 local_dict, global_dict, force, compiler, verbose, support_code, headers,
 customize, type_converters, auto_downcast, newarr_converter, **kw)
     331                                     type_converters =
 type_converters,
     332                                     auto_downcast = auto_downcast,
 --> 333                                     **kw)
     334
     335             function_catalog.add_function(code,func,module_dir)

 /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-
 packages/scipy/weave/inline_tools.pyc in compile_function(code, arg_names,
 local_dict, global_dict, module_dir, compiler, verbose, support_code,
 headers, customize, type_converters, auto_downcast, **kw)
     457     # setting.  All input keywords are passed through to distutils
     458     mod.compile(location=storage_dir,compiler=compiler,
 --> 459                 verbose=verbose, **kw)
     460
     461     # import the module and return the function.  Make sure

 /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-
 packages/scipy/weave/ext_tools.pyc in compile(self, location, compiler,
 verbose, **kw)
     363         success = build_tools.build_extension(file, temp_dir =
 temp,
     364                                               compiler_name =
 compiler,
 --> 365                                               verbose = verbose,
 **kw)
     366         if not success:
     367             raise SystemError, 'Compilation failed'

 /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-
 packages/scipy/weave/build_tools.pyc in build_extension(module_path,
 compiler_name, build_dir, temp_dir, verbose, **kw)
     269         environ = copy.deepcopy(os.environ)
     270         try:
 --> 271             setup(name = module_name, ext_modules =
 [ext],verbose=verb)
     272         finally:
     273             # restore state

 /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-
 packages/numpy/distutils/core.pyc in setup(**attr)
     182     new_attr['distclass'] = NumpyDistribution
     183
 --> 184     return old_setup(**new_attr)
     185
     186 def _check_append_library(libraries, item):

 /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/distutils/core.pyc
 in setup(**attrs)
     166                 raise
     167             else:
 --> 168                 raise SystemExit, "error: " + str(msg)
     169
     170     return dist

 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/guyer/.python25_compiled/sc_10b0723c9885e560f2d43325cd25f1e53.cpp
 -o
 /var/folders/kF/kF4nCVfY2RWCI++1YoH0LU+++TM/-Tmp-/guyer/python25_intermediate/compiler_0ce8a1fa01e8914c0a4825c7c67de6c6/Users/guyer/.python25_compiled/sc_10b0723c9885e560f2d43325cd25f1e53.o"
 failed with exit status 1
 }}}

-- 
Ticket URL: <http://www.scipy.org/scipy/scipy/ticket/496#comment:3>
SciPy <http://www.scipy.org/>
SciPy is open-source software for mathematics, science, and engineering.


More information about the Scipy-tickets mailing list