【问题标题】:Vowal Wabbit "-Wno-unused-local-typedef" error on CentOSCentOS上的Vowal Wabbit“-Wno-unused-local-typedef”错误
【发布时间】:2023-04-09 00:11:01
【问题描述】:

当我尝试在 CentOS(vmware 映像)上安装 vowpal wabbit 时,我不断收到此错误:

At global scope:
cc1plus: warning: unrecognized command line option "-Wno-unused-local-typedef" [enabled by default]
make[1]: *** [lda_core.lo] Error 1
make[1]: Leaving directory `/home/tom/vowpal_wabbit/vowpalwabbit'
make: *** [install-recursive] Error 1


full error info :


Making install in vowpalwabbit
make[1]: Entering directory `/home/tom/vowpal_wabbit/vowpalwabbit'
depbase=`echo lda_core.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
    /bin/sh ../libtool --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I.    -I/usr/include -I/include  -Wall -Wno-unused-local-typedef    -pedantic  -ffast-math   -O3 -fomit-frame-pointer -fno-strict-aliasing -DNDEBUG  -std=gnu++11 -MT lda_core.lo -MD -MP -MF $depbase.Tpo -c -o lda_core.lo lda_core.cc &&\
    mv -f $depbase.Tpo $depbase.Plo
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I/usr/include -I/include -Wall -Wno-unused-local-typedef -pedantic -ffast-math -O3 -fomit-frame-pointer -fno-strict-aliasing -DNDEBUG -std=gnu++11 -MT lda_core.lo -MD -MP -MF .deps/lda_core.Tpo -c lda_core.cc  -fPIC -DPIC -o .libs/lda_core.o
lda_core.cc: In function ‘T ldamath::lgamma(T)’:
lda_core.cc:361:94: error: there are no arguments to ‘BOOST_STATIC_ASSERT_MSG’ that depend on a template parameter, so a declaration of ‘BOOST_STATIC_ASSERT_MSG’ must be available [-fpermissive]
   BOOST_STATIC_ASSERT_MSG(true, "ldamath::lgamma is not defined for this type and math mode.");
                                                                                              ^
lda_core.cc:361:94: note: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated)
lda_core.cc: In function ‘T ldamath::digamma(T)’:
lda_core.cc:367:95: error: there are no arguments to ‘BOOST_STATIC_ASSERT_MSG’ that depend on a template parameter, so a declaration of ‘BOOST_STATIC_ASSERT_MSG’ must be available [-fpermissive]
   BOOST_STATIC_ASSERT_MSG(true, "ldamath::digamma is not defined for this type and math mode.");
                                                                                               ^
lda_core.cc: In function ‘T ldamath::exponential(T)’:
lda_core.cc:373:99: error: there are no arguments to ‘BOOST_STATIC_ASSERT_MSG’ that depend on a template parameter, so a declaration of ‘BOOST_STATIC_ASSERT_MSG’ must be available [-fpermissive]
   BOOST_STATIC_ASSERT_MSG(true, "ldamath::exponential is not defined for this type and math mode.");
                                                                                                   ^
lda_core.cc: In function ‘T ldamath::powf(T, T)’:
lda_core.cc:379:92: error: there are no arguments to ‘BOOST_STATIC_ASSERT_MSG’ that depend on a template parameter, so a declaration of ‘BOOST_STATIC_ASSERT_MSG’ must be available [-fpermissive]
   BOOST_STATIC_ASSERT_MSG(true, "ldamath::powf is not defined for this type and math mode.");
                                                                                            ^
At global scope:
cc1plus: warning: unrecognized command line option "-Wno-unused-local-typedef" [enabled by default]
make[1]: *** [lda_core.lo] Error 1
make[1]: Leaving directory `/home/tom/vowpal_wabbit/vowpalwabbit'
make: *** [install-recursive] Error 1

请帮忙。我该如何解决?我已经有了“g++ (GCC) 4.8.2 20140120 (Red Hat 4.8.2-15)”版本。

【问题讨论】:

标签: gcc machine-learning centos vowpalwabbit


【解决方案1】:

这是文件之间的链接问题,请运行以下命令

试运行

# yum install devtoolset-2-gcc-4.8.2 devtoolset-2-gcc-c++-4.8.2
# /opt/rh/devtoolset-2/root/usr/bin/gcc --version

导出

ln -s /opt/rh/devtoolset-2/root/usr/bin/* /usr/local/bin/
hash -r
gcc --version

更多信息:http://www.computerhope.com/unix/uln.htm

【讨论】:

    【解决方案2】:

    这是我在 CentOs 6.8 上所做的,然后将 pip install vowpalwabbit 运行到 conda 或构建本机部分和 python 鸡蛋的主要 python 发行版。包含构建 docker 映像案例的注释行。很确定这对构建 vowpal-wabbit 库有帮助。

    BOOST_STATIC_ASSERT_MSG 的原始问题已通过安装 boost-devel:1.59 得到修复。

    yum -y install wget make python-devel zlib-devel
    
    # Boost 1.59 required for vowpal wabbit, Boost 1.41 is going with CentOs 6.8 image and repo
    wget http://repo.enetres.net/enetres.repo -O /etc/yum.repos.d/enetres.repo
    yum -y install boost-devel
    
    # This step is done for the original author, but will be needed if you didn't install updated gcc/g++ yet.
    # GCC and G++ 4.8.2 for vowpal wabbit build, 4.4.x is going with CentOs 6.8 image by default.
    # Don't go with too new gcc versions like gcc 5.x, it will not work 
    wget http://people.centos.org/tru/devtools-2/devtools-2.repo -O /etc/yum.repos.d/devtools-2.repo
    yum -y install devtoolset-2-gcc devtoolset-2-gcc-c++ devtoolset-2-binutils devtoolset-2-runtime devtoolset-2-libstdc++-devel
    
    scl enable devtoolset-2 bash
    # Set PATH, because "scl enable" does not have any effects inside "docker build"
    #-docker- PATH /opt/rh/devtoolset-2/root/usr/bin:$PATH
    # Set CC, CXX, LD variables for make, because "scl enable" does not have any effects inside "docker build"
    #-docker- ENV CC /opt/rh/devtoolset-2/root/usr/bin/gcc
    #-docker- ENV CXX /opt/rh/devtoolset-2/root/usr/bin/g++
    #-docker- ENV LD /opt/rh/devtoolset-2/root/usr/bin/ld
    
    # Python 2.7 for vowpal wabbit, CentOs 6.8 comes with python 2.6
    # --enable-shared flag is important for the vowpal wabbit build
    cd /opt &&\
      wget --no-check-certificate https://www.python.org/ftp/python/2.7.6/Python-2.7.6.tar.xz &&\
      tar xf Python-2.7.6.tar.xz &&\
      cd Python-2.7.6 &&\
      ./configure --enable-shared --prefix=/usr/local &&\
      make && make altinstall
    
    ln -s /usr/local/bin/python2.7 /usr/bin/python2.7
    echo "/usr/local/lib/python2.7" > /etc/ld.so.conf.d/python27.conf
    echo "/usr/local/lib" >> /etc/ld.so.conf.d/python27.conf
    ldconfig
    

    在此步骤之后,pip install vowpalwabbitmake 原始本机库应该可以工作。

    Related discussion 在 vowpal-wabbit 问题跟踪器中。

    【讨论】:

      猜你喜欢
      • 2015-04-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-05-24
      • 2015-03-14
      • 1970-01-01
      • 2020-07-28
      相关资源
      最近更新 更多