Actually, the following problem appeared when I tried to compile a huge fortran code with pgfortran 12.8-1 64-bit. For simplicity I created the code given below (a.f90) that reproduces the same problem. When I try to compile it (using pgfortran a.f90) I get the following error message
PGF90-S-0165-c appeared more than once as a subprogram (a.f90)
0 inform, 0 warnings, 1 severes, 0 fatal for c
I understand that something goes wrong with the names of subroutines during linking and how the compiler combines the names of the modules with the names of the subroutines. In the case that I rename subroutine “c” to “c1” everything works. Of course in such a small code I could just rename the subroutines but this work around can not be applied to the real code. Why this strange behavior and how someone could overcome it?
module a contains subroutine b_c print*,'Hello from b_c' end subroutine b_c end module a module a_b contains subroutine c print*,'Hello from c' end subroutine c end module a_b program aaa use a use a_b call b_c call c end program aaa