Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!yale!cmcl2!acf4!mcqueen From: mcqueen@acf4.NYU.EDU (David M. McQueen) Newsgroups: comp.sys.sgi Subject: Re: executable size Message-ID: <17280032@acf4.NYU.EDU> Date: 24 Feb 90 14:18:00 GMT References: <3747@uceng.UC.EDU> Organization: New York University Lines: 40 /* 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."