问题描述
在我的 CMake 项目中,我正在检查 MSVC 编译器的使用,以提醒用户注意特定的错误消息。但是,当我使用所有英特尔编译器(Fortran、C、C++)时,MSVC CMake 变量仍处于启用状态。这是预期的吗?
检查“MSVC”的 CMakeCache 显示链接器和存档器来自 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
我在 CMakeLists.txt 中添加了一个检查以打印该变量的值:message("MSVC ${MSVC}")
。这是我的 CMake 配置命令和输出:
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".
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)