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

relocation truncated to fit and openmp

monty_m_
Beginner
475 Views

Hello,

When I compile my project, I obtain "relocation truncated to fit" errors. However, these errors disappear if I add the -openmp flag to my compiler options, even though I am not actually using any open mp directives in my code. When I use -openmp, what memory options are being set that avoid these relocation truncated to fit errors? I feel I should be using these, rather than just setting the openmp flag.

Thanks

 

0 Kudos
1 Solution
TimP
Honored Contributor III
475 Views

-openmp implies -auto, which has the same effect as declaring RECURSIVE procedures.  These options could reduce your use of static address space when you have large local arrays not declared with SAVE.

The latest compilers want the spelling of -openmp changed to -qopenmp, which avoids some of the bad effects should you make typographical errors.

View solution in original post

0 Kudos
2 Replies
TimP
Honored Contributor III
476 Views

-openmp implies -auto, which has the same effect as declaring RECURSIVE procedures.  These options could reduce your use of static address space when you have large local arrays not declared with SAVE.

The latest compilers want the spelling of -openmp changed to -qopenmp, which avoids some of the bad effects should you make typographical errors.

0 Kudos
Ron_Green
Moderator
475 Views

you might explore the -mcmodel=large option as well.  The static segment contains your COMMON and statically declared variables, SAVE variables, and large local arrays as Tim described.  the relocation error is when all this data plus your code cannot fit in a 32bit addressed segment.  Some linux distros don't limit static to 2GB, but others like some versions of SUSE do.  WIndows limits it to 2GB also.

Another option is to use allocatable arrays instead of static ones.  This takes more rework of older F77 style codes.

ron

0 Kudos
Reply