Subject: Compiling F77 on SGI and Re: CCL:RPAC 11.0

From: "Robert Fraczkiewicz" <[email-masked]>
Date: Wed, 20 Nov 1996 11:29:02 -0600

On Nov 20,  8:59am, JOCHEN BUEHLER wrote:
> Dear CCL'ers,
>
> has anybody successfully compiled RPAC 11.0 on a SGI running IRIX 6.2
> or a Cray J916 ?
> I'm getting a clean compile on the Cray but incorrect results and
> failing compiles on the SGI...
>

Dear Jochen,

Are you compiling on SGI with R10000 chip?  The new MIPSpro F77 compiler
may be buggy. Let me explain why: I have an experience compiling program
FANTOM (refinement and Monte Carlo simulations of proteins) on SGI with
R4400, SGI with R10000 and Cray J90. It compiles with or without optimization
(either partial, or complete) and runs perfectly on SGI R4400, Cray J90 and
SGI R10000 in 32-bit mode. The trouble begins when attempt is made to perform
optimized compilation in 64-bit mode on R10000, i.e. with the "f77 -64 -O2"
or "f77 -64 -O2 -r10000" commands. FANTOM is a ~17000-line code with
2200-line main program fantom.f and subroutines in separate smaller *.f
files. With the set of options quoted above the compiler performs complete
optimization of every subroutine, but only partial optimization of the main
program because of the exceeded size limits. It does not matter in 32-bit
mode: fantom.f is not fully optimized but the executable works fine.
Now the real show begins when I try to run 64-bit version irregardles of
what input file I use:

1) it crashes with "Segmentation fault".
2) it works perfectly when I do either of these:
   2.1) remove  a n y  IF statement from fantom.f
   2.2) replace the contents of  a n y  IF() THEN .... ENDIF statement
        with CONTINUE
   2.3) force complete optimization of fantom.f with -OPT:size_limit
        options
   2.4) recompile it without optimization (option -g)

I really do not want to jump to the conclusion that there is a bug in the
compiler, but this is so far the only logical solution to this puzzle.
FANTOM interprets user commands interactively and there are a lot of IF
statements in fantom.f; is there a limit to the number of IFs in the
partial compilation of F77 code?

Curious,
Robert Fraczkiewicz
University of Texas Medical Branch