PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

Preprocessing .f90 files

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



Joined: 07 Apr 2012
Posts: 29

PostPosted: Tue May 22, 2012 9:19 am    Post subject: Preprocessing .f90 files Reply with quote

I am not able to preprocess .f90 files using pgf90 (v12.3 of the compiler)...I have tried using -Mcpp, but the compilation is silent with no informational messages.
I guess if the files are named as .F90 then by default the compiler would preprocess it before compiling, but we cannot change file names. -Mpreprocess gave an error. Any help appreciated.
Back to top
View user's profile
mkcolg



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

PostPosted: Tue May 22, 2012 9:24 am    Post subject: Reply with quote

Quote:
I have tried using -Mcpp, but the compilation is silent with no informational messages.
-Mcpp will stop after pre-precessing so is most likely not what you want.

Quote:
-Mpreprocess gave an error
"-Mpreprocess" is the correct flag to use. What error are you getting?

- Mat
Back to top
View user's profile
_sayan_



Joined: 07 Apr 2012
Posts: 29

PostPosted: Tue May 22, 2012 11:02 am    Post subject: Reply with quote

Thanks for correcting. I have an interface in my f90 file, the structure is like this.

Code:


module xyz_m
implicit none
interface init_ctx
module procedure x
module procedure y
module procedure z
end interface init_ctx

contains

subroutine xyz_f (i, j, k)
!declarations
args = iargc()
var = 1
! some other code
end subroutine xyz_f


Now the error that I get upon compiling with the following flags is given below.
Code:

-Mpreprocess -fastsse -Mvect=noaltcode -Mipa=fast -mp=numa -ta=nvidia,host -Minfo=ccff,accel,mp,loop,opt -Mneginfo


Error:
Code:


PGF90-S-0038-Symbol, iargc, has not been explicitly declared (xyz.f90)
  0 inform,   0 warnings,   1 severes, 0 fatal for xyz_f


I think I am missing an Intel equivalent of "-gen-interfaces".

Thank you very much.
Back to top
View user's profile
mkcolg



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

PostPosted: Tue May 22, 2012 11:29 am    Post subject: Reply with quote

Hi _sayan_,

"iargc" is an external function not an intrinsic, hence you need to declare it. For example:
Code:
subroutine xyz_f (i, j, k)
!declarations
integer iargc
args = iargc()
var = 1
! some other code
end subroutine xyz_f

Note that Fortran 2003 standardized command line arguments. The "command_argument_count()" intrinsic can be used in place of the non-standard "iagrc" function.

Hope this helps,
Mat
Back to top
View user's profile
_sayan_



Joined: 07 Apr 2012
Posts: 29

PostPosted: Tue May 22, 2012 11:38 am    Post subject: Reply with quote

Great, this really helps...thank you.
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