CentOS上的Vowal Wabbit“-Wno-unused-local-typedef”错误

时间:2015-09-26 13:51:08

标签: gcc machine-learning centos vowpalwabbit

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

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)”版本。

2 个答案:

答案 0 :(得分: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

答案 1 :(得分:0)

这是我在CentOs 6.8上所做的事情,然后将pip install vowpalwabbit运行到conda或构建本机部分和python egg的主python发行版。包含用于构建泊坞窗图像的注释行。很有把握应该只是建立vowpal-wabbit库。

通过安装boost-devel修复BOOST_STATIC_ASSERT_MSG的原始问题: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应该有效。

vowpal-wabbit问题跟踪器中的

Related discussion