illustration rabbits

Install Vowpal Wabbit on Windows and Cygwin

There are already instructions on how to install Vowpal Wabbit on other operating systems, but we could not find a clear one for Windows. We will use Cygwin to install the latest version of Vowpal Wabbit.

Thanks to reader Dominic for providing useful feedback! Guide is now updated and suitable for both 32-bit and 64-bit systems.

Thanks to readers Ray, Phil Culliton, dou, Christophe, Fred and Brian guide is updated for the latest version of Vowpal Wabbit.

Install Cygwin

Download the version of Cygwin for your operating system from: http://cygwin.com/install.html

In the Cygwin setup “Select Packages” window you will need to install the following packages:

  • Search for "git". From Devel select git: Distributed version control system
  • Search for "make". From Devel select make: the GNU version of the 'make' utility
  • Search for "g++". From Devel select gcc-g++ GNU compiler Collection (C++)
  • Search for "zlib". From Libs select zlib-devel: Zlib de/compression library (development)
  • Search for "boost". From Libs select libboost-devel: Boost C++ Libraries
  • Search for "libtool". From Devel select libtool: Generic library support script
  • Search for "automake". From Devel select automake: Wrapper scripts for automake and aclocal.
  • Search for "automake". From Devel select automake1.9: (1.9) a tool for generating GNU-compliant Makefiles (The others should be installed when resolving dependancies).
  • Search for "libboost". From Libs select libboost_python-devel: Boost C++ libraries
  • Search for "libboost". From Libs select libboost_program_options1.55: Boost C++ libraries

(Updated for the new Python bindings)

If you get shown a screen with “Resolving Dependancies”, keep the option ‘Select required packages (RECOMMENDED)’ checked.

You can always run the Cygwin installer/setup again to install more packages.

install make package

Installing the ‘make’ package.

Install Vowpal Wabbit

Open a command prompt with cmd, and run Cygwin.bat. If you installed on the c: disk and in the cygwin64 directory, then run:

c:\cygwin64\cygwin.bat

or go to the directory and click on cygwin.bat (file extension may not show)

You should now be in the Cygwin terminal (starts with a $). Use ls to get a directory listing.

Cloning vowpalwabbit

Here you run the following command to clone the Vowpal Wabbit Github Repo (latest master version):

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

This will start the download. When it is done go to the vowpal_wabbit directory with:

cd vowpal_wabbit

Here run:

./autogen.sh

And when that is done, run:

make

and

make install

That’s it! Go into the vowpalwabbit directory

cd vowpalwabbit

and run it:

./vw --help

To get help on all the command line arguments.

./vw --version

To get the version.

If you installed on c:, in the cygwin64 directory, in Windows you can go to:

C:\cygwin64\home\your_username\vowpal_wabbit\vowpalwabbit

to quickly put some .vw datasets there or copy the output predictions.

You could also use the cygdrive-prefix to run VW on files stored outside your user directory (or to output your model to another directory/drive). If your training set is on c:\data\train.vw try:

./vw -d /cygdrive/c/data/train.vw

Utility scripts

Perl should now also be installed. If not search for perl in the Cygwin setup and from perl select perl: Perl programming language interpreter. In the vowpal_wabbit/utl directory you’ll find some utility scripts, of which vw-varinfo is particularly useful.

The illustration with this post came from “The Velveteen Rabbit (1922)” and is in the Public Domain.

