[mlpack-git] [mlpack] Linking errors in building mlpack in Mac OS X (#442)

ttuethao notifications at github.com
Sun Jun 14 15:02:08 EDT 2015


Hi guys,
I am trying to build mlpack under mac Marvericks over the weekend. So far I failed again and again. 

(Again, I am sorry the quote text does not appear as I expected. I try few wikitags I learned, but non of them work for me... Sorry.)

1. The library is built successfully with compiler c++ (in fact, clang, clang++), but gives a weird error in passing arguments in logistic regression, see here https://github.com/mlpack/mlpack/issues/428#issuecomment-111815633

2. I suspected it  was the issue of the compiler c++ that does not understand the arma::vec constructor by reference. Therefore I tried to build mlpack with gcc and g++, with all versions I have (g++-5.1, g++-mp-5, g++-mp-4.8, g++-mp-4.9), but they failed to recognise boost symbols. For example:

My armadillo is the 5.200.1.

<quote> 

CC=/usr/local/bin/gcc CXX=/usr/local/bin/g++ cmake -D BOOST_LIBRARYDIR=/opt/local/lib/ BOOST_INCLUDEDIR=/opt/local/include Boost_USE_MULTITHREAD=OFF ../ 
-- Armadillo libraries: /usr/lib/libarmadillo.dylib
CMake Warning at CMakeLists.txt:88 (message):
  This is a 64-bit system, but Armadillo was compiled without 64-bit index
  support.  Consider recompiling Armadillo with ARMA_64BIT_WORD to enable
  64-bit indices (large matrix support).  MLPACK will still work without
  ARMA_64BIT_WORD defined, but will not scale to matrices with more than 4
  billion elements.


-- Boost version: 1.58.0
-- Found the following Boost libraries:
--   program_options
--   unit_test_framework
--   random
CMake Warning (dev) at src/mlpack/CMakeLists.txt:78 (add_custom_target):
  Policy CMP0037 is not set: Target names should not be reserved and should
  match a validity pattern.  Run "cmake --help-policy CMP0037" for policy
  details.  Use the cmake_policy command to set the policy and suppress this
  warning.

  The target name "test" is reserved or not valid for certain CMake features,
  such as generator expressions, and may result in undefined behavior.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning at CMakeLists.txt:292 (message):
  txt2man not found; man pages will not be generated.


-- Configuring done
CMake Warning (dev):
  Policy CMP0042 is not set: MACOSX_RPATH is enabled by default.  Run "cmake
  --help-policy CMP0042" for policy details.  Use the cmake_policy command to
  set the policy and suppress this warning.

  MACOSX_RPATH is not specified for the following targets:

   mlpack

This warning is for project developers.  Use -Wno-dev to suppress it.

-- Generating done
-- Build files have been written to: /Volumes/SHome/Developer/lib/mlpack-1.0.12/build
</quote>

The errors is (second make)

<quote>

$ make
Moving header files to include/mlpack/
[  0%] Built target mlpack_headers
Linking CXX shared library ../../lib/libmlpack.dylib
Undefined symbols for architecture x86_64:
  "boost::program_options::to_internal(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)", referenced from:
      boost::program_options::basic_command_line_parser<char>::basic_command_line_parser(int, char const* const*) in cli.cpp.o
  "boost::program_options::basic_parsed_options<char> boost::program_options::parse_config_file<char>(std::basic_istream<char, std::char_traits<char> >&, boost::program_options::options_description const&, bool)", referenced from:
      mlpack::CLI::ParseStream(std::basic_istream<char, std::char_traits<char> >&) in cli.cpp.o
  "boost::program_options::options_description::options_description(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int, unsigned int)", referenced from:
      mlpack::CLI::CLI()  in cli.cpp.o
      mlpack::CLI::CLI(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) in cli.cpp.o
      mlpack::CLI::CLI(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) in cli.cpp.o
  "boost::program_options::arg[abi:cxx11]", referenced from:
      boost::program_options::typed_value<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, char>::name() const in cli.cpp.o
  "boost::program_options::detail::cmdline::set_additional_parser(boost::function1<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&>)", referenced from:
      boost::program_options::basic_command_line_parser<char>::extra_parser(boost::function1<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&>) in cli.cpp.o
  "boost::program_options::detail::cmdline::cmdline(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&)", referenced from:
      boost::program_options::basic_command_line_parser<char>::basic_command_line_parser(int, char const* const*) in cli.cpp.o
  "boost::program_options::validate(boost::any&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, int)", referenced from:
      boost::program_options::typed_value<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, char>::xparse(boost::any&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&) const in cli.cpp.o
  "boost::program_options::abstract_variables_map::operator[](std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const", referenced from:
      mlpack::CLI::UpdateGmap()     in cli.cpp.o
  "boost::program_options::value_semantic_codecvt_helper<char>::parse(boost::any&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, bool) const", referenced from:
      vtable for boost::program_options::typed_value<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, char> in cli.cpp.o
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
make[2]: *** [lib/libmlpack.1.0.dylib] Error 1
make[1]: *** [src/mlpack/CMakeFiles/mlpack.dir/all] Error 2
make: *** [all] Error 2

</quote>

I have no idea what else to try. If you can give me some hint, it would be great. I am very grateful.

PS: Thanhk you for your project. I really like the name mlpack, perhaps because  I am also a fan of lapack.

---
Reply to this email directly or view it on GitHub:
https://github.com/mlpack/mlpack/issues/442
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20150614/e3b3947f/attachment.html>


More information about the mlpack-git mailing list