Silverfrost Forums

Welcome to our forums

FTN95 options

26 Aug 2015 9:56 #16761

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

27 Aug 2015 11:50 #16763

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.

27 Aug 2015 8:55 #16764

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.

30 Aug 2015 4:31 #16766

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

30 Aug 2015 11:02 #16768

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

1 Sep 2015 8:32 #16772

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

2 Sep 2015 12:07 #16773

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

2 Sep 2015 12:07 #16774

Quoted from kaliuzhkin

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

ftn95 file1.f90
ftn95 file2.f90

will produce file1.obj, file2.obj, and will not call the linker.

2 Sep 2015 11:05 #16775

kaliuzhkin wrote

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

2 Sep 2015 6:31 #16776

http://www.lahey.com/docs/LangRefEXP73_revG05.pdf is a bad link. However, I found and downloaded LF Fortran Express User’s Guide Revision D.05

2 Sep 2015 6:34 #16777

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]

3 Sep 2015 2:49 #16778

See this recent thread for examples of code with the WINAPP directive: http://forums.silverfrost.com/viewtopic.php?t=3072&postdays=0&postorder=asc&start=0 .

3 Sep 2015 4:28 #16784

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.

Please login to reply.