relocation truncated to fit: R_X86_64_32S

hello,

i have a programe where i define some max variables,

#define N_MAX 100
when i increment this variable some variables i this errors in the linking phase.

 In function `main':
: relocation truncated to fit: R_X86_64_PC32 out_fem
smain6.o(.text+0x5d): In function `main':
: relocation truncated to fit: R_X86_64_PC32 out_matvis
smain6.o(.text+0x1b7): In function `main':
: relocation truncated to fit: R_X86_64_PC32 out_fem
smain6.o(.text+0x217): In function `main':
: relocation truncated to fit: R_X86_64_PC32 out_matvis
smain6.o(.text+0x2d2): In function `main':
: relocation truncated to fit: R_X86_64_PC32 out_fem
smain6.o(.text+0x2f6): In function `main':
: relocation truncated to fit: R_X86_64_PC32 out_matvis
smain6.o(.text+0x3ad): In function `main':
: relocation truncated to fit: R_X86_64_PC32 out_fem
smain6.o(.text+0x3bf): In function `main':
: relocation truncated to fit: R_X86_64_PC32 out_matvis
smain6.o(.text+0x402): In function `main':
: relocation truncated to fit: R_X86_64_PC32 nb_images_inc
smain6.o(.text+0x418): In function `main':
: relocation truncated to fit: R_X86_64_32S images_inc
smain6.o(.text+0x420): In function `main':
: additional relocation overflows omitted from the output

i think that i must increment the virual memory, but when i see some forum i see that the architecture and the compilator can be the problem.


Any idea?


thank’s advance.

Saad.

hi, its work i see in anther topic some that had a same probleme
and i use
mcmodel=medieum,

but i would know some explication i will try rhe sectin 5.3

Hi,

I’m also experiencing the “relocation truncated to fit: R_X86_64_32S” error message for an ocean modelling programme, NEMO. Whilst I have successfully built and run this application under other compilers, I am struggling with the PGI build.
I’ve tried different opteron-based clusters with different versions of the PGI compiler (pgf90 6.0-8 , pgf90 6.1-3, plus more recent releases of the compiler), but all so far give the same error:

if [ -n “cat KEY_CPP | grep key_agrif” ]; then rm -f -r OPAFILES model.o …/lib/oce/*.mod …/lib/oce/libopa.a …/lib/oce/libopa.a; fi
mpif90 -O2 -tp k8-64 -r8 -mcmodel=medium -i8 -o …/bin/orca025 model.o …/lib/oce/libopa.a …/lib/libioipsl.a -L/home/cak78/netCDF-xd1/lib -lnetcdf -lnetcdff
…/lib/oce/libopa.a(zdfmxl.o)(.text+0x286): In function zdfmxl_zdf_mxl_': : relocation truncated to fit: R_X86_64_32S zdfmxl_2_ ../lib/oce/libopa.a(zdfmxl.o)(.text+0x358): In function zdfmxl_zdf_mxl_’:
: relocation truncated to fit: R_X86_64_32S zdfmxl_0_
…/lib/oce/libopa.a(zdfmxl.o)(.text+0x3da): In function zdfmxl_zdf_mxl_': : relocation truncated to fit: R_X86_64_32S zdfmxl_0_ ../lib/oce/libopa.a(zdfmxl.o)(.text+0x3f6): In function zdfmxl_zdf_mxl_’:
: relocation truncated to fit: R_X86_64_32S zdfmxl_2_
…/lib/oce/libopa.a(zdfmxl.o)(.text+0x407): In function zdfmxl_zdf_mxl_': : relocation truncated to fit: R_X86_64_32S zdfmxl_2_ ../lib/oce/libopa.a(zdfmxl.o)(.text+0x514): In function zdfmxl_zdf_mxl_’:
: relocation truncated to fit: R_X86_64_32S zdfmxl_0_
…/lib/oce/libopa.a(ldfslp.o)(.text+0x442): In function ldfslp_ldf_slp_': : relocation truncated to fit: R_X86_64_32S ldfslp_5_ ../lib/oce/libopa.a(ldfslp.o)(.text+0x694): In function ldfslp_ldf_slp_’:
: relocation truncated to fit: R_X86_64_32S ldfslp_5_
…/lib/oce/libopa.a(ldfslp.o)(.text+0x788): In function ldfslp_ldf_slp_': : relocation truncated to fit: R_X86_64_32S ldfslp_5_ ../lib/oce/libopa.a(ldfslp.o)(.text+0x969): In function ldfslp_ldf_slp_’:
: relocation truncated to fit: R_X86_64_32S ldfslp_5_
…/lib/oce/libopa.a(ldfslp.o)(.text+0xae0): In function `ldfslp_ldf_slp_’:
: additional relocation overflows omitted from the output
make: *** […/bin/orca025] Error 2

Has anyone else come across this before and can they suggest a fix?

Many thanks,
Chris

Hi Chris,

Try re-compiling the objects in the “libopa.a” library with “-fpic”.

When linking a static library with code compiled with “-mcmodel=medium”, all objects in the library must be compiled with “-fpic”.

Hope this helps,
Mat

Thanks Matt,

the -fpic flag has indeed managed to fix the problem.

Kind regards,
Chris

Hi Crish,
Hello, I am Gelsomina Mattia of Bologna University
(Dept of
Environmental Sciences). I am working in the framework
of an European
Project to the implementation and use of a coupled physica-
biogeochemical model of the Mediterranean Sea (NEMO).
I am writing you because
I carried out an internet search aim at solving some compilation
problems I am experiencing with my code. I found a message you sent to
http://www.pgroup.com
concerning the error message
relocation truncated to fit: R_X86_64_PC32 .bss
This is the very same
error message I am getting and I am still receiving it also after
following the suggestions you received
in reply to your message.
I just
wanted to ask you if you could provide me with some more
additional
information about the solution of the problem
(if any).
I am running
my code using the intel compiler ifort version 10.0.23 and the
processor is an opteron AMD 8214 .