0

我正在尝试编译别人的代码并且没有简单的头文件。我需要在 osx 上链接默认的 lapack 和 blas 库,经过一番搜索,我发现它们在 Accelerate 框架中,在我的 make.inc 中我使用了类似的东西

LAPACK_LIBS = -framework Accelerate

现在我阅读了我应该包含的手册页

#include <Accelerate/Accelerate.h>

有没有办法在 make.inc 中做到这一点?

对不起,如果这很愚蠢,我不是真正的程序员,我已经尽力搜索......


我得到的错误是:

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
4

1 回答 1

1

#include行将进入一个或多个源文件,无论哪个使用来自 Accelerate 框架的 API。你得到编译错误吗?如果没有,则无需添加这样的包含行。如果是,那么您需要将它添加到遇到由于缺少这些声明而导致的错误的文件的顶部附近。

于 2013-10-27T07:28:16.407 回答