View previous topic :: View next topic |
Author |
Message |
kaliuzhkin
Joined: 17 Sep 2012 Posts: 33
|
Posted: Wed Aug 26, 2015 10:56 pm Post subject: FTN95 options |
|
|
I am new at using FTN95 and am struggling with the options. My computer does not have Visual Studio and I doubt if it has .NET. I suppose its Win32.
What options should I select in order to produce object files? /
-CLR and /-LINK?
I'm an oldtime programmer and in the 1970's, I worked professionally as a scientific programmer. Boy, have things changed!
Dan Kalish |
|
Back to top |
|
|
IanLambley
Joined: 17 Dec 2006 Posts: 490 Location: Sunderland
|
Posted: Thu Aug 27, 2015 12:50 pm Post subject: |
|
|
Try using Plato instead of visual studio.
Create a new project, select all your source files, you may have to change the type to ".for" as this is not the default.
Put WINAPP as the first line of your main program.
Then use the "Project, Properties" menu option set all the switches you might need. First start with:
Configuration: Checkmate
Platform: Win32
Then use the build menu option to Build, Rebuild or Start Run.
Regards
Ian
Ah! programming in the 1970s.... Such memories. |
|
Back to top |
|
|
DanRRight
Joined: 10 Mar 2008 Posts: 2834 Location: South Pole, Antarctica
|
Posted: Thu Aug 27, 2015 9:55 pm Post subject: |
|
|
Perhaps Silverfrost has to create Youtube presentation "Getting Started" as well as a guide on the website. The "Teardown of iPhone6" or "Teardown iPad" by iFixit on website and YouTube are good examples. Important to create that i think just right now as the students return to the classes and engineers and scientists to their labs from vacations. |
|
Back to top |
|
|
JohnCampbell
Joined: 16 Feb 2006 Posts: 2560 Location: Sydney
|
Posted: Sun Aug 30, 2015 5:31 am Post subject: |
|
|
If you are an oldtime programmer, you probably know about dos boxes or cmd.exe.
Assuming your program is called "test.f95" for free format or "test.for" for old fixed format code layout:
You can compile the program using the command : FTN95 test
This will produce a file "test.obj" or some error messages. You will also probably get some warning messages, which don't stop the .obj file from being created.
If the program does compile, there are a number of ways to run it or produce a .exe file. options are:
FTN95 test /LGO
FTN95 test /LINK
SLINK test.obj (SLINK is the linker for FTN95)
Note that this is not unix/Linux so options start with a / and case is not important.
Probably the best way to start is to use
FTN95 test /check /lgo ( this may start SDBG if you have run time errors )
or
FTN95 test /debug /link
FTN95 /? will give you a list of all the options.
RTFM for compiler options and for SLINK or SDBG and you will find a lot more info.
If none of this works, then check your PATH. You probably don't have the environment variables set correctly.
see C:\Program Files (x86)\Silverfrost\ftn95\fvars.bat for details.
Good luck,
John |
|
Back to top |
|
|
DanRRight
Joined: 10 Mar 2008 Posts: 2834 Location: South Pole, Antarctica
|
Posted: Sun Aug 30, 2015 12:02 pm Post subject: |
|
|
There are several major options for "Getting Started" with this compiler, using or not Plato and using or not MS Dev Studio.
For English speaking developers of this compiler this would not be as hard to cover all of them in short "Getting Started in 3 minutes" movies and few easy looking web pages with pictures |
|
Back to top |
|
|
kaliuzhkin
Joined: 17 Sep 2012 Posts: 33
|
Posted: Tue Sep 01, 2015 9:32 pm Post subject: different objective |
|
|
Okay, I've gotten somewhere, but now for some different objectives and additional questions:
I've gotten somewhere with Plato, but ...
Using Plato as an editor, it doesn't do much for fixed format positioning. The tabs are at 0.5", 1.0", etc. And, the tabs get interpreted as spaces. So, even if I start a statement at [tab][tab], the compiler reads it as position 0.3". This doesn't have any advantage over editing with Notebook.
If I compile from Plato, I don't get a list file, even though FTN95.cfg includes /LIST. I have to compile from the command prompt and then review the *.LIS file in Plato.
Back to the command prompt, sometimes I'd like the compiler to generate *.obj files but NOT link them. E.g., if my source files must be separately compiled and then linked together, say, with SLINK. What command does that?
Anyway, this is far easier than JCL
Lastly, where is an online reference to Fortran statements? I've got a couple of books but there must be some online reference.
Thanks |
|
Back to top |
|
|
DanRRight
Joined: 10 Mar 2008 Posts: 2834 Location: South Pole, Antarctica
|
Posted: Wed Sep 02, 2015 1:07 am Post subject: |
|
|
I do not use Plato because I did not like its TAB options there but after discussing thiis issue here i thought it was fixed, no?
To get OBJ file using command prompt just type: FTN95 FILENAME.FOR (the letters do not have to be capital) for fixed source formats or FTN95 FILENAME for free sources (you do not need extension if it is F95 instead of FOR or F on any other) and this will generate you FILENAME.OBJ |
|
Back to top |
|
|
mecej4
Joined: 31 Oct 2006 Posts: 1895
|
Posted: Wed Sep 02, 2015 1:07 am Post subject: Re: different objective |
|
|
kaliuzhkin wrote: |
Back to the command prompt, sometimes I'd like the compiler to generate *.obj files but NOT link them. E.g., if my source files must be separately compiled and then linked together, say, with SLINK. What command does that?
Thanks |
The sequence of commands
Code: | ftn95 file1.f90
ftn95 file2.f90
|
will produce file1.obj, file2.obj, and will not call the linker. |
|
Back to top |
|
|
JohnCampbell
Joined: 16 Feb 2006 Posts: 2560 Location: Sydney
|
Posted: Wed Sep 02, 2015 12:05 pm Post subject: |
|
|
kaliuzhkin wrote Quote: | Lastly, where is an online reference to Fortran statements? I've got a couple of books but there must be some online reference. |
For many years I have utilised the Fortran 95 language reference at Lahey. You can find it at:
http://www.lahey.com/docs/LangRefEXP73_revG05.pdf
It is a very useful and concise record of all Fortran statements.
John |
|
Back to top |
|
|
kaliuzhkin
Joined: 17 Sep 2012 Posts: 33
|
|
Back to top |
|
|
kaliuzhkin
Joined: 17 Sep 2012 Posts: 33
|
Posted: Wed Sep 02, 2015 7:34 pm Post subject: Re: |
|
|
Do I position "WINAPP" before or after the PROGRAM or SUBROUTINE statement?
[quote="IanLambley"]Try using Plato instead of visual studio.
Create a new project, select all your source files, you may have to change the type to ".for" as this is not the default.
Put WINAPP as the first line of your main program.
Then use the "Project, Properties" menu option set all the switches you might need. First start with:
Configuration: Checkmate
Platform: Win32
Then use the build menu option to Build, Rebuild or Start Run.
Regards
Ian
Ah! programming in the 1970s.... Such memories.[/quote] |
|
Back to top |
|
|
mecej4
Joined: 31 Oct 2006 Posts: 1895
|
|
Back to top |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2391 Location: Yateley, Hants, UK
|
Posted: Thu Sep 03, 2015 5:28 pm Post subject: |
|
|
I remember when the PROGRAM statement wasn't required, as any block of code NOT starting with SUBROUTINE or FUNCTION was assumed to be the main program routine, and several Fortran errors would often lead to 'Duplicate main programs' messages.
You can use directive for FTN95 in several places in your source code, but most prominently at the front, which is where WINAPP goes. You don't need WINAPP of course, in which case your program will execute in DOS mode (character mode, in a DOS box, in a command window or in Windows shell, the precise nomenclature depending on which version of windows you use). If you do use WINAPP, you have access to all sorts of Windows things through the agency of Clearwin+, and your 70s codes can be turned into Windows applications. Note that FTN95 does not have some things you may remember from back then, but it has lots that have been developed since. |
|
Back to top |
|
|
John-Silver
Joined: 30 Jul 2013 Posts: 1520 Location: Aerospace Valley
|
Posted: Thu Sep 03, 2015 8:07 pm Post subject: |
|
|
John's link to the Lahey manual is not bad, it works fine for me ! |
|
Back to top |
|
|
John-Silver
Joined: 30 Jul 2013 Posts: 1520 Location: Aerospace Valley
|
Posted: Fri Sep 04, 2015 8:01 pm Post subject: |
|
|
This post/question highlights one of the main criticisms of FTN95 by users of all levels, namely documentation.
Note that what follows is not a damning criticism of FTN95 documentation, Paul has always said that they are fully aware of the shortcomings in the various documentations. The question posed here though does illustrate well the 'barrier' that a lack of better structured documentation poses for maybe all new users. This is then more of a damning 'moan'.
Most people will search for an answwr to their problem, and expect (maybe unrealistically) to drop on the exact answer they're looking for first time !
I usually start by searching the on-line help if I have a problem.
In the case in hand, search for 'Command Line' and you're presented with a myriad of POSSIBLY related links.
Maybe this appears appropriate:-
http://silverfrost.com/ftn95-help/options/compiler_options_command_line.aspx
but on looking, it's not exactly clear is it, especially as it jumps in immen�diately with the /CLR option attached which is for .NET applications which , frankly, only a minotity of people use.
You could drop on this:-
http://silverfrost.com/ftn95-help/options/quick_reference.aspx
although it contains all (well most of) the command line options for compiling/linking it isn't maybe intuitive for new users.
One thing that is hidden in there is under /FREE_FORMAT which is the ONLY place (apart from on comments in forums) I've ever seen mention of F77 fixed format files needing to have .for extension and F95 files .f90 extension !!! Surely that should be in the main, simple opening paragraph of any documentation on running in Command Line mode ???
And someone please tell me why it's not a .f95 extension required ? ('because the differences between f90 and f95 are not very big' is not a valid answer imo)
then again you could drop on this:-
http://silverfrost.com/ftn95-help/devel/compiler_cmdline.aspx
or become befuddled by this:-
http://silverfrost.com/ftn95-help/slink/command_line_mode1.aspx
(lots of talk of colons for example, yet not a colon in sight in example !!! and what DOES that 'kite' symbol mean ? (also seen in other strange places)
Then there's the .pdf documentation, and the downloadable .chm (is that just the same as the online manual or are there differences ?, then of course the .enh file as sources for documentation of various things.
Personally I'd recommend to PrintTFM and RTFM off-line first before jumping into the on-line manual, but then I'm of the old school and have no quarms about saving the trees (if you think stopping printing stuff on paper is going to save the rain forest then you've not grasped the scale of that particular problem).
All in all these sources contain a cornucopia of information, which contains almost everything you need, but maybe not in an ordered obvious style.
As a minimum there should be a logical summary of the various documentations, and where best to look and in what order, which would help enormously new users (and old !) to find stuff and not put them off at the first hurdle.
Then there's Dan's suggestion of 'the modern way' of producing tutorial videos, which I agree would be good IF it was well done and concise.
I've seen one major company I've worked for in the past employ specifically a person to collate and organise all the documentation in the department and it was worth it's weight in gold once achieved.
Maybe Silverfrost should consider taking on a student or two on work experience to re-organise all the documentation ?
First impressions are the most important and in the case of FTN95 is an area which could be improved significantly I believe.
All Food for Thought.
... and for the 2nd time in 2 days I'll say again 'don't get me going on the inadequacies of searching in the forums. It drives me crazy.
Luckily I've passed the critical point where I have seen that the capabilities and potential of FTN95 make the documentation pains bearable, but how many don't and simply give up I wonder ? |
|
Back to top |
|
|
|