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

ld: codegen problem, can't use rel32 to external symbol in _MAIN_

hghu
Beginner
759 Views
Hello,

I tried to read a big dataset with a Fortrn program which works very well on the Linux machine (Lahey Fortran compiler), but there is a problem when running it on the MAC with ifort compiler. Error messege:

ifort -mcmodel=large readdata.f
ld: codegen problem, can't use rel32 to external symbol in _MAIN__ from /var/folders/tS/tSn88ZqRE6822yVNcVSo2E++0+A/-Tmp-//ifortw82CxZ.o

ifort -V
Intel Fortran Compiler for applications running on Intel 64, Version 10.1 Build 20080801 Package ID: m_fc_p_10.1.017
Copyright (C) 1985-2008 Intel Corporation. All rights reserved.

OS:
MAC OS X 10.5.2

Computer:
Processor 2x32 GHz Quad-Core Intel Xeon
Memory 32 GB 800 MHz DDr2 FB-DIMM

Any suggestions?

Thanks

Haoguo
0 Kudos
1 Solution
Kevin_D_Intel
Employee
759 Views

Ok. The issue you are facing relates to compiling a program containing >2GB of static data.

There were a couple of issues at play in the past regarding this involving large static arrays. At least one fix was provided in the Intel compiler 11.0 release for one aspect of this error, but nothing in the 10.1.024 (the last 10.1 update).

Can you upgrade to our 11.1 compiler?

If not, there is a possible work around of either placing static arrays into a MODULE or allocating the arrays dynamically using ALLOCATE.

View solution in original post

0 Kudos
4 Replies
Kevin_D_Intel
Employee
759 Views

The -mcmodel option is not supported on Mac OS. Versions prior to 11.1 incorrectly accepted, but version 11.1 now ignores and issue a warning as shown below.

$ ifort -V -mcmodel=large -c hello.f90
Intel Fortran Intel 64 Compiler Professional for applications running on Intel 64, Version 11.1 Build 20090624 Package ID: m_cprof_p_11.1.058
Copyright (C) 1985-2009 Intel Corporation. All rights reserved.
ifort: command line warning #10152: option '-mcmodel large' not supported

Intel Fortran 11.1-2536


The linker error you received is related to using the -mcmodel option, so please try compiling without this option.
0 Kudos
hghu
Beginner
759 Views
Hello Kevin,
Here is the message:

% ifort readdata.f
call out of range from _o2c_ (10000355C) in /var/folders/tS/tSn88ZqRE6822yVNcVSo2E++0+A/-Tmp-//ifortjD1DKu.o to rotini_$BFSOCNG.0.3 (215E35100) in /var/folders/tS/tSn88ZqRE6822yVNcVSo2E++0+A/-Tmp-//ifortjD1DKu.o
ld: rel32 out of range in _o2c_ from /var/folders/tS/tSn88ZqRE6822yVNcVSo2E++0+A/-Tmp-//ifortjD1DKu.o

H.



The -mcmodel option is not supported on Mac OS. Versions prior to 11.1 incorrectly accepted, but version 11.1 now ignores and issue a warning as shown below.

$ ifort -V -mcmodel=large -c hello.f90
Intel Fortran Intel 64 Compiler Professional for applications running on Intel 64, Version 11.1 Build 20090624 Package ID: m_cprof_p_11.1.058
Copyright (C) 1985-2009 Intel Corporation. All rights reserved.
ifort: command line warning #10152: option '-mcmodel large' not supported

Intel Fortran 11.1-2536


The linker error you received is related to using the -mcmodel option, so please try compiling without this option.

0 Kudos
Kevin_D_Intel
Employee
760 Views

Ok. The issue you are facing relates to compiling a program containing >2GB of static data.

There were a couple of issues at play in the past regarding this involving large static arrays. At least one fix was provided in the Intel compiler 11.0 release for one aspect of this error, but nothing in the 10.1.024 (the last 10.1 update).

Can you upgrade to our 11.1 compiler?

If not, there is a possible work around of either placing static arrays into a MODULE or allocating the arrays dynamically using ALLOCATE.
0 Kudos
hghu
Beginner
759 Views
The problem fixed after updated to 11.1.
Thank you very much!


Ok. The issue you are facing relates to compiling a program containing >2GB of static data.

There were a couple of issues at play in the past regarding this involving large static arrays. At least one fix was provided in the Intel compiler 11.0 release for one aspect of this error, but nothing in the 10.1.024 (the last 10.1 update).

Can you upgrade to our 11.1 compiler?

If not, there is a possible work around of either placing static arrays into a MODULE or allocating the arrays dynamically using ALLOCATE.

0 Kudos
Reply