[SciPy-user] extra_compile_args in weave

Prabhu Ramachandran prabhu at aero.iitm.ernet.in
Mon Feb 9 00:06:53 CST 2004


>>>>> "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"])
		
All the options available can be seen here:

 http://www.scipy.org/site_content/weave/tutorial.html

in the Keyword options section.

I'm not sure your os.putenv statements are going to be of any use.
IIRC these changes do not propagate to your shell.

cheers,
prabhu



More information about the SciPy-user mailing list