Re: size of executable - g95 vs gfortran42 - shared libs?

2008-06-09 Thread Anton Shterenlikht
On Thu, Jun 05, 2008 at 04:07:23PM +0200, Kris Kennaway wrote:
 Anton Shterenlikht wrote:
 g95.out:
 libm.so.5 = /lib/libm.so.5 (0x280c5000)
 libc.so.7 = /lib/libc.so.7 (0x280db000)
 
 ^-- this one doesn't link to a dynamic fortran library, so it is 
 presumably statically linked, explaining the size.  Look into how the 
 file was constructed (e.g. the command used to link the binary).
 

Kris, many thanks.
I have confirmed this with Andy Vaught (g95 main developer).

-- 
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
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


size of executable - g95 vs gfortran42 - shared libs?

2008-06-05 Thread Anton Shterenlikht
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?

% gfortran42 tmp.f90
% ls -al a.out
-rwxr-xr-x  1 xxx  zzz9179  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
%

The program results seem to be identical.

many thanks
anton

-- 
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
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


RE: size of executable - g95 vs gfortran42 - shared libs?

2008-06-05 Thread Tobias Hoellrich
 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of 
 Anton Shterenlikht
 Sent: Thursday, June 05, 2008 7:21 AM
 To: freebsd-questions@freebsd.org
 Subject: size of executable - g95 vs gfortran42 - shared libs?
 
 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?
 
 % gfortran42 tmp.f90
 % ls -al a.out
 -rwxr-xr-x  1 xxx  zzz9179  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
 %
 
 The program results seem to be identical.
 
 many thanks
 anton

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

[EMAIL PROTECTED] ~]# 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

[EMAIL PROTECTED] ~]# ldd `which ls`
/bin/ls:
libutil.so.7 = /lib/libutil.so.7 (0x28082000)
libncurses.so.7 = /lib/libncurses.so.7 (0x2809)
libc.so.7 = /lib/libc.so.7 (0x280cf000)
[EMAIL PROTECTED] ~]#

Hope this helps
  Tobias
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: size of executable - g95 vs gfortran42 - shared libs?

2008-06-05 Thread Kris Kennaway

Anton Shterenlikht 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?


You tell us :)  What does file tell you?

Kris



% gfortran42 tmp.f90
% ls -al a.out
-rwxr-xr-x  1 xxx  zzz9179  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
%

The program results seem to be identical.

many thanks
anton



___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: size of executable - g95 vs gfortran42 - shared libs?

2008-06-05 Thread Anton Shterenlikht
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:
 
 [EMAIL PROTECTED] ~]# 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
 
 [EMAIL PROTECTED] ~]# ldd `which ls`
 /bin/ls:
 libutil.so.7 = /lib/libutil.so.7 (0x28082000)
 libncurses.so.7 = /lib/libncurses.so.7 (0x2809)
 libc.so.7 = /lib/libc.so.7 (0x280cf000)
 [EMAIL PROTECTED] ~]#

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  wheel9179  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
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: size of executable - g95 vs gfortran42 - shared libs?

2008-06-05 Thread Sébastien Morand
 % 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)
 %

In the first one the library fortran is directly included in your exec
file, so the file is bigger. It looks like you have only a static
version of the g95 installed, and then the library is included in the
final program
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: size of executable - g95 vs gfortran42 - shared libs?

2008-06-05 Thread Kris Kennaway

Anton Shterenlikht wrote:

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:

[EMAIL PROTECTED] ~]# 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

[EMAIL PROTECTED] ~]# ldd `which ls`
/bin/ls:
libutil.so.7 = /lib/libutil.so.7 (0x28082000)
libncurses.so.7 = /lib/libncurses.so.7 (0x2809)
libc.so.7 = /lib/libc.so.7 (0x280cf000)
[EMAIL PROTECTED] ~]#


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  wheel9179  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


Both files have debugging symbols enabled.  You can remove these with 
strip, at the cost of not being able to use gdb to obtain backtraces if 
you run into a bug.



% ldd *.out
g95.out:
libm.so.5 = /lib/libm.so.5 (0x280c5000)
libc.so.7 = /lib/libc.so.7 (0x280db000)


^-- this one doesn't link to a dynamic fortran library, so it is 
presumably statically linked, explaining the size.  Look into how the 
file was constructed (e.g. the command used to link the binary).



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)
% 



Kris
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]