Caffe2 Compilation Error gflags.cc' is being linked both statically and dynamically into this execut

来源:互联网 发布:百电通软件 编辑:程序博客网 时间:2024/05/27 00:42

问题描述


python -c 'from caffe2.python import core' 2>/dev/null && echo "Success" || echo "Failure"

出现这个问题

ERROR: something wrong with flag 'flagfile' in file '/home/bids/softwares/gflags-2.2.0/src/gflags.cc'.  One possibility: file '/home/bids/softwares/gflags-2.2.0/src/gflags.cc' is being linked both statically and dynamically into this executable.

这是因为之前设置 Ubuntu 15.04 安装 boost-python , 导致 gflags.cc 指向了 

/usr/local/lib/libgflags.a  /usr/local/lib/libgflags_nothreads.a 和  /usr/local/include/gflags

caffe2调用gflags会出现矛盾。



解决方法


#Uninstall libgflagssudo apt-get remove -y libgflags#Delete make install versionssudo rm -f /usr/local/lib/libgflags.a /usr/local/lib/libgflags_nothreads.asudo rm -rf  /usr/local/include/gflags#Re-install libgflags packagesudo apt-get install -y libgflags-dev

参考文献


Caffe Compilation Error: gflags.cc’ is being linked both statically and dynamically into this executable

caffe2 安装与介绍
caffe2

0 0