On Thu, Mar 25, 2010 at 12:06 AM, Ondrej Certik <[email protected]> wrote:
> Hi Kurt!

>>>
>>>
>>> Kurt and Dag seem to be working/interested in this, so if we can get
>>> something usable (90%) to get started and then once I can use it for
>>> my stuff (I just need simple wrappers for now), it'd be really cool.
>>
>> I'm *really* aiming for something like 90% by the end of April, as
>> unlikely as the above makes it seem.  I'll put a post on the blog
>> (fortrancython.wordpress.com/) about what 90% means.  It will include
>> all the basic support stuff that you mention above (where hosted
>> (likely bitbucket), a mailing-list, and the features supported).
>>
>> So by summer (end of May) fwrap should have a couple of releases out,
>> and be usable.  It will certainly work for simple wrappers (no
>> callback support).  Although that depends on just what you mean by
>> 'simple.'
>
> That should be enough. I use cmake, so I'd appreciate if fwrap could
> just spit the C (or fortran or both) files, that I compile and link
> myself. Just like Cython does. (I read some issues with integrating
> fwrap into build tools like distutils etc. ---- I really don't need
> that at all). If I can wrap fortran subroutines, pass some arguments
> to them from Python and get results back (as numpy arrays), that's all
> I need. I will need passing numpy arrays in and out though --- I don't
> know if this is "simple" or not. I don't need callbacks.

Scalars and numpy arrays will be supported, certainly.  No problem.

The issue that will take some work (as always) is getting everything
working together -- fwrap, cython, user-specified fortran compiler
(with entailed compiler flags, etc.), gcc, python, etc.

Here's what fwrap will do, for the default case:

You have a fortran source file, fsource.f90, with a function in it,
say, bessel(knd, m, x).

The default command invocation would look something like this -- fairly obvious:

$ fwrap fsource.f90

Which would generate a bunch of source files in a directory
'fwrap-default' (the name can be changed with a flag), all necessary
for wrapping the fsource.f90 source.  By default, fwrap will take
these source files and generate an extension module
'fwrap_default.so', placing it in the directory.

The source files generated will include the cython .pxds necessary to
use the wrapper code from other Cython source code.  (If this doesn't
make sense I'll come up with a more exhaustive example.)  The C
headers will be generated to use the wrappers from C source, too.  It
won't be necessary to recompile the Fortran source to call the wrapped
code from Cython or C -- you just have to link in the shared object
file (in this case, 'fwrap_default.so').

>
> It seems to me, that fwrap is really close. Can you please ping me,
> when I can run some simple example with fwrap? I will need some time
> to learn it, so if you could just fix fwrap so that it runs, it'd be
> cool for now. :)

Yes, it is really close -- thanks for the input.  I'll ping you.

>
> I am excited, couldn't wait to see this working, at least a little bit.
>
> Thanks and looking forward!
>
> Ondrej
> _______________________________________________
> Cython-dev mailing list
> [email protected]
> http://codespeak.net/mailman/listinfo/cython-dev
>
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to