Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 5 Jun 2008 06:29:35 -0700
From:      "Tobias Hoellrich" <thoellri@adobe.com>
To:        "Anton Shterenlikht" <mexas@bristol.ac.uk>, <freebsd-questions@freebsd.org>
Subject:   RE: size of executable - g95 vs gfortran42 - shared libs?
Message-ID:  <E891374F64B9194FB5BFFF28935811CA02A3EC77@namail2.corp.adobe.com>
In-Reply-To: <20080605132106.GA51988@mech-aslap33.men.bris.ac.uk>
References:  <20080605132106.GA51988@mech-aslap33.men.bris.ac.uk>

next in thread | previous in thread | raw e-mail | index | archive | help
> -----Original Message-----
> From: owner-freebsd-questions@freebsd.org=20
> [mailto:owner-freebsd-questions@freebsd.org] On Behalf Of=20
> Anton Shterenlikht
> Sent: Thursday, June 05, 2008 7:21 AM
> To: freebsd-questions@freebsd.org
> Subject: size of executable - g95 vs gfortran42 - shared libs?
>=20
> I use two different fortran90 compiler on a simple input file
> and get executables which differ in size by almost 3 orders of
> magnitude, see below. Is this something to do with the use
> of shared libraries?
>=20
> % gfortran42 tmp.f90
> % ls -al a.out
> -rwxr-xr-x  1 <xxx>  <zzz>    9179  5 Jun 14:15 a.out
> % g95 tmp.f90
> % ls -al a.out
> -rwxr-xr-x  1 <xxx>  <zzz>  546413  5 Jun 14:15 a.out
> %
>=20
> The program results seem to be identical.
>=20
> many thanks
> anton

Run "file" and "ldd" on the executables to see the difference:

[root@santafe ~]# file `which ls`
/bin/ls: ELF 32-bit LSB executable, Intel 80386, version 1 (FreeBSD),
for FreeBSD 8.0 (800038), dynamically linked (uses shared libs),
FreeBSD-style, stripped

[root@santafe ~]# ldd `which ls`
/bin/ls:
        libutil.so.7 =3D> /lib/libutil.so.7 (0x28082000)
        libncurses.so.7 =3D> /lib/libncurses.so.7 (0x28090000)
        libc.so.7 =3D> /lib/libc.so.7 (0x280cf000)
[root@santafe ~]#

Hope this helps
  Tobias



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?E891374F64B9194FB5BFFF28935811CA02A3EC77>