【代码问题】MatConvNet+VS2017编译找不到cl.exe错误

用vl_compilenn做普通的CPU编译报错:

'cl.exe' 不是内部或外部命令,也不是可运行的程序
或批处理文件。
错误使用 vl_compilenn>check_clpath (line 656)
Unable to find cl.exe

 

环境:Win10+VS2017+Matlab2017b+MatConvNet1.25

 

很明显是找不到cl.exe的位置

将646行左右的cl_path = fullfile(cc.Location, 'VC', 'bin', 'amd64');  (该语句在check_clpath函数内)改成

cl_path='D:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.15.26726\bin\Hostx64\x64'; 即可解决

 

用vl_compilenn做GPU编译也有类似报错:

Failed to run D:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/VC/Tools/MSVC/14.15.26726/bin/Hostx64/cl.exe (系统找不到指定的文件。  

也是找不到cl.exe

问题出现在大概426行左右, cl_path = fileparts(check_clpath());把check_clpath解析出的路径的最后一层目录给丢掉了。改成cl_path = check_clpath();即可

 

更改完了出现:

tmpxft_000001f0_00000000-1.cpp
nvcc fatal : Host compiler targets unsupported OS.

 

。。。。。只好换VS2015编译。杯具。

 

posted on 2019-04-14 15:26  博闻强记2010  阅读(3296)  评论(0编辑  收藏  举报

导航