forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Preprocessor parameter passing

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
Ryan



Joined: 25 Feb 2016
Posts: 110

PostPosted: Fri Aug 26, 2016 4:28 pm    Post subject: Preprocessor parameter passing Reply with quote

From the documentation I see this line;

Quote:
The pre-processor can only be used for conditional compilation. Macro substitution is not supported.


Which I guess rules out overriding parameters from the command line.

I've tried
Code:
ftn95 file.f90 /VPARAM maxabcval 8192


and in Fortran;

Code:
PARAMETER (maxabc=maxabcval)


But this yields a compilation error.

Is there another way to pass in values for compilation time or is this not possible?

Thanks in advance

Ryan
Back to top
View user's profile Send private message
mecej4



Joined: 31 Oct 2006
Posts: 1885

PostPosted: Fri Aug 26, 2016 6:05 pm    Post subject: Reply with quote

You could place the PARAMETER statement in an include file, and place an INCLUDE statement in every subprogram that needs to use that parameter.

You could use another preprocessor on your source code that utilizes macros and run that preprocessor before feeding its output to the Fortran compiler.
Back to top
View user's profile Send private message
Ryan



Joined: 25 Feb 2016
Posts: 110

PostPosted: Fri Aug 26, 2016 6:55 pm    Post subject: Reply with quote

Both of those are good options, thank you.
Back to top
View user's profile Send private message
wahorger



Joined: 13 Oct 2014
Posts: 1217
Location: Morrison, CO, USA

PostPosted: Sun Aug 28, 2016 5:07 am    Post subject: Reply with quote

I've only used these in conditional compilations.

I've tried everything in the documentation (and a few others) to get this to work, and cannot.

Perhaps a bug?
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
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 © 2001, 2005 phpBB Group