GNU Fortran (version 3.4.6_3)

GNU Fortran (version 3.4.6 release 3)

How set up a simple application to run the GNU Fortran for RISC-OS

GNU Fortran requires a machine with at least 4Mbytes free application space
This version is claimed to be 32-bit (Iyonix) compatible.

If you already have this GNU Fortran set up and want the PGPlot package, click here

There is a rudimentary interface to RISC-OS in our library called ‘OSlibN32’ which contains many of the functions of the Utils, Graphics and SpriteOps libraries defined in our free distribution for Fortran release 2. This library has had little testing so far, (Oct 2004), we can do more testing and extend it further if there is any interest.

Now you should be ready to compile, link and run a simple Fortran program.
Double-click on the !GNUF77 which sets up system variables and opens the directory ‘myprogs’ containing the source subdirectory ‘f’ with the trivial program ‘Hello’.
The obey files ‘clr’ and ‘clrOpt’ will compile, link and run a Fortran program, either unoptimized or optimized.
‘clr’ or ‘clrOpt’ request a 4Mbyte chunk of memory for the compiler. This is not necessary for short programs and can be reduced to 3Mbytes if you only have a 4Mbyte computer (use !Edit to change the second line of these Obey files appropriately).
Open a task window (Ctrl+F12) and type ‘clr hello’ to see it perform.
It will create a directory ‘o’ with the object code and place the run image directly into ‘myprogs’.

GNU Fortran and the PGPlot graphics package

PGplot is a portable high level Fortran graphics library, written for the display of astronomical data, but useful for any scientific discipline.
Full information can be found on the official PGPlot web site: PGPlot (version 5.2.0).
Brief details and some example plots can be seen here.
The RISC OS version for GNUF77 is available from here (size 201K) and contains instructions on how to set it up. It has been compiled optimised.
It does not contain a PGPlot manual; this can be found on the PGPlot web site (above).

Bugs we have found

These we list in order of decreasing seriousness:
  1. unable to open a file with a name with a ‘/’ in it;
    unhelpful for files with DOS extensions
    no change from previous version;
  2. reading integers which are too big for the word size does not report an error, it just gives a wrong result;
    no change from previous version;
  3. does not allow trailing blanks in I/O keywords;
    no change from previous version;
  4. integer division by zero gives the diagnostic ‘Floating Exception’;
    no change from previous version.

Please send any comments to us here.

Good Luck!

Page last updated 8 February 2010
Click here to return to Fortran Friends Top page