pgf95 compiling errors

I tried to compile f90 codes. It gave me following errors. In my codes, a few double-precision variables have these dimensions: x(3, 300,100,3,9,44). I tried both pgi 6.1 and 7.1, and have use ‘-mcmodel=medium’ option. But, if I reduce the variable size to x(3,120,40,3,9,44), no compiling errors show up. Any help is highly appreciated.

pgf95 -c -fastsse -mcmodel=medium -O -llapack -lblas -c mod_para.f90
mod_para.f90:
pgf95 -c -fastsse -mcmodel=medium -O -llapack -lblas -c mod_ntretire.f90
mod_ntretire.f90:
pgf95 -c -fastsse -mcmodel=medium -O -llapack -lblas -c retire.f90
retire.f90:
pgf95 -fastsse -mcmodel=medium -O -o retire0 mod_para.o mod_ntretire.o retire.o -llapack -lblas
/usr/local/pgi712/linux86-64/7.1-2/lib/liblapack.a(dlamch.o)(.text+0x3a8): In function dlamc1_': : relocation truncated to fit: R_X86_64_PC32 .bss /usr/local/pgi712/linux86-64/7.1-2/lib/liblapack.a(dlamch.o)(.text+0x409): In function dlamc1_’:
: relocation truncated to fit: R_X86_64_PC32 .bss
/usr/local/pgi712/linux86-64/7.1-2/lib/liblapack.a(dlamch.o)(.text+0x415): In function dlamc1_': : relocation truncated to fit: R_X86_64_PC32 .bss /usr/local/pgi712/linux86-64/7.1-2/lib/liblapack.a(dlamch.o)(.text+0x469): In function dlamc1_’:
: relocation truncated to fit: R_X86_64_PC32 .bss
/usr/local/pgi712/linux86-64/7.1-2/lib/liblapack.a(dlamch.o)(.text+0x47c): In function dlamc1_': : relocation truncated to fit: R_X86_64_PC32 .bss /usr/local/pgi712/linux86-64/7.1-2/lib/liblapack.a(dlamch.o)(.text+0x4ee): In function dlamc1_’:
: relocation truncated to fit: R_X86_64_PC32 .bss
/usr/local/pgi712/linux86-64/7.1-2/lib/liblapack.a(dlamch.o)(.text+0x4f4): In function dlamc1_': : relocation truncated to fit: R_X86_64_PC32 .bss /usr/local/pgi712/linux86-64/7.1-2/lib/liblapack.a(dlamch.o)(.text+0x4fa): In function dlamc1_’:
: relocation truncated to fit: R_X86_64_PC32 .bss
/usr/local/pgi712/linux86-64/7.1-2/lib/liblapack.a(dlamch.o)(.text+0x526): In function dlamc1_': : relocation truncated to fit: R_X86_64_PC32 .bss /usr/local/pgi712/linux86-64/7.1-2/lib/liblapack.a(dlamch.o)(.text+0x52f): In function dlamc1_’:
: relocation truncated to fit: R_X86_64_PC32 .bss
/usr/local/pgi712/linux86-64/7.1-2/lib/liblapack.a(dlamch.o)(.text+0x577): In function `dlamc1_’:
: additional relocation overflows omitted from the output
make: *** [retire0] Error 2

Thanks

xcst.

Hi,

lapack library is not compiled with -mcmodel=medium and some instructions are only 32-bit addressing and hence does not properly work with your large arrays. You might need to either compile lapack yourself with -mcmodel=medium or you can download 64-bit acml library with int64 version and link to it.

Hongyon

Thanks, Hongyon.

I am not a root of the server, so cannot change anything. The error is not only about the acml library, it is also about the pgf90lib if not using ‘-mcmodel=medium’ option, as following.

/usr/pgi/linux86-64/6.1/lib/libpgf90.a(initpar.o)(.text+0x2): In function __hpf_myprocnum': : relocation truncated to fit: R_X86_64_PC32 __hpf_lcpu /usr/pgi/linux86-64/6.1/lib/libpgf90.a(initpar.o)(.text+0x9): In function __hpf_ncpus’:
: relocation truncated to fit: R_X86_64_PC32 __hpf_tcpus
/usr/pgi/linux86-64/6.1/lib/libpgf90.a(initpar.o)(.text+0x10): In function __hpf_getioproc': : relocation truncated to fit: R_X86_64_PC32 __hpf_ioproc /usr/pgi/linux86-64/6.1/lib/libpgf90.a(initpar.o)(.text+0x17): In function __hpf_is_ioproc’:
: relocation truncated to fit: R_X86_64_PC32 __hpf_lcpu
/usr/pgi/linux86-64/6.1/lib/libpgf90.a(initpar.o)(.text+0x1d): In function `__hpf_is_ioproc’:
: relocation truncated to fit: R_X86_64_PC32 __hpf_ioproc

But with the option ‘-mcmodel=medium’ and without using acml library, I do not replicate such errors, even I use much bigger array sizes. Thanks again for helping.

xcst

Hi Hongyon,

Further on compiling lapack with -mcmodel=medium, can I compile such a lapack library as a user and link it to my home (say /home/funnyway/lapack/lib) when I compile my f90 codes? Do I compile lapack with pgf95? Any guides would be appreciated.

xcst

Hi,

For acml library, you will need to download it from AMD website. You can install it anywhere even in your home directory and manually put a link to it. The one that comes with PGI does not compile with -mcmodel=medium. The website is: http://developer.amd.com/Downloads/acml-4-1-0-pgi-64bit-int64.tgz.

For lapack, yes you can compile as normal user and link to your home or wherever you install it. You can use pgf95 to compile it.

Also the compiler you use 6.1? is quite old and may have a bug. If possible use the latest compiler you have access to.

Hongyon

Hi there,

I’m having the same problem as funnyway so I tried installing acml and adding a library link to it in my makefile but it doesn’t seem to be working.

Presumably lapack is still going straight to the other version… how do I make sure it always uses the 64-bit version?

Thanks in advance,
Crip_crop

Hi Crip Crop,

Presumably lapack is still going straight to the other version… how do I make sure it always uses the 64-bit version?

The Lapack that we ship is only available as static library build with 32-bit addressing, i.e. -mcmodel=small, (not to be confused with 32-bit pointer sizes, the library is still 64-bit). For the medium memory model, you need to use a library compiled with Position Independent Code (-fpic) enabled. Hence for you, we’d suggest using the ACML Shared libraries by compiling “-fpic -lacml”.

Hope this helps,
Mat