FORTRAN Question

chiba khb at chiba.Sun.COM
Tue Jun 13 16:31:26 AEST 1989


In article <8906081116.aa29217 at SMOKE.BRL.MIL> XBR2D96D at DDATHD21.BITNET (Knobi der Rechnerschrat) writes:
>Hallo everybody,
>
> a friend of mine without a network connection (poor guy) reported the
>following observation to me. When I was able to reproduce it, I didn't feel
>really happy about it. Here it comes: my friend has the following Fortran code
>
>        PROGRAM TEST
>        WRITE(*,*) 'Test Test'
>        END
>
> When compiling this code with several debug/optimize switches you get the
>following sizes for the executable image files:
>
>                 cc -xxx t.f -o t        f77 -xxx t.f -o t
>xxx=g              220472 byte             292984 byte
>xxx=O1             220388 byte             292900 byte
>xxx=O2                          same as O1
>xxx=O3                          same as O1
>
>The same program compiled on a VAX (I'm definitely not a great VAX friend) with
>the most unfavourable switches (/DEBUG=ALL/NOOPT on compile and /DEBUG/NOSYSSHR
>on link) gives a maximum size of 25000 byte (4000 byte using the shared libs).
>
>I know that RISC code is larger than CISC code, but I didn't know that the
>difference is that large. What I also don't understand is the difference
>between cc and f77. I thought if cc detects a fortran file it would just do the
>same as f77. As a last question, is SGI (or MIPS if thats the right target for
>this problem) thinking about shareable libraries beside libgl_s.a ? I think
>that would greatly reduce link time and disk usage.
>

I must confess to finding these results strange. I don't have an SGI
handy, and the local MIPSbox is busy so I tried a sun 4/330

Compiled f77 file.f

chiba:/home/tipatina/khb>size a.out
text	data	bss	dec	hex
40960	8192	7720	56872	de28
chiba:/home/tipatina/khb>ls -l a.out
-rwxr-xr-x  1 khb         57344 Jun 12 23:26 a.out*

So shared libraries are a big win ????

chiba:/home/tipatina/khb>f77 amy.f -Bstatic
chiba:/home/tipatina/khb>r ls
ls  -l a.out
-rwxr-xr-x  1 khb         98304 Jun 12 23:29 a.out*

Yeah, somewhat  220472 byte  or 292984 byte seems somewhat largeish...
someone must be asleep in the library crafting group or some such....

btw: cc *.f probably gets you some slighly different library support.
Try -v and other options to see what the compiler actually does.
Keith H. Bierman      |*My thoughts are my own. Only my work belongs to Sun*
It's Not My Fault     |	Marketing Technical Specialist    ! kbierman at sun.com
I Voted for Bill &    |   Languages and Performance Tools. 
Opus  (* strange as it may seem, I do more engineering now     *)



More information about the Comp.sys.sgi mailing list