[MITgcm-support] Compiler options for ifort on x86_64

Lucas Merckelbach lmm at noc.soton.ac.uk
Fri Oct 21 09:17:41 EDT 2005


Constantinos, thanks for your message. It helped me a bit, but it didn't 
solved the problem. Yet, I hope.

On Thu, 20 Oct 2005, Constantinos Evangelinos wrote:

> On Thursday 20 October 2005 06:31, Lucas Merckelbach wrote:
>> 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'
[...]

> Solutions:
> 1) Compile everything (including MPI/NetCDF libraries) with -fPIC (-fpic etc.
> should be the same) and link with -i_dynamic. This should work in most if not
> all cases.
I compiled it without MPI and NetCDF support using this solution. And it 
didn't work. (At least consistent as I thought I tried this before).

> 2) Compile everything (apparently and unfortunately including MPI/NetCDF
> libraries) with -mcmodel=medium. This should work in all cases with a small
> performance penalty.
Funny enough I saw this solution somewhere, but for another compiler. 
According to the man page of ifort this option doesn't exist. But it 
does... The code *does* compile, using this solution.

> 3) Compile everything (apparently and unfortunately including MPI/NetCDF
> libraries) with -mcmodel=large. This should work in all cases with a slightly
> larger performance penalty than (2) [...]
I haven't tried this one (yet) as the option (2) compiles.

But.... it doesn't run. Upon execution it simply returns immediately with 
"Killed".

Then I tried your code:
Compiled it with:

ifort -mcmodel=large -O3 -xW -c large.f -o large.o
ifort -i_dynamic -o large large.o
and without the options -O3 -xW

It does compile, but also produces a runtime "Killed"
It actually doesn't do much:

nova:~/big$ strace ./large
execve("./large", ["./large"], [/* 45 vars */]) = 0
+++ killed by SIGKILL +++

It does that as soon as there is any reference in the code to variable 
a(). Commenting these out and the program runs, but doesn't do anything.

The good news, however, that it *does* run on an AMD64 based processor 
(and not on an EM64T).

The bad news is, that on both architectures the mitgcmuv executable exits 
with "Killed", using scenario 2). No libraries are specifically linked 
against.

Scenario3 also exits with "Killed" on both architectures.

Any ideas?

Thanks,
Lucas



More information about the MITgcm-support mailing list