PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Course

Compiler error message: PGF90-S-0087-Non-constant expression

 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling
View previous topic :: View next topic  
Author Message
Albert_1



Joined: 28 Jan 2011
Posts: 2

PostPosted: Fri Jan 28, 2011 11:48 am    Post subject: Compiler error message: PGF90-S-0087-Non-constant expression Reply with quote

Dear all,

I'm getting from the pgf90 compiler the error message:
PGF90-S-0087-Non-constant expression where constant expression required
(bb.f90: 1)
PGF90-S-0081-Illegal selector - KIND parameter has unknown value for
data type (bb.f90: 1)

This error message comes from the line:
real(prec) function bb
it looks like the real(prec) is evaluated before the declaration of of the variables in the body of the function or the variables in the use statements are evaluated.
When I declare the return type inside the body of the function the function compiles (see cc.f90).
I've below the commands + generated output as well as the used source files.

Is this a bug in the pgf90 compiler (version 11.1) ? As other compilers don't complain.

Best Regards,

Albert

=============== compiler commands and results =======
$ pgf90 aa.f90 -c
$ pgf90 bb.f90 -c
PGF90-S-0087-Non-constant expression where constant expression required
(bb.f90: 1)
PGF90-S-0081-Illegal selector - KIND parameter has unknown value for
data type (bb.f90: 1)
0 inform, 0 warnings, 2 severes, 0 fatal for bb

$ pgf90 -c cc.f90

================ aa.f90 ======================
module aa
INTEGER, parameter :: prec = kind(1.0D0)
end module
================ bb.f90 ======================
real(prec) function bb
use aa

bb = 7.3D1
end function
================ cc.f90 ======================
function bb
use aa
real(prec) bb

bb = 7.3D1
end function
Back to top
View user's profile
mkcolg



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

PostPosted: Mon Jan 31, 2011 9:57 am    Post subject: Reply with quote

Hi Albert,

We are aware of the issue, though, it's not really a bug. The standard's a bit contradictory here. It states that when variables found in external modules are accessed, the 'use' statement must precede the actual use. However, it also seems to have relaxed this criteria for this one case. We are looking into how to support this feature but no firm date when it will be available.

Best Regards,
Mat
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
Page 1 of 1

 
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