我已经通过Homebrew安装了Armadillo
brew install homebrew/science/armadillo
我尝试编译了一些代码,使用的是
g++-4.7 -I/usr/local/include file1.cpp -O2 -llapack -lblas
但是我得到的仅仅是
空白
。Undefined symbols for architecture x86_64: "_wrapper_ddot_", referenced from:
void arma::syrk<false, false, false>::apply_blas_type<double, arma::Mat<double> >(arma::Mat<double>&, arma::Mat<double> const&, double, double) in ccYKNLEL.o "_wrapper_dgemm_", referenced from:
_main in ccYKNLEL.o "_wrapper_dgemv_", referenced from:
_main in ccYKNLEL.o "_wrapper_dsyrk_", referenced from:
void arma::syrk<false, false, false>::apply_blas_type<double, arma::Mat<double> >(arma::Mat<double>&, arma::Mat<double> const&, double, double) in ccYKNLEL.o ld: symbol(s) not found for architecture
x86_64 collect2: error: ld returned 1 exit status
对于同样的情况
g++-4.7 -I/usr/local/include file1.cpp -O2 -framework accelerate
还包括-larmadillo
g++-4.7 -I/usr/local/include file1.cpp -O2 -larmadillo -llapack -lblas
返回结果为
library not found for -larmadillo
And in
/usr/local/Cellar/armadillo/4.100.2/lib/
我发现像
libarmadillo.4.10.2.dylib
这样的库,但是它们无法通过 -I
包含进来。可能出了什么问题?