From owner-freebsd-questions@FreeBSD.ORG Thu Jun 5 13:50:26 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 825EC1065678 for ; Thu, 5 Jun 2008 13:50:26 +0000 (UTC) (envelope-from mexas@bristol.ac.uk) Received: from dirg.bris.ac.uk (dirg.bris.ac.uk [137.222.10.102]) by mx1.freebsd.org (Postfix) with ESMTP id 3CE028FC22 for ; Thu, 5 Jun 2008 13:50:26 +0000 (UTC) (envelope-from mexas@bristol.ac.uk) Received: from isis.bris.ac.uk ([137.222.10.63]) by dirg.bris.ac.uk with esmtp (Exim 4.69) (envelope-from ) id 1K4FrB-0003S2-Oc; Thu, 05 Jun 2008 14:50:25 +0100 Received: from mech-aslap33.men.bris.ac.uk ([137.222.184.33]) by isis.bris.ac.uk with esmtp (Exim 4.67) (envelope-from ) id 1K4FrA-0002SH-TD; Thu, 05 Jun 2008 14:50:21 +0100 Received: from mech-aslap33.men.bris.ac.uk (localhost [127.0.0.1]) by mech-aslap33.men.bris.ac.uk (8.14.2/8.14.2) with ESMTP id m55DoFwd052261; Thu, 5 Jun 2008 14:50:20 +0100 (BST) (envelope-from mexas@bristol.ac.uk) Received: (from mexas@localhost) by mech-aslap33.men.bris.ac.uk (8.14.2/8.14.2/Submit) id m55DoFpe052260; Thu, 5 Jun 2008 14:50:15 +0100 (BST) (envelope-from mexas@bristol.ac.uk) X-Authentication-Warning: mech-aslap33.men.bris.ac.uk: mexas set sender to mexas@bristol.ac.uk using -f Date: Thu, 5 Jun 2008 14:50:15 +0100 From: Anton Shterenlikht To: Tobias Hoellrich Message-ID: <20080605135015.GA52233@mech-aslap33.men.bris.ac.uk> Mail-Followup-To: Tobias Hoellrich , freebsd-questions@freebsd.org References: <20080605132106.GA51988@mech-aslap33.men.bris.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-Spam-Score: -1.3 X-Spam-Level: - Cc: freebsd-questions@freebsd.org Subject: Re: size of executable - g95 vs gfortran42 - shared libs? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jun 2008 13:50:26 -0000 On Thu, Jun 05, 2008 at 06:29:35AM -0700, Tobias Hoellrich wrote: > > > > 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? > > 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 => /lib/libutil.so.7 (0x28082000) > libncurses.so.7 => /lib/libncurses.so.7 (0x28090000) > libc.so.7 => /lib/libc.so.7 (0x280cf000) > [root@santafe ~]# Many thanks, the ldd resuts differ, but how does this translate into size? % ls -al *out -rwxr-xr-x 1 mexas wheel 546413 5 Jun 14:39 g95.out -rwxr-xr-x 1 mexas wheel 9179 5 Jun 14:39 gf42.out % file *out g95.out: ELF 32-bit LSB executable, Intel 80386, version 1 (FreeBSD), for FreeBSD 7.0 (700109), dynamically linked (uses shared libs), FreeBSD-style, not stripped gf42.out: ELF 32-bit LSB executable, Intel 80386, version 1 (FreeBSD), for FreeBSD 7.0 (700109), dynamically linked (uses shared libs), FreeBSD-style, not stripped % ldd *.out g95.out: libm.so.5 => /lib/libm.so.5 (0x280c5000) libc.so.7 => /lib/libc.so.7 (0x280db000) gf42.out: libgfortran.so.2 => /usr/local/lib/gcc-4.2.4/libgfortran.so.2 (0x2807e000) libm.so.5 => /lib/libm.so.5 (0x28103000) libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x28119000) libc.so.7 => /lib/libc.so.7 (0x28124000) % -- Anton Shterenlikht Room 2.6, Queen's Building Mech Eng Dept Bristol University University Walk, Bristol BS8 1TR, UK Tel: +44 (0)117 928 8233 Fax: +44 (0)117 929 4423