0

I am trying to install vowpal_wabbit in ubuntu 16.04.
Error :

./libvw.a(search.o): In function `Search::setup(vw&)':
search.cc:(.text+0xa5f8): undefined reference to `boost::program_options::options_description::options_description(std::string const&, unsigned int, unsigned int)'
search.cc:(.text+0xaafe): undefined reference to `boost::program_options::abstract_variables_map::operator[](std::string const&) const'
search.cc:(.text+0xac0e): undefined reference to `boost::program_options::abstract_variables_map::operator[](std::string const&) const'
search.cc:(.text+0xad20): undefined reference to `boost::program_options::abstract_variables_map::operator[](std::string const&) const'
search.cc:(.text+0xadda): undefined reference to `boost::program_options::abstract_variables_map::operator[](std::string const&) const'
search.cc:(.text+0xae94): undefined reference to `boost::program_options::abstract_variables_map::operator[](std::string const&) const'
./libvw.a(search.o):search.cc:(.text+0xafaa): more undefined references to `boost::program_options::abstract_variables_map::operator[](std::string const&) const' follow
./libvw.a(search_meta.o): In function `SelectiveBranchingMT::initialize(Search::search&, unsigned long&, boost::program_options::variables_map&)':
search_meta.cc:(.text+0x7645): undefined reference to `boost::program_options::options_description::options_description(std::string const&, unsigned int, unsigned int)'
./libvw.a(search_sequencetask.o): In function `SequenceSpanTask::initialize(Search::search&, unsigned long&, boost::program_options::variables_map&)':
search_sequencetask.cc:(.text+0x14ab): undefined reference to `boost::program_options::options_description::options_description(std::string const&, unsigned int, unsigned int)'
./libvw.a(search_sequencetask.o): In function `ArgmaxTask::initialize(Search::search&, unsigned long&, boost::program_options::variables_map&)':
search_sequencetask.cc:(.text+0x2a02): undefined reference to `boost::program_options::options_description::options_description(std::string const&, unsigned int, unsigned int)'
./libvw.a(search_dep_parser.o): In function `DepParserTask::initialize(Search::search&, unsigned long&, boost::program_options::variables_map&)':
search_dep_parser.cc:(.text+0x4328): undefined reference to `boost::program_options::options_description::options_description(std::string const&, unsigned int, unsigned int)'
./libvw.a(search_dep_parser.o): In function `void Search::check_option<unsigned int>(unsigned int&, vw&, boost::program_options::variables_map&, char const*, bool, bool (*)(unsigned int, unsigned int), char const*, char const*)':
search_dep_parser.cc:(.text._ZN6Search12check_optionIjEEvRT_R2vwRN5boost15program_options13variables_mapEPKcbPFbS1_S1_ESA_SA_[_ZN6Search12check_optionIjEEvRT_R2vwRN5boost15program_options13variables_mapEPKcbPFbS1_S1_ESA_SA_]+0x1ea): undefined reference to `boost::program_options::abstract_variables_map::operator[](std::string const&) const'
./libvw.a(search_entityrelationtask.o): In function `EntityRelationTask::initialize(Search::search&, unsigned long&, boost::program_options::variables_map&)':
search_entityrelationtask.cc:(.text+0x33f7): undefined reference to `boost::program_options::options_description::options_description(std::string const&, unsigned int, unsigned int)'
./libvw.a(search_graph.o): In function `GraphTask::initialize(Search::search&, unsigned long&, boost::program_options::variables_map&)':
search_graph.cc:(.text+0x17aa): undefined reference to `boost::program_options::options_description::options_description(std::string const&, unsigned int, unsigned int)'
search_graph.cc:(.text+0x196c): undefined reference to `boost::program_options::abstract_variables_map::operator[](std::string const&) const'
./libvw.a(scorer.o): In function `scorer_setup(vw&)':
scorer.cc:(.text+0x1cd): undefined reference to `boost::program_options::options_description::options_description(std::string const&, unsigned int, unsigned int)'
scorer.cc:(.text+0x271): undefined reference to `boost::program_options::abstract_variables_map::operator[](std::string const&) const'
collect2: error: ld returned 1 exit status
Makefile:46: recipe for target 'vw' failed
make[1]: *** [vw] Error 1
make[1]: Leaving directory '/home/kapil/Projects/MachineLearning/vowpal_wabbit/vowpalwabbit'
Makefile:97: recipe for target 'vw' failed
make: *** [vw] Error 2

I am following the instructions provided in the repository. I have installed libboost-program-options-dev, zlib1g-dev & libboost-python-dev. I tried to first run just make, which gives undefined reference error. Then I tried using autogen.sh script before make, but that leads to same error too. I also tried, unsuccessfully, using commands like make BOOST_FLAGS=-lboost-program-options & make BOOST_FLAGS=-lboost_options. I tried using clang++ but that gives same output. I have checked for both boost & boost_program-options & they are present and are the latest version. How do I remove the error?

The problem is that, although I can install vowpalwabbit using ppa in ubuntu, when I try installing it for python using pip, it gives the same reference error. I need to install the python version.

Community
  • 1
  • 1
Kapil Gupta
  • 7,091
  • 5
  • 16
  • 25

1 Answers1

1

The errors you're getting indicate you don't have libboost development libraries (more specifically, libboost-program-options-dev) installed. libboost-program-options-dev is listed in the prerequisites for building vw from source. You may install all the boost libraries+headers by installing the meta package libboost-all-dev.

According to the official instructions in the README.md file there's no need to run autogen.sh on Ubuntu (in fact, it is recommended not to do it by default because it overwrites the original Makefiles which work just fine).

Here are the full Ubuntu instructions (reproduced from the official wiki on github for convenience):

Ubuntu/Debian specific info

On Ubuntu/Debian/Mint and similar the following sequence should work for building the latest from github:

Get libboost program-options and zlib:

apt-get install libboost-program-options-dev zlib1g-dev

Get the python libboost bindings (python subdir) - optional:

apt-get install libboost-python-dev

Get the vw source:

git clone git://github.com/JohnLangford/vowpal_wabbit.git

Build:

cd vowpal_wabbit
make
make test       # (optional)
make install

If these instructions don't work for you, please make sure you don't have other, non-standard changes to your environment. Changes that are known to cause issues are non-standard LD_LIBRARY_PATH, LD_RPRELOAD, or ldconfig changes which might cause the linker to fail to find libraries in the standard places.

arielf
  • 5,802
  • 1
  • 36
  • 48