Skip to content

Installing dependencies

Vladimir Venediktov edited this page Jul 21, 2019 · 35 revisions

For Linux

CMAKE

purge your old cmake by following command

sudo apt-get purge cmake

Download latest cmake

mkdir cmake
wget --no-check-certificate --quiet -O - https://cmake.org/files/v3.12/cmake-3.12.0.tar.gz | tar --strip-components=1 -xz -C cmake
cd cmake
./bootstrap --prefix=/usr
sudo make -j4 install

Boost

remove old version of Boost

dpkg -S /usr/include/boost/version.hpp
-> libboost1.58-dev:amd64: /usr/include/boost/version.hpp
sudo apt-get autoremove libboost1.58-dev:amd64

If you have root access then install it with apt-get command

sudo apt-get install libboost-all-dev

If the above command brings version < 1.60 try something like this

sudo apt-get install libboost1.60-all-dev

Or even higher version

sudo apt-get install libboost1.64-all-dev

If you don't have root access on your machine then download and build boost in custom directory

Download version >= 1.67

mkdir boost167
wget --no-check-certificate --quiet -O - https://dl.bintray.com/boostorg/release/1.67.0/source/boost_1_67_0.tar.gz | tar --strip-components=1 -xz -C boost167
cd boost167 
./bootstrap.sh --with-toolset=gcc --with-libraries=program_options,system,regex,serialization,log,date_time,test,filesystem
./b2 toolset=gcc variant=release install --prefix=/usr

If you don't use --prefix= boost by default gets installed into /usr/local/include

Building project with boost installed not in /usr/include or /usr/local/include

cmake -DCMAKE_BUILD_TYPE=Release -DBOOST_ROOR=/path/to/boost-dir .. -G "Unix Makefiles"

For Mac OS

Install Homebrew if you don't have it already installed

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)

Then run below commands to install latest cmake and boost

brew doctor
brew install cmake
brew install boost

https://github.com/venediktov/vanilla-rtb/blob/master/README.md#mac-os-x-command-line-tools-

For Mac OS with gcc or if boost cherry picked version needed

brew remove boost
mkdir boost167
wget --no-check-certificate --quiet -O - https://dl.bintray.com/boostorg/release/1.67.0/source/boost_1_67_0.tar.gz | tar --strip-components=1 -xz -C boost167
cd boost167 
CC=/usr/local/bin/gcc-9 CXX=/usr/local/bin/g++-9   ./bootstrap.sh --with-toolset=gcc --with-libraries=all
./b2 toolset=gcc-9 variant=release install --prefix=/usr/local

when building vanilla-rtb under root refer to gcc compiler version either by name of gcc executable or full path

mkdir Release
cd Release
cmake -DCMAKE_C_COMPILER=/usr/local/bin/gcc-9 -DCMAKE_CXX_COMPILER=/usr/local/bin/g++-9 -DCMAKE_BUILD_TYPE=Release .. -G "Unix Makefiles"
make VERBOSE=1 -j4 install

Mac OSX for gcc with boost 1.69.0

brew remove boost
mkdir boost169
wget --no-check-certificate --quiet -O - https://dl.bintray.com/boostorg/release/1.69.0/source/boost_1_69_0.tar.gz | tar --strip-components=1 -xz -C boost169
cd boost167 
CC=/usr/local/bin/gcc-9 CXX=/usr/local/bin/g++-9   ./bootstrap.sh --with-toolset=gcc --with-libraries=all
./b2 cxxflags=-std=c++17 toolset=gcc-9 variant=release install --prefix=/usr/local

Cmake and Boost 1.70.00

Set Boost_NO_BOOST_CMAKE to ON to disable the search for boost-cmake.

SET ( Boost_NO_BOOST_CMAKE ON )