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

lld-link: error: section larger than 4 GiB

JulieMarieC
Novice
1,521 Views

Hello,

I was using ifort compiler, but i have seen the message that it will be deprecated, so I'm trying to use ifx instead, but I get this error:

lld-link: error: section larger than 4 GiB: .data

Do you have any suggestions?

 

Best regards,

 

Julie

Labels (2)
0 Kudos
7 Replies
Steve_Lionel
Honored Contributor III
1,495 Views

Do you really have a static variable (COMMON, most likely) larger than 4GB?

This isn't a compiler issue - add -mcmodel medium to the compiler options.

JulieMarieC
Novice
1,406 Views

It seems that '-mcmodel medium' is not recognized by ifx compiler.

0 Kudos
Barbara_P_Intel
Employee
1,384 Views

On Linux the syntax is "-mcmodel=medium". There is no equivalent option for Windows. See this section in the Fortran Developer Guide and Reference.

 

JulieMarieC
Novice
1,365 Views

Thanks for your answer. I will in the next few months, maybe there will be an update that will allow this option for Windows.

 

0 Kudos
Steve_Lionel
Honored Contributor III
1,353 Views

No, there won't - Windows has a hard limit of 2GB static code and data, due to the design of the executable format. Use ALLOCATABLE arrays instead of very large static arrays.

JulieMarieC
Novice
1,350 Views

Ok, thanks for this precision.

So I don't know why it works with ifort but not with ifx: maybe it is linked to the fact that with ifort, our code is compiled for win32, but we have to compile for x64 with ifx?

 

0 Kudos
Steve_Lionel
Honored Contributor III
1,306 Views

It doesn't work with 64-bit ifort either. 

0 Kudos
Reply