Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!uakari!xanth!ames!sgi!shinobu!odin!bananapc.wpd.sgi.com!ciemo From: ciemo@bananapc.wpd.sgi.com (Dave Ciemiewicz) Newsgroups: comp.sys.sgi Subject: Re: executable size Message-ID: <4529@odin.SGI.COM> Date: 24 Feb 90 21:17:46 GMT References: <17280032@acf4.NYU.EDU> <3747@uceng.UC.EDU> Sender: news@odin.SGI.COM Reply-To: ciemo@bananapc.wpd.sgi.com (Dave Ciemiewicz) Organization: Silicon Graphics, Inc. Lines: 60 In article <17280032@acf4.NYU.EDU>, mcqueen@acf4.NYU.EDU (David M. McQueen) writes: > /* acf4:comp.sys.sgi / trohling@uceng.UC.EDU (tom rohling) / 12:27 am Feb 24, 1990 */ > > > On a related note to my other article, can the size of an executable > >be reduced while still being an executable? I noticed that the size of the > >exec for some of the demos and such are very small but any extensive > >graphics thing I do is easily over 800k in size so something must have been > >done to 'em right? > > > > Any ideas? > > > >=========================================================================== > >Tom Rohling "Infinity is where things happen > >trohling@uceng.uc.edu that don't." -Anonymous > > or > >rohling@afiris.ase.uc.edu > >=========================================================================== > /* ---------- */ > > Two ways I have found to reduce the size of executables are: > > 1) compile using shared graphics libraries. As an example (Fortran, but > similar and even greater reductions are possible with C programs): > > With f77 program.f -lfgl -lgl : 652704 bytes > With f77 program.f -lfgl -lgl_s : 453440 bytes > > a reduction of about 200 Kbytes > > 2) again in Fortran, if you are using large arrays, place those arrays > in labelled common blocks. > > > =============================================================================== > Disclaimer: The above is just my opinion. God Alone Knows. > > David M. McQueen,Courant Institute of Mathematical Sciences,New York University > > "The difference between long-distance commuting and long-distance computing is > that with long-distance computing you can stay in your office and get stuck in > traffic." The MIPS compilers used on SGI, MIPS, and other competitor's workstations generate a lot of symbol information in executables, even if no debugging is selected. This symbol info includes function names, globals, and line number information. This level of detail allows you to dbx an executable (too a limited extent) or use pixie for profiling. If you are satisfied that you do not want or need any of this symbol info in you code (i.e. if you are shipping it to customers), you can strip your executable using the program strip(1). This should reduce the size of your executables by possible a couple hundred 'k'. Don't go stripping your libraries though -- you won't be able to link to them. --- Ciemo