[Numpy-discussion] Bento question: Fortran 90 & Cython support

David Cournapeau cournape@gmail....
Fri Aug 13 10:20:34 CDT 2010


On Fri, Aug 13, 2010 at 11:28 PM, Kurt Smith <kwmsmith@gmail.com> wrote:
> On Thu, Aug 12, 2010 at 8:51 PM, David <david@silveregg.co.jp> wrote:
>> Hi Kurt,
>>
>> On 08/13/2010 03:40 AM, Kurt Smith wrote:
>>> Hi,
>>>
>>> I'm very interested in Bento and think it will be a killer project.
>>>
>>> My question: do you anticipate supporting Fortran 90 within Bento, or
>>> will that be delegated to an external build tool?
>>
>> Bento does not support building at all. The idea is that you will be
>> able to plug your build tool of choice if desired, and bento will just
>> gives you a very high level description of your extensions.
>>
>> Right now, I am working on yaku, which is a simple build tool designed
>> as a library, and would be used by bento by default. If I can build
>> scipy with it and keep it simple, I will integrate yaku and bento. This
>> means at least basic fortran spuport. Otherwise, I may just give up yaku
>> - if it ends up being as big as say waf, there is really no point in it.
>>
>> I was not using waf directly because previous to 1.6, using waf as a
>> library was not as easy as expected (much better than scons, though),
>> but this is changing in 1.6. This means I will also need to add fortran
>> support to waf. I really like waf but was a bit concerned with the lack
>> of usage - now that samba is working on it, the prospect of long term
>> support for waf look much better (
>> http://wiki.samba.org/index.php/Waf).
>>
>
> This is all very good to hear.  I've been struggling with
> numpy.distutils for fwrap, and it is a nightmare.  My current
> problem---requiring yet-another-monkeypatch---is getting try_compile
> in the 'config' stage to work with Fortran 90 sources and .mod files
> that have to be generated before the 'config' stage begins.

I am still not clear on the exact issue you are trying to solve: could
you just say which file output are you expecting in which order ?

>
> Sounds like the best long-term solution is to put effort into better
> fortran support in waf, unless you plan on yaku's fortran support
> covering all cases (fortran 77/9X, .mod files, etc.).

I want yaku to be able to build scipy so that I know that it will
cover 99 % of python needs if integrated to bento. But I still intend
to use waf+bento as the longer term. Waf is just very powerful, and
the new codebase at its core is around 3500 lines of code. The only
advantage of yaku is to be built from the ground up as a library.

>  I'll start
> looking into that.  Is there a repo somewhere, or are you contributing
> to waf directly?

There used to be some fortran support in the waf trunk, but this has
disappeared with the new trunk for 1.6. I hope to be able to port it
this WE.

> Are you referring to waf?  Or are you speaking of Bento/yaku?

In general. The configure stage does involve compilation, so I don't
really understand your problem. You could do everything you want in
the configure stage - the main point is that configure and build are
separated, and you don't expect configure stage to change much during
development. So everything that is potentially expensive and stable,
you put in the configure stage.

>
> A somewhat separate question: Since both waf & bento have 'configure'
> steps how do they coordinate with each other, i.e. what is the
> 'responsibility' for each configure step? (same goes for bento/scons,
> or any other build tool, I reckon.)

You can set up a hook file in the bento.info file, which is a python
file containing hooks for each stage (configure, build, etc..). Right
now, if you build with yaku, the configure  and build hooks give you
yaku configure and build contexts, from which you can do whatever you
could using yaku directly.

In practice, it is a bit more complicated, because I want most of the
code to be declarative in principle, with bento driving the process
and calling your functions, but sometimes imperative is needed. So
right now the whole thing is very messy, especially yaku, and will
remain so until I figure it all out :)

> Interesting.  Kinda like waf's recommendation to include waf with the
> project, which I like.  Is this recommended for bento/yaku, too, or
> just a current stopgap?

It is certainly recommended for now, but I see no reason to disable
that feature later. But I also want to make it natural to install
bento, so that it can be included in distributions. I hope that once
it stabilizes, bento won't need to change much. One of the main
rationale to start this is to make it extensible after all,

cheers,

David


More information about the NumPy-Discussion mailing list