windows8.1下如何在Matlab 2014b中安装SPAMS工具箱

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

我正在尝试学习如何在我使用 Windows 8.1 OS 和 MATLAB R2014b 的机器上成功编译 "Sparse Modeling Software" (SPAMS)。

我采取的步骤如下(有些部分可能是不必要的或遗漏的)

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

步骤 2. 已安装 "Microsoft Windows Software Development Kit (SDK)".

步骤 3.http://spams-devel.gforge.inria.fr/

下载 "spams-matlab-v2.4-svn2014-02-18.tar"

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

ERROR: Can not set reparse data: C:\Users\Yashar\Desktop\spams-matlab\cpp_library\spams.h

Step5: 在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 步。 在垃圾邮件中打开 compile.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 接口代码等相关的问题需要一段时间。可以你能帮我解决我遇到的问题并设法在我的机器上编译 SPAMS 工具箱吗?仅供参考,我有兴趣在此工具箱中使用 mexLasso 函数。

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

这是我在 Windows 7 + MATLAB 2013a 中的做法。 希望对你有用。

(我没有解压的问题)

首先,你要确保 '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

一共有六块你需要改变如下,

  1. -I./linalg/
  2. -I./decomp/
  3. -I./prox/
  4. -I./dictLearn/
  5. -I./dags/
  6. -I./image/

替换完这些字符串后,只要运行compile.m,就可以了。

Select 2.5 版垃圾邮件软件你运行宁为Windows版。在compile.m中将编译器设置为VS并执行代码。这会生成所需的文件。最后 运行 start_spams.m,这又会创建源文件夹。现在您可以 运行 相应的代码。