f77 and -static option

YATES, JOHN H. YATES at c.chem.upenn.edu
Mon Feb 25 03:14:00 AEST 1991


I have a Fortran program that repeatedly builds and diagonalizes a 400x400
array using routines from a math library. I find that if I compile without
the option -static, it core dumps (after about the 7th array,
about 27 minutes of CPU time). If I build the whole code with

f77 -g -static -o pa1 pa1.f pa2.f pa3.f

It did not core dump. (roughly 2 hours of CPU time, about 29 400x400 arrays.)

I learned about using -static by example from someones Makefile for a large
Fortran code, and it is described in the f77 man page, which seems to leave
it to folklore on when to use it or when it is necessary.

My questions are, 

1. should ALL Fortran Unix codes be compiled with the -static option?

2. When is it "safe" to not use it?

3. Are the unsafe -automatic Fortran constructs things like EQUIVALENCE,
   COMMON blocks, BLOCK DATA, ... and others?

4. Is it buggy Fortran code that requires -static to be used, or just normal
   Fortran coding practices?

5. What f77 options are generally regarded as "necessary" or "useful" in
   building large codes ported from non-Unix (e.g. VMS) systems.

6. Could this perhaps be an IRIX or f77 bug?

Thanks, John
yates at c.chem.upenn.edu



More information about the Comp.sys.sgi mailing list