- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I am using Visual Studio 2022, version 17.2.5 to build a CMake project that creates a Fortran library as a target. The first two lines of my CMakeLists.txt are:
cmake_minimum_required(VERSION 3.0)
enable_language(Fortran)
When using Visual Studio to build the project, it fails at the second line with the following message:
1> [CMake] -- Check for working Fortran compiler: C:/Program Files (x86)/Intel/oneAPI/compiler/2022.1.0/windows/bin/intel64/ifort.exe
1> [CMake] CMake Error: Error required internal CMake variable not set, cmake may not be built correctly.
1> [CMake] Missing variable is:
1> [CMake] CMAKE_Fortran_PREPROCESS_SOURCE
1> [CMake] CMake Error at C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.22/Modules/CMakeTestFortranCompiler.cmake:49 (try_compile):
1> [CMake] Failed to generate test project build system.
I have CMake 3.22, and I am using Ninja 1.10.2 as a generator. I have installed the Intel Fortran Compiler and I have ticked the option to add support for VS2022.
Does anyone know what is the cause of this problem and can help me ?
Thanks a lot !
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The first thing I noticed is that you are using Visual Studio 2022, version 17.2.5. The interface to Intel Fortran broke when MS released v 17.2. MS changed the COM API with that release. See this thread for more information and several workarounds.
We expect to have a fix for this problem in the next oneAPI release.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Any ideas on the release time frame for the next oneAPI?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

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