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 

Problem with compiler option
Goto page 1, 2  Next
 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
fmolina



Joined: 15 Oct 2009
Posts: 10
Location: Buenos Aires, Argentina

PostPosted: Fri Oct 16, 2009 5:47 pm    Post subject: Problem with compiler option Reply with quote

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

Code:
real (kind = 8) a


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
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Fri Oct 16, 2009 6:49 pm    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
fmolina



Joined: 15 Oct 2009
Posts: 10
Location: Buenos Aires, Argentina

PostPosted: Fri Oct 16, 2009 8:53 pm    Post subject: Reply with quote

This is the whole test program, not much larger indeed:

Code:
program test

real (kind = 8) a

a = 2

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


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

PostPosted: Sat Oct 17, 2009 8:10 am    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
fmolina



Joined: 15 Oct 2009
Posts: 10
Location: Buenos Aires, Argentina

PostPosted: Sat Oct 17, 2009 8:29 pm    Post subject: Reply with quote

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
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Sun Oct 18, 2009 9:04 am    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
fmolina



Joined: 15 Oct 2009
Posts: 10
Location: Buenos Aires, Argentina

PostPosted: Sun Oct 18, 2009 8:52 pm    Post subject: Reply with quote

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
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Mon Oct 19, 2009 7:05 am    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
fmolina



Joined: 15 Oct 2009
Posts: 10
Location: Buenos Aires, Argentina

PostPosted: Mon Oct 19, 2009 2:36 pm    Post subject: Reply with quote

OK, I understand. Any guess about when the 'due course' will arrive?

Thanks for the attention

Fernando
Back to top
View user's profile Send private message
silverfrost
Site Admin


Joined: 29 Nov 2006
Posts: 191
Location: Manchester

PostPosted: Mon Oct 19, 2009 7:07 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
fmolina



Joined: 15 Oct 2009
Posts: 10
Location: Buenos Aires, Argentina

PostPosted: Mon Oct 19, 2009 9:10 pm    Post subject: Reply with quote

Excellent!

Thanks a lot
Back to top
View user's profile Send private message
JohnCampbell



Joined: 16 Feb 2006
Posts: 2554
Location: Sydney

PostPosted: Tue Oct 20, 2009 1:02 am    Post subject: Reply with quote

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
View user's profile Send private message
fmolina



Joined: 15 Oct 2009
Posts: 10
Location: Buenos Aires, Argentina

PostPosted: Tue Oct 20, 2009 3:34 am    Post subject: Reply with quote

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
View user's profile Send private message
JohnCampbell



Joined: 16 Feb 2006
Posts: 2554
Location: Sydney

PostPosted: Tue Oct 20, 2009 7:30 am    Post subject: Reply with quote

I am surprised that Netlib have general use of kind as "real (kind = Cool" 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
View user's profile Send private message
fmolina



Joined: 15 Oct 2009
Posts: 10
Location: Buenos Aires, Argentina

PostPosted: Tue Oct 20, 2009 1:39 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
Goto page 1, 2  Next
Page 1 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