[Numpy-discussion] Compile extension modules with Visual Studio 2005

2007-07-24 Thread Geoffrey Zhu
Hi, I am about to write a C extension module. C functions in the module will take and return numpy arrays. I found a tutorial online, but I am not sure about the following: 1. Can I compile my extension with Visual Studio 2005? My impression is that I will have to link with numpy libraries, and,

Re: [Numpy-discussion] Compile extension modules with Visual Studio 2005

2007-07-24 Thread Robert Kern
Geoffrey Zhu wrote: > Hi, > > I am about to write a C extension module. C functions in the module will > take and return numpy arrays. I found a tutorial online, but I am not > sure about the following: > > 1. Can I compile my extension with Visual Studio 2005? My impression is > that I will ha

Re: [Numpy-discussion] Compile extension modules with Visual Studio 2005

2007-07-24 Thread Geoffrey Zhu
Hi Robert, On 7/24/07, Robert Kern <[EMAIL PROTECTED]> wrote: > Geoffrey Zhu wrote: > > Hi, > > > > I am about to write a C extension module. C functions in the module will > > take and return numpy arrays. I found a tutorial online, but I am not > > sure about the following: > > > > 1. Can I com

Re: [Numpy-discussion] Compile extension modules with Visual Studio 2005

2007-07-24 Thread Robert Kern
Geoffrey Zhu wrote: > Thanks for your help. Do you know what exactly is the issue of having > to use VS2003 to build extensions? If the interactions are done at DLL > level, shouldn't call compilers that can generate DLLs work? Mostly it's an issue of the C runtime that is used for either compiler

Re: [Numpy-discussion] Compile extension modules with Visual Studio 2005

2007-07-24 Thread Geoffrey Zhu
Hi Robert, On 7/24/07, Robert Kern <[EMAIL PROTECTED]> wrote: > Geoffrey Zhu wrote: > > Thanks for your help. Do you know what exactly is the issue of having > > to use VS2003 to build extensions? If the interactions are done at DLL > > level, shouldn't call compilers that can generate DLLs work?

Re: [Numpy-discussion] Compile extension modules with Visual Studio 2005

2007-07-24 Thread Robert Kern
Geoffrey Zhu wrote: > Hi Robert, > > On 7/24/07, Robert Kern <[EMAIL PROTECTED]> wrote: >> Geoffrey Zhu wrote: >>> Thanks for your help. Do you know what exactly is the issue of having >>> to use VS2003 to build extensions? If the interactions are done at DLL >>> level, shouldn't call compilers th

Re: [Numpy-discussion] Compile extension modules with Visual Studio 2005

2007-07-24 Thread Gael Varoquaux
On Tue, Jul 24, 2007 at 02:32:10PM -0500, Robert Kern wrote: > > I haven't looked at PyMultilter objects. I am just trying to build a > > 'vector version' of my C function so that it can do batch > > calculations. For example, for a vector X, I can do > > for x in X: y=my_func(x) > > Or I can do

Re: [Numpy-discussion] Compile extension modules with Visual Studio 2005

2007-07-25 Thread Ray Schumacher
Geoffrey Zhu wrote: > Hi, > > I am about to write a C extension module. C functions in the module will > take and return numpy arrays. I found a tutorial online, but I am not > sure about the following: I agree with others that ctypes might be your best path. The codeGenerator is magic, if yo

Re: [Numpy-discussion] Compile extension modules with Visual Studio 2005

2007-07-25 Thread Gael Varoquaux
On Wed, Jul 25, 2007 at 06:38:55AM -0700, Ray Schumacher wrote: > The codeGenerator is magic, if you ask me: > http://starship.python.net/crew/theller/ctypes/old/codegen.html Can it wrap code passing around arrays ? If so it really does magic that I don't understand. Gaƫl

Re: [Numpy-discussion] Compile extension modules with Visual Studio 2005

2007-07-25 Thread Stefan van der Walt
On Wed, Jul 25, 2007 at 03:41:37PM +0200, Gael Varoquaux wrote: > On Wed, Jul 25, 2007 at 06:38:55AM -0700, Ray Schumacher wrote: > > The codeGenerator is magic, if you ask me: > > http://starship.python.net/crew/theller/ctypes/old/codegen.html > > Can it wrap code passing around arrays ? If so it

Re: [Numpy-discussion] Compile extension modules with Visual Studio 2005

2007-07-25 Thread Gael Varoquaux
On Wed, Jul 25, 2007 at 04:44:08PM +0200, Stefan van der Walt wrote: > On Wed, Jul 25, 2007 at 03:41:37PM +0200, Gael Varoquaux wrote: > > On Wed, Jul 25, 2007 at 06:38:55AM -0700, Ray Schumacher wrote: > > > The codeGenerator is magic, if you ask me: > > > http://starship.python.net/crew/theller/c

Re: [Numpy-discussion] Compile extension modules with Visual Studio 2005

2007-07-25 Thread Chris Barker
Ray Schumacher wrote: > I agree with others that ctypes might be your best path. Pyrex is a good bet too: http://www.scipy.org/Cookbook/Pyrex_and_NumPy The advantage with pyrex is that you don't have to write any C at all. You will have to use a compiler that is compatible with your Python buil

Re: [Numpy-discussion] Compile extension modules with Visual Studio 2005

2007-07-25 Thread David Cournapeau
Gael Varoquaux wrote: > On Wed, Jul 25, 2007 at 04:44:08PM +0200, Stefan van der Walt wrote: >> On Wed, Jul 25, 2007 at 03:41:37PM +0200, Gael Varoquaux wrote: >>> On Wed, Jul 25, 2007 at 06:38:55AM -0700, Ray Schumacher wrote: The codeGenerator is magic, if you ask me: http://starship.py