0

我想在我的 Matlab2012a 上安装 enceval 工具包:

要在 Matlab 上安装的 enceval 工具包文件

我已经安装了支持编译器 Visual Studio 10 和 SDK 7.1。他们在 file.m 中编写了这段代码来安装:

archstr = computer('arch');
if(strcmp(archstr,'win64'))
  lapacklib = fullfile(matlabroot, ...
  'extern', 'lib', 'win64', 'microsoft', 'libmwlapack.lib');
  blaslib = fullfile(matlabroot, ...
  'extern', 'lib', 'win64', 'microsoft', 'libmwblas.lib');
  command =  'mex (''LLCEncodeHelper.cpp'', lapacklib, blaslib, largeArrayDims)';
elseif(strcmp(archstr,'win32'))
  lapacklib = fullfile(matlabroot, ...
 'extern', 'lib', 'win32', 'microsoft', 'libmwlapack.lib');
  blaslib = fullfile(matlabroot, ...
  'extern', 'lib', 'win32', 'microsoft', 'libmwblas.lib');
  command =  'mex(''LLCEncodeHelper.cpp'', lapacklib, blaslib)';
elseif strcmp(archstr,'glnx86')
    command = 'mex -O LLCEncodeHelper.cpp -lmwlapack -lmwblas';
elseif strcmp(archstr,'glnxa64')
    command = 'mex -O LLCEncodeHelper.cpp -lmwlapack -lmwblas -largeArrayDims';
else
    error('System architecture could not be identified');
end

mexCmds=cell(0,1);
mexCmds{end+1}=command;

for i=1:length(mexCmds)
  fprintf('Executing %s\n',mexCmds{i});
  eval(mexCmds{i});
end

当我运行这段代码时,我得到了这个异常:

*Executing mex ('LLCEncodeHelper.cpp', lapacklib, blaslib, largeArrayDims)

Error using eval

Undefined function or variable 'largeArrayDims'.

Error in featpipem_setup (line 32)

  eval(mexCmds{i});*

我不知道为什么这是 matlab 版本的问题或缺少某些东西?

4

1 回答 1

0

Try passing a string '-largeArrayDims' instead of variable largeArrayDims which is not declared anywhere prior to the call to mex, that is, try running the following:

lapacklib = fullfile(matlabroot, ...
  'extern', 'lib', 'win64', 'microsoft', 'libmwlapack.lib');
blaslib = fullfile(matlabroot, ...
  'extern', 'lib', 'win64', 'microsoft', 'libmwblas.lib');
command =  'mex (''LLCEncodeHelper.cpp'', lapacklib, blaslib, ''-largeArrayDims'')';
eval(command)
于 2013-07-25T13:00:00.767 回答