View previous topic :: View next topic |
Author |
Message |
AndreaC
Joined: 17 Feb 2012 Posts: 8
|
Posted: Fri Feb 17, 2012 10:17 pm Post subject: Porting a program fromSalford FTN77 |
|
|
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 |
|
 |
davidb
Joined: 17 Jul 2009 Posts: 560 Location: UK
|
Posted: Sat Feb 18, 2012 12:11 am Post subject: |
|
|
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 |
|
 |
AndreaC
Joined: 17 Feb 2012 Posts: 8
|
Posted: Sat Feb 18, 2012 12:35 am Post subject: Re: |
|
|
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 |
|
 |
davidb
Joined: 17 Jul 2009 Posts: 560 Location: UK
|
Posted: Sat Feb 18, 2012 1:36 am Post subject: |
|
|
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 |
|
 |
AndreaC
Joined: 17 Feb 2012 Posts: 8
|
Posted: Sat Feb 18, 2012 4:27 am Post subject: Re: |
|
|
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 |
|
 |
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2402 Location: Yateley, Hants, UK
|
Posted: Sat Feb 18, 2012 6:00 pm Post subject: |
|
|
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 |
|
 |
simon
Joined: 05 Jul 2006 Posts: 299
|
Posted: Sun Feb 19, 2012 1:40 pm Post subject: |
|
|
Try replacing
Code: | INCLUDE <windows.ins> |
with
|
|
Back to top |
|
 |
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2402 Location: Yateley, Hants, UK
|
Posted: Tue Feb 21, 2012 2:39 pm Post subject: |
|
|
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 |
|
 |
AndreaC
Joined: 17 Feb 2012 Posts: 8
|
Posted: Tue Feb 21, 2012 4:45 pm Post subject: Thanks! |
|
|
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 |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8210 Location: Salford, UK
|
Posted: Tue Feb 21, 2012 4:51 pm Post subject: |
|
|
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 |
|
 |
AndreaC
Joined: 17 Feb 2012 Posts: 8
|
Posted: Tue Feb 21, 2012 6:20 pm Post subject: Re: |
|
|
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 |
|
 |
|