【问题标题】:Unable to build vowpal wabbit in centos 7无法在 centos 7 中构建 vowpal wabbit
【发布时间】:2020-07-28 15:13:04
【问题描述】:

我正在尝试在 centos 7 的虚拟环境中安装 vowpal wabbit。我已经安装了所需的 boost(https://medium.com/@royendgel/boost-boost-python-dlib-python3-on-centos-or-amazon-linux-4039f70a3614) 等依赖项。

Python:3.6 Cmake:3.6.2(按照此文档安装:http://jotmynotes.blogspot.com/2016/10/updating-cmake-from-2811-to-362-or.html

这是运行“make install”时的错误。我遵循了来自https://github.com/VowpalWabbit/vowpal_wabbit/wiki/Installing 的 Linux 指令。

 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

【问题讨论】:

标签: python build centos7 vowpalwabbit


【解决方案1】:

清除linux centos 7

  • 百胜更新
  • 安装 gcc*
  • 安装cmake-3.10.2.tar.gz
  • 安装 boost_1_65_1.tar.gz
  • 安装java-1.8

LD_LIBRARY_PATH=/opt/boost/lib 导出 LD_LIBRARY_PATH

BOOST_ROOT=/opt/boost(选择安装位置) 导出 BOOST_ROOT ... 光盘构建; cmake ..

完成。

【讨论】:

    【解决方案2】:

    尝试安装 vowpal wabbit

    g++ 编译器必须是 c++11 版本。 Boost 必须用 c++11 编译...见how to install gcc 4.9.2 on RHEL 7.4

    CentOS 7:构建示例,在 /home/[name]/tmp/

    ======= Boost ========
    cd boost_1_68_0/
    echo "using gcc : : /usr/bin/g++73 ; " >> tools/build/src/user-config.jam
    echo "using python : 3.6 : /usr/bin/python3.6 : /usr/include/python3.6m ; " >> tools/build/src/user-config.jam
    
    ./bootstrap.sh
    ./b2
    # ./b2 install
    
    ======== dlib ============
    cd dlib-19.19.0/ && python3 setup.py build
    # python3 setup.py install
    
    ======== VowpalWabbit ========
    git clone https://github.com/VowpalWabbit/vowpal_wabbit.git
    cd vowpal_wabbit/
    git submodule update --init --recursive
    mkdir build && cd build/
    CC=gcc73 CXX=g++73 cmake3 ..
    make      // no errors
    

    P.S.:参考。 README.md → 新的“建筑信息”在这里https://github.com/VowpalWabbit/vowpal_wabbit/wiki/Building警告:在 vowpal_wabbit/ 中执行“make”只能为 Python 2 配置。


    为 VowpalWabbit 构建 python3 绑定:由于默认 Makefile 和 cmake 选项仅适用于 python2,因此解决方案如下:

    cd vowpal_wabbit/
    export CC=gcc73 CXX=g++73 && python3 setup.py build
    .
    [100%] Built target pylibvw
    .
    # export CC=gcc73 CXX=g++73 && python3 setup.py install
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-12-05
      • 1970-01-01
      • 2012-07-26
      • 2018-01-20
      • 2017-10-09
      • 2015-01-06
      • 2013-12-15
      相关资源
      最近更新 更多