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

Visual Studio and CMake compiler error

Mark_Hammond
Beginner
1,130 Views

Hello,

I am using Visual Studio 2022 (17.7.7) and Fortran Compiler to build a CMake (3.27.7) project and getting the following error

 

 

-- Feature FORTRAN enabled
-- The Fortran compiler identification is unknown
Intel(R) Fortran Intel(R) 64 Compiler Classic for applications running on Intel(R) 64, Version 2021.11.0 Build 20231010_000000
Copyright (C) 1985-2023 Intel Corporation.  All rights reserved.

-- Check for working Fortran compiler: C:/Program Files (x86)/Intel/oneAPI/compiler/2024.0/bin/ifort.exe
CMake Error: Error required internal CMake variable not set, cmake may not be built correctly.
Missing variable is:
CMAKE_Fortran_PREPROCESS_SOURCE
CMake Error at C:/msys64/mingw64/share/cmake/Modules/CMakeTestFortranCompiler.cmake:49 (try_compile):
  Failed to generate test project build system.
Call Stack (most recent call first):
  cmake/ecbuild_enable_fortran.cmake:46 (enable_language)
  CMakeLists.txt:158 (ecbuild_enable_fortran)

 

 

Please help me understand how to fix this.

 

Thanks

0 Kudos
1 Reply
jimdempseyatthecove
Honored Contributor III
1,126 Views

This may help: https://cmake.org/cmake/help/latest/prop_tgt/Fortran_PREPROCESS.html

You also should consult cmake.org for other settings that may be of use.

Jim Dempsey

0 Kudos
Reply