- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When building HDF5 1.14.6 on Windows using ifx (OneAPI 2025) I get the following error:
CMake Error at C:/Program Files/CMake/share/cmake-4.0/Modules/FortranCInterface.cmake:396 (message):
The Fortran compiler:
C:/Program Files (x86)/Intel/oneAPI/compiler/2025.1/bin/ifx.exe
and the C compiler:
C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.39.33519/bin/Hostx64/x64/cl.exe
failed to compile a simple test project using both languages. The output was:
Change Dir: 'D:/ci-cd/jenkins/lagrange-svn.de/workspace/Lagrange/lagrange_extern_up_windows/WC_extern/hdf5/build/CMakeFiles/FortranCInterface/VerifyC'
Run Build Command(s): "C:/Program Files/Microsoft Visual Studio/2022/Professional/Common7/IDE/devenv.com" VerifyFortranC.sln /build Release /project VerifyFortranC
Microsoft Visual Studio 2022 Version 17.9.2.
Copyright (C) Microsoft Corp. All rights reserved.
The operation could not be completed
Use: devenv [solutionfile | projectfile | folder | anyfile.ext] [switches]
I have selected ifx as the fortran compiler via the toolset argument of CMake (-T fortran=ifx) otherwise I am using the default settings of the HDF5 project. This same error occurs for various other fortran projects. Previous builds using ifort were successful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, there's appears to be something up with the VS 2022 integration when using oneAPI 2025.1. Have you tried using a different generator with cmake? I built HDF5 successfully with the Ninja generator and ifx 2025.1.1.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you look at release_docs/HISTORY-1_14.txt for HDF5 1.14.6 you will find that under Platforms Tested the latest ifx version they used was 2024.2.0 on Linux (and there is no mention of Fortran for Windows). I can build HDF5 on Windows with the VS 2022 generator if my selected IFX is 2024.2.1, but it fails with 2025.1.1. Given the release date of 1.14.6, they had no chance to verify it with OneAPI 2025.1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
For information, this appears to be a regression in ifx 2025.1.1; HDF5 1.14.6 builds in earlier versions of ifx.
To reproduce:
In Visual Studio 2022, set Selected compiler to 2025.0.0 in Options->Intel Compilers and Libraries->IFX Intel Fortran->Compilers
Create a folder c:\Source\hdf_inst
Unzip the hdf5-1.14.6 source into there (from Source Code - The HDF Group - ensuring long-term access and usability of HDF data and supporting users of HDF technologies)
Open a oneAPI development command prompt in c:\Source\hdf_inst
Run cmake-gui (I have cmake 3.29.2 installed):
Select hdf5-1.14.6 as the source code location
Set preset to ci-StdShar-Intel
Set HDF5_BUILD_JAVA to OFF (I don't have Java installed)
Configure
Specify the generator for this project "Visual Studio 17 2022" (I have 17.12.4 LTSC installed)
Optional toolset to to use (argument to -T): fortran=ifx
Use default preset compilers
Finish
Generate
cd build114\ci-StdShar-Intel
devenv hdf5.sln
In the solution build project hdf5-fortran-shared (in libraries/fortran), this should succeed.
Now select ifx 2025.1.1 as compiler and try rebuilding only the project:
Rebuild started at 15:58...
1>------ Rebuild All started: Project: hdf5_fortran-shared (IFX), Configuration: Debug x64 ------
Deleting intermediate files and output files for project 'hdf5_fortran-shared', configuration 'Debug|x64'.
Compiling with Intel® Fortran Compiler 2025.1.1 [Intel(R) 64]...
H5_gen.F90
ifx: command line warning #10161: unrecognized source type 'Files\Microsoft'; object file assumed
ifx: command line warning #10161: unrecognized source type 'Visual'; object file assumed
fpp: fatal: can't fopen file: Studio\2022\Professional\VC\Tools\MSVC\14.42.34433\bin\HostX64\x64 /Qm64 C:\Source\hdf_inst\build114\ci-StdShar-Intel\fortran\shared\H5_gen.F90
H5fortran_types.F90
ifx: command line warning #10161: unrecognized source type 'Files\Microsoft'; object file assumed
ifx: command line warning #10161: unrecognized source type 'Visual'; object file assumed
fpp: fatal: can't fopen file: Studio\2022\Professional\VC\Tools\MSVC\14.42.34433\bin\HostX64\x64 /Qm64 C:\Source\hdf_inst\build114\ci-StdShar-Intel\fortran\shared\H5fortran_types.F90
<elided>
However, the H5_buildiface project does build with 2025.1.1.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Have you first launched the oneAPI command prompt to get to your CMD window?
:: initializing oneAPI environment...
Initializing Visual Studio command-line environment...
Visual Studio version 17.8.2 environment configured.
"C:\Program Files\Microsoft Visual Studio\2022\Community\"
Visual Studio command-line environment initialized for: 'x64'
: advisor -- latest
: compiler -- latest
: dal -- latest
: debugger -- latest
: dev-utilities -- latest
: dnnl -- latest
: dpcpp-ct -- latest
: dpl -- latest
: inspector -- latest
: ipp -- latest
: ippcp -- latest
: itac -- latest
: mkl -- latest
: mpi -- latest
: ocloc -- latest
: pti -- latest
: tbb -- latest
: umf -- latest
: vtune -- latest
:: oneAPI environment initialized ::
C:\Program Files (x86)\Intel\oneAPI>
Then from there CD to the desired folder, and set any additional environment variables.
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I assume that's a reply to the OP @jimdempseyatthecove ? In my repro steps above, I specify the use of a oneAPI command prompt. I got HDF5 to build using cmake and a preset file with IFX 2025.0 and 2024.2.
Also, in releases/INSTALL_CMake.txt, they describe how to build HDF5 with a ctest build script, but I couldn't persuade that to use ifx instead of ifort, which wouldn't be of much use for anyone with OneAPI 2025.0 or later
My suggestion to the OP is to either get hold of a copy of oneAPI 2025.0 or 2024.2 or to install a pre-compiled binary.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the suggestions; I'm afraid I don't have the option to revert to an older version of oneAPI as the machine isn't adminstered by me so I was interested to hear if anyone else was experiencing the same issue and perhaps knew of a workaround.
Regarding persuading the ctest build script to use ifx instead of ifort (raised by @Mark_Lewy ), if you add
set (CMAKE_GENERATOR_TOOLSET "fortran=ifx")
To the HDF5config.cmake file, it has the same effect as the -T command line option of cmake.
My build environment is initialised using the setvars.bat script:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, there's appears to be something up with the VS 2022 integration when using oneAPI 2025.1. Have you tried using a different generator with cmake? I built HDF5 successfully with the Ninja generator and ifx 2025.1.1.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That's brilliant - I hadn't thought of that! Using Ninja I'm now able to build successfully.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page