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

2008-05-25 Thread Zachary Pincus
Thanks for the tips! This is very helpful.


>> 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
> (sources/tests/ctypesext).
>
> 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.
>
> cheers,
>
> David
>
> ___
> Numpy-discussion mailing list
> Numpy-discussion@scipy.org
> http://projects.scipy.org/mailman/listinfo/numpy-discussion

___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion


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

2008-05-25 Thread David Cournapeau
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
(sources/tests/ctypesext).

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.

cheers,

David

___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion