Error Compiling Armadillo

1.4k views Asked by At

I have the following error trying to compile Armadillo:

Undefined symbols for architecture x86_64:
  "_wrapper_ddot_", referenced from:
      void arma::syrk_vec<true, false, false>::apply<double, arma::Mat<double> >(arma::Mat<double>&, arma::Mat<double> const&, double, double) in exampleArma.o
      void arma::syrk_vec<true, false, false>::apply<double, arma::Row<double> >(arma::Mat<double>&, arma::Row<double> const&, double, double) in exampleArma.o
  "_wrapper_dgemm_", referenced from:
      void arma::gemm<true, false, false, false>::apply_blas_type<double, arma::Mat<double>, arma::Mat<double> >(arma::Mat<double>&, arma::Mat<double> const&, arma::Mat<double> const&, double, double) in exampleArma.o
      void arma::gemm<true, false, false, false>::apply_blas_type<double, arma::Row<double>, arma::Row<double> >(arma::Mat<double>&, arma::Row<double> const&, arma::Row<double> const&, double, double) in exampleArma.o
  "_wrapper_dgemv_", referenced from:
      void arma::glue_times::apply<double, true, false, false, arma::Mat<double>, arma::Mat<double> >(arma::Mat<double>&, arma::Mat<double> const&, arma::Mat<double> const&, double) in exampleArma.o
      void arma::glue_times::apply<double, true, false, false, arma::Row<double>, arma::Row<double> >(arma::Mat<double>&, arma::Row<double> const&, arma::Row<double> const&, double) in exampleArma.o
  "_wrapper_dsyrk_", referenced from:
      void arma::syrk<true, false, false>::apply_blas_type<double, arma::Mat<double> >(arma::Mat<double>&, arma::Mat<double> const&, double, double) in exampleArma.o
      void arma::syrk<true, false, false>::apply_blas_type<double, arma::Row<double> >(arma::Mat<double>&, arma::Row<double> const&, double, double) in exampleArma.o

I'm compiling using makefile and i already tried the solutions found here with no good results. Until now my project has different classes that are compiled with makefile. Two of them use armadillo: the first one doesn't show any problems. Instead this new class gives me compilation errors. I figured out that the error here is given using the cor function of armadillo. When i just use rowvec or cx_rowvec as in the first class all works perfectly. Debugging i noticed that when i uncomment the line code with cor i get the error. Can someone help me? I installed the last armadillo version 7.600.2.

Now i tried to use different Armadillo library functions: it sounds like i don't have some of them. For example using the following functions mean(X),var(X),stddev(X) i haven't any problems, it compiles perfectly. Instead when i try to use others function like cov(X), cor(X) i get that errors. I guess that i don't have that functions in my library. So in order to solve the problem i tried to remove safely the old library and install a new one. Unfortunately the error holds. I hope this update will be helpful. I don't think that i'm doing some mistake in my makefile, because it doesn't compile well just when i use some specifics functions in my code. Thank you to everyone!

1

There are 1 answers

1
enne On BEST ANSWER

I solved commenting the following lines in armadillo_bits/config.hpp: #define ARMA_USE_LAPACKand #define ARMA_USE_BLAS. Even if it works, it's the wrong solution. A better solution is described in the linking section here http://arma.sourceforge.net/faq.html#linking.