19 thoughts on “Install Vowpal Wabbit on Windows and Cygwin”

  1. Hi,

    I’m coming from Kaggle and installed your version of vowpal wabbit. Thanks for providing the executable! Really lowering the entry barriers when trying this tool :)

    There was one problem though that I ran into. Cygwin is not installing boost by default and vowpal wabbit needs it. Copying it as described in “the harder way” didn’t work. You can though just tell the installer to include it, which was quite easy and worked well. I’ve also installed make, g++ and zlib to be one the save side. Don’t know if that was necessary too.

  2. Hey Dominic! Thank you for the tip on using the Cygwin installer for boost! I will update the tutorial!

  3. Hi ,
    Thanks for posting this.

    I’m having trouble with the “make” command. There seems to be a problem compiling, so vw is not created. Have you encountered this problem. I’ve included the errors that resulted from executing “make” below:

    g++ -MM hash.cc > hash.d
    g++ -march=native -Wall -pedantic -O3 -fomit-frame-pointer -fno-strict-aliasing -ffast-math -D_FILE_OFFSET_BITS=64 -DNDEBUG -I /usr/include -c main.cc -o main.o
    g++ -march=native -Wall -pedantic -O3 -fomit-frame-pointer -fno-strict-aliasing -ffast-math -D_FILE_OFFSET_BITS=64 -DNDEBUG -I /usr/include -c hash.cc -o hash.o
    g++ -march=native -Wall -pedantic -O3 -fomit-frame-pointer -fno-strict-aliasing -ffast-math -D_FILE_OFFSET_BITS=64 -DNDEBUG -I /usr/include -c memory.cc -o memory.o
    g++ -march=native -Wall -pedantic -O3 -fomit-frame-pointer -fno-strict-aliasing -ffast-math -D_FILE_OFFSET_BITS=64 -DNDEBUG -I /usr/include -c global_data.cc -o global_data.o
    g++ -march=native -Wall -pedantic -O3 -fomit-frame-pointer -fno-strict-aliasing -ffast-math -D_FILE_OFFSET_BITS=64 -DNDEBUG -I /usr/include -c io_buf.cc -o io_buf.o
    g++ -march=native -Wall -pedantic -O3 -fomit-frame-pointer -fno-strict-aliasing -ffast-math -D_FILE_OFFSET_BITS=64 -DNDEBUG -I /usr/include -c parse_regressor.cc -o parse_regressor.o
    g++ -march=native -Wall -pedantic -O3 -fomit-frame-pointer -fno-strict-aliasing -ffast-math -D_FILE_OFFSET_BITS=64 -DNDEBUG -I /usr/include -c parse_primitives.cc -o parse_primitives.o
    g++ -march=native -Wall -pedantic -O3 -fomit-frame-pointer -fno-strict-aliasing -ffast-math -D_FILE_OFFSET_BITS=64 -DNDEBUG -I /usr/include -c unique_sort.cc -o unique_sort.o
    g++ -march=native -Wall -pedantic -O3 -fomit-frame-pointer -fno-strict-aliasing -ffast-math -D_FILE_OFFSET_BITS=64 -DNDEBUG -I /usr/include -c cache.cc -o cache.o
    g++ -march=native -Wall -pedantic -O3 -fomit-frame-pointer -fno-strict-aliasing -ffast-math -D_FILE_OFFSET_BITS=64 -DNDEBUG -I /usr/include -c rand48.cc -o rand48.o
    g++ -march=native -Wall -pedantic -O3 -fomit-frame-pointer -fno-strict-aliasing -ffast-math -D_FILE_OFFSET_BITS=64 -DNDEBUG -I /usr/include -c simple_label.cc -o simple_label.o
    g++ -march=native -Wall -pedantic -O3 -fomit-frame-pointer -fno-strict-aliasing -ffast-math -D_FILE_OFFSET_BITS=64 -DNDEBUG -I /usr/include -c multiclass.cc -o multiclass.o
    rand48.cc:11:14: warning: use of C++0x long long integer constant [-Wlong-long]
    uint64_t a = 0xeece66d5deece66dULL;
    ^
    g++ -march=native -Wall -pedantic -O3 -fomit-frame-pointer -fno-strict-aliasing -ffast-math -D_FILE_OFFSET_BITS=64 -DNDEBUG -I /usr/include -c oaa.cc -o oaa.o
    g++ -march=native -Wall -pedantic -O3 -fomit-frame-pointer -fno-strict-aliasing -ffast-math -D_FILE_OFFSET_BITS=64 -DNDEBUG -I /usr/include -c ect.cc -o ect.o
    g++ -march=native -Wall -pedantic -O3 -fomit-frame-pointer -fno-strict-aliasing -ffast-math -D_FILE_OFFSET_BITS=64 -DNDEBUG -I /usr/include -c autolink.cc -o autolink.o
    g++ -march=native -Wall -pedantic -O3 -fomit-frame-pointer -fno-strict-aliasing -ffast-math -D_FILE_OFFSET_BITS=64 -DNDEBUG -I /usr/include -c binary.cc -o binary.o
    g++ -march=native -Wall -pedantic -O3 -fomit-frame-pointer -fno-strict-aliasing -ffast-math -D_FILE_OFFSET_BITS=64 -DNDEBUG -I /usr/include -c lrq.cc -o lrq.o
    g++ -march=native -Wall -pedantic -O3 -fomit-frame-pointer -fno-strict-aliasing -ffast-math -D_FILE_OFFSET_BITS=64 -DNDEBUG -I /usr/include -c cost_sensitive.cc -o cost_sensitive.o
    g++ -march=native -Wall -pedantic -O3 -fomit-frame-pointer -fno-strict-aliasing -ffast-math -D_FILE_OFFSET_BITS=64 -DNDEBUG -I /usr/include -c csoaa.cc -o csoaa.o
    g++ -march=native -Wall -pedantic -O3 -fomit-frame-pointer -fno-strict-aliasing -ffast-math -D_FILE_OFFSET_BITS=64 -DNDEBUG -I /usr/include -c cb.cc -o cb.o
    g++ -march=native -Wall -pedantic -O3 -fomit-frame-pointer -fno-strict-aliasing -ffast-math -D_FILE_OFFSET_BITS=64 -DNDEBUG -I /usr/include -c cb_algs.cc -o cb_algs.o
    g++ -march=native -Wall -pedantic -O3 -fomit-frame-pointer -fno-strict-aliasing -ffast-math -D_FILE_OFFSET_BITS=64 -DNDEBUG -I /usr/include -c wap.cc -o wap.o
    lrq.cc: In instantiation of ‘void LRQ::predict_or_learn(LRQ::LRQstate&, LEARNER::learner&, example&) [with bool is_learn = true]’:
    lrq.cc:239:53: required from here
    lrq.cc:136:76: warning: narrowing conversion of ‘left’ from ‘unsigned char’ to ‘char’ inside { } is ill-formed in C++11 [-Wnarrowing]
    char subname[4] = { left, ‘^’, right, ” };
    ^
    lrq.cc:136:76: warning: narrowing conversion of ‘right’ from ‘unsigned char’ to ‘char’ inside { } is ill-formed in C++11 [-Wnarrowing]
    lrq.cc: In instantiation of ‘void LRQ::predict_or_learn(LRQ::LRQstate&, LEARNER::learner&, example&) [with bool is_learn = false]’:
    lrq.cc:240:56: required from here
    lrq.cc:136:76: warning: narrowing conversion of ‘left’ from ‘unsigned char’ to ‘char’ inside { } is ill-formed in C++11 [-Wnarrowing]
    lrq.cc:136:76: warning: narrowing conversion of ‘right’ from ‘unsigned char’ to ‘char’ inside { } is ill-formed in C++11 [-Wnarrowing]
    g++ -march=native -Wall -pedantic -O3 -fomit-frame-pointer -fno-strict-aliasing -ffast-math -D_FILE_OFFSET_BITS=64 -DNDEBUG -I /usr/include -c searn.cc -o searn.o
    g++ -march=native -Wall -pedantic -O3 -fomit-frame-pointer -fno-strict-aliasing -ffast-math -D_FILE_OFFSET_BITS=64 -DNDEBUG -I /usr/include -c searn_sequencetask.cc -o searn_sequencetask.o
    g++ -march=native -Wall -pedantic -O3 -fomit-frame-pointer -fno-strict-aliasing -ffast-math -D_FILE_OFFSET_BITS=64 -DNDEBUG -I /usr/include -c parse_example.cc -o parse_example.o
    g++ -march=native -Wall -pedantic -O3 -fomit-frame-pointer -fno-strict-aliasing -ffast-math -D_FILE_OFFSET_BITS=64 -DNDEBUG -I /usr/include -c scorer.cc -o scorer.o
    g++ -march=native -Wall -pedantic -O3 -fomit-frame-pointer -fno-strict-aliasing -ffast-math -D_FILE_OFFSET_BITS=64 -DNDEBUG -I /usr/include -c network.cc -o network.o
    g++ -march=native -Wall -pedantic -O3 -fomit-frame-pointer -fno-strict-aliasing -ffast-math -D_FILE_OFFSET_BITS=64 -DNDEBUG -I /usr/include -c parse_args.cc -o parse_args.o
    g++ -march=native -Wall -pedantic -O3 -fomit-frame-pointer -fno-strict-aliasing -ffast-math -D_FILE_OFFSET_BITS=64 -DNDEBUG -I /usr/include -c accumulate.cc -o accumulate.o
    g++ -march=native -Wall -pedantic -O3 -fomit-frame-pointer -fno-strict-aliasing -ffast-math -D_FILE_OFFSET_BITS=64 -DNDEBUG -I /usr/include -c gd.cc -o gd.o
    g++ -march=native -Wall -pedantic -O3 -fomit-frame-pointer -fno-strict-aliasing -ffast-math -D_FILE_OFFSET_BITS=64 -DNDEBUG -I /usr/include -c learner.cc -o learner.o
    searn.cc:283:31: warning: integer constant is too large for ‘long’ type [-Wlong-long]
    (int)(ceil( log10((float)10000000000+1) ))) + 1; // max action id
    ^
    searn.cc:1864:5: warning: integer constant is too large for ‘long’ type [-Wlong-long]
    size_t neighbor_constant = 8349204823;
    ^
    g++ -march=native -Wall -pedantic -O3 -fomit-frame-pointer -fno-strict-aliasing -ffast-math -D_FILE_OFFSET_BITS=64 -DNDEBUG -I /usr/include -c lda_core.cc -o lda_core.o
    searn_sequencetask.cc: In function ‘void SequenceSpanTask::structured_predict(Searn::searn&, std::vector)’:
    searn_sequencetask.cc:244:91: error: call of overloaded ‘predict(example*&, uint32_t, v_array*&)’ is ambiguous
    last_prediction = srn.predict(ec[i], MULTICLASS::get_example_label(ec[i]), y_allowed);
    ^
    searn_sequencetask.cc:244:91: note: candidates are:
    In file included from searn_sequencetask.h:9:0,
    from searn_sequencetask.cc:6:
    searn.h:47:14: note: uint32_t Searn::searn::predict(example*, uint32_t, v_array*)
    uint32_t predict(example* ec, uint32_t one_ystar, v_array* yallowed=NULL); // if there is a single oracle action
    ^
    In file included from searn_sequencetask.h:9:0,
    from searn_sequencetask.cc:6:
    searn.h:51:14: note: uint32_t Searn::searn::predict(example*, size_t, v_array*, v_array*)
    uint32_t predict(example* ecs, size_t ec_len, v_array* ystar, v_array* yallowed=NULL); // if there is a single oracle action
    ^
    Makefile:28: recipe for target ‘searn_sequencetask.o’ failed
    make[1]: *** [searn_sequencetask.o] Error 1
    make[1]: *** Waiting for unfinished jobs….
    searn.cc: In function ‘void Searn::print_update(vw&, Searn::searn&)’:
    searn.cc:1847:43: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘size_t {aka unsigned int}’ [-Wformat=]
    fprintf(stderr, ” %15lusec”, num_sec);
    ^
    searn.cc:1847:43: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘size_t {aka unsigned int}’ [-Wformat=]
    searn.cc: In function ‘void Searn::add_neighbor_features(Searn::searn&)’:
    searn.cc:1864:32: warning: large integer implicitly truncated to unsigned type [-Woverflow]
    size_t neighbor_constant = 8349204823;
    ^
    make[1]: Leaving directory ‘/cygdrive/c/vowpal_wabbit/vowpalwabbit’
    Makefile:75: recipe for target ‘vw’ failed
    make: *** [vw] Error 2

    1. Hey Ray,

      Unfortunately I don’t recognize that error. I’ve tried above tutorial on two laptops and I can get VW to compile (It does show a few warnings to me, but nothing show-stopping).

      If you did install all the required packages, but just can’t make the VW executable, take a look at: https://github.com/MLWave/vowpal-wabbit-cygwin-executables for pre-made executables. Do note that these are for 64-bit systems.

      If all else fails, you could have a look at: https://github.com/MLWave/Kaggle_Rotten_Tomatoes which has a Windows executable of VW version 7.1.

      A thing you can try: If libtools is not installed, install libtools.

      Also, maybe you can find your answer here: http://stackoverflow.com/questions/11694597/has-anyone-ever-successfully-compiled-vowpal-wabbit-on-a-windows-7-machine

      If you are really desperate for some Vowpal Wabbit, install VirtualBox with an Ubuntu image. Then you can simply type ‘make’ or ‘apt-get’ what you need.

      Hope you get it to work!

      Greetings, Triskelion

  4. That error is caused by GCC being tetchy about ambiguous overloads (as it often is). It looks like the issue has been cleared up in more recent commits, though, so just pulling the latest code should clear it up.

  5. Hi, thank you for this tutorial, i got the following error:

    /usr/lib/gcc/i686-pc-cygwin/4.8.3/../../../../i686-pc-cygwin/bin/ld: cannot find -lboost_python-mt
    collect2: error: ld returned 1 exit status
    Makefile:28: recipe for target ‘pylibvw.dll’ failed
    make[1]: *** [pylibvw.dll] Error 1
    make[1]: Leaving directory ‘/home/nietzschetmh/vowpal_wabbit/python’
    Makefile:87: recipe for target ‘python’ failed
    make: *** [python] Error 2

    Do i need to install another package called boost_python in cygwin?

    Thanks.

    1. Maybe “libboost-python” is a newer requirement (for the Python wrapper)? I’ll have to recompile the latest version soon and update this tutorial if it stops working.

      You did install the boost library?

      I believe you can download older versions. Perhaps try building 7.6.1.

  6. Hi Triskellon ,thank you for the tutorial.

    I got the following error :

    /usr/lib/gcc/i686-pc-cygwin/4.8.3/../../../../i686-pc-cygwin/bin/ld: cannot find -lboost_program_options-mt
    collect2: error: ld returned 1 exit status
    Makefile:43: recipe for target ‘vw’ failed
    make[1]: *** [vw] Error 1
    make[1]: Leaving directory ‘/home/Fred/vowpal_wabbit/vowpalwabbit’
    Makefile:78: recipe for target ‘vw’ failed
    make: *** [vw] Error 2

    this time it’s about -lboost_program_options-mt and not python…
    any idea ?

    thanks

    1. I was having the same issues. Look at the page posted: http://stackoverflow.com/questions/11694597/has-anyone-ever-successfully-compiled-vowpal-wabbit-on-a-windows-7-machine

      And this part (it worked for me and I was able to type make and make install afterwards):

      For me, the command “configure” (step 4) didn’t work. I typed dir and notice there was a file named autogen.sh. I don’t know what this is but I typed ./autogen.sh anyway and stuff started happening. I read the text as it scrolled down the screen and I notice it said it had created vowpal_wabbit/make – and I had been previously trying to use the make command to do the install (but it wasn’t working). So, after the autogen.sh stopped running I just typed “make” – and it worked! Now a bunch of stuff is happening… I’ll write back later if this stuff isn’t good stuff…

        1. Triskellon – I followed the steps you laid out in this post, but was unable to issue a make command. I then did as suggested in the stack overflow linked above – the snippet of the comment I pasted. I.e. Once I ran ./autogen.sh and that completed, I was able to continue with your post outline and issue a make and make install command. Everything was good after that!

      1. Like you I had to run the ./autogen.sh command to get the make command to execute normally (so far). In addition, I had to install automake and libtool before the autogen command would execute correctly. Hope that helps someone.

  7. Hi Triskelion, I just find the solution :

    1) before run the “make” command, I installed the “boost”, “libtool”, “make” and “automake” (full package) in the Cygwin setup.
    2) “./autogen.sh” command,
    3) then make, make clean, …

    Thank a lot for your instructions

  8. Just tried a clean install on cygwin64 and was met with the following problem (over and over):

    mv -f .deps/parse_regressor.Tpo .deps/parse_regressor.Plo
    mv: cannot move ‘.deps/parse_regressor.Tpo’ to ‘.deps/parse_regressor.Plo’: No such file or directory

    To get around this (no idea why this happens) I just did “touch vowpalwabbit/.deps/parse_regressor.Plo”. In all I had to do the following touches to keep make happy:

    touch vowpalwabbit/.deps/allreduce.Plo
    touch vowpalwabbit/.deps/parse_regressor.Plo
    touch vowpalwabbit/.deps/unique_sort.Plo
    touch vowpalwabbit/.deps/cache.Plo
    touch vowpalwabbit/.deps/rand48.Plo
    touch vowpalwabbit/.deps/simple_label.Plo
    touch vowpalwabbit/.deps/ect.Plo
    touch vowpalwabbit/.deps/lrq.Plo
    touch vowpalwabbit/.deps/search.Plo
    touch vowpalwabbit/.deps/search_sequencetask.Plo
    touch vowpalwabbit/.deps/search_hooktask.Plo
    touch vowpalwabbit/.deps/search_entityrelationtask.Plo
    touch vowpalwabbit/.deps/parse_args.Plo
    touch vowpalwabbit/.deps/gd.Plo
    touch vowpalwabbit/.deps/bfgs.Plo
    touch vowpalwabbit/.deps/noop.Plo
    touch vowpalwabbit/.deps/cbify.Plo
    touch vowpalwabbit/.deps/library_example.Po
    touch library/.deps/library_example.Po

    After that, everything builds fine and vw works.

  9. Going through the install on 64-bit win8.1 and I also needed to install this:
    search “clang”, choose devel -> clang: C/C++/ObjC compiler frontend based on LLVM

    It got rid of an error message at the start of ./autogen.sh:
    “which: no clang++ in (.. and a whole lot of paths)

    I still get stuck on an error tho and no way past it:
    make[1]: *** No rule to make target ‘vowpalwabbit/beam.h’, needed by ‘all-am’. Stop.

    Any ideas about this one?

    1. “Resolved” it.. just deleted the beam.h line from Makefile and everything works. Seems it was dropped at some point in last couple of months, it does show in some of the older commits.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>