Hi all. I have a C++ code that calls a Fortran subroutine which internally makes a call to the Fortran function dpmeps(). I use CMake to compile the Fortran code into a library that I link to my C++ executables. (CMakelist.txt files are attached). My code compiles without errors in both Debug and Release configurations. But it works as expected only in Debug configuration. In Release configuration it gets stuck in an infinite loop in the Fortran function dpmeps() (code files attached) at the code-block after label 10. I suspect that compiler optimization flags are somehow responsible for this. Any ideas how to fix this? <!--break-->
I have Visual Studio Community edition with Intel Parallel Studio XE 2017 with latest Intel C++ and Intel Visual Fortran compilers. This code is part of a bigger project which compiles and runs fine and quick with GCC compilers on Linux. We want the project to be portable to Windows and hence I am trying to get it working with Intel Compilers as well. Although with the Debug configuration flags the code works, it is much slower than GCC so it is not acceptable. Since, I have Intel i7 Skylake processors I was hoping Intel compilers to give a faster performance than GCC.
Please let me know if you need any more information. I have attached the Visual Studio Solution and project files in ZIP as well.
Regards,
Amit