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

Using -ipo in mixed Fortran and C++ program

joeli
Beginner
573 Views
In a mixed Fortran and C++ program, I'm getting incorrect results if the -ipo switch is used.

This happens with Intel 12.1.0. I can get the correct results by doing one of these things:

* Switch off -ipo
* Go back to Intel 10.1
* Insert printf code in a specific place (commented in the example code)
* or link with icpc instead of ifort

I compile with these commands:

ifort -ipo -c demo.f90 -o demo.o
icpc -ipo -c findnearest.cc -o findnearest.o
ifort demo.o findnearest.o -o demo -cxxlib

I've attached demo.f90 and findnearest.cc. Correct output is a list of coordinates around a center, with ipo some of the coordinates are garbage or zero.

Am I missing something in the compilation commands? Should ifort not be used when linking mixed programs? Or could this be a bug in IPO?

Thanks!

- Joe
0 Kudos
1 Reply
Anonymous66
Valued Contributor I
573 Views
Hello Joe,

This is a bug in IPO. I have escalated it to the developers. The issue number is DPD200182313. I will post any updates on this issue to this thread.

Regards,
Annalee
Intel Developer Support
0 Kudos
Reply