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

unable to compile

S_Adhikary
Beginner
564 Views
Dear Sir/Ma'am,
I am trying to compile the code using intel fortran it is giving the error ,but if i reduce the size of arry it is compiling .can u plz help me.
i am attaching code and inputfile can u plz help me to resolve this issue .

code.f:(.text+0x5c0): relocation truncated to fit: R_X86_64_32S against symbol `abc1_' defined in COMMON section in /tmp/ifortvzgc7F.o
code.f:(.text+0x5e8): relocation truncated to fit: R_X86_64_32S against symbol `abc1_' defined in COMMON section in /tmp/ifortvzgc7F.o
code.f:(.text+0x610): relocation truncated to fit: R_X86_64_32S against symbol `abc1_' defined in COMMON section in /tmp/ifortvzgc7F.o
code.f:(.text+0x638): relocation truncated to fit: R_X86_64_32S against symbol `abc1_' defined in COMMON section in /tmp/ifortvzgc7F.o
code.f:(.text+0x660): relocation truncated to fit: R_X86_64_32S against symbol `abc1_' defined in COMMON section in /tmp/ifortvzgc7F.o
code.f:(.text+0x6c6): relocation truncated to fit: R_X86_64_32S against symbol `abc2_' defined in COMMON section in /tmp/ifortvzgc7F.o
code.f:(.text+0x6ee): relocation truncated to fit: R_X86_64_32S against symbol `abc2_' defined in COMMON section in /tmp/ifortvzgc7F.o
code.f:(.text+0x716): relocation truncated to fit: R_X86_64_32S against symbol `abc2_' defined in COMMON section in /tmp/ifortvzgc7F.o
code.f:(.text+0x73e): relocation truncated to fit: R_X86_64_32S against symbol `abc2_' defined in COMMON section in /tmp/ifortvzgc7F.o
code.f:(.text+0x766): relocation truncated to fit: R_X86_64_32S against symbol `abc2_' defined in COMMON section in /tmp/ifortvzgc7F.o
code.f:(.text+0x9d8): additional relocation overflows omitted from the outpu
0 Kudos
3 Replies
Kevin_D_Intel
Employee
564 Views

You've let a lot unknown like the compiler used, your target architecture and OS.

I guessed, 11.1, Intel 64, Linux, and with the OpenMP directives in the code, try this:

$ ifort -V -mcmodel=medium -shared-intel -openmp code.f
Intel Fortran Intel 64 Compiler Professional for applications running on Intel 64, Version 11.1 Build 20091130 Package ID: l_cprof_p_11.1.064
Copyright (C) 1985-2009 Intel Corporation. All rights reserved.

Intel Fortran 11.1-2649
GNU ld version 2.17.50.0.6-5.el5 20061020

Its not clear how input.dat is intended to be read in, but to execute you may also need to increase your shell stack space using either:

For Bash/sh/ksh use: ulimit -s unlimited
For Csh use: limit stacksize unlimited
0 Kudos
S_Adhikary
Beginner
564 Views

I am sorry for that.

The os is centos - 5.2 ( linux x86_64).

intel compiler version is

Intel Fortran Intel 64 Compiler Professional for applications running on Intel 64, Version 11.0 Build 20090318 Package ID: l_cprof_p_11.0.083
Copyright (C) 1985-2009 Intel Corporation. All rights reserved.

Intel Fortran Intel 64 Compiler Professional for applications running on Intel 64, Version 11.0 Build 20090318 Package ID: l_cprof_p_11.0.083Copyright (C) 1985-2009 Intel Corporation. All rights reserved.

the input file is require to run the code

when i use

ifort -V -mcmodel=medium -shared-intel -openmp then it is compiling but when run it is giving

Segmentation fault.

i used ulimit -s unlimited

0 Kudos
Kevin_D_Intel
Employee
564 Views

Yes, I saw the the immediate segmentation fault too which is why I suggested commands to increase the shell stack limit, and after doing so on my system permits the application to execute and start writing MATRIX files. I didn't wait for the program to finish. Its not clear how long it supposedto run.

The immediate segmentation fault is almost certainly a shell stack limit issue. Assuming your working shell is bash/sh, if the ulimit command wasn't sufficient that suggests the defined maximum stack usage limit in your Linux kernel isn't sufficient to run the program with the current declared array sizes.

If you do not compile with -openmp, then you can try the other trick of compiling with -heap-arrays and you might find the program will run, but that's just a test as I expect you want to run with OpenMP enabled.

Given that, the other suggestion is to consider using allocatable arrays for some of the large static arrays; those declared (in many places) with dimension NN and MM are good candidates. Making some allocatable seems to allow the program to run using OpenMP and a shell stack limit of 10240 kbytes. As you know there are a number of large arrays declared with those parameters so you may need to make many if not all allocatable.

I recommend starting with getting the program to run with no optimizations (e.g. -O0) and using allocatable arrays, and then enable optimizations including OpenMP. You can also refer to this Knowledge Base article (here) for other tips on root causing the segmentation fault and other options to enable to help generate traceback, etc.

I hope that helps.

0 Kudos
Reply