[MITgcm-support] Compiler options for ifort on x86_64

Lucas Merckelbach lmm at noc.soton.ac.uk
Thu Oct 20 06:31:40 EDT 2005


Hi *,

In an attempt to compile the mitgcm model for a 512x512x32 grid on 
x86_64 machines (EM64T and AMD64), the linking stage fails with

impldiff.o: In function `impldiff_':
impldiff.f:(.text+0x697): relocation truncated to fit: R_X86_64_PC32 
against `.bss'
:
:


which apparantly is caused by arrays that are too big, as a 256x256x32 
gird compiles just fine. A very similar "relocation truncated to fit" 
error is obtained with the following test program:

       program main
       real*8 a(600000000)
       a(1) = 10.0
       stop
       end

when compiled without any specific options

/nerc/packages/intel_compilers/intel_fce_8.1/lib/libifcore.a(for_init.o)(.text+0x20): 
In function `for_rtl_init_':
: relocation truncated to fit: R_X86_64_PC32 .bss

However, adding the option -i_dynamic to the linker (also ifort) cures 
this. Unfortunately, it makes no difference for the mitgcm model, if I add 
the option to the linker (in the Makefile). Also adding -fpic to FFLAGS 
didn't help, as I found in the mitgcm-archives.

The Makefile is generated from
genmake2 -fc=ifort -of [..]/build_options/linux_amd64_ifort
Then the Makefile is tweaked to have the option -i_dynamic during linking.

Using g77 as fortran compiler fails as well, also generating "relocation 
truncated to fit" errors.

Then I thought, inspired by what google came up with, that it may be 
related to the linker 'ld'.

$ ld --version
GNU ld version 2.15.92.0.2 20040927

Installing the newest version of binutils:
$ ld --version
GNU ld version 2.16
didn't make a difference, though.

Using the buildoption file "linux_ia64_ifort" on an ia64 machine, and 
everything *does* work.

Does anyone have any experience with this issue or any suggestions?

Cheers,

Lucas





More information about the MITgcm-support mailing list