2013-12-16 140 views
0

我已經下載了最新的Armadillo軟件包(3.920),我試圖在我的機器上使用它(Ubuntu 12.04)。我按照readme.txt文件中提到的步驟安裝(cmake。,make,sudo make install)。我有我的系統,並抨擊我。當我嘗試運行使用實施例目錄中提供的示例: 克++ example1.cpp -O2 -larmadillo 我得到錯誤: /usr/lib/liblapack.so.3gf:未定義參照ATL_zptgemm' /usr/lib/liblapack.so.3gf: undefined reference to ATL_scopy」 等使用Armadillo時出錯

如果我嘗試運行與 例子G ++ example1.cpp -02 -llpack -lblas -lgfortran 我得到的錯誤: /tmp/ccOsKhfg.o:在功能double arma::blas::dot<double>(unsigned int, double const*, double const*)': example1.cpp:(.text._ZN4arma4blas3dotIdEET_jPKS2_S4_[double arma::blas::dot<double>(unsigned int, double const*, double const*)]+0x36): undefined reference to wrapper_ddot_」 /tmp/ccOsKhfg.o :功能void arma::blas::gemv<double>(char const*, int const*, int const*, double const*, double const*, int const*, double const*, int const*, double const*, double*, int const*)': example1.cpp:(.text._ZN4arma4blas4gemvIdEEvPKcPKiS5_PKT_S8_S5_S8_S5_S8_PS6_S5_[void arma::blas::gemv<double>(char const*, int const*, int const*, double const*, double const*, int const*, double const*, int const*, double const*, double*, int const*)]+0x53): undefined reference to wrapper_dgemv_' /tmp/ccOsKhfg.o:功能void arma::blas::gemm<double>(char const*, char const*, int const*, int const*, int const*, double const*, double const*, int const*, double const*, int const*, double const*, double*, int const*)': example1.cpp:(.text._ZN4arma4blas4gemmIdEEvPKcS3_PKiS5_S5_PKT_S8_S5_S8_S5_S8_PS6_S5_[void arma::blas::gemm<double>(char const*, char const*, int const*, int const*, int const*, double const*, double const*, int const*, double const*, int const*, double const*, double*, int const*)]+0x61): undefined reference to wrapper_dgemm_'

請注意,如果我註釋行'#define ARMA_USE_LAPACK','#define ARMA_USE_BLAS'in config.hpp我可以運行示例1,但不是示例2,因爲它需要lapack。

請你指導我解決問題。 謝謝。 Salil

+1

您需要在提交問題前清除格式。請查看:http://stackoverflow.com/editing-help –

回答

0

看到你的問題, 我想你應該輸入-llapack而不是-llpack。
沒有-lgfortan它可以工作,所以也試試。

g++ main.cpp -o main -o1 -larmadillo -llapack -lblas