我正在努力学习如何成功地编译“稀疏建模软件”(垃圾邮件)在我的机器使用Windows8.1操作系统和MATLAB R2014b。
我所采取的步骤如下(有些部分可能是不必要的或缺失的)
步骤1.安装了“MicrosoftVisualC++ 2013专业版”。
步骤2.安装了“(SDK)”。
步骤3.从http://spams-devel.gforge.inria.fr/下载“垃圾邮件-matlab-v2.4-Step 2014-02-18.tar”
步骤4.使用7-zip在中解压缩它.我只收到一个错误,但所有其他数据都未被压缩。错误是:
ERROR: Can not set reparse data: C:\Users\Yashar\Desktop\spams-matlab\cpp_library\spams.hStep5:在MATLAB中,我设置了编译器:
>> mex -setup C++我收到的信息:
MEX configured to use 'Microsoft Visual C++ 2013 Professional' for C++ language compilation.
Warning: The MATLAB C and Fortran API has changed to support MATLAB
variables with more than 2^32-1 elements. In the near future
you will be required to update your code to utilize the
new API. You can find more information about this at:
http://www.mathworks.com/help/matlab/matlab_external/upgrading- mex-files-to-use-64-bit-api.html.步骤6.垃圾邮件中的打开编译器m(如建议的那样)并运行它。我得到的错误如下:
compilation of: -I./linalg/ -I./decomp/ -I./prox/ -I./dictLearn/ dictLearn/mex/mexTrainDL.cpp
Error using mex
C:\Users\Yashar\Desktop\spams-matlab\Files not found; check that you are in the
correct current folder, and check the spelling of
'C:\Users\Yashar\Desktop\spams-matlab\Files'.
Error in compile (line 391)
mex(args{:});问题:我对自己做的事情看上去很标准,但我知道这需要一段时间才能学会如何处理与MATLAB接口代码有关的问题,您能帮我解决我遇到的问题并设法在我的机器中编译垃圾邮件工具箱吗?FYI,我对在这个工具箱中使用mexLasso函数感兴趣。
发布于 2015-03-17 18:53:23
嗯。编译这个工具箱有点棘手。
下面是我在Windows 7+MATLAB2013a中所做的工作。希望它能为您工作。
(我没有解压缩的问题)
首先,您要确保“mex”正常工作,我已经编译了一些较小的包,它们一般都能工作。
第二,换行
compiler='gcc';至
compiler='mex';第三,你可以发现很多行看起来
-I./linalg/ -I./decomp/ -I./prox/ -I./spams/dictLearn/ dictLearn/mex/mexArchetypalAnalysis.cpp这里的‘I/lib_name/’是Linux风格的路径,您需要将它更改为Windows可以理解的内容。
下面是一个示例:
-I./linalg/ ---> -IC:\Users\XXX\Downloads\SPAMS\linalg有六个部分你需要修改如下,
替换这些字符串后,只需运行compile.m,那么它就可以工作了。
发布于 2017-09-20 06:57:29
选择2.5版本,您正在为Windows版本运行的垃圾邮件软件。在compile.m中将编译器设置为VS并执行代码。这将生成所需的文件。最后,运行start_spams.m,然后创建源文件夹。现在您可以运行相应的代码了。
https://stackoverflow.com/questions/28627540
复制相似问题