问题
cmake 提示找不到编译器,vs命令行编译提示 [工作目录“\mkl\tools”不存在]
有些时候,我们需要安装intel的 Intel® Math Kernel Library (Intel® MKL) 。
https://software.intel.com/en-us/mkl
https://software.seek.intel.com/performance-libraries
这个倒霉玩意儿,虽然说免费。但是必须注册后才能下载。
而且!!!!需要你注册后的2个工作日后,才能下载。
应用了一段时间之后,你可能不用了,会卸载掉。
这个时候,问题就来了。
它会在你的系统留下遗产:
#比如在vs2015的目录下留下
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Platforms\x64\PlatformToolsets\v140\ImportBefore\Intel.Libs.MKL.v140.targets
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Platforms\x64\PlatformToolsets\v140\ImportAfter\Intel.Libs.MKL.v140.props
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Platforms\x64\PlatformToolsets\v140_xp\ImportBefore\Intel.Libs.MKL.v140_xp.props
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Platforms\x64\PlatformToolsets\v140_xp\ImportBefore\Intel.Libs.MKL.v140_xp.targets
如果你安装了TBB,同样会留下类似的
Intel.Libs.TBB.v140.props
Intel.Libs.TBB.v140.targets
Intel.Libs.TBB.v140_xp.props
Intel.Libs.TBB.v140_xp.targets
这时候,当你使用cmake configure的时候,当选择vs2017 v140,配置项,或者直接使用vs2015命令行编译的时候,就会提示错误。
error MSB6003: 指定的任务可执行文件“cmd.exe”未能运行。工作目录“\mkl\tools”不存在
cmake 提示从错误,表面上看是这样:
The C compiler identification is unknown
The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:2 (project):
No CMAKE_C_COMPILER could be found.
CMake Error at CMakeLists.txt:2 (project):
No CMAKE_CXX_COMPILER could be found.
当打开error.log时,提示【工作目录“\mkl\tools”不存在】。如下:
Configuring incomplete, errors occurred!
See also "D:/git/cdnunion/million/miner/xmrig/build/CMakeFiles/CMakeOutput.log".
See also "D:/git/cdnunion/million/miner/xmrig/build/CMakeFiles/CMakeError.log".
D:/git/cdnunion/million/miner/xmrig/build/CMakeFiles/CMakeError.log
Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler:
Build flags:
Id flags:
The output was:
1
用于 .NET Framework 的 Microsoft (R) 生成引擎版本 15.7.180.61344
版权所有(C) Microsoft Corporation。保留所有权利。
生成启动时间为 2018-07-26 23:41:06。
节点 1 上的项目“D:\git\cdnunion\million\miner\xmrig\build\CMakeFiles\3.12.0\CompilerIdC\CompilerIdC.vcxproj”(默认目标)。
PrepareForBuild:
正在创建目录“Debug\”。
正在创建目录“Debug\CompilerIdC.tlog\”。
InitializeBuildStatus:
正在创建“Debug\CompilerIdC.tlog\unsuccessfulbuild”,因为已指定“AlwaysCreate”。
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Platforms\x64\PlatformToolsets\v140\ImportBefore\Intel.Libs.MKL.v140.targets(62,5): error MSB6003: 指定的任务可执行文件“cmd.exe”未能运行。工作目录“\mkl\tools”不存在。 [D:\git\cdnunion\million\miner\xmrig\build\CMakeFiles\3.12.0\CompilerIdC\CompilerIdC.vcxproj]
已完成生成项目“D:\git\cdnunion\million\miner\xmrig\build\CMakeFiles\3.12.0\CompilerIdC\CompilerIdC.vcxproj”(默认目标)的操作 - 失败。
生成失败。
“D:\git\cdnunion\million\miner\xmrig\build\CMakeFiles\3.12.0\CompilerIdC\CompilerIdC.vcxproj”(默认目标) (1) ->
(SetVCMKLEnvironment 目标) ->
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Platforms\x64\PlatformToolsets\v140\ImportBefore\Intel.Libs.MKL.v140.targets(62,5): error MSB6003: 指定的任务可执行文件“cmd.exe”未能运行。工作目录“\mkl\tools”不存在。 [D:\git\cdnunion\million\miner\xmrig\build\CMakeFiles\3.12.0\CompilerIdC\CompilerIdC.vcxproj]
0 个警告
1 个错误
已用时间 00:00:00.41
解决办法
1 删除文件
Intel.Libs.MKL.v140.props
Intel.Libs.MKL.v140.targets
注意:在原目录下修改文件名称,无法解决问题
2 重新安装MKL库