comp.lang.ada
 help / color / mirror / Atom feed
From: RCAPENER@cc.utah.edu
Subject: Re: Sizes of executables from VMS (was UNIX) Compilers
Date: 10 Jun 90 06:46:16 GMT	[thread overview]
Message-ID: <68773@cc.utah.edu> (raw)
In-Reply-To: 1990Jun8.213230.10693@cbnewsl.att.com

In article <1990Jun8.213230.10693@cbnewsl.att.com>,
arny@cbnewsl.att.com (arny.b.engelson) writes:

	[ Hello World code and other stuff deleted ]

> I can't believe I'm doing this.  I got curious enough to go run these on
> a VAX/VMS system using DEC's Ada and C compilers.  Given the results, I
> decided to post them (and start a war I'm sure, but what the hell)...
> 
> First of all, I ran the compilers with their default settings, no special
> optimizations, pragmas, options, nothing.  Second, the source looks exactly
> like Mike's programs above.  Last, the results:
> 
> Ada executable =  6 blocks (512 byte blocks)
> C   executable = 87 blocks   "
>

I can't either, since I assume you already know that Ada (and almost all
other languages on VAX-VMS) link in the shared libraries by default, while
C does not.  To do that you need a file (name it SHARE.OPT) in your SYS$LOGIN
directory that has the following line in it:

sys$share:vaxcrtl/share

then you link your files as follows:

link file1,file2,file3,sys$login:share.opt/opt

You can also create a simple clink.com file for handling one *.obj file
that was created from one C source file.  Put it in your SYS$LOGIN dir.
It is as follows:

$ if "''p1'" .nes. "" then goto$ setlinkfile
$ if "''shlinkprevfile'" .eqs. "" then goto$ getfile
$ $goto dolink
$ getfile:
$ inquire p1 "enter filename"
$ setlinkfile:
$ shlinkprevfile == "''p1'"
$ dolink:
$ link 'shlinkprevfile',sys$login:share.opt/opt
$ assign/user sys$command sys$input
$ exit

You also need the following line in your LOGIN.COM file:

$ clink :== @sys$login:clink

You will notice that now that the C code is linked with the shareable
libraries, it shrinks drastically in size, and is usually smaller than
the equivalent Ada *.exe file.

This blurb was provided for the enlightenment for those in the Ada
community that work strictly on UNIX and DOS machines.  If you link
the non-shared libraries with C (the default), and link the shared
libraries with Ada (also the default) on VAX-VMS, you are comparing
apples with oranges.  Link the C generated code shared, and we have
a fairer apples - apples comparison.  I am sure Arny knew this, and
produced it solely for the entertainment of the VAX-VMS community.


Happy times with Ada (pun intended)

  parent reply	other threads:[~1990-06-10  6:46 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1990-06-04 22:35 Sizes of executables from Unix compilers Michael Feldman
1990-06-06  6:37 ` Erland Sommarskog
1990-06-06 23:06   ` Doug McDonald
1990-06-07  3:57     ` diamond@tkovoa
1990-06-09 15:26   ` Sizes of executables from (UNIX) VMS compilers tdhammer
1990-06-11 14:47     ` David Kassover
1990-06-11 16:43       ` Paul A. Varner
1990-06-08 21:32 ` Sizes of executables from Unix compilers arny.b.engelson
1990-06-09  4:01   ` Michael Feldman
1990-06-10  6:46   ` RCAPENER [this message]
1990-06-11 14:56     ` Sizes of executables from VMS (was UNIX) Compilers arny.b.engelson
1990-06-12 22:05   ` Sizes of executables from Unix compilers Erland Sommarskog
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox