[Numpy-discussion] build outside C code with scons within numpy distutils

David Cournapeau cournapeau@cslab.kecl.ntt.co...
Sun May 25 19:38:36 CDT 2008

On Sun, 2008-05-25 at 11:25 -0400, Zachary Pincus wrote:

> Specifically, I have a package that uses numpy and numpy.distutils to  
> built itself. Unfortunately, there are some pure-C libraries that I  
> call using ctypes, and as these libraries are are not python  
> extensions, it is hard to get distutils to build them happily on all  
> platforms.

You can take a look at the examples in numscons sources

In the setup.py, you call config.add_sconscript('SConstruct')

And in the scons script, you do:

from numscons import GetNumpyEnvironment
env = GetNumpyEnvironment(ARGUMENTS)

env.NumpyCtypes('foo', source = ['foo.c'])

Note that although this has not changed since it existed, I do not
guarantee API stability at this point.



More information about the Numpy-discussion mailing list