[SciPy-user] extra_compile_args in weave

Christopher Fonnesbeck chris at fonnesbeck.org
Sun Feb 8 13:50:18 CST 2004


On Feb 8, 2004, at 1:36 PM, Prabhu Ramachandran wrote:

>>>>>> "CF" == Christopher Fonnesbeck <chris at fonnesbeck.org> writes:
>
>     CF> I am trying to write a GRASS GIS module (ANSI C) using
>     CF> weave.inline, so that I can interface my python simulation
>     CF> code with a GIS to get spatial information. As such, I need
>     CF> some GRASS header files. However, I am having trouble setting
>     CF> the GRASS include directory for weave. Here is a very simple
>     CF> example that simply initializes the GIS:
>
> Try something like this:
>
> def test(foo):
> 	code = """
> 	G_gisinit(argv[0]);
> 	
> 	return foo;	
> 	"""
> 	
> 	weave.inline(code, ['foo'],
>                      include_dirs=["/usr/local/grass57/include"],
>                      headers=["gis.h", "stdio.h", "string.h",  
> "math.h"])
> 		

Thanks for the correction. However, I still get a similar error message:

Traceback (most recent call last):
   File "grasstest.py", line 19, in ?
     test(3)
   File "grasstest.py", line 15, in test
     headers=["gis.h", "stdio.h", "string.h", "math.h"])
   File  
"/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ 
python2.3/site-packages/weave/inline_tools.py", line 335, in inline
     auto_downcast = auto_downcast,
   File  
"/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ 
python2.3/site-packages/weave/inline_tools.py", line 421, in  
compile_function
     type_converters = type_converters)
   File  
"/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ 
python2.3/site-packages/weave/ext_tools.py", line 176, in __init__
     auto_downcast, type_converters)
   File  
"/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ 
python2.3/site-packages/weave/ext_tools.py", line 391, in  
assign_variable_types
     errors[var] = ("The type and dimensionality specifications" +
TypeError: cannot concatenate 'str' and 'int' objects

I  am using a recent CVS build of scipy (i.e. since weave was  
integrated into the scipy code base).

C.
--
Christopher J. Fonnesbeck ( c h r i s @ f o n n e s b e c k . o r g )
Georgia Cooperative Fish & Wildlife Research Unit, University of Georgia



More information about the SciPy-user mailing list