PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

64 bit errors: trouble linking libpgf90 with mcmodel=medium

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



Joined: 23 Sep 2005
Posts: 1

PostPosted: Fri Sep 23, 2005 8:25 am    Post subject: 64 bit errors: trouble linking libpgf90 with mcmodel=medium Reply with quote

I am having trouble compiling some code that uses large address space for an Opteron cluster. I am using -tp k8-64 -mcmodel=medium and with or without -Mlarge_arrays I get errors from the linker that look like the section below. Does anybody have an idea of what is going wrong here?

/usr/local/pgi/linux86-64/6.0/lib/libpgf90.a(initpar.o)(.text+0x2): In function `__hpf_myprocnum':
initpar.c: relocation truncated to fit: R_X86_64_PC32 against symbol `__hpf_lcpu' defined in COMMON section in /usr/local/pgi/linux86-64/6.0/lib/libpgf90.a(initpar.o)
/usr/local/pgi/linux86-64/6.0/lib/libpgf90.a(initpar.o)(.text+0x9): In function `__hpf_ncpus':
initpar.c: relocation truncated to fit: R_X86_64_PC32 against symbol `__hpf_tcpus' defined in COMMON section in /usr/local/pgi/linux86-64/6.0/lib/libpgf90.a(initpar.o)
/usr/local/pgi/linux86-64/6.0/lib/libpgf90.a(initpar.o)(.text+0x10): In function `__hpf_getioproc':
initpar.c: relocation truncated to fit: R_X86_64_PC32 against symbol `__hpf_ioproc' defined in COMMON section in /usr/local/pgi/linux86-64/6.0/lib/libpgf90.a(initpar.o)
/usr/local/pgi/linux86-64/6.0/lib/libpgf90.a(initpar.o)(.text+0x17): In function `__hpf_is_ioproc':
initpar.c: relocation truncated to fit: R_X86_64_PC32 against symbol `__hpf_lcpu' defined in COMMON section in /usr/local/pgi/linux86-64/6.0/lib/libpgf90.a(initpar.o)
/usr/local/pgi/linux86-64/6.0/lib/libpgf90.a(initpar.o)(.text+0x1d):initpar.c: relocation truncated to fit: R_X86_64_PC32 against symbol `__hpf_ioproc' defined in COMMON section in /usr/local/pgi/linux86-64/6.0/lib/libpgf90.a(initpar.o)
/usr/local/pgi/linux86-64/6.0/lib/libpgf90.a(initpar.o)(.text+0x41): In function `__hpf_abort':
initpar.c: relocation truncated to fit: R_X86_64_PC32 against symbol `__hpf_lcpu' defined in COMMON section in /usr/local/pgi/linux86-64/6.0/lib/libpgf90.a(initpar.o)
/usr/local/pgi/linux86-64/6.0/lib/libpgf90.a(initpar.o)(.text+0xa5): In function `__hpf_abortp':
initpar.c: relocation truncated to fit: R_X86_64_PC32 against symbol `__hpf_lcpu' defined in COMMON section in /usr/local/pgi/linux86-64/6.0/lib/libpgf90.a(initpar.o)
/usr/local/pgi/linux86-64/6.0/lib/libpgf90.a(initpar.o)(.text+0x5c0): In function `__hpf_istat':
initpar.c: relocation truncated to fit: R_X86_64_PC32 against symbol `__hpf_quiet' defined in COMMON section in /usr/local/pgi/linux86-64/6.0/lib/libpgf90.a(initpar.o)
/usr/local/pgi/linux86-64/6.0/lib/libpgf90.a(initpar.o)(.text+0x5e6):initpar.c: relocation truncated to fit: R_X86_64_PC32 against symbol `__hpf_quiet' defined in COMMON section in /usr/local/pgi/linux86-64/6.0/lib/libpgf90.a(initpar.o)
/usr/local/pgi/linux86-64/6.0/lib/libpgf90.a(initpar.o)(.text+0x60c):initpar.c: relocation truncated to fit: R_X86_64_PC32 against symbol `__hpf_quiet' defined in COMMON section in /usr/local/pgi/linux86-64/6.0/lib/libpgf90.a(initpar.o)
/usr/local/pgi/linux86-64/6.0/lib/libpgf90.a(initpar.o)(.text+0x632):initpar.c: additional relocation overflows omitted from the output
gmake: *** [flash2] Error 2


Thanks,
Sebastian
Back to top
View user's profile
mkcolg



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

PostPosted: Fri Sep 23, 2005 8:44 am    Post subject: Reply with quote

Hi Sebastien,

You need to add "-mcmodel=medium" to the link line as well. Without it, the compiler will attempt to link with the small memory model libraries.

Hope this helps,
Mat
Back to top
View user's profile
Martin Buro



Joined: 15 Jun 2006
Posts: 1

PostPosted: Thu Jun 15, 2006 5:25 am    Post subject: -mcmodel=medium does not help Reply with quote

I have exactly the same problem, but adding -mcmodel=medium to the linking step (or to both the compilation and linking) does not help:
pgf90 -c -Mlist -O3 -byteswapio -Mr8 -I ../../../lib -I/include -c modele.f
pgf90 -Wl,-Bstatic -Mbounds -mcmodel=medium -o ../../../bin/opa modele.o ../../../lib/libsxopa.a ../../../lib/libsxioipsl.a -L/usr/local/netcdf/lib/ -lnetcdf
/usr/local/Cluster-Apps/pgi-5.2-4/linux86-64/5.2/lib/libpgf90.a(initpar.o)(.text+0x2): In function `__hpf_myprocnum':
: relocation truncated to fit: R_X86_64_PC32 __hpf_lcpu

What else could cause this problem?
Back to top
View user's profile
mkcolg



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

PostPosted: Thu Jun 15, 2006 8:13 am    Post subject: Reply with quote

Hi Martin,

The problem in your case is the "-Wl,-Bstatic" flag. The static libraries that accompany the 5.2 compilers were compiled for the small memory model and can't be used with the "-mcmodel=medium" flag. Linking dynamically, i.e remove "-Wl,-Bstatic", will fix your issue.

Note that starting with the 6.0 compilers, two version of the runtime libraries are included. The small memory model versions are located in the "lib" directory while the medium memory model versions are located in the "libso" directory. In other words, with 6.0 and later versions of the compilers, linking "-mcmodel=medium" with static libraries is supported.

Hope this helps,
Mat
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