pgf90 compiling error

Hello,

I am trying to compile a program, but it gives the error message below when I try to increase an arrays size in the code. Below a certain value, compiling works.

Could you help me?

Thanks,

/usr/local/pgi/linux86-64/6.2/lib/libpgf90.a(initpar.o): In function __hpf_myprocnum': initpar.c:(.text+0x2): relocation truncated to fit: R_X86_64_PC32 against symbol __hpf_lcpu’ defined in COMMON section in /usr/local/pgi/linux86-64/6.2/lib/libpgf90.a(initpar.o)
/usr/local/pgi/linux86-64/6.2/lib/libpgf90.a(initpar.o): In function __hpf_ncpus': initpar.c:(.text+0x12): relocation truncated to fit: R_X86_64_PC32 against symbol __hpf_tcpus’ defined in COMMON section in /usr/local/pgi/linux86-64/6.2/lib/libpgf90.a(initpar.o)
/usr/local/pgi/linux86-64/6.2/lib/libpgf90.a(initpar.o): In function __hpf_getioproc': initpar.c:(.text+0x22): relocation truncated to fit: R_X86_64_PC32 against symbol __hpf_ioproc’ defined in COMMON section in /usr/local/pgi/linux86-64/6.2/lib/libpgf90.a(initpar.o)
/usr/local/pgi/linux86-64/6.2/lib/libpgf90.a(initpar.o): In function __hpf_is_ioproc': initpar.c:(.text+0x32): relocation truncated to fit: R_X86_64_PC32 against symbol __hpf_ioproc’ defined in COMMON section in /usr/local/pgi/linux86-64/6.2/lib/libpgf90.a(initpar.o)
initpar.c:(.text+0x38): relocation truncated to fit: R_X86_64_PC32 against symbol __hpf_lcpu' defined in COMMON section in /usr/local/pgi/linux86-64/6.2/lib/libpgf90.a(initpar.o) /usr/local/pgi/linux86-64/6.2/lib/libpgf90.a(initpar.o): In function __hpf_abort’:
initpar.c:(.text+0x5f): relocation truncated to fit: R_X86_64_PC32 against symbol __hpf_lcpu' defined in COMMON section in /usr/local/pgi/linux86-64/6.2/lib/libpgf90.a(initpar.o) /usr/local/pgi/linux86-64/6.2/lib/libpgf90.a(initpar.o): In function __hpf_abortp’:
initpar.c:(.text+0xf0): relocation truncated to fit: R_X86_64_PC32 against symbol __hpf_lcpu' defined in COMMON section in /usr/local/pgi/linux86-64/6.2/lib/libpgf90.a(initpar.o) /usr/local/pgi/linux86-64/6.2/lib/libpgf90.a(initpar.o): In function __hpf_initarg’:
initpar.c:(.text+0x147): relocation truncated to fit: R_X86_64_PC32 against .bss' initpar.c:(.text+0x171): relocation truncated to fit: R_X86_64_PC32 against .bss’
initpar.c:(.text+0x19b): relocation truncated to fit: R_X86_64_PC32 against `.bss’
initpar.c:(.text+0x1ab): additional relocation overflows omitted from the output

Hi wizendraw,

Add “-mcmodel=medium” since the total size of your static arrays are most likely greater than 2GB.

Hope this helps,
Mat

Hello Mat,

Thanks for the answer. The makefile seems working but produced an .exe file with a size nearly 1/10 of the previous exe file (previous: the one obtained without using “-mcmodel=medium”). Is it normal?
Anyway, after obtaining the exe file, I tried to execute the file, but it doesn’t seem working.
It gives a segmentation error;

$ ./static_friction
0
1
Segmentation fault

Any ideas?

Thanks,

The makefile seems working but produced an .exe file with a size nearly 1/10 of the previous exe file (previous: the one obtained without using “-mcmodel=medium”). Is it normal?

It’s most likely just the difference between linking your binary statically versus dynamically (-mcmodel=medium implies dynamic). Try compiling your initial version’s size with and without “-Bdynamic”.

Segmentation fault Any ideas?

Compile with “-g” and then run your program in the PGI debugger, PGDBG, to get a better idea of where the seg fault occurs.

Also, try compiling with “-i8” to set your default INTEGER kind to 8 since you might be overflowing an index variable.

  • Mat

Hi Mat,

I tried compiling with -i8, but it again gave segmentation fault. So I added -g and debug: here is the message I got:

pgdbg> run
libpgf90.so loaded by ld-linux-x86-64.so.2.
libpgf90_rpm1.so loaded by ld-linux-x86-64.so.2.
libpgf902.so loaded by ld-linux-x86-64.so.2.
libpgf90rtl.so loaded by ld-linux-x86-64.so.2.
libpgftnrtl.so loaded by ld-linux-x86-64.so.2.
libpgc.so loaded by ld-linux-x86-64.so.2.
libm.so.6 loaded by ld-linux-x86-64.so.2.
libc.so.6 loaded by ld-linux-x86-64.so.2.
Signalled SIGSEGV at 0x7F7EDA378426, function __hpfio_assign
7F7EDA378426: F2 41 F 11 4 24 movsd %xmm0,(%r12)


What does this problem mean? Do you have any idea?

Thanks for your help,

Ali

Hi wizendraw,

Within PGDBG, after the seg fault occurs, type “where” to get a stacktrace. This should tell you the line number where the segv occurs.

  • Mat

Thanks, Matt. I had the same problem and your suggestion worked like a charm!