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

Linking problem for 64-bit OS X application

bene
Beginner
272 Views
I'm trying to build a fortran application for structural biology that allocates 4 GB static arrays. The application builds okay, but fails during the linking stage:
ifort -m64 frealign_v7.o frealign_v7.a -o ../bin/frealign_v7.exe
call out of range from _MAIN__ (1000012E4) in frealign_v7.o to frealign_$CDATE.0.0 (20C2C4A00) in frealign_v7.o
ld: rel32 out of range in _MAIN__ from frealign_v7.o

I'm using /opt/intel/fce/10.0.016/bin/ifort and the fce lib directory is in the LD and DYLD_LIBRARY_PATH.

I can successfully compile and link versions of the program that use arrays smaller than 2 GB.
0 Kudos
4 Replies
Steven_L_Intel1
Employee
272 Views
As far as I know, Mac OS X does not support static code/data size greater than 2GB. You will need to use ALLOCATABLE arrays instead.
0 Kudos
Ron_Green
Moderator
272 Views
By default, the static segment is still limited to 2GB, as you discovered. To override this:

-m64 -shared-intel

Try these options and let me know if this helps.

ron
0 Kudos
bene
Beginner
272 Views

Hi Ron-

Same issue:

ifort -m64 -shared-intel frealign_v7.o frealign_v7.a -o  ../bin/frealign_v7.exe
call out of range from _MAIN__ (1000013D8) in frealign_v7.o to frealign_$CDATE.0.0 (20C1FCA00) in frealign_v7.o
ld: rel32 out of range in _MAIN__ from frealign_v7.o

I think Steve's diagnosis is correct; I seem to recall running into this problem in the past.

This is a Fortran 77 application, BTW.

0 Kudos
Steven_L_Intel1
Employee
272 Views
Windows has the same issue. I'm uncertain about Linux; one would have to use "-mcmodel medium" at least there. Mac OS does'tsupport -mcmodel.
0 Kudos
Reply