replica nfl jerseysreplica nfl jerseyssoccer jerseyreplica nfl jerseys forums.silverfrost.com :: View topic - Porting a program fromSalford FTN77
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 

Porting a program fromSalford FTN77

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



Joined: 17 Feb 2012
Posts: 8

PostPosted: Fri Feb 17, 2012 10:17 pm    Post subject: Porting a program fromSalford FTN77 Reply with quote

I'm quite new to Silverfrost compilers and I've been asked to review and maintain a fairly large codebase written in Salford FTN77/ClearView+. Two questions:

1. Is FTN77/ClearView+ still available somewhere, so I can try the program as it is?
2. Is there a porting guide for FTN77 to FTN95? I guess most of the differences will be in ClearView+

Thanks is advance for any help!
Back to top
View user's profile Send private message
davidb



Joined: 17 Jul 2009
Posts: 560
Location: UK

PostPosted: Sat Feb 18, 2012 12:11 am    Post subject: Reply with quote

I don't know if Fortran 77 is still available.

However, you can use the Fortran 95 compiler to compile Fortran 77 programs though. There is also ClearWin+ support.

You probably don't need to convert to Fortran 95 at all unless you are planning on a major re-write of the code. You should not need to make any changes at all if the code worked previously with Salford F77.
_________________
Programmer in: Fortran 77/95/2003/2008, C, C++ (& OpenMP), java, Python, Perl
Back to top
View user's profile Send private message
AndreaC



Joined: 17 Feb 2012
Posts: 8

PostPosted: Sat Feb 18, 2012 12:35 am    Post subject: Re: Reply with quote

davidb wrote:
You probably don't need to convert to Fortran 95 at all unless you are planning on a major re-write of the code. You should not need to make any changes at all if the code worked previously with Salford F77.


Thanks, David! I already tried that and I've discovered some differences (minor so far). For instance, in the existing code I see many INCLUDE <windows.ins> and INCLUDE <colours.ins> directives, but I don't see those 2 files in FTN95. Am I missing something?
Back to top
View user's profile Send private message
davidb



Joined: 17 Jul 2009
Posts: 560
Location: UK

PostPosted: Sat Feb 18, 2012 1:36 am    Post subject: Reply with quote

AndreaC,

I don't know a lot about ClearWin+ so you might need to wait for someone else with that specific knowledge to help.

However, on my installation I have windows.ins and colours.ins (and lots of others) in C:\Program Files\Silverfrost\FTN95\include. You should have these files if you did a default install.

Once you get the files, you may need to tell the compiler where these are. In Plato there's an option in project properties for setting the include path, or if you are using the command line there is an option /INCLUDE. Alternatively the < > syntax might mean the include files in the above directory are found automatically.

One more thing, under Tools>Options in Plato there is an option "Use F77 instead of FTN95" which might be helpful.

David.
_________________
Programmer in: Fortran 77/95/2003/2008, C, C++ (& OpenMP), java, Python, Perl
Back to top
View user's profile Send private message
AndreaC



Joined: 17 Feb 2012
Posts: 8

PostPosted: Sat Feb 18, 2012 4:27 am    Post subject: Re: Reply with quote

davidb wrote:
However, on my installation I have windows.ins and colours.ins (and lots of others) in C:\Program Files\Silverfrost\FTN95\include. You should have these files if you did a default install.


Hey David, that's an excellent idea, I did a default installation, but I haven't actually checked whether I installed everything or not. ClearWin+ samples compile, though. But I definitely don't have those 2 files. I'm puzzled... I have to try reinstalling FTN95
Back to top
View user's profile Send private message
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2402
Location: Yateley, Hants, UK

PostPosted: Sat Feb 18, 2012 6:00 pm    Post subject: Reply with quote

First of all, FTN95 is completely backwards compatible with FTN77. Yes, the <> syntax tells the compiler to look in the default location for the INS files - i.e. where they were installed.

You should look at the date of the code you are dealing with. There was a very early version of Clearwin for a version of FTN77 transitional between FTN77 with its own DOS-extender (DBOS) and FTN77 for Win32. Information on the development of FTN77 ... FTN95 is given somewhere in the main Silverfrost website. However, the syntax of Clearwin+ has remained unchanged.

You can't port the Clearwin code to anything else (i.e. not Silverfrost)without a huge amount of re-writing, but you don't have to. If anything, the program will run better if recompiled with FTN95 than it did originally.

One change that you might find helps the look and feel of the program is to add the line

1 24 default.manifest

to the resources section (or the RC file) as which gives buttons and windows controls a more modern look and feel.

An old program may (or it may not!) make use of specific fonts. Some of these will have changed or been removed in current versions of Windows, so you may find yourself doing some fine tuning on this. Old windows programs tend to use colours for window backgrounds that look discordant when run in modern versions of Windows. Another thing to look out for.

Eddie
Back to top
View user's profile Send private message
simon



Joined: 05 Jul 2006
Posts: 299

PostPosted: Sun Feb 19, 2012 1:40 pm    Post subject: Reply with quote

Try replacing
Code:
INCLUDE <windows.ins>

with
Code:
USE clrwin
Back to top
View user's profile Send private message
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2402
Location: Yateley, Hants, UK

PostPosted: Tue Feb 21, 2012 2:39 pm    Post subject: Reply with quote

Simon,

I think it highly unlikely that changing an INCLUDE to a USE (regardless of the merits of the Fortran-90/95 syntax) will solve the particular problem, as the INS file is installed into the same folder as the MOD file, and I don't think that it is possible to just install MOD files when you install FTN95. WINDOWS.INS actually contains 3 further nested INCLUDEs, and whether or not CLRWIN.MOD has the same functionality as CLEARWIN.INS (or the three parts of WINDOWS.INS) is something I am not knowledgeable enough to comment on - you can read the INS file, but the contents of the MOD file are not readable.

I recommend changing the absolute minimum of source code when trying to get an old program working. Code that compiled with FTN77 (and Clearwin) should compile and run straightaway with no errors with FTN95 (as noted by davidb). Once it is working then by all means change to a modern syntax. Otherwise, what happens is that you never know where the problem lies: with the original, or with your modifications.

COLOURS.INS sets up the 16 colour names for VGA, which rather suggests that the original application doesn't use RGB_colours, and may look a bit old-fashioned when it runs.

Eddie
Back to top
View user's profile Send private message
AndreaC



Joined: 17 Feb 2012
Posts: 8

PostPosted: Tue Feb 21, 2012 4:45 pm    Post subject: Thanks! Reply with quote

Thanks everybody for the help! I've reinstalled FTN95 and I got all the include files, indeed. I was able to compile most of the code (even though Plato was not really happy with 800+ source files...) but I have a few syntax errors to fix.

Thanks again, I'm really impressed by the responsiveness of this community!
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Tue Feb 21, 2012 4:51 pm    Post subject: Reply with quote

If you have 800+ source files in a Plato project then you may need to disable the dependency checking (found on the main Project menu).
Back to top
View user's profile Send private message AIM Address
AndreaC



Joined: 17 Feb 2012
Posts: 8

PostPosted: Tue Feb 21, 2012 6:20 pm    Post subject: Re: Reply with quote

PaulLaidler wrote:
If you have 800+ source files in a Plato project then you may need to disable the dependency checking (found on the main Project menu).


Oh, thanks! That's why Plato was choking!
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 -> General 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