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

Compiling with large memory requirements

tschaack1
Beginner
2,377 Views
I am trying to compile a program that requires ~13 Gb of data in memory. We are using ifort professional v11, on a Sun workstation with 64Gb of ram. When trying to compile the program I get a series of messages similar to :

(.text+0x263b): relocation truncated to fit: R_X86_64_32S against `.bss'

Any suggestions on how to proceed?

Thanks,
Todd
0 Kudos
3 Replies
TimP
Honored Contributor III
2,377 Views
If you want to use default memory model, any arrays >2GB should be ALLOCATABLE. That looks like a link step failure, not a compile problem.
0 Kudos
rreis
New Contributor I
2,377 Views
Quoting - tschaack
I am trying to compile a program that requires ~13 Gb of data in memory. We are using ifort professional v11, on a Sun workstation with 64Gb of ram. When trying to compile the program I get a series of messages similar to :

(.text+0x263b): relocation truncated to fit: R_X86_64_32S against `.bss'

Any suggestions on how to proceed?

Thanks,
Todd

From man ifort:

-mcmodel= mem_model

Tells the compiler to use a specific memory model to gen-
erate code and store data.

Architectures: Intel 64 architecture

Default:

-mcmodel=small On systems using Intel 64 architec-
ture, the compiler restricts code and
data to the first 2GB of address space.
Instruction Pointer (IP)-relative
addressing can be used to access code
and data.

Description:

This option tells the compiler to use a specific memory
model to generate code and store data. It can affect code
size and performance. If your program has COMMON blocks
and local data with a total size smaller than 2GB,
-mcmodel=small is sufficient. COMMONs larger than 2GB
require-mcmodel=medium or -mcmodel=large. Allocation of
memory larger than 2GB can be done with any setting of
-mcmodel.

IP-relative addressing requires only 32 bits, whereas
absolute addressing requires 64-bits. IP-relative address-
ing is somewhat faster. So, the small memory model has the
least impact on performance.

NOTE: When you specify -mcmodel=medium or -mcmodel=large,
you must also specify compiler option -shared-intel to
ensure that the correct dynamic versions of the Intel
run-time libraries are used.

0 Kudos
Kevin_D_Intel
Employee
2,377 Views

This is a common situation. There are many pre-existing forum threads with lots of details. Please review the earlier threads hereand here.

You will likely need at least: -mcmodel=medium -shared-intel
0 Kudos
Reply