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

How to solve error during compile when using -ipo

Wee_Beng_T_
Beginner
1,970 Views

Hi,

I just change my original code from serial to parallel. Originally, I was using -ipo to compile/link and I noticed some improvement in speed.

However, now when I trying to compile the parallel code, I get error when I use -ipo:

IPO: performing multi-file optimizations
IPO: generating object file /tmp/ipo_ifort2Mdtd3.o
backend signals

fortcom: Severe: **Internal compiler error: internal abort** Please report this error along with the circumstances in which it occurred in a Software Problem Report. Note: File and line given may not be explicit cause of this error.

ifort: error: problem during multi-file optimization compilation (code 3)
make: *** [a.out] Error 3

So how do I go about solving this problem? Btw, I'm using linux ifort 9.1.

Thank you very much.

Regards.

0 Kudos
13 Replies
Steven_L_Intel1
Employee
1,970 Views
In almost all cases, "Internal compiler error" indicates a compiler bug. If you are seeing this with a current compiler version you can contact Intel Support and ask for assistance (providing a test case.) Can you try this with 10.1?
0 Kudos
Wee_Beng_T_
Beginner
1,970 Views

Thanks Steve. My school is using ifort 9.1. As a student, I don't think I'm eligible for support, is that right?

My school is using MPICH and I believed it 's compiled using ifort 9.1. In that case, if I install ifort 10.1, can I still compile my mpi code with ifort 10.1 and then link with the MPICH2? Btw, I was compiling my code using mpif90.

Thank you very much.

Regards

0 Kudos
TimP
Honored Contributor III
1,970 Views
The MPICH2 compiled with ifort 9.1 should be compatible with ifort 10.1. However, it seems foolish for your school to require you to use out of date or unsupported software, when Intel has favorable terms for updates, including MPI support.
0 Kudos
Wee_Beng_T_
Beginner
1,970 Views

Hi,

I just installed ifort 10.1 to give it a quick test. Compiling is ok. However, the same "internal compiler error'" occurs. When I just use -ip (w/o -xP and -ipo), I got the error during linking:

grid.o(.text+0xa919): In function `grid_mp_grid_gen9_':
: undefined reference to `__svml_tanh2'
grid.o(.text+0xaa07): In function `grid_mp_grid_gen9_':
: undefined reference to `__svml_tanh2'
grid.o(.text+0xaaf4): In function `grid_mp_grid_gen9_':
: undefined reference to `__svml_tanh2'
grid.o(.text+0xaddc): In function `grid_mp_grid_gen9_':
: undefined reference to `__svml_tanh2'
grid.o(.text+0xaec2): In function `grid_mp_grid_gen9_':
: undefined reference to `__svml_tanh2'
grid.o(.text+0xaf9e): more undefined references to `__svml_tanh2' follow

Compiling/link used to fine for ifort 9.1. I thought the tanh is an intrinsic function. I also compiled all other files except grid.f90 using -r8. I did not use -r8 for grid.f90 because some special subroutine need to use "real".

What could be causing the error?

Thank you very much.

Regards.

0 Kudos
TimP
Honored Contributor III
1,970 Views
You must perform the final link using the newer compiler, when mixing 9.1 and 10.1 objects. It's possible that your old MPICH would default to linking the older library; it would certainly do so if the older ifort is the active one. In the 32-bit case, the svml (short vector math library) will not be linked unless you specify an SSE option such as -xP. The 10.1 compiler introduced additional vector intrinsics which would not be resolved by linking with 9.1 library.
If your MPICH doesn't do the right thing when the newer ifort is active, you would have to specify the newer ifort library explicitly, or rebuild the MPICH. The MPICH built with 10.1 would be able to use objects built with 9.1.
0 Kudos
Ron_Green
Moderator
1,970 Views
MPICH's mpif90, mpicc wrappers that you have will use the older 9.1 compilers. It's hardcoded in these wrappers. These wrappers are plain text files, so you can view them:

which mpif90
more mpif90

Now, inside these wrappers you should find all the link information you need - all the -I -L and -l options needed to link in mpich.

Using this information, compile your code using 10.1 ifort. Then, for the final link, use the 10.1 compiler driver 'ifort' and the appropriate -I -L and -l options that you gleaned from studying the mpif90 wrapper.

As others have said, the mpich libs compiled with 9.1 should link just fine with 10.1.

ron
0 Kudos
Wee_Beng_T_
Beginner
1,970 Views

Hi,

I just tried what you have suggested. However, the same problem occurs. Maybe I'll try to see if there's some ways I can modify the code to compile grid.f90 in -r8. Strangely, the problem doesn't happen in ifort 9.1.

Thank you.

0 Kudos
Wee_Beng_T_
Beginner
1,970 Views

Hi,

supposed I have a code like this

real(4) :: x,y

...

call plot(real(x))

..

x is supposed to be REAL(4) and the subroutine plot accepts REAL(4) as input.

Now if during compilation I use the option -r8, is plot still accepting x as REAL(4) or REAL(8)?

If it is REAL(8), how can I change it to REAL(4)?

Thank you very much.

0 Kudos
Steven_L_Intel1
Employee
1,970 Views
If you declare something with an explicit kind, such as real(4), -r8 does not affect it. If you just say REAL or use implicit typing, then -r8 does affect it.

In the example you gave above, x would be converted to and passed as real(8) if you compiled it with -r8. If the called routine declares the argument as real(4) (and not just real), then you'll have a mismatch.

Compiling with "-gen-interface -warn interface" cna help find such problems.
0 Kudos
Wee_Beng_T_
Beginner
1,970 Views

Thank you very much Steve. I understand now.

Btw, if I use REAL(x) as the input, I'll get a mismatch since with -r8, x will be real(8). Is there anyway I can change x to a real(4) variable during input to plot(), something like plot(real*4(x)), similar to changing x to another integer with int(x)? I tried but it doesn't work.

0 Kudos
Steven_L_Intel1
Employee
1,970 Views
real(x,4)
0 Kudos
Wee_Beng_T_
Beginner
1,970 Views

Thanks alot Steve. Btw, I managed to solve the compilation problem with regard to grid.f90:

grid.o(.text+0xa919): In function `grid_mp_grid_gen9_':
: undefined reference to `__svml_tanh2'

I simply change all the function tanh to dtanh and compile in -r8.

Unfortunately, the -ipo still cannot work. Does it mean there's some problems with my code? I also posted another msg in the forum regarding error results when I use -O3. It was solved when I use -save. Could these 2 be related?

Thank you very much.

0 Kudos
TimP
Honored Contributor III
1,970 Views
Do you mean, would uninitialized variables make a problem for -ipo? It's possible.
0 Kudos
Reply