relocation truncated to fit and openmp

relocation truncated to fit and openmp


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.



3 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.
Best Reply

-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.

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.


Leave a Comment

Please sign in to add a comment. Not a member? Join today