(j3.2006) TKR for C Interop

Bill Long longb
Wed Feb 28 20:29:51 EST 2007



Aleksandar Donev wrote:

>
>I believe that an important goal of interop TR should be binary compatibility. 
>That is, I believe one should be able to compile a C routine and then switch 
>different Fortran compilers (and libraries of course) without recompiling 
>(and vice versa). If the C struct is fully specified (no opaque components), 
>and the handles for the Fortran descriptors are pointers (void *), I think we 
>have achieved that goal. Essentially the whole TR header file will be 
>specified from Fortran, and the vendor will only provide the library that 
>implements the specified API. For efficiency, we may want to allow a vendor 
>to replace the header file with something that makes the routines macros, for 
>example.
>  
>

I do not see how this sort of binary compatibility is possible in any 
reasonable way.  Vendor dope vectors have different formats, so the size 
of the corresponding C descriptor will be different from one Fortran 
compiler to the next. Unless you want the C struct to include separate 
regions for each vendor's specifics, in which case the struct will be in 
the 1000+ word range. And all the vendors have to agree on the layout, 
and they would be prohibited from changing their dope vectors in the 
future.  I'm seeing epsilon probability here.  Calling sequence 
conventions are not even necessarily the same among Fortran compilers.  
A Fortran implementation can interoperate with the C compiler specified 
at compile time, but that's it.  This is true of the current interop - 
nothing special about the new extensions.

Cheers,
Bill


-- 
Bill Long                                   longb at cray.com
Fortran Technical Support    &              voice: 651-605-9024
Bioinformatics Software Development         fax:   651-605-9142
Cray Inc., 1340 Mendota Heights Rd., Mendota Heights, MN, 55120

            





More information about the J3 mailing list