(j3.2006) Alternative binding label without C interoperability?

Cohen Malcolm malcolm
Thu Sep 29 03:59:26 EDT 2016


>If the entry name is for a module procedure, it's unlikely the program
>will be able to guess how the compiler mangled it.

A module procedure is not even required to have a binding name of any kind. 
Indeed, the NAG compiler on both VAX/VMS and OpenVMS did not produce global 
binding names for module procedures.

Tom mentioned shared libraries, but did not explain clearly that he wanted 
to use dynamic loading to get at them.  (I still don't understand what the 
problem really is!)  Before we embark on solutions, we do need a good 
understanding of the problem.

>"Not in portable standard Fortran."

Absolutely, because dlsym and dlopen are not portable.

If you're willing to limit yourself to dlsym and dlopen, and willing to 
limit yourself to using interoperable procedures, it is easy enough to do 
already.  Also, one can usually finesse the interoperability requirements by 
passing C_PTR instead, though if the desired argument list is long and 
complicated that could be tedious.  OTOH a long a complicated argument list 
is probably not such a great idea anyway, as you won't get any checking if 
you are loading something dynamically.

>  The nonportable
>part has been the mangling of both external and module procedure names.

Well, it would be easy enough to have a "BINDING_NAME()" intrinsic function, 
specifically to enable dynamic loading (we could even require dlsym/dlload 
to work if they are supported by the processor, by referencing the Posix 
standard).  That would probably be ok for external procedures, but not for 
module procedures.  For module procedures one could just have an external 
procedure that called the module procedure.

But I think we will need a lot more discussion to work out what is really 
needed.

Cheers,
-- 
........................Malcolm Cohen, Nihon NAG, Tokyo. 




More information about the J3 mailing list