8

I'm trying real hard to install vowpal wobbit and it fails when i run the make file, throwing:

    cd library; make; cd .. 
    g++ -g -o ezexample temp2.cc -L ../vowpalwabbit -l vw -l allreduce -l boost_program_options -l z -l pthread 
    ld: library not found for -lboost_program_options collect2: ld returned 1   exit status make[1]: *** [ezexample] Error 1'

I then added the links to the boost library here by specifying -L/usr/local/lib

Now I get the following error:

    g++ -g -o ezexample temp2.cc -L/usr/local/lib ../vowpalwabbit -l vw -l  allreduce -l boost_program_options -l z -l pthread 
    ld: library not found for -lvw
    collect2: ld returned 1 exit status   
    make: *** [ezexample] Error 1
Community
  • 1
  • 1
madCode
  • 3,733
  • 5
  • 26
  • 31
  • This is (probably) better suited to SO. Voting to close. – cardinal Jul 11 '12 at 16:38
  • I'm looking for people who've used vowpal wabbit, though. – madCode Jul 11 '12 at 16:41
  • Do you have a working `boost` installation? The `program_options` library should be built separately, if I remember correctly. Also, there should be no space after `-L` or `-l` switch. – chl Jul 11 '12 at 17:23

4 Answers4

7

I happened to get everything working on OS X 10.7 as follows:

  1. Make sure you have a working Boost installation. As indicated on the Getting started page, usually we only need header files, but some Boost libraries must be built separately, including the program_options library which is used to process options from command line or config file. Go into your boost folder, and then at your shell prompt:

    $ ./bootstrap.sh
    $ ./bjam
    

    This will compile and build everything. You should now have a bin.v2/ directory in your boost directory, with all built libraries for your system (static and threaded libs).

    $ ls bin.v2/libs/
    date_time       iostreams       python          serialization   test
    filesystem      math            random          signals         thread
    graph           program_options regex           system          wave
    

    More importantly, extra Boost libraries are made available in the stage/lib/ directory. For me, these are Mach-O 64-bit dynamically linked shared library x86_64.

    The include path should be your_install_dir/boost_x_xx_x, where boost_x_xx_x is the basename of your working Boost. (I personally have boost_1_46_1 in /usr/local/share/ and I symlinked it to /usr/local/share/boost to avoid having to remember version number.) The library path (for linking) should read your_install_dir/boost_x_xx_x/stage/lib. However, it might be best to symlink or copy (which is what I did) everything in usual place, i.e. /usr/local/include/boost for header files, and /usr/local/lib for libraries.

  2. Edit the Makefile from the vowpal_wabbit directory, and change the include/library paths to reflect your current installation. The Makefile should look like this (first 12 lines):

    COMPILER = g++
    UNAME := $(shell uname)
    
    ifeq ($(UNAME), FreeBSD)
    LIBS = -l boost_program_options -l pthread -l z -l compat
    BOOST_INCLUDE = /usr/local/include
    BOOST_LIBRARY = /usr/local/lib
    else
    LIBS = -l boost_program_options -l pthread -l z
    BOOST_INCLUDE = /usr/local/share/boost            # change path to reflect yours
    BOOST_LIBRARY = /usr/local/share/boost/stage/lib  # idem
    endif
    

    Then, you are ready to compile vowpal_wabbit (make clean in case you already compiled it):

    $ make
    $ ./vw --version
    6.1
    $ make test
    
chl
  • 27,771
  • 5
  • 51
  • 71
3

You can also install vowpal wabbit on OS X using brew:

brew install vowpal-wabbit

Or you can just install boost, and then install vw from the github repo.

brew install boost
Zach
  • 29,791
  • 35
  • 142
  • 201
  • 1
    (+1) Yeh, that's what I did now that I definitely switched to Homebrew. – chl Aug 14 '14 at 10:01
  • Are you able to use the vw-hypersearch utility if you install vowpal-wabbit with brew? I am getting an error stating "command not found," but the rest of vw works fine. – Vivek Subramanian Jul 24 '15 at 16:19
0

For installation on CentOS 7 (6.5 perl version is too old for latest vw source code), I've found the instructions at http://wkoplitz.blogspot.be/2012/12/vowpal-wabbit-on-centos.html to work fine:

yum install zlib-devel boost-devel

yum groupinstall "Development Tools"

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

cd vowpal_wabbit

./autogen.sh

make

make test
herman
  • 11,740
  • 5
  • 47
  • 58
0

Good news:

As of the latest release VowpalWabbit version 9.1.0, vw no longer relies on Boost program_options

From the release highlights:

Removal of Boost Program Options dependency

For a long time we have depended on Boost Program Options for command line options parsing. In this release, we have > replaced this dependency with our own implementation of command line parsing. Apart from one place where we depend > on Boost Math in standalone mode, this means that VW core and the command line tool are free of Boost dependencies hopefully making the code a bit easier to build and package.

Vowpal Wabbit 9.1.0 release notes

arielf
  • 5,802
  • 1
  • 36
  • 48