我注意到 MATLAB 提供了 BLAS 和 LAPACK 标头等:
$ ls ${MATLAB_DIR}/extern/include/
blas.h engine.h lapack.h mat.h mclmcr.h mex.h mwutil.h
blascompat32.h fintrf.h libmatlbm.mlib matrix.h mclmcrrt.h mwdebug.h tmwtypes.h
emlrt.h io64.h libmatlbmx.mlib mclcppclass.h mcr.h mwservices.h
我想将它们用于我的编译代码,所以我尝试编译以下内容:
ex_blas.c
#include <blas.h>
int main()
{
return 0;
}
使用以下命令:
$ mex ex_blas.c
但这会返回一个错误:
In file included from ex_blas.c:1:
/Applications/MATLAB_R2009b.app/extern/include/blas.h:51: error: syntax error before ‘*’ token
/Applications/MATLAB_R2009b.app/extern/include/blas.h:62: error: syntax error before ‘*’ token
/Applications/MATLAB_R2009b.app/extern/include/blas.h:77: error: syntax error before ‘*’ token
/Applications/MATLAB_R2009b.app/extern/include/blas.h:92: error: syntax error before ‘*’ token
/Applications/MATLAB_R2009b.app/extern/include/blas.h:103: error: syntax error before ‘ptrdiff_t’
/Applications/MATLAB_R2009b.app/extern/include/blas.h:122: error: syntax error before ‘ptrdiff_t’
blas.h
MATLAB 提供的 MATLAB 之外的第 3 方应用程序是否可以使用?如果是,是什么导致了上述错误?