- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
-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.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
-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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
![](/skins/images/54BF544B471F3F61DFD338F1D58F9426/responsive_peak/images/icon_anonymous_message.png)
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page