如何使用MATLAB提供的BLAS库? [英] How do I use the BLAS library provided by MATLAB?

查看:115
本文介绍了如何使用MATLAB提供的BLAS库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我注意到,MATLAB提供了BLAS和LAPACK标头:

I have noticed that MATLAB provides the BLAS and LAPACK headers among others:

$ 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

我想将它们用于我的编译代码,所以我尝试编译以下代码:

I would like to use them for my compiled code, so I tried to compile the following:

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’

由MATLAB提供的blas.h是否可以被MATLAB外部的第三方应用程序使用?如果是,是什么导致上述错误?

Is the blas.h provided by MATLAB usable by a 3rd party application outside of MATLAB? If yes, what is causing the error above?

推荐答案

我不确定它是否可以完全解决您的问题,但是您可能还必须包含

I'm not sure if it will completely resolve your problems, but you may also have to include stddef.h since that is where the ptrdiff_t type is defined.

这篇关于如何使用MATLAB提供的BLAS库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