<div dir="ltr">Yes.  John Linford (formerly of ParaTools, Inc. aka TAU team, now at ARM) developed such a thing for OpenSHMEM.<div><br></div><div>Jeff<br><div><br></div><div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">---------- Forwarded message ----------</span><div dir="ltr" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><div>I've written a Fortran bindings generator that uses ISO_C_BINDING to link a Fortran code to any SHMEM implementation with C linkage:<span> </span><a href="https://github.com/jlinford/shmem_iso_c_binding" target="_blank" style="color:rgb(17,85,204)">https://github.com/jlinford/<wbr>shmem_iso_c_binding</a>. shmem.f90 in that repo provides the complete OpenSHMEM 1.2 API.</div><div><br></div><div>We can use this and the TAU Performance System to automatically generate Fortran interfaces for just about any OpenSHMEM implementation, and to update bindings as the API expands, in support of<span> </span><a href="https://github.com/openshmem-org/specification/pull/48" target="_blank" style="color:rgb(17,85,204)">https://github.com/openshmem-<wbr>org/specification/pull/48</a>.</div><div><br></div><div>There are some quirks of using ISO_C_BINDING, e.g. shmem_malloc needs a following call to c_f_pointer and C_PTRDIFF_T isn't available in some compilers so I used C_INTPTR_T as a workaround.   See rotput.f90 in the repo for details.</div></div><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, May 3, 2018 at 8:50 AM, Smith, Barry F. <span dir="ltr"><<a href="mailto:bsmith@mcs.anl.gov" target="_blank">bsmith@mcs.anl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
   Jeff, (and others),<br>
<br>
     Do you know of a tool that can take a C prototype and automatically generate the Fortran C binding interface definition? We currently generate stubs for C functions that have character arguments manually and it would be great to remove that manual step.<br>
<br>
   Thanks<br>
<span class="HOEnZb"><font color="#888888"><br>
      Barry<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
> On May 2, 2018, at 11:42 PM, Jeff Hammond <<a href="mailto:jeff.science@gmail.com">jeff.science@gmail.com</a>> wrote:<br>
> <br>
> Or you could just use ISO_C_BINDING.  Decent compilers should support it.<br>
> <br>
> On Wed, May 2, 2018 at 8:56 AM, Jed Brown <<a href="mailto:jed@jedbrown.org">jed@jedbrown.org</a>> wrote:<br>
> See Fortran Language Issues.<br>
> <br>
>   <a href="https://gcc.gnu.org/gcc-8/porting_to.html" rel="noreferrer" target="_blank">https://gcc.gnu.org/gcc-8/<wbr>porting_to.html</a><br>
> <br>
> We'll have to test for this (probably compiler version) and change the<br>
> PETSC_MIXED_LEN / PETSC_END_LEN to use size_t instead of int.<br>
> <br>
> <br>
> <br>
> -- <br>
> Jeff Hammond<br>
> <a href="mailto:jeff.science@gmail.com">jeff.science@gmail.com</a><br>
> <a href="http://jeffhammond.github.io/" rel="noreferrer" target="_blank">http://jeffhammond.github.io/</a><br>
<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">Jeff Hammond<br><a href="mailto:jeff.science@gmail.com" target="_blank">jeff.science@gmail.com</a><br><a href="http://jeffhammond.github.io/" target="_blank">http://jeffhammond.github.io/</a></div>
</div></div></div></div>