My objectif is to rename a fortran subroutine inside a module to be easily callable by C code (i.e. without the __<modulename>_MOD_
prefix), and using GCC-6.3.0. I cannot use bind(c,name='')
even if it works great. I have read that I should use interface, but without any success. Here is the MWE:
module testmodule
interface
subroutine func02
!GCC$ ATTRIBUTES CDECL :: func01
end subroutine
end interface
contains
subroutine func01
print*,"func01"
end subroutine
end module
I compile using command gfortran -c test.f90
and then I check if the subroutine is correctly renamed using nm test.o
, but there is no sign of func02
.
Any help appreciated.