MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   资料存档 (https://www.labfans.com/bbs/forumdisplay.php?f=72)
-   -   如何使用MATLAB提供的BLAS库? (https://www.labfans.com/bbs/showthread.php?t=22905)

poster 2019-12-10 16:49

如何使用MATLAB提供的BLAS库?
 
我注意到,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 我想将它们用于编译后的代码,因此尝试编译以下代码:

[B]ex_blas.c[/B]

#include 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 鈥榩trdiff_t鈥?/Applications/MATLAB_R2009b.app/extern/include/blas.h:122: error: syntax error before 鈥榩trdiff_t鈥? MATLAB提供的blas.h是否可被MATLAB外部的第三方应用程序使用?如果是,是什么导致上述错误?


回答:
我不确定它是否可以完全解决您的问题,但是您可能还必须包含[URL="http://www.cplusplus.com/reference/clibrary/cstddef/"]stddef.h[/URL]因为这是定义ptrdiff_t类型的地方。



[url=https://stackoverflow.com/questions/1735985]更多&回答...[/url]


所有时间均为北京时间。现在的时间是 10:26

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.