Looking for a real Fortran-66 compatible PC compiler (CP/M or DOS or at least also Windows, doesn't matter)

556 views
Skip to first unread message

comp...@is-not-my.name

unread,
Dec 30, 2010, 10:46:03 AM12/30/10
to
On 2010-12-26, Peter Dassow wrote:

> Hi,
>
> I have to compile some very old Fortran-66 programs, but I do not have
> an IBM host or a TOPS-10/VMS machine.

Hello Peter,

Do you simply need to compile the programs or do you need to actually run
them?

> So I am looking for a real compatible compiler for these old sources,
> Fortran-80 (CP/M) is one of the candidates, but there are problems with
> the data types. Are there any other PC compatible Fortran-66 compilers
> out there ?

From a little time searching the web I found a thread here:

http://lists.apple.com/archives/fortran-dev/2009/Mar/threads.html

reading through it suggests a modern compliant compiler should compile
compliant code from the old days. One of the great things about old
languages, especially old languages IBM supported, is almost everything
that used to work 50 years ago still does today.

Therefore, http://www.gfortran.org/ might be a good first stop. I don't
know if they have a Windows version but they (gcc) usually do have
somebody building Windows installers.

If you can't find a PC compiler that works then emulating an old system is
going to be one way to go although it's a big hammer when all you want to
do is compile old code. You can make a virtual VAX or PDP machine and it
will be just like the old days, only faster and it won't heat up your
room. You can find a lot of doc on http://www.bitsavers.org for old
hardware and software. They host some old software as well.

http://simh.trailing-edge.com/ is a site hosting emulator software and OS
and other kits. It has a lot of PDP stuff which should be very helpful. I
would also recommend looking for computer history sites and vintage
computing sites, for someone who might have an old CP/M or DOS
compiler. Many times the vintage sites have buy/sell sections.

I found an interesting page here but it may not be immediately relevant for
your project. Lots of good info here for FORTRAN historians.

http://www.softwarepreservation.org/projects/FORTRAN/

> [It's been a long time since anyone cared about F66. You might consider
> running an old IBM system on Hercules, the freeware IBM emulator
> http://www.hercules-390.org/ -John]

This is a good suggestion if you're familiar with old IBM OS but if not, it
will be so painful it won't be worth it. The yahoo groups supporting
hercules do have very helpful guys but to go through all that just to
install a FORTRAN compiler is overkill unless you're rich and retired and
bored.

If you actually need to compile and run and work on old code you really
should get an environment for your PC and that may require you to set up a
vintage OS and compilers and use Linux to host it. Hopefully gfortran will
run on Windows or you'll find an old compiler for CP/M or DOS and you'll be
done.

I saw this link http://www.retroarchive.org/dos/lang/index.html
(retroarchive is actually linked from your z80 site so you probably checked
here already) but it looks like there is a DOS FORTRAN compiler from
IBM. Have you tried it?

If for some reason you just need (as you said) to compile but not actually
run the code, I have access to IBM F and G level FORTRAN (1974 and earlier)
which are FORTRAN IV compilers. FORTRAN IV is not exactly F66 but it should
be close enough. I'm not sure what good it will do to compile the code for
an IBM mainframe if you don't have anything to run the code on. I didn't
understand exactly what you want to do, perhaps you could explain a little
further.

How much code do you have, as in how many modules and how many lines,
approximately?

I'm interested in vintage computing and I have various old/ancient
compilers installed. A great site for IBM fans is

http://www.jaymoseley.com/hercules/

Jay has done a tremendous amount of work rounding up old compilers and
tools and packaging them for MVS3.8J or later systems. You will need some
MVS sysprog experience or a couple of sixpacks and a pretty good buddy.

Hope this helps. I follow the list watching vintage computing and language
discussions with interest.

steve

unread,
Dec 31, 2010, 4:56:59 PM12/31/10
to
On Dec 30, 7:46 am, compil...@is-not-my.name wrote:

> From a little time searching the web I found a thread here:
>
> http://lists.apple.com/archives/fortran-dev/2009/Mar/threads.html
>
> reading through it suggests a modern compliant compiler should compile
> compliant code from the old days. One of the great things about old
> languages, especially old languages IBM supported, is almost everything
> that used to work 50 years ago still does today.

This is almost true. Fortran 95 has short list of deleted features
(e.g., REAL do-loop index). Most (all?) modern compilers still
implement the deleted feature. More importantly there are two
F66 features that most (all?) modern compilers do not implement.
I cannot remember one and would need to pull out my copy
of F66 to find it. The other feature is the extended do loop.
From F66:

7.1.2.8.2 A DO is said to have an EXTENDED RANGE if both
of the following conditions apply:

(1) There exists a GO TO statement or arithmetic IF
statement within the range of the innermost DO of a
completely nested nest that can cause control to pass
out that nest.

(2) There exists a GO TO statement of arithmetic IF
statement not within the nest that, in the collection
of all possible sequences of execution in the particular
program unit, could be executed after a statement of the
type described in (1), and the execution of which could
cause control to return into the range of the innermost
DO of the completely nested nest.

This looks like an early attempt at exception handling.

> Therefore,http://www.gfortran.org/might be a good first stop. I don't


> know if they have a Windows version but they (gcc) usually do have
> somebody building Windows installers.

Yes, there are windows builds. Go to the gfortran wiki.
http://gcc.gnu.org/wiki/GFortran

If OP doesn't want to bother with installing gfortran, I'm more
than willing to throw his code at gfortran. Feel free to contact
me off list.
--
steve

glen herrmannsfeldt

unread,
Jan 2, 2011, 1:20:15 AM1/2/11
to
steve <kar...@comcast.net> wrote:
> On Dec 30, 7:46 am, compil...@is-not-my.name wrote:
(snip)

>> One of the great things about old languages, especially old
>> languages IBM supported, is almost everything that used to
>> work 50 years ago still does today.

> This is almost true. Fortran 95 has short list of deleted features
> (e.g., REAL do-loop index). Most (all?) modern compilers still
> implement the deleted feature. More importantly there are two
> F66 features that most (all?) modern compilers do not implement.
> I cannot remember one and would need to pull out my copy
> of F66 to find it. The other feature is the extended do loop.
> From F66:

The H format descriptor might be the other one.

> 7.1.2.8.2 A DO is said to have an EXTENDED RANGE if both
> of the following conditions apply:

> (1) There exists a GO TO statement or arithmetic IF
> statement within the range of the innermost DO of a
> completely nested nest that can cause control to pass
> out that nest.

> (2) There exists a GO TO statement of arithmetic IF
> statement not within the nest that, in the collection
> of all possible sequences of execution in the particular
> program unit, could be executed after a statement of the
> type described in (1), and the execution of which could
> cause control to return into the range of the innermost
> DO of the completely nested nest.

> This looks like an early attempt at exception handling.

In Fortran I, SUBROUTINE, CALL, and FUNCTION hadn't yet been added.

ASSIGNed GOTO could be used to fake subroutine calls. ASSIGN
the label of the statement to return to to an appropriate variable,
then GOTO to the subroutine. At the end, an assigned GOTO returns.

Since you want to be able to do subroutine calls from inside DO loops,
extended range was allowed. Of course now no-one thinks anything
unusual at all about a CALL inside a DO loop.

-- glen
[How could you forget FREQUENCY ? -John]

glen herrmannsfeldt

unread,
Jan 2, 2011, 11:54:48 PM1/2/11
to
glen herrmannsfeldt <g...@ugcs.caltech.edu> wrote:

(big snip)

> [How could you forget FREQUENCY ? -John]

I do remember wondering not so many years ago why it wasn't
brought back again. People seem much more interested in
optimization that they were 50 years ago.

Getting out my copy (printed from a PDF somewhere on the web)
of the Fortran manual for the 704...

"The FREQUENCY statement permits the programmer to give his
estimate, for each branch-point of control, of hte frequencies
with which the several branches will actually be executed
in the object program."

That would be useful for static branch prediction, though maybe
dynamic prediction works so well that it isn't needed.

There is also a form estimating the number of cycles for a DO loop,
which would also presumably be useful for optimization.

-- glen
[There is a legend that FREQUENCY went away when someone realized that
a compiler had implemented it backwards and nobody noticed. One of
the reasons we use optimizers is that we trust them to write nasty
tricky code correctly that would be buggy and unmaintainable if we
tried to do it by hand. -John]

Reply all
Reply to author
Forward
0 new messages