Skip to content
Jack Gerrits edited this page Jun 5, 2021 · 74 revisions

Getting started > [Dependencies] > Building > Installing > Tutorial


Get the source

# Important - ensure submodules are downloaded
git clone --recursive https://github.com/VowpalWabbit/vowpal_wabbit.git
cd vowpal_wabbit

Ubuntu

sudo apt install libboost-dev libboost-thread-dev libboost-program-options-dev libboost-system-dev libboost-math-dev libboost-test-dev zlib1g-dev cmake g++

# Optional: flatbuffers
sudo apt install libflatbuffers-dev

# Optional: Building Python bindings
sudo apt install libboost-python-dev

WSL Notes

  • If using WSL ensure you clone the repo in WSL and not in Windows to prevent broken line endings.
  • If building on WSL on an NTFS drive, also be sure that the drive is mounted with the "metadata" option, or CMake will not complete successfully. (See: here)

Next step: building on Linux

MacOS

brew install cmake boost zlib

# Optional: flatbuffers
brew install flatbuffers

# Optional: Building Python bindings
brew install boost-python3

The rest of the Linux instructions should apply to MacOS too.

Next step: building on Linux

Windows

  • 10.0.16299.0 Windows 10 SDK must be installed

When using CMake for Windows, dependencies can be managed through Vcpkg. Install the following dependencies with Vcpkg:

vcpkg --triplet x64-windows install zlib boost-system boost-program-options boost-test boost-align boost-foreach boost-math

# Optional: flatbuffers
vcpkg --triplet x64-windows install flatbuffers

# Optional: flatbuffers
vcpkg --triplet x64-windows install boost-python python3
  • Add the flatbuffers tool directory to your PATH: <vcpkg_root>\installed\x64-windows\tools\flatbuffers

See here for the old instructions for the solution based approach.

Targeting non latest build tools

If targeting vs2017 with vs2019 installed (v142) also installed then additional steps will need to be taken to avoid linker errors due to version incompatibilities.

  1. From the triplets directory in your Vcpkg installation (e.g. <vcpkg_root>\triplets)
    cp x64-windows.cmake x64-windows-v141.cmake
    
  2. Set the VCPKG_PLATFORM_TOOLSET variable to v141 by adding set(VCPKG_PLATFORM_TOOLSET v141) to the new x64-windows-v141.cmake file
  3. When installing the list of dependencies additionally specify:
    vcpkg install --triplet x64-windows-v141 ...
    
  4. In the next step when building add the following to the CMake command line -DVCPKG_TARGET_TRIPLET=x64-windows-v141

Next step: building on Windows

Details

A vendored dep is provided by the project and built as part of building VW. A system dep is externally provided by the OS or a package manager. All dependencies must be available as as system dependency and can optionally be provided vendored.

Dependency Available as vendored? Can be system? Optional?
boost No Yes, default No
zlib No Yes, default No
rapidjson Yes, default Yes, -DRAPIDJSON_SYS_DEP=On in CMake No
flatbuffers No Yes, default Yes, off by default. -DBUILD_FLATBUFFERS=On in CMake to enable
spdlog Yes, default Yes, -DFMT_SYS_DEP=On in CMake No
fmt Yes, default Yes, -DSPDLOG_SYS_DEP=On in CMake No
Clone this wiki locally