Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29487 Discussions

relocation truncated to fit: R_X86_64_PC32

chamecki
Beginner
2,242 Views
I've been trying to compile a code that uses more than 2GB on my Intel Xeon processor running Red Hat Enterprise Linux WS v5 for EM64T.
I am using ifort v11 and in order to acomodate the large memory requirement I am using the options "
-mcmodel=medium -shared-intel"
The issue is that I am using the libraries fftw2.1.5 and I get errors of the type

relocation truncated to fit: R_X86_64_PC32 against symbol `rfftw_plan_hook' defined in .bss

associated with the fftw libraries. I tried to compile the libraries again using the same compiler options and I still get the same error messages. The fftw libraries are actually written in C and I have options for including CFLAGS and FFLAGS when I generate the new libraries. I am specifying the intel fortran and cc compilers explicitly in the generation of the libraries. Based on my internet search, I dont believe that any options of the type "-mcmodel=medium -shared-intel" are needed for the C compiler. Therefore, I am generating the libraries using the following options:

./configure F77=ifort CC=icc FFLAGS="-mcmodel=medium -shared-intel"

and leting the standard CFLAGS. The libraries comile without problems, but when I am linking my main code I get the relocation truncated error above. I also tried an alternative compilation of the libraries using

./configure F77=ifort CC=icc CFLAGS="-fPIC" FFLAGS="-fPIC"

with no success. Any suggestions on possible solutions?

Thanks.
0 Kudos
2 Replies
Ron_Green
Moderator
2,242 Views
you will need the same -mcmodel for the ICC compiler. 'medium' sets data pointers to 64bits (instruction pointers stay at 32bits). Imagine if Fortran is passing 64bit pointers in arguments and C is expecting 32bit pointers. Not good.

Keep the memory models consistent.

ron
0 Kudos
chamecki
Beginner
2,242 Views
you will need the same -mcmodel for the ICC compiler. 'medium' sets data pointers to 64bits (instruction pointers stay at 32bits). Imagine if Fortran is passing 64bit pointers in arguments and C is expecting 32bit pointers. Not good.

Keep the memory models consistent.

ron
Thanks for the quick response.
Including the same options in the icc compilation solved the problem.
Thanks.

0 Kudos
Reply