安装SPAMS工具箱

来源:互联网 发布:斯坦福英语软件下载 编辑:程序博客网 时间:2024/05/29 14:15

PC环境:64位Win7,Matlab2013a + VS2010


第一步


SPAMS工具箱是c++代码,需要先编译才能使用

>> mex -setup
 
Welcome to mex -setup.  This utility will help you set up  
a default compiler.  For a list of supported compilers, see  
http://www.mathworks.com/support/compilers/R2013a/win64.html
 
Please choose your compiler for building MEX-files:
 
Would you like mex to locate installed compilers [y]/n? y
 
Select a compiler:
[1] Microsoft Visual C++ 2010 in D:\Microsoft Visual Studio 10.0
 
[0] None
 
Compiler: 1
 
Please verify your choices:
 
Compiler: Microsoft Visual C++ 2010  
Location: D:\Microsoft Visual Studio 10.0
 
Are these correct [y]/n? y
 
***************************************************************************
  Warning: MEX-files generated using Microsoft Visual C++ 2010 require
           that Microsoft Visual Studio 2010 run-time libraries be  
           available on the computer they are run on.
           If you plan to redistribute your MEX-files to other MATLAB
           users, be sure that they have the run-time libraries.
***************************************************************************
 
 
Trying to update options file: C:\Users\Happy\AppData\Roaming\MathWorks\MATLAB\R2013a\mexopts.bat
From template:              D:\Matlab\bin\win64\mexopts\msvc100opts.bat
 
Done . . .
 
**************************************************************************
  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  
           Building with the -largeArrayDims option enables the new API.
**************************************************************************

:-)配置成功


第二步


首先修改compile.m文件

compiler='mex';
use_multithread=false;
use_64bits_integers=false;

接着运行compile.m,build文件夹下查看编译成功的文件。p.s. 忽略出现的各种warning


第三步


打开test_release文件夹,选择文件test_archetypalAnalysis.m进行测试,结果如下


!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!End



0 0
原创粉丝点击