Dag Sverre Seljebotn wrote:
> Sturla Molden wrote:
>>> What is the best way of declaring Fortran types in C? I understand there
>>> is likely no perfect cross-platform solution here
>> ISO Fortran 2003 has standard bindings to ISO C. Most Fortran compilers
>> support them, including gfortran. These C bindings make C callable from
>> Fortran, but they also make Fortran callable from C in a standardized and
>> portable way.
>>
>> The short receipe is: you don't declare any Fortran types in C. You
>> declare your Fortran functions with C types. This even includes
>> pass-by-value calling convention. Then the Fortran compiler will do the
>> correct conversion.
> 
> Thanks! (I'm rather new to Fortran...)
> 
> Ideally one should be able to point Cython to a Fortran library and 
> start using it automatically. A good solution then seems to be to have 
> Cython generate a Fortran 2003 wrapper around Fortran code (of any 
> dialect), retyping the arguments as the ISO C types.

Actually, I suppose chasm might help me there and do much of this. I'll 
have to look closer at it. Thanks again.

-- 
Dag Sverre
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to