I am trying to install vowpal wabbit in a virtual env in centos 7. I have installed the dependencies like boost(https://medium.com/@royendgel/boost-boost-python-dlib-python3-on-centos-or-amazon-linux-4039f70a3614) required.
Python : 3.6
Cmake : 3.6.2 (Installed as per this doc : http://jotmynotes.blogspot.com/2016/10/updating-cmake-from-2811-to-362-or.html)
Here is the error when running “make install”. I followed the instruction for Linux from https://github.com/VowpalWabbit/vowpal_wabbit/wiki/Installing.
Scanning dependencies of target spanning_tree
[ 1%] Building CXX object cluster/CMakeFiles/spanning_tree.dir/spanning_tree_main.cc.o
[ 1%] Building CXX object cluster/CMakeFiles/spanning_tree.dir/__/vowpalwabbit/spanning_tree.cc.o
[ 2%] Building CXX object cluster/CMakeFiles/spanning_tree.dir/__/vowpalwabbit/vw_exception.cc.o
[ 3%] Linking CXX executable spanning_tree
[ 3%] Built target spanning_tree
[ 6%] Built target allreduce
[ 6%] Building CXX object vowpalwabbit/CMakeFiles/vw.dir/audit_regressor.cc.o
In file included from /home/joel/vowpal_wabbit/vowpalwabbit/reductions.h:9:0,
from /home/joel/vowpal_wabbit/vowpalwabbit/audit_regressor.cc:5:
/home/joel/vowpal_wabbit/vowpalwabbit/global_data.h:479:30: warning: missing initializer for member ‘std::array<std::vector<std::shared_ptr<std::unordered_map<std::basic_string<char>, std::unique_ptr<features> > > >, 256ul>::_M_elems’ [-Wmissing-field-initializers]
namespace_dictionaries{}; // each namespace has a list of dictionaries attached to it
^
In file included from /home/joel/vowpal_wabbit/vowpalwabbit/global_data.h:49:0,
from /home/joel/vowpal_wabbit/vowpalwabbit/reductions.h:9,
from /home/joel/vowpal_wabbit/vowpalwabbit/audit_regressor.cc:5:
/home/joel/vowpal_wabbit/vowpalwabbit/options.h: In instantiation of ‘VW::config::typed_option<T>::typed_option(const string&, T&) [with T = std::basic_string<char>; std::string = std::basic_string<char>]’:
/home/joel/vowpal_wabbit/vowpalwabbit/options.h:97:40: required from ‘VW::config::typed_option<T> VW::config::make_option(std::string, T&) [with T = std::basic_string<char>; std::string = std::basic_string<char>]’
/home/joel/vowpal_wabbit/vowpalwabbit/audit_regressor.cc:249:58: required from here
/home/joel/vowpal_wabbit/vowpalwabbit/options.h:37:117: error: invalid initialization of non-const reference of type ‘std::basic_string<char>&’ from an rvalue of type ‘<brace-enclosed initializer list>’
typed_option(const std::string& name, T& location) : base_option(name, typeid(T).hash_code()), m_location{location} {}
^
make[2]: *** [vowpalwabbit/CMakeFiles/vw.dir/audit_regressor.cc.o] Error 1
make[1]: *** [vowpalwabbit/CMakeFiles/vw.dir/all] Error 2
make: *** [all] Error 2
2
Answers
The g++ compiler must be a c++11 version. Boost must be compiled with c++11 … see how to install gcc 4.9.2 on RHEL 7.4
CentOS 7 : Build example, in /home/[name]/tmp/
P.S.: Ref. README.md → the new “Building information” is here https://github.com/VowpalWabbit/vowpal_wabbit/wiki/Building → Warning : Doing ‘make’ in vowpal_wabbit/ can configure for Python 2 only.
Building the python3 bindings for VowpalWabbit : As the default Makefile and the cmake options are for python2 only, this is the solution:
Clear linux centos 7
LD_LIBRARY_PATH=/opt/boost/lib
export LD_LIBRARY_PATH
BOOST_ROOT=/opt/boost(choose location in install)
export BOOST_ROOT
…
cd build; cmake ..
Complete.