PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

Identifying exectuables with largefile support

 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling
View previous topic :: View next topic  
Author Message
Tim Butler



Joined: 15 Sep 2004
Posts: 3

PostPosted: Wed Sep 15, 2004 9:45 am    Post subject: Identifying exectuables with largefile support Reply with quote

Does anyone know of a way to determine if a dynamically linked executable file was created with largefile support?
Back to top
View user's profile
mkcolg



Joined: 30 Jun 2004
Posts: 6141
Location: The Portland Group Inc.

PostPosted: Wed Sep 15, 2004 10:37 am    Post subject: Use "ldd" Reply with quote

You can use ldd to determine which libpgc.so is being used, "lib" or "liblf". With "liblf" bing the large file support library.

Example:
Code:

umpqua:/tmp% pgf90 -Bdynamic hello.f
umpqua:/tmp% ldd a.out
        libc.so.6 => /lib/libc.so.6 (0x40025000)
        libpgc.so => /usr/pgi_rel/linux86/5.2/lib/libpgc.so (0x4015c000)
        libm.so.6 => /lib/libm.so.6 (0x40170000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
umpqua:/tmp% pgf90 -Bdynamic -Mlfs hello.f
umpqua:/tmp% ldd a.out
        libc.so.6 => /lib/libc.so.6 (0x40025000)
        libpgc.so => /usr/pgi_rel/linux86/5.2/liblf/libpgc.so (0x4015c000)
        libm.so.6 => /lib/libm.so.6 (0x40170000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)


-Mat
Back to top
View user's profile
Tim Butler



Joined: 15 Sep 2004
Posts: 3

PostPosted: Fri Sep 17, 2004 7:50 am    Post subject: Reply with quote

Mat,

Using ldd doesn't work in my case. Instead of using "-Mlfs" option, I have been
using "-L/usr/pgi/linux86/5.1/liblf" to get large file support (since v3.2).
The man page for pgf90 (v5.1) states these two methods are equivalent but
it does not appear they the same. Both methods produce executables that work
correctly, i.e. they can create files >2.1GB. An executable built using
"-L/usr/pgi/linux86/5.1/liblf" looks like an executable built without any
large file support options using ldd. See below:

[enguser@cluster2 ~/pgi]$ pgf90 -V
pgf90 5.1-3


enguser@cluster2 ~/pgi]$ pgf90 -Mlfs bigfile.f -o test_lfs
enguser@cluster2 ~/pgi]$ ldd test_lfs
libc.so.6 => /lib/i686/libc.so.6 (0x42000000)
libpgc.so => /usr/pgi/linux86/5.1/liblf/libpgc.so (0x40027000)
libm.so.6 => /lib/i686/libm.so.6 (0x4003b000)


enguser@cluster2 ~/pgi]$ pgf90 bigfile.f -o test_lfs2 -L/usr/pgi/linux86/5.1/liblf
enguser@cluster2 ~/pgi]$ ldd test_lfs2
libc.so.6 => /lib/i686/libc.so.6 (0x42000000)
libpgc.so => /usr/pgi/linux86/5.1/lib/libpgc.so (0x40027000)
libm.so.6 => /lib/i686/libm.so.6 (0x4003b000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)


enguser@cluster2 ~/pgi]$ pgf90 bigfile.f -o test_nolfs
enguser@cluster2 ~/pgi]$ ldd test_nolfs
libc.so.6 => /lib/i686/libc.so.6 (0x42000000)
libpgc.so => /usr/pgi/linux86/5.1/lib/libpgc.so (0x40027000)
libm.so.6 => /lib/i686/libm.so.6 (0x4003b000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)

[enguser@cluster2 ~/pgi]$ ls -l test_*
-rwxr-xr-x 1 enguser eng 239424 Sep 17 09:24 test_lfs
-rwxr-xr-x 1 enguser eng 239424 Sep 17 09:24 test_lfs2
-rwxr-xr-x 1 enguser eng 234736 Sep 17 09:24 test_nolfs

[enguser@cluster2 ~/pgi]$ diff test_lfs test_lfs2
Binary files test_lfs and test_lfs2 differ

Tim
Back to top
View user's profile
mkcolg



Joined: 30 Jun 2004
Posts: 6141
Location: The Portland Group Inc.

PostPosted: Fri Sep 17, 2004 3:41 pm    Post subject: Reply with quote

This is a bit harder and may not work in all cases but let's give it a try. I compiled a 'Hello World' program using no flags, "-L$PGI/5.2/liblf/", and "-Mlfs". Next I compared each output of "objdump -x a.out" and noticed that the LOAD filesz in the program header are the same for the large file programs but both were larger than the regular compiled exe. I don't know if this works for all cases, but it might if the only difference is large file support or no large file support.

While "-L$PGI/5.2/liblf" and "-Mlfs" are equivlent, they do have a subtle difference. When you use "-Mlfs", the linker is given "$PGI/5.2/liblf" as the "rpath". rpath acts just like "-L$PGI/5.2/liblf" except that it also sets the location to the runtime libraries. This is why ldd gives "lib" for "-L" and "liblf" for -Mlfs.

To compare the two binaries you should use the output from "nm" or "objdump" since the instruction addresses may vary but the instructions themselves will not.
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group