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 

How program knows that it is 64bit or 32bit?
Goto page Previous  1, 2
 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> 64-bit
View previous topic :: View next topic  
Author Message
JohnCampbell



Joined: 16 Feb 2006
Posts: 2154
Location: Sydney

PostPosted: Thu May 23, 2019 1:10 pm    Post subject: Reply with quote

mecej4,

I have been requesting for a few of these new system routines for a while, see:
http://forums.silverfrost.com/viewtopic.php?t=2176&postdays=0&postorder=asc&start=120

A few more requesting some of these utility routines may help identify those that are more useful.

Support for a FTN95 version of the module ISO_FORTRAN_ENV could also be helpful, which would provide some guidance for making code more portable.

The idea of more flexibility on KIND values could also help. More consensus on this idea could lead to a better approach.

John
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 6133
Location: Salford, UK

PostPosted: Thu May 23, 2019 3:44 pm    Post subject: Reply with quote

It turns out that the version number is intended to be provided via _SAL_VER but this seems to have been forgotten and not updated from 450 which presumably refers to FTN95 v4.50.

We can add a new macro (say _FTN95_VER) and aim to keep it up to date.

I have made a note of the request for COMPILE_VERSION() etc.
Back to top
View user's profile Send private message
JohnCampbell



Joined: 16 Feb 2006
Posts: 2154
Location: Sydney

PostPosted: Fri May 24, 2019 8:03 am    Post subject: Reply with quote

I have my own solution for compiler_version , which is:
Code:
   subroutine get_compiler_version ( version )
      character version*(*)
      character ftn95_ver*80
!
      include <ftn95_ver.ins>
      version = ftn95_ver
   end subroutine get_compiler_version


The include file in C:\Program Files (x86)\Silverfrost\ftn95\include looks like
Code:
      ftn95_ver = '[FTN95/x64 Ver. 8.40.0 Nov18 Copyright (c) Silverfrost Ltd 1993-2018]'


It would be good if a similar (or different) approach could be applied to salflibc.dll or where suitable.
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 6133
Location: Salford, UK

PostPosted: Fri May 24, 2019 8:43 am    Post subject: Reply with quote

For future releases of FTN95, _SAL_VER will be kept up to date and _FTN95_VER will be provided as an alternative.
Back to top
View user's profile Send private message
DietmarSiepmann



Joined: 03 Jun 2013
Posts: 197

PostPosted: Fri May 24, 2019 11:05 am    Post subject: Reply with quote

Thanks Paul, John and mecej4 for your information/discussion (@Paul ... and for providing the symbols Smile

John, did you create include file ftn95_ver.ins? I could not find it in my SALFORD installations.

Regards,
Dietmar
Back to top
View user's profile Send private message
JohnCampbell



Joined: 16 Feb 2006
Posts: 2154
Location: Sydney

PostPosted: Fri May 24, 2019 11:14 am    Post subject: Reply with quote

Dietmar,

Yes, for each new version I create the file, by running ftn95 > zz, editing zz then copying into ...ftn95..\include\ftn95_ver.ins

With difficulty, as you need to copy as administrator. C:\Program Files (x86)\Silverfrost\ftn95\include is now too protected.
Back to top
View user's profile Send private message
DietmarSiepmann



Joined: 03 Jun 2013
Posts: 197

PostPosted: Thu Jan 09, 2020 8:16 pm    Post subject: Reply with quote

Now, with fnt95 version 8.60.0 preprocessor macros _SAL_VER and _FTN95_VER are available. I would like to use _FTN95_VER, however, I do not know the value it is defined to.

Following code works and activates the code between #IF and #ELSE:
Code:

#IF _FTN95_VER
      ctmp='_FTN95_VER  defined'
#ELSE
      ctmp='_FTN95_VER  not defined'
#ENDIF

This may be checked e.g. using sdbg64 or via creating the corresponding *.lis file.

However, I do not know how to activate code which applies only for ftn95 version 8.60.0. I would expect something like
Code:

#IF _FTN95_VER == 8.60.0
      ctmp='_FTN95_VER  defined'
#ELSE
      ctmp='_FTN95_VER  not defined'
#ENDIF

but when compiling this code (using ftn95 options /64 and /cfpp) the following error messages occur:
Code:

#IF _FTN95_VER == 8.60.0
*** Invalid character '' found in expression

    1 ERROR [test_graphics_window0.for] - Compilation failed.

. I suspect the right hand side of the #IF statement above expects an integer value. For code sequence
Code:

#IF _FTN95_VER == 8
      ctmp='_FTN95_VER  defined'
#ELSE
      ctmp='_FTN95_VER  not defined'
#ENDIF

works and activates the code between the #ELSE and the #ENDIF.

Now I wonder which right hand side I would have to specify in order to activate the code bewtween #IF and #ELSE for version 8.60.0 of ftn95 only.

I know I could bypass this problem by defining a preprocessor symbol via ftn95 option /define in the ftn95 call, however, the reason for introducing symbol _FTN95_VER was to avoid this proceeding, wasn't it?

Regards,
Dietmar
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 6133
Location: Salford, UK

PostPosted: Fri Jan 10, 2020 9:00 am    Post subject: Reply with quote

The internal value is the integer 860 for v8.60...

Code:
      character(80) ctmp
#IF (_FTN95_VER == 860)
      ctmp='FTN95 is v8.60'
#ELSE
      ctmp='FTN95 is not v8.60'
#ENDIF   
      print*, ctmp
      end 
Back to top
View user's profile Send private message
DietmarSiepmann



Joined: 03 Jun 2013
Posts: 197

PostPosted: Fri Jan 10, 2020 3:52 pm    Post subject: Reply with quote

Thanks, Paul.

I tried with internal value 8600 (because of ftn95 displaying version number 8.60.0) but this did not work Wink

I'm fine with internal value 860.

Is there any documentaion about all the preprocessor constants of ftn95 for version 8.60?
It may be worthwhile having some examples for the C style preprocessor usage, especially #if clauses
Code:

#IF (_FTN95_VER == 860)
#IF _FTN95_VER == 860

which both may start at column 1 even if using ftn95 option /fixed_format.
Maybe some more documentation could be added to the online help, tabs
Code:

FTN95 Language extension
Conditional compilation

?

Regards
Dietmar
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 6133
Location: Salford, UK

PostPosted: Fri Jan 10, 2020 5:10 pm    Post subject: Reply with quote

There is some information in ftn95.chm when you search for "conditional compilation".
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> 64-bit All times are GMT + 1 Hour
Goto page Previous  1, 2
Page 2 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 © 2001, 2005 phpBB Group