PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

Issue: PGF90-S-0044-Multiple declaration for symbol
Goto page 1, 2  Next
 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling
View previous topic :: View next topic  
Author Message
.zYs.



Joined: 11 Apr 2010
Posts: 21

PostPosted: Tue Mar 12, 2013 3:21 am    Post subject: Issue: PGF90-S-0044-Multiple declaration for symbol Reply with quote

Hi,

I met such a problem when compiling some fortran codes. The error message is PGF90-S-0044-Multiple declaration for symbol. It complains the line of subroutine as shown below

Code:
integer*4 function checkdims (ncid, ncname, lstr, recsize)
      USE Agrif_Util                                                                                   
                                                                                           
      CHARACTER :: ncname*80                                                                           
      INTEGER*4 :: ncid                                                                                 
      INTEGER*4 :: lstr                                                                                 
      INTEGER*4 :: recsize                                                                             
                                                                                                       
      Call Sub_Loop_checkdims( ncid,ncname,lstr,recsize                                                 
     &,checkdims ,  Agrif_tabvars(187) % var% iarray0                                                   
     &,  Agrif_tabvars(188) % var% iarray0 ,  Agrif_tabvars(189)                                       
     &% var% iarray0 ,  Agrif_tabvars(190) % var% iarray0)                                             
                                                                                                       
      end                                                                                               
                                                                                                       
            subroutine Sub_Loop_checkdims(ncid,ncname,lstr                                             
     &,recsize,checkdims,eta_v,eta_rho,xi_u,xi_rho)                                                     
                                                                                                       
      IMPLICIT NONE
      ............
      ............


Is there any idea how to fix this? I am using PGI 12.3

Thanks!!
Yisen
Back to top
View user's profile
mkcolg



Joined: 30 Jun 2004
Posts: 6125
Location: The Portland Group Inc.

PostPosted: Tue Mar 12, 2013 9:02 am    Post subject: Reply with quote

Hi Yisen,

What symbol and where is it being declared twice? Could one of your local variables be declared in the module? Can you provide a reproducing example?

- Mat
Back to top
View user's profile
Wesley Emeneker



Joined: 21 Jun 2011
Posts: 1

PostPosted: Tue Mar 26, 2013 5:04 am    Post subject: Reproducing example for multiple declarations problem Reply with quote

Mat,
I'm helping Yisen with the problem, and I have a reproducible example.

test1.f90 (this is a wrapper for the code that produces the error):

PROGRAM test1
IMPLICIT NONE
INTEGER :: checkdims

print *,'checkdims returns',checkdims(3)


END PROGRAM test1


test1_sub.f (this is the code that produces the error):
integer function checkdims (in)
IMPLICIT NONE
INTEGER :: in

checkdims=in*4

Call Sub_Loop_checkdims(checkdims)

contains


subroutine Sub_Loop_checkdims(checkdims)
IMPLICIT NONE
INTEGER :: checkdims

checkdims=checkdims+1
end subroutine Sub_Loop_checkdims



end function checkdims


If I change the "checkdims" variable in Sub_Loop_checkdims to something else (like checkdimss), the code compiles and works just fine.
If the checkdims variable in Sub_Loop_checkdims is left as-is, I get this error:
test1_sub.f:
PGF90-S-0044-Multiple declaration for symbol checkdims (test1_sub.f: 12)
PGF90/x86-64 Linux 11.10-0: compilation completed with severe errors

This happens with PGI 11.10, 12.3, and 12.10

I'm not a fortran expert (I'm not even a fotran novice yet), so I don't know if the above code is legal, but both the Intel and GNU compilers accept this construct without warning.


Wesley
Back to top
View user's profile
mkcolg



Joined: 30 Jun 2004
Posts: 6125
Location: The Portland Group Inc.

PostPosted: Tue Mar 26, 2013 1:26 pm    Post subject: Reply with quote

Thanks Wesley. I've sent a report to our compiler engineers (TPR#19232) and asked them to look into the source of the problem,

Best Regards,
Mat
Back to top
View user's profile
.zYs.



Joined: 11 Apr 2010
Posts: 21

PostPosted: Wed Apr 03, 2013 6:25 am    Post subject: Reply with quote

Hi Mat,

Is there any news on this issue?

Thanks
Yisen
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling All times are GMT - 7 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group