[mlpack] linker error in mlpack installation

Gilles Barges gbarges at free.fr
Wed Dec 4 00:18:54 EST 2013


> On Tue, Dec 03, 2013 at 03:10:28PM +0100, Gilles Barges wrote:
>> 
>> The unresolved symbols were :
>> _wrapper_ddot_
>> _wrapper_dgels_
>> _wrapper_dgemm_
>> _wrapper_dgemv_
>> .../...
>> _wrapper_dsyrk_
>> 
> 

> A related ticket is here:
> 
> http://trac.research.cc.gatech.edu/fastlab/ticket/260
> 
> In that ticket, the location of Armadillo was being specified for CMake
> by hand with -D ARMADILLO_LIBRARY=... and -D ARMADILLO_INCLUDE_DIR=...
> but the problem was that the ARMADILLO_LIBRARY should be set to the
> exact path of libarmadillo.dylib and not the directory it's contained
> in.  So that may be something to check.

checked : no problem here. 

> 
> My best guess is that the linker is not properly linking against
> Armadillo.  

yes.

Finally I found the trick I used some month ago :
simply comment #define ARMA_USE_LAPACK and #define ARMA_USE_BLAS in armadillo_bits/config.hpp
without using BLAS nor LAPACK, I get no unresolved ! and MLPACK installation goes to the end.

This is not really a solution, as you may think.

Usually I can find information in the commands that are issued (what is linked _exactly_),
but cmake hides the guts - I'm not used with cake.

Finally, it looks like the linker (we talk about mlpack installation) were lacking some -lblas, -llapack, -larmadillo … option.

can cmake be told to show more details when running the Makefiles it creates ?

When enabling BLAS & LAPACK & WRAPPING in armadillo includes, making mlpack 1.0.7 gives :

$ make
Linking CXX shared library ../../lib/libmlpack.dylib
Undefined symbols for architecture x86_64:
  "_wrapper_ddot_", referenced from:
      void arma::syrk_vec<false, false, false>::apply<double, arma::Col<double> >(...) in gaussian_distribution.cpp.o
      void arma::syrk_vec<false, true, true>::apply<double, arma::Col<double> >(…) in gaussian_distribution.cpp.o
      void arma::syrk_vec<false, true, false>::apply<double, arma::Col<double> >(...) in gaussian_distribution.cpp.o
      void arma::syrk_vec<false, false, true>::apply<double, arma::Col<double> >(...) in gaussian_distribution.cpp.o
      void arma::syrk_vec<true, false, false>::apply<double, arma::Mat<double> >(...) in gaussian_distribution.cpp.o
      mlpack::math::RandVector(arma::Col<double>&) in lin_alg.cpp.o
      void arma::syrk_vec<false, false, false>::apply<double, arma::Mat<double> >(...) in lin_alg.cpp.o
      ...
  "_wrapper_dgels_", referenced from:
      bool arma::auxlib::solve_od<double, arma::Gen<arma::Mat<double>, arma::gen_ones_full> >(...) in lars.cpp.o
      bool arma::auxlib::solve_ud<double, arma::Gen<arma::Mat<double>, arma::gen_ones_full> >(...) in lars.cpp.o
      bool arma::auxlib::solve_od<double, arma::Glue<arma::Op<arma::Mat<double>, arma::op_htrans>, arma::Col<double>, arma::glue_times> >(...) in linear_regression.cpp.o
      bool arma::auxlib::solve_ud<double, arma::Glue<arma::Op<arma::Mat<double>, arma::op_htrans>, arma::Col<double>, arma::glue_times> >(...) in linear_regression.cpp.o

...and a lot of others...

ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [lib/libmlpack.1.0.dylib] Error 1

Attached is the file CMakeCache.txt

greetings 

--
Gilles Barges.




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack/attachments/20131204/ebbefb02/attachment-0002.html>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: CMakeCache.txt
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack/attachments/20131204/ebbefb02/attachment-0001.txt>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack/attachments/20131204/ebbefb02/attachment-0003.html>


More information about the mlpack mailing list