Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
29285 Discussions

relocation truncated to fit and openmp

monty_m_
Beginner
793 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
793 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
794 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
793 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