【问题标题】:How to install SPAMS toolbox in Matlab 2014b under windows 8.1windows 8.1下如何在matlab 2014b中安装SPAMS工具箱
【发布时间】:2015-02-20 11:08:51
【问题描述】:

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

我采取的步骤如下(某些部分可能是不必要的或丢失的)

第 1 步。 安装“Microsoft Visual C++ 2013 Professional”。

第 2 步。 安装“Microsoft Windows 软件开发工具包 (SDK)”。

第 3 步。http://spams-devel.gforge.inria.fr/ 下载“spams-matlab-v2.4-svn2014-02-18.tar”

第 4 步。 在 Windows 中使用 7-zip 解压缩。我只收到 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 步。 在 SPAMS 中打开 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 功能。

【问题讨论】:

  • 您是否按照错误中的说明进行操作? “检查您是否在正确的当前文件夹中”。我的建议是确保在 MATLAB 中移动到包含 compile.m 的文件夹并通过键入 compile 从命令行运行它。

标签: c++ matlab mex


【解决方案1】:

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

这是我在 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,就可以了。

【讨论】:

    【解决方案2】:

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

    【讨论】:

      猜你喜欢
      • 2011-03-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-05-19
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多