[comp.unix.ultrix] Problem with Fortran/Mips Compiler and Blank Common Blocks

mking@lll-crg.llnl.gov (Marianne King) (10/04/90)

I'm working on a DecStation 3100/Ultrix 4.0 and using the mips FORTRAN 77
compiler.  I am porting some FORTRAN codes that compile and run 
on Sun 3s and 4s to the DecStation 3100.
The program compiles on the Ultrix machine. However, I'm having problems
loading the program.  The error message is listed at the end of this 
message.  I looked into the problem further and noticed that there are
blank common blocks called WORK that were declared 2 different sizes in
different subroutines.
In the subroutine that is referenced first WORK is declared as follows:

	PARAMETER (MAXWRK=1000000)
	COMMON WORK(MAXWRK)

Then there are several other subroutines that declare it as

	COMMON WORK(1)

I thought this is supposed to be legal FORTRAN code as long as the
first declaration is larger than subsequent ones.  
Is there a simple work around for this?

Thanks for the help.

Marianne King
Lawrence Livermore National Laboratory
(415) 423-4116
mking@lll-crg.llnl.gov

========= Error message ========
`rec_llnl_mips' is up to date.
f77 -yBLNK -y_BLNK -y_BLNK__ -o rec_donner_mips -O rec_donner.mips.o donner.mips.o  	main.mips.o ascii_file.mips.o binary_file.mips.o ctp_file.mips.o disp_funcs.mips.o  other_file.mips.o parse_args.mips.o timing.mips.o view_file.mips.o center.mips.o /usr/local/ct/lib/donnermips.a -lF77 -lI77 -lU77 -lm
donner.mips.o: definition of common _BLNK__ size 4000000
/usr/local/ct/lib/donnermips.a(setup.mips.o): definition of small common _BLNK__ size 4
/usr/local/ct/lib/donnermips.a(bkfil.mips.o): definition of small common _BLNK__ size 4
/usr/local/ct/lib/donnermips.a(ramp.mips.o): definition of common _BLNK__ size 4
/usr/local/ct/lib/donnermips.a(bin.mips.o): definition of small common _BLNK__ size 4
/usr/local/ct/lib/donnermips.a(ham.mips.o): definition of common _BLNK__ size 4
/usr/local/ct/lib/donnermips.a(han.mips.o): definition of common _BLNK__ size 4
/usr/local/ct/lib/donnermips.a(parzn.mips.o): definition of common _BLNK__ size 4
/usr/local/ct/lib/donnermips.a(buter.mips.o): definition of common _BLNK__ size 4
/usr/local/ct/lib/donnermips.a(convo.mips.o): definition of small common _BLNK__ size 4
/usr/local/ct/lib/donnermips.a(binf.mips.o): definition of small common _BLNK__ size 4
/usr/local/ct/lib/donnermips.a(congr.mips.o): definition of small common _BLNK__ size 4
/usr/local/ct/lib/donnermips.a(prf.mips.o): definition of small common _BLNK__ size 4
/usr/local/ct/lib/donnermips.a(brf.mips.o): definition of small common _BLNK__ size 4
/usr/local/ct/lib/donnermips.a(lgtxt.mips.o): definition of common _BLNK__ size 4
/usr/local/ct/lib/donnermips.a(memst.mips.o): definition of small common _BLNK__ size 4
/usr/local/ct/lib/donnermips.a(stptr.mips.o): definition of small common _BLNK__ size 4
/usr/local/ct/lib/donnermips.a(rchek.mips.o): definition of common _BLNK__ size 4
/usr/local/ct/lib/donnermips.a(getde.mips.o): definition of small common _BLNK__ size 4
/usr/local/ct/lib/donnermips.a(cisq.mips.o): definition of small common _BLNK__ size 4
/usr/local/ct/lib/donnermips.a(setit.mips.o): definition of small common _BLNK__ size 4
/usr/local/ct/lib/donnermips.a(rayst.mips.o): definition of small common _BLNK__ size 4
_BLNK__: a large common placed in gp area because also defined as small common (possible gp relocation errors may result)
_BLNK__: a large common placed in gp area because also defined as small common (possible gp relocation errors may result)
_BLNK__: a large common placed in gp area because also defined as small common (possible gp relocation errors may result)
_BLNK__: a large common placed in gp area because also defined as small common (possible gp relocation errors may result)
_BLNK__: a large common placed in gp area because also defined as small common (possible gp relocation errors may result)
_BLNK__: a large common placed in gp area because also defined as small common (possible gp relocation errors may result)
_BLNK__: a large common placed in gp area because also defined as small common (possible gp relocation errors may result)
ld:
gp relocation out-of-range errors have occured and bad object file produced (corrective action must be taken)
Best -G num value to compile all -count'ed objects creating rec_donner_mips with is 3
Above best -G num value conservative because of inconsistent
common symbol sizes. Use the -y flag to trace inconsistant common
definitions and then change source to make them consistent
Best -G num value calculation reliable only if all
-count'ed objects were compiled with -G num greater or
equal to maximum size of a literal pool item (8).
*** Error code 1