CMake MSVC variable on when using all Intel compilers

544 Views Asked by At

In my CMake project, I'm checking for use of MSVC compilers in order to alert users of a particular error message. However, when I use all Intel compilers (Fortran, C, C++), the MSVC CMake variable is still enabled. Is this expected?

Inspecting the CMakeCache for "MSVC" shows that the linker and archiver are from MSVC:

//Path to a program.
CMAKE_AR:FILEPATH=C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.27.29110/bin/Hostx64/x64/lib.exe
//Path to a program.
CMAKE_LINKER:FILEPATH=C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.27.29110/bin/Hostx64/x64/link.exe

I've added a check in my CMakeLists.txt to print the value of that variable: message("MSVC ${MSVC}"). Here's my CMake configuration command and output:

C:\Users\rmudafor\Desktop\openfast\build_sl>cmake .. -G"NMake Makefiles" -DCMAKE_C_COMPILER:FILEPATH="C:\Program Files (x86)\Intel\oneAPI\compiler\latest\windows\bin\intel64\icl.exe" -DCMAKE_CXX_COMPILER:FILEPATH="C:\Program Files (x86)\Intel\oneAPI\compiler\latest\windows\bin\intel64\icl.exe" -DCMAKE_Fortran_COMPILER:FILEPATH="C:\Program Files (x86)\Intel\oneAPI\compiler\latest\windows\bin\intel64\ifort.exe" -DBUILD_SHARED_LIBS=ON
-- The CXX compiler identification is Intel 20.2.1.20201112
-- The C compiler identification is Intel 20.2.1.20201112
-- The Fortran compiler identification is Intel 20.2.1.20201112
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Intel/oneAPI/compiler/latest/windows/bin/intel64/icl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files (x86)/Intel/oneAPI/compiler/latest/windows/bin/intel64/icl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Check for working Fortran compiler: C:/Program Files (x86)/Intel/oneAPI/compiler/latest/windows/bin/intel64/ifort.exe - skipped
-- Checking whether C:/Program Files (x86)/Intel/oneAPI/compiler/latest/windows/bin/intel64/ifort.exe supports Fortran 90
-- Checking whether C:/Program Files (x86)/Intel/oneAPI/compiler/latest/windows/bin/intel64/ifort.exe supports Fortran 90 - yes
-- Performing Test HAS_FORTRAN2008
-- Performing Test HAS_FORTRAN2008 - Success
-- Enabling Fortran 2008 features
-- Found MKL: C:/Program Files (x86)/Intel/oneAPI/mkl/latest/lib/intel64/mkl_intel_lp64.lib;C:/Program Files (x86)/Intel/oneAPI/mkl/latest/lib/intel64/mkl_sequential.lib;C:/Program Files (x86)/Intel/oneAPI/mkl/latest/lib/intel64/mkl_core.lib
MSVC 1
CMake Error at CMakeLists.txt:81 (message):
  Shared libraries are not support by OpenFAST with the MSVC build tool
  (https://github.com/OpenFAST/openfast/issues/448).


-- Configuring incomplete, errors occurred!
See also "C:/Users/rmudafor/Desktop/openfast/build_sl/CMakeFiles/CMakeOutput.log".
See also "C:/Users/rmudafor/Desktop/openfast/build_sl/CMakeFiles/CMakeError.log".
0

There are 0 best solutions below