View previous topic :: View next topic |
Author |
Message |
fmolina
Joined: 15 Oct 2009 Posts: 10 Location: Buenos Aires, Argentina
|
Posted: Fri Oct 16, 2009 5:47 pm Post subject: Problem with compiler option |
|
|
Hello all,
I have just downloaded FTN95 personal, installed on Win XP x64 SP2. It seems to work mostly fine; however, I tried to compile code with a lot of declarations such as
which fails with error 600. I found that the option /ALT_KINDS would make kind = 8 acceptable, however I cannot get it to work: either from plato (Project -> properties -> compiler options -> miscellaneous -> extra compiler options) or compiling from the command line (ftn95 test1.f95 /ALT_KINDS) the error still appears. Am I missing something?
I would prefer not changing the code to kind = 2 or something else for portability reasons.
Regards,
Fernando |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7928 Location: Salford, UK
|
Posted: Fri Oct 16, 2009 6:49 pm Post subject: |
|
|
When I put this into a short program I don't get an error.
Maybe you need to post a larger sample. |
|
Back to top |
|
|
fmolina
Joined: 15 Oct 2009 Posts: 10 Location: Buenos Aires, Argentina
|
Posted: Fri Oct 16, 2009 8:53 pm Post subject: |
|
|
This is the whole test program, not much larger indeed:
Code: | program test
real (kind = 8) a
a = 2
end |
|
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7928 Location: Salford, UK
|
Posted: Sat Oct 17, 2009 8:10 am Post subject: |
|
|
This program works fine for me but I am not using a 64bit OS.
Can anyone else test this on a 64bit OS? |
|
Back to top |
|
|
fmolina
Joined: 15 Oct 2009 Posts: 10 Location: Buenos Aires, Argentina
|
Posted: Sat Oct 17, 2009 8:29 pm Post subject: |
|
|
Hello Paul,
I have installed ftn95 in two other machines, both running Win XP 32 bits SP3, with the same result. The option /ALT_KINDS seems to be ignored; either specifying it or not, the result is the same:
Code: | 0003) real (kind = 8) a
*** The KIND number should be 1, 2, or 3
COMMENT - Specifying the kind of the type REAL with the constant '1' is
non-portable - 'SELECTED_REAL_KIND(6,37)' would be better
1 ERROR, 1 COMMENT [<TEST> FTN95/Win32 v5.30.0]
*** Compilation failed |
If I change the program to kind = 2 it compiles either without of with /ALT_KINDS in the command line
Moreover, I tried downloading from the two sites (CNET and Tucows) just in case, but there is no difference (as expected).
Quite puzzling, but I do not know what to do next.
Regards,
Fernando |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7928 Location: Salford, UK
|
Posted: Sun Oct 18, 2009 9:04 am Post subject: |
|
|
I can only think of two possible reasons for the failure.
1. You are accessing an old version of the compiler. The version appears when you type FTN95 on a command line.
2. The option /ALT_KINDS is not getting through to the compiler. If you also add /EXPLIST to the command line then the .lis file generated will provide a list of the options that the compiler is using. |
|
Back to top |
|
|
fmolina
Joined: 15 Oct 2009 Posts: 10 Location: Buenos Aires, Argentina
|
Posted: Sun Oct 18, 2009 8:52 pm Post subject: |
|
|
The .lis file generated is the following:
Silverfrost FTN95/WIN32 Ver 5.30.0 test1.F95 Sun Oct 18 16:46:52 2009
Compiler Options in Effect:
ALT_KINDS COLOUR DELETE_OBJ_ON_ERROR EXPLIST MINIMISE_REBUILD NO_QUIT NON_STANDARD SINGLE_THREADED
0001 program test
0002
0003 real (kind = 8) a
0004
*** The KIND number should be 1, 2, or 3
COMMENT - Specifying the kind of the type REAL with the constant '1' is non-portable - 'SELECTED_REAL_KIND(6,37)' would be better
0005 real*8 b
0006
0007 a = 2 + b
0008
0009 end
As it can be seen, version is 5.30.0 and ALT_KINDS is listed as in effect. Besides, real*8 is not a problem. |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7928 Location: Salford, UK
|
Posted: Mon Oct 19, 2009 7:05 am Post subject: |
|
|
Looks like you need to wait for version 5.4 of FTN95. This is available for download except for the personal edition which will be made available in due course. |
|
Back to top |
|
|
fmolina
Joined: 15 Oct 2009 Posts: 10 Location: Buenos Aires, Argentina
|
Posted: Mon Oct 19, 2009 2:36 pm Post subject: |
|
|
OK, I understand. Any guess about when the 'due course' will arrive?
Thanks for the attention
Fernando |
|
Back to top |
|
|
silverfrost Site Admin
Joined: 29 Nov 2006 Posts: 191 Location: Manchester
|
Posted: Mon Oct 19, 2009 7:07 pm Post subject: |
|
|
Version 5.40 is available now. I have put a direct link on the download page to our MediaFire account that we use for the Express version. The problem with cnet and tucows is that they can take weeks just to process an update (unless you pay $1000 and then it takes 10 minutes).
Edit: the link is http://www.silverfrost.com/32/ftn95/ftn95_personal_edition.aspx |
|
Back to top |
|
|
fmolina
Joined: 15 Oct 2009 Posts: 10 Location: Buenos Aires, Argentina
|
Posted: Mon Oct 19, 2009 9:10 pm Post subject: |
|
|
Excellent!
Thanks a lot |
|
Back to top |
|
|
JohnCampbell
Joined: 16 Feb 2006 Posts: 2554 Location: Sydney
|
Posted: Tue Oct 20, 2009 1:02 am Post subject: |
|
|
Why not try
real*8 a
Having the value of kind not being defined in the standard has always looked as a "one step foward, one step back" approach.
The standards committee has always frowned on "real*8", which I have said many times is concise and clear definition of the number being used.
My Ver 5.30.0 also does not work for /alt_kind. I'm not sure if it worked in the past for variable definitions, such the example above.
Constants, such as 2.1_8 appear to compile ok.
John
Code: | program test
real*8 b, c
! real (kind = 8) a
b = 2.1_8
c = 2.1d0
write (*,*) b,c
! a = 2
end |
|
|
Back to top |
|
|
fmolina
Joined: 15 Oct 2009 Posts: 10 Location: Buenos Aires, Argentina
|
Posted: Tue Oct 20, 2009 3:34 am Post subject: |
|
|
Because I am trying FTN95 with programs that heavily use code from netlib, which in f90 (for example minpack.f90) use kind = 8 all the time. Besides, as far as I know, is the most common way to use 'kind'. |
|
Back to top |
|
|
JohnCampbell
Joined: 16 Feb 2006 Posts: 2554 Location: Sydney
|
Posted: Tue Oct 20, 2009 7:30 am Post subject: |
|
|
I am surprised that Netlib have general use of kind as "real (kind = " as although this syntax is valid in the standard, it is definately not portable.
I am not sure how many other fortran 90+ compilers, apart from Salford, who don't use the value of kind as the number of bytes, but it is definately not a requirement of the standard.
As I have only compiled in a Control Data / Prime / Vax / Apollo / Sun / Wintel environment, I am not aware of any compiler since Control Data that does not support Real*8
As I have limited experience of the high performance super-computers and workstations, I'd be interested to know of those that don't support real*8.
If you ask Fortran Standards comittee, they will recomend that you use a module to define the value of kind, by using SELECTED_REAL_KIND and specify a precision. To me it's a total "waste of space" as there are not that many different values of precision that are provided by all the hardware/software manufactures available.
John |
|
Back to top |
|
|
fmolina
Joined: 15 Oct 2009 Posts: 10 Location: Buenos Aires, Argentina
|
Posted: Tue Oct 20, 2009 1:39 pm Post subject: |
|
|
I agree that real*8 is simpler than any use of "kind". But this is what I have found. Regarding SELECTED_REAL_KIND, I only know of one package (Ronald Cools' cubpack.f90) which uses it.
Besides the old days of the PDP-11, my experience with fortan compilers is in the PC environment, either windows or, to some extent, linux, and real*8 and the like are always supported, as far as I know.
Fernando |
|
Back to top |
|
|
|