问题
I'm trying to compile someone else's code and there isn't a simple header file. I need to link the default lapack and blas libraries on osx, and after some searching I figured they're in the Accelerate framework, and in my make.inc I used something like
LAPACK_LIBS = -framework Accelerate
Now I read in the man page that I should include
#include <Accelerate/Accelerate.h>
Is there a way I can do it in make.inc?
Sorry if this is dumb I'm not really a programmer and I've tried my best to search...
The errors I'm getting are:
2 warnings generated.
Undefined symbols for architecture x86_64:
"_dgemm_", referenced from:
_umfdi_blas3_update in libumfpack.a(umf_di_blas3_update.o)
"_dgemv_", referenced from:
_umfdi_local_search in libumfpack.a(umf_di_local_search.o)
"_dger_", referenced from:
_umfdi_blas3_update in libumfpack.a(umf_di_blas3_update.o)
"_dtrsm_", referenced from:
_umfdi_blas3_update in libumfpack.a(umf_di_blas3_update.o)
"_dtrsv_", referenced from:
_umfdi_local_search in libumfpack.a(umf_di_local_search.o)
"_main", referenced from:
start in crt1.10.5.o
(maybe you meant: _luaH_mainposition)
"_zgemm_", referenced from:
_umfzi_blas3_update in libumfpack.a(umf_zi_blas3_update.o)
"_zgemv_", referenced from:
_umfzi_local_search in libumfpack.a(umf_zi_local_search.o)
"_zgeru_", referenced from:
_umfzi_blas3_update in libumfpack.a(umf_zi_blas3_update.o)
"_ztrsm_", referenced from:
_umfzi_blas3_update in libumfpack.a(umf_zi_blas3_update.o)
"_ztrsv_", referenced from:
_umfzi_local_search in libumfpack.a(umf_zi_local_search.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
mex: link of ' "meshmex.mexmaci64"' failed.
make[2]: *** [meshmex.] Error 1
make[1]: *** [all] Error 2
make: *** [all] Error 2
回答1:
The #include
line would go into one or more of the source files, whichever ones uses APIs from the Accelerate framework. Are you getting compile errors? If not, then there's no need to add such an include line. If you are, then you need to add it near the top of whichever file is encountering the errors resulting from lack of those declarations.
来源:https://stackoverflow.com/questions/19615629/framework-accelerate-where-to-include-accelerate-accelerate-h