home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!usc!rpi!crdgw1!ge-dab!puma.ATL.GE.COM!fergie.dnet.ge.com!wmitchel
- From: wmitchel@fergie.dnet.ge.com (Bill Mitchell)
- Newsgroups: comp.lang.fortran
- Subject: Re: Size of executables
- Message-ID: <1992Sep8.141200.12145@puma.ATL.GE.COM>
- Date: 8 Sep 92 14:12:00 GMT
- References: <9209031948.AA10327@ros6.gsfc.nasa.gov>
- Sender: news@puma.ATL.GE.COM (USENET News System)
- Organization: GE Advanced Technology Labs
- Lines: 77
-
- It would seem there is more than just a question of shared/static
- libraries involved here. Consider the following two programs:
-
- edgar% cat test1.f
- END
- edgar% cat test2.f
- parameter(ndim=128)
- real a(ndim,ndim),b(ndim,ndim),c(ndim,ndim)
- real second
- ......trivial main program to initialize a,b,c,n, call matmul
- between calls to second, and print results, omitted ......
- stop
- end
- subroutine matmul(a,b,c,n,lda)
- real a(lda,*),b(lda,*),c(lda,*)
- real sdot
- do i=1,n
- do j=1,n
- c(i,j)=sdot(n,a(i,1),lda,b(1,j),1)
- end do
- end do
- return
- end
- REAL FUNCTION SDOT(N,SX,INCX,SY,INCY)
- C
- ......... Level 1 BLAS routine SDOT from netlib omitted ........
- END
- function second()
- c
- c returns user time since beginning of program
- c
- real dummy,times(2)
- c
- dummy = etime(times)
- second = times(1)
- c
- return
- end
-
- Compiled on a Sun SPARCstation IPC running SunOS 4.1.1. I get
-
- edgar% f77 -o test1 test1.f
- test1.f:
- MAIN:
- edgar% f77 -o test2 test2.f
- test2.f:
- MAIN:
- matmul:
- sdot:
- second:
- edgar% ls -l
- total 315
- -rwxr-xr-x 1 wmitchel 147456 Sep 2 11:20 test1*
- -rw-r--r-- 1 wmitchel 10 Sep 2 10:42 test1.f
- -rw-r--r-- 1 wmitchel 88 Sep 2 11:21 test1.o
- -rwxr-xr-x 1 wmitchel 147456 Sep 2 11:21 test2*
- -rw-r--r-- 1 wmitchel 2345 Sep 2 10:49 test2.f
- -rw-r--r-- 1 wmitchel 5236 Sep 2 11:21 test2.o
-
- Why are the two executable *exactly* the same size?
-
- BTW, on a VAX running ULTRIX I get
-
- -rwxr-xr-x 1 wmitchel 24576 Sep 2 13:22 test1*
- -rw-r--r-- 1 wmitchel 10 Sep 2 10:42 test1.f
- -rw-r--r-- 1 wmitchel 124 Sep 2 13:22 test1.o
- -rwxr-xr-x 1 wmitchel 35840 Sep 2 13:22 test2*
- -rw-r--r-- 1 wmitchel 2350 Sep 2 13:21 test2.f
- -rw-r--r-- 1 wmitchel 3544 Sep 2 13:22 test2.o
-
- --
- -- Bill
-
- William F. Mitchell | wmitchell@atl.ge.com
- GE Advanced Technology Labs | na.mitchell@na-net.ornl.gov
-
- Just the facts -- no opinion disclaimer necessary.
-