Absoft F77 for Linux

Second Impressions

I now am trying to compile and run a huge data-analysis code. This code is the source of our search beyond f2c, which is otherwise quite reasonable. The data-analysis code is packed with VAX Fortran extensions such as esoteric FORMAT statements, CRAY-style pointers, and most importantly DEC-style STRUCTUREs (as opposed to F90 derived TYPEs which accomplish the same thing.) There is also lots of storage association, as we are dealing with hardware quantities. Cross-language (Fortran to C and back) issues are also important.

I encountered my first bug in the Absoft compiler here. It turns out that if one uses deeply-nested STRUCTUREs in the code, it can confuse the part of the compiler that generates debugger info. This results in certain symbols left laying around in the object file, which are then never resolved by the linker. Without some workaround (convincing the linker to ignore them?) this makes the debugger unusable for some programs. Absoft tech support has told me they are looking into it.

Here are a list of language-incompatibilites I ran into. The code I'm porting compiles with no errors under HP/UX.

o variable-length FORMAT specifiers (e.g. FORMAT(1x,f10.4,4x,A<I2>)).
  This is a means to specify at run time a character field length.
  This is not accepted by Absoft, but is not necessary since one can
  ensure that the string being printed by the "A" format has the
  desired length, and "A" with no width will use the string length.
  This is not the case, however, with the "I", "F", and other Format
  descriptors, and a run-time workaround was necessary.

o changes were needed in declaration of form logical event_hbit*1(NHITBIT)
  to logical*1 event_hbit(NHITBIT).  Absoft F77 doesn't support the

o a function was declared to be character*(NHIT) function blortch(args)
  This was not accepted since NHIT was declared (as a PARAMETER) in an
  "include" statement in the following line.  Absoft complained about it not
  being defined yet.  Makes sense, but other compilers accepted it.

o Some DATA statements had to be moved towards the end of the declaration
  region of routines, since for some reason Absoft F77 refuses to let
  you declare a STRUCTURE after any DATA statement has appeared.

o VAX/VMS RECORDTYPE qualifier on OPEN statement not supported.  Workaround
  for variable-length records was to  specify BLOCK=-1.

o Absoft F77 was very strict about making intrinsic functions with multiple
  arguments (e.g. MIN or MAX) having all arguments of the same type.

o Absoft got confused about where the continuation character was on files
  which were done in VAX TAB Format.

o Absoft does not allow intrinsic functions to be used in PARAMETER
  not allowed.

o Absoft did not like two different BLOCK DATA routines having access to
  the same COMMON block.

o Absoft caught a bug in a DATA statement which HP/UX let slip.

o Absoft doesn't like two different MAPs in a UNION having a namespace
  overlap.  For example:

	      real r, theta, phi
	      real r, z,  phi

  will not be accepted, since r and phi are defined in two places.
  HP/UX will let you do this.  The workaround is to use something like

	real r
	      real theta
	      real z
	real phi

o Absoft did not like the following:


  Said "multiple definition of RAN1".

All in all, fairly reasonable. I actually agree with Absoft in many of the cases where it differs with HP/UX Fortran. The large list of differences should not be construed as a criticism of either Absoft or HP/UX. I just want to give people a realistic idea of the incompatibilities I experienced.