如何在windows 8.1下在Matlab 2014b中安装SPAMS工具箱

How to install SPAMS toolbox in Matlab 2014b under windows 8.1

本文关键字:安装 SPAMS 2014b 工具箱 1下 windows Matlab      更新时间:2023-10-16

我正在努力学习如何在使用Windows 8.1操作系统和MATLAB R2014b的机器上成功编译"稀疏建模软件"(SPAMS)。

我采取的步骤如下(有些零件可能是不必要的或缺失的)

步骤1.已安装"Microsoft Visual C++2013 Professional"。

步骤2.已安装"Microsoft Windows软件开发工具包(SDK)"。

步骤3.从下载"spams-matlab-v2.4-svn2014-02-18.tar"http://spams-devel.gforge.inria.fr/

步骤4.在Windows中使用7-zip解压缩。我只收到一个错误,但其他所有数据都未压缩。错误是:

ERROR: Can not set reparse data: C:UsersYasharDesktopspams-matlabcpp_libraryspams.h

步骤5:在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.在SPAMS中打开compile.m(根据建议)并运行它。我得到的错误如下:

compilation of: -I./linalg/ -I./decomp/ -I./prox/ -I./dictLearn/ dictLearn/mex/mexTrainDL.cpp
Error using mex
C:UsersYasharDesktopspams-matlabFiles not found; check that you are in the
correct current folder, and check the spelling of
'C:UsersYasharDesktopspams-matlabFiles'.
Error in compile (line 391)
mex(args{:});

问题:我所做的看起来很标准,但我知道需要一段时间来学习如何处理与MATLAB等接口代码有关的问题。你能帮我解决我遇到的问题并在我的机器中编译SPAMS工具箱吗?仅供参考,我有兴趣在这个工具箱中使用mexLasso函数。

嗯。编译这个工具箱有点棘手。

以下是我在Windows7+MATLAB2013a中的操作方法希望它对你有用。

(我没有解压缩的问题)

首先,你想确保"mex"正常工作,我编译了一些较小的包,它们总体上正常工作。

第二,更改线路

compiler='gcc';

compiler='mex';

第三,你可以发现很多线条看起来像

-I./linalg/ -I./decomp/ -I./prox/ -I./spams/dictLearn/ dictLearn/mex/mexArchetypalAnalysis.cpp

给我/lib_name/是Linux风格的路径,您需要将其更改为Windows能够理解的路径。

这里有一个例子:

-I./linalg/       --->       -IC:UsersXXXDownloadsSPAMSlinalg

总共有六件事你需要改变如下,

  1. -I/直线加速器/
  2. -I/反编译/
  3. -I/prox/
  4. -I/dictLearn/
  5. -I/dags/
  6. -I/图像/

替换这些字符串后,只需运行compile.m,它就可以工作了。

选择2.5版本您正在运行的SPAMS软件的Windows版本。在compile.m中将编译器设置为VS并执行代码。这将生成所需的文件。最后运行start_spams.m,它依次创建源文件夹。现在,您可以运行相应的代码。