Object names

Hi all,

I am looking for a solution to a problem unique to the PGI compiler (it seems). With ISO_C_BINDINGS, the PGI compiler still prepends the name of the module to the object, i.e.

module a
use, intrinsic :: iso_c_binding
contains
subroutine b bind©
print *,“Hello World”
end subroutine b
end module a

would give an object name a_b. This is incompatible with our development efforts and other compilers (Intel, GNU), which would give an object name b when iso_c_bindings are used.

Is there any possibility to suppress this, or do newer versions of the PGI compiler fix this issue (or will it be fixed in the future)? I tried PGI 12.5 and 17.7.

Thanks!
Dom

As a workaround for this you can use the ‘name=’ specifier:

module a
 contains
   subroutine b() bind(c,name='b')
   end subroutine b
end module a

[This problem is still present in 17.10.]

this has been logged as TPR 23822.

Workaround is to add a name argument to the bind call.

subroutine s(x,y) bind(c,name=‘s’)

dave