DeepVariant必需组件CLIF的安装

gcc路径设置

是为了解决安装clif时调用cmake时不认自己安装的gcc-6.2.0。报错:
Host GCC version must be at least 4.8!
解决方案1(推荐,设置完后要删除之前生成的文件):
来源:http://www.jyguagua.com/?p=3261
指定:

export CC=/usr/local/bin/gcc
export CXX=/usr/local/bin/g++

失败。
解决方案2:
来源:https://blog.csdn.net/amds123/article/details/53812133

# 修改 CMakeLists.txt 文件,在文件最开始添加:
SET(CMAKE_C_COMPILER “/home/hhb/gcc-5.2.0/bin/gcc”)
SET(CMAKE_CXX_COMPILER “/home/hhb/gcc-5.2.0/bin/g++”)

StackOverflow有更为详细的解答。
暂未尝试。

protobuf安装

解决gcc路径问题后,又出现了protobuf找不到的问题,正常下载github的release版本后,正常安装,之后加入PATH、LD_LIBRARY_PATH,还需要添加另一个变量:
export PKG_CONFIG_PATH=/data2/myname/protobuf-3.6.1/makehere/lib/pkgconfig/
才能够识别。

protobuf安装后,重新安装clif时,到100%时出现error

fatal error: 'atomic' file not found
是因为从3.5开始,protobuf都以C++ 11进行编译(https://github.com/protocolbuffers/protobuf/releases)。 而3.5之前又没有protobuf-all的release,因而检查系统的C++安装,如gcc和cmake,使其用C++ 11。怀疑环境变量CPLUS_INCLUDE_PATH及C_INCLUDE_PATH未包含glibc中的include。

因此在.bashrc添加

export CPLUS_INCLUDE_PATH="$CPLUS_INCLUDE_PATH:/data2/myname/tools/glibc-2.17/makehere/include/:/data2/myname/tools/glibc-2.17/include"
注意是两个include,分别包含两个必需的头文件。不知道为什么makehere中不包含所有的,可能是在安装glibc时没有安装好。但是更改后atomic依然找不到。

尝试简单粗暴的把atomic.h拷到调用它的文件的同一个目录。

cp /data2/myname/glibc-2.17/include/atomic.h /data2/myname/protobuf-3.6.1/makehere/include/google/protobuf/
无法解决。

把cp后的atomic.h改名为atomic。

无法解决,但是错误代码更新:

/data2/myname/protobuf-3.6.1/makehere/include/google/protobuf/atomic:50:10: fatal error: 'bits/atomic.h' file not found
#include <bits/atomic.h>

继续用拷贝大法,注意此时bits在glibc文件夹中是glibc根目录下的glibc,不是include下的那个,因为include下的bits无atomic.h。
cp -r /data2/myname/glibc-2.17/bits/ /data2/myname/protobuf-3.6.1/makehere/include/google/protobuf/
重新运行,报新错。其中有一句
In file included from /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/mutex:45:

是不是用的gcc依然是旧版的gcc?不确定。

实在不想折腾了,看起来是protobuf要求C++ 11问题

但是又不知道在哪里安装clif时候强制用C++ 11。换protobuf版本吧。protobuf 3.4及其之前都是没有强制用C++ 11的,因此换3.4版本。

依然报错。

在出现错误后不管,直接ninja install。失败。

更改clif_backend/llvm中的CMAKEList.txt

依据CSDN,增加指定gcc的语句,即之前提到的SET …语句。
失败。

尝试docker

docker pull gcr.io/deepvariant-docker/deepvariant
来自:https://zhuanlan.zhihu.com/p/27303469
失败,需要sudo。

发现gcc中的include没有在C_INCLUDE_PATH当中

添加gcc的include。注意不仅要加include,还得加下面的某些子目录(出错后根据错误添加)。
export CPLUS_INCLUDE_PATH="$CPLUS_INCLUDE_PATH:/data2/myname/gcc-6.2.0/makehere/include/c++/6.2.0/x86_64-pc-linux-gnu/"

运行到python install setup.py又出现错误。

日志显示出现错误的命令为

/data2/myname/gcc-6.2.0/makehere/bin/g++ -pthread -shared -B /data2/myname/anaconda2/compiler_compat -L/data2/myname/anaconda2/lib -Wl,-rpath=/data2/myname/anaconda2/lib -Wl,--no-as-needed -Wl,--sysroot=/ build/temp.linux-x86_64-2.7/clif/python/proto_util.o build/temp.linux-x86_64-2.7/clif/python/utils/proto_util.o build/temp.linux-x86_64-2.7/clif/python/utils/proto_util.init.o build/temp.linux-x86_64-2.7/clif/python/pyproto.o build/temp.linux-x86_64-2.7/clif/python/runtime.o build/temp.linux-x86_64-2.7/clif/python/slots.o build/temp.linux-x86_64-2.7/clif/python/types.o -L/data2/myname/anaconda2/lib -lprotobuf -lpython2.7 -o build/lib.linux-x86_64-2.7/clif/python/utils/proto_util.so

其中-lprotobuf的意思是搜索protobuf的lib,即libprotobuf*.so,确实/data2/myname/anaconda2/lib中没有这个lib。尝试把protobuf安装路径下的一系列so文件拷贝到该目录。

安装成功,估计问题的关键一直都是gcc的include未加入C_INCLUDE_PATH,可惜了浪费这么长时间。

另,如在安装失败后再更改以上设置后重新安装,可能需要删除原来产生的文件(../clif_backend),否则可能依然报同样的错误。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值