Intrinsic modules

Brooks Moses bmoses@stanford.edu
Tue Sep 26 07:36:00 GMT 2006


François-Xavier Coudert wrote:
> I tried today to locate a version of your ISO_C_BINDING patch using
> Google, because I thought I remembered you posted a preliminary patch
> at some point, but couldn't find anything. 

I'm reasonably sure, looking at the gmane.org archives, that nothing was 
ever posted.  For the longest time, Christopher's copyright assignment 
status was "in progress" (and, at last report, it still is), so it would 
arguably have been inconvenient for him to post anything.

> So, here's my question: I
> have implemented yesterday night a patch to add intrinsic modules to
> gfortran, as well as a first example module, ISO_FORTRAN_ENV from
> F2003. And then I realized that ISO_C_BINDING is also an intrinsic
> module, so you must have done something about that yourself. I wanted
> to see if you indeed worked on that or just made it a simple module in
> the standard include path, like OMP_LIB. And, if you did implement it,
> maybe comparing our implementations would be good.

For the record, here's a post where this was discussed, which I found 
while looking to see if any code had been posted:

> -------- Original Message --------
> Subject: Re: F03 C interop..
> Date: Thu, 29 Sep 2005 14:19:13 -0600 (MDT)
> From: Christopher D. Rickett <crickett@lanl.gov>
> 
> On Thu, 29 Sep 2005, Richard E Maine wrote:
>> On Sep 29, 2005, at 10:23 AM, Christopher D. Rickett wrote:
>> > Do you know what the plan is for implementing intrinsic modules?  Can they
>> > simply be modules that are built by the compiler during the build process of
>> > gfortran itself?
>> 
>> I could be wrong (and I don't know anything specific about gfortran plans
>> anyway), but I don't think there is anything about the ISO_C_BINDING module
>> that fundamentally has to be integrated with the compiler. That is, the
>> compiler doesn't necessarily need to "know" much about the module. One could
>> implement the module separately, with the only implication of intrinsicness
>> being that it is found properly when INTRINSIC is specified on a USE statement
>> (which could be done just by having a special directory that the compiler
>> knows to look in).
> 
> I actually agree and had this plan in mind due to other work we've done here. 
> With a separate project I've worked on we've done something similar to 
> the iso_c_binding module, but for f90 so we could declare the interoperable 
> types and some of the functions that we needed.  When looking at the module, 
> it is something that configure could generate based on the architecture and 
> the f03 draft (for types that don't apply to the given machine).
> 
>> Basically, for this module, "intrinsic" means very little other than "provided
>> with the compiler", plus "looked for in the right module search order". I
>> don't know what, if any gfortran plans have been made, but I think it *could*
>> be done this way.
> 
> I think it could be done this way, and that this is possibly the most 
> straight-forward way to do it.
[...]

- Brooks



More information about the Fortran mailing list