[mlpack] linker error in mlpack installation
Gilles Barges
gbarges at free.fr
Mon Dec 9 22:31:27 EST 2013
hi Ryan,
>
> Ok, I'm very confused by what's going on here. Can you tell me the
> version (exact) of OS X that you are using, the version of your
> compiler, XCode, and Armadillo, so that I can try to reproduce this?
here is the linker command and it's output :
Linking CXX shared library ../../lib/libmlpack.dylib
cd /Users/gbg/dev/Librairies/HMM-GMM/mlpack-1.0.7/build/src/mlpack && "/Applications/CMake 2.8-10.app/Contents/bin/cmake" -E cmake_link_script CMakeFiles/mlpack.dir/link.txt --verbose=1
/usr/bin/c++ -O3 -dynamiclib -Wl,-headerpad_max_install_names -compatibility_version 1.0.0 -current_version 1.0.0 -o ../../lib/libmlpack.1.0.dylib -install_name /Users/gbg/dev/Librairies/HMM-GMM/mlpack-1.0.7/build/lib/libmlpack.1.dylib CMakeFiles/mlpack.dir/core/dists/discrete_distribution.cpp.o CMakeFiles/mlpack.dir/core/dists/gaussian_distribution.cpp.o CMakeFiles/mlpack.dir/core/kernels/epanechnikov_kernel.cpp.o CMakeFiles/mlpack.dir/core/kernels/pspectrum_string_kernel.cpp.o CMakeFiles/mlpack.dir/core/math/lin_alg.cpp.o CMakeFiles/mlpack.dir/core/math/random.cpp.o CMakeFiles/mlpack.dir/core/optimizers/aug_lagrangian/aug_lagrangian_test_functions.cpp.o CMakeFiles/mlpack.dir/core/optimizers/lbfgs/test_functions.cpp.o CMakeFiles/mlpack.dir/core/optimizers/sgd/test_function.cpp.o CMakeFiles/mlpack.dir/core/tree/mrkd_statistic.cpp.o CMakeFiles/mlpack.dir/core/util/cli.cpp.o CMakeFiles/mlpack.dir/core/util/cli_deleter.cpp.o CMakeFiles/mlpack.dir/core/util/log.cpp.o CMakeFiles/mlpack.dir/core/util/option.cpp.o CMakeFiles/mlpack.dir/core/util/prefixedoutstream.cpp.o CMakeFiles/mlpack.dir/core/util/save_restore_utility.cpp.o CMakeFiles/mlpack.dir/core/util/string_util.cpp.o CMakeFiles/mlpack.dir/core/util/timers.cpp.o CMakeFiles/mlpack.dir/methods/cf/cf.cpp.o CMakeFiles/mlpack.dir/methods/det/dtree.cpp.o CMakeFiles/mlpack.dir/methods/det/dt_utils.cpp.o CMakeFiles/mlpack.dir/methods/lars/lars.cpp.o CMakeFiles/mlpack.dir/methods/linear_regression/linear_regression.cpp.o CMakeFiles/mlpack.dir/methods/neighbor_search/sort_policies/nearest_neighbor_sort.cpp.o CMakeFiles/mlpack.dir/methods/neighbor_search/sort_policies/furthest_neighbor_sort.cpp.o CMakeFiles/mlpack.dir/methods/neighbor_search/unmap.cpp.o CMakeFiles/mlpack.dir/methods/pca/pca.cpp.o CMakeFiles/mlpack.dir/methods/radical/radical.cpp.o -L/usr/local/lib /usr/lib/libarmadillo.dylib /usr/local/lib/libboost_program_options.dylib /usr/local/lib/libboost_unit_test_framework.dylib /usr/local/lib/libboost_random.dylib /usr/local/lib/libboost_program_options.dylib /usr/local/lib/libboost_unit_test_framework.dylib /usr/lib/libxml2.dylib /usr/local/lib/libboost_random.dylib /usr/lib/libxml2.dylib
Undefined symbols for architecture x86_64:
"_ddot_", referenced from:
void arma::syrk_vec<false, false, false>::apply<double, arma::Col<double> >(arma::Mat<double>&, arma::Col<double> const&, double, double) in gaussian_distribution.cpp.o
void arma::syrk_vec<false, true, true>::apply<double, arma::Col<double> >(arma::Mat<double>&, arma::Col<double> const&, double, double) in gaussian_distribution.cpp.o
void arma::syrk_vec<false, true, false>::apply<double, arma::Col<double> >(arma::Mat<double>&, arma::Col<double> const&, double, double) in gaussian_distribution.cpp.o
void arma::syrk_vec<false, false, true>::apply<double, arma::Col<double> >(arma::Mat<double>&, arma::Col<double> const&, double, double) in gaussian_distribution.cpp.o
void arma::syrk_vec<true, false, false>::apply<double, arma::Mat<double> >(arma::Mat<double>&, arma::Mat<double> const&, double, 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> >(arma::Mat<double>&, arma::Mat<double> const&, double, double) in lin_alg.cpp.o
.../...
"_dgels_", referenced from:
bool arma::auxlib::solve_od<double, arma::Gen<arma::Mat<double>, arma::gen_ones_full> >(arma::Mat<double>&, arma::Mat<double>&, arma::Base<double, arma::Gen<arma::Mat<double>, arma::gen_ones_full> > const&) in lars.cpp.o
this is obtained when commenting #define ARMA_USE_WRAPPER in armadillo's config.hpp file.
If uncommenting the above, I get the same diagnosis but with _wrapper_ddot_ instead of _ddot_, and so on.
Leaving ARMA_USE_WRAPPER commented and commenting ARMA_USE_LAPACK & ARMA_USE_BLAS
lead to a successful linking (and install) of libmlpack.dylib.
Leaving Armadillo in this state (no BLAS), I can write a program using mlpack (HMM-GMM), compile it and link it,
but NOT execute it (BLAS is required for arma::inv() somewhere in mlpack )
Then, just uncommenting ARMA_USE_LAPACK & ARMA_USE_BLAS in armadillo's header
solves the problem : the program can execute.
Mac OSX 10.7.5
$ uname -a
Darwin marcus.local 11.4.2 Darwin Kernel Version 11.4.2: Thu Aug 23 16:25:48 PDT 2012; root:xnu-1699.32.7~1/RELEASE_X86_64 x86_64
$ c++ -v
Apple LLVM version 4.2 (clang-425.0.28) (based on LLVM 3.2svn)
Target: x86_64-apple-darwin11.4.2
Thread model: posix
XCode Version 4.6.1 (4H512)
$ ll /usr/lib/libarmadillo.*
-rwxr-xr-x@ 1 root wheel 8240 11 sep 07:52 /usr/lib/libarmadillo.3.91.0.dylib*
lrwxr-xr-x 1 root wheel 25 9 sep 09:45 /usr/lib/libarmadillo.3.dylib@ -> libarmadillo.3.91.0.dylib
lrwxr-xr-x 1 root wheel 20 9 sep 09:45 /usr/lib/libarmadillo.dylib@ -> libarmadillo.3.dylib
Hope this helps
--
Gilles Barges.
More information about the mlpack
mailing list