Como uso a biblioteca blas fornecida pelo MATLAB?
Pergunta
Percebi que o MATLAB fornece os blas e os cabeçalhos de lateja, entre outros:
$ 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
Eu gostaria de usá -los para o meu código compilado, então tentei compilar o seguinte:
ex_blas.c
#include <blas.h>
int main()
{
return 0;
}
com o seguinte comando:
$ mex ex_blas.c
Mas isso retorna um erro:
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’
É o blas.h
Fornecido pelo Matlab Usable por um aplicativo de terceiros fora do MATLAB? Se sim, o que está causando o erro acima?
Solução
Não tenho certeza se isso resolverá completamente seus problemas, mas você também pode ter que incluir stddef.h
já que é onde o ptrdiff_t
tipo é definido.
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow