Problems with Visual Studio and Intel Fortran oneAPI

My laptop has been migrated from Windows 10 to WIndows 11 and that was a good opportunity to update my Visual Studio and Intel Fortran installations. So I installed VIsual Studio 2022 and Intel Fortran oneAPI 2025.0. So far so good.

The problems start when I want to actually use the software. Visual Studio complains about the “Debug|x64” configuration - identical to Configuration in Visual Studio 2022 requires compiler support - Intel Community. The posters moved on to an older version of Intel Fortran oneAPI.
I thought the problem was due to ifort not being available anymore, so I forced the re-generation of the solution via CMake and explicitly setting the ifx compiler instead of leaving it to whatever CMake comes up with. This resulted in the same error messages during the CMake generation step, but at the end these errors were printed:

-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - failed
-- Check for working Fortran compiler: c:/Program Files (x86)/Intel/oneAPI//compiler/latest/bin/ifx.exe
-- Check for working Fortran compiler: c:/Program Files (x86)/Intel/oneAPI//compiler/latest/bin/ifx.exe - broken
CMake Error at C:/Program Files/CMake/share/cmake-3.30/Modules/CMakeTestFortranCompiler.cmake:59 (message):
  The Fortran compiler

    "c:/Program Files (x86)/Intel/oneAPI//compiler/latest/bin/ifx.exe"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: 'D:/delft3d-git/build_all/CMakeFiles/CMakeScratch/TryCompile-k77xh6'

    Run Build Command(s): "C:/Program Files/Microsoft Visual Studio/2022/Professional/Common7/IDE/devenv.com" CMAKE_TRY_COMPILE.sln /build Debug /project cmTC_4e973

    Microsoft Visual Studio 2022 Version 17.11.5.
    Copyright (C) Microsoft Corp. All rights reserved.
    Build started at 10:33...
    1>Error: Error HRESULT E_FAIL has been returned from a call to a COM component.
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
    ========== Build completed at 10:33 and took 02,423 seconds ==========

I found this thread - visual studio - Error HRESULT E_FAIL has been returned from a call to a COM component VS2012 when debugging - Stack Overflow - on StackOverflow, but it does not really help me solving it.

Does anyone have a better solution than going back to Intel Fortran oneAPI 2024-something? That would be a shame :roll_eyes:

A colleague of mine had issues (I don’t remember what exactly) with VS2022 Fortran integration as well (some time ago). I would say it’s not due to oneAPI 2025 but rather the VS2022 upgrade.
I would test it with a VS2019 installation, and see if that works.

Okay, that is an idea. Thanks.

Please don’t … if you have VS2022 and try to install VS2019 with intel integration you are bound to a very nasty experience!!

I don’t know if checking the generator option could help Using ifx rather than ifort with cmake - #11 by hkvzjal ?

Oh, that is a very different solution than I tried (-DCMAKE_Fortran_COMPILER=…). Definitely worth trying!

I agree. On a windows platform I always install from the oldest to the newest when working with Visual Studio.

I have made progress, at the very least CMake was able to generate a VS solution and that can (almost) be built. The way towards this result was rather bumpy and I am not sure we have progressed in a sustainable way. We’ll see.

Thanks for the help!

1 Like