首页 > 代码库 > ceph libs3编译

ceph libs3编译

1、提示找不到依赖的libxml2库头文件 libxml/parser.h

build/obj/util.do: Compiling dynamic object src/simplexml.c:27:27: error: libxml/parser.h: No such file or directory src/simplexml.c:48: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘saxGetEntity’ cc1: warnings being treated as errors src/simplexml.c:56: error: type defaults to ‘int’ in declaration of ‘xmlChar’ src/simplexml.c:56: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token src/simplexml.c:88: error: type defaults to ‘int’ in declaration of ‘xmlChar’ src/simplexml.c:88: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token src/simplexml.c:111: error: type defaults to ‘int’ in declaration of ‘xmlChar’ src/simplexml.c:111: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token build/obj/acl.o: Compiling object


通过yum install 安装xml2解决问题

2、提示依赖的libxml2库头文件 libxml/parser.h不存在正确的编译文件

make[3]: Entering directory `/var/lib/jenkins/jobs/nds/workspace/src/libs3‘ make[3]: *** No rule to make target `libxml/parser.h‘, needed by `build/obj/simplexml.do‘.  Stop. make[3]: Leaving directory `/var/lib/jenkins/jobs/nds/workspace/src/libs3‘

解决方式如下:

A. 使用命令grep xml2 libs3/GNUmakefile查对xml2的依赖方式如下

LIBXML2_LIBS := $(shell xml2-config --libs)
 LIBXML2_CFLAGS := $(shell xml2-config --cflags)

B. 在上面运行./configure之后会生成一个小的Shell脚本xml2-config,它会被安装成为libxml2的一部分

查本机生成的路径/usr/bin/xml2-config ,文件中cflags选项如下

--cflags)
        echo -I${includedir}/libxml2 

C. 重新运行ldconfig或类似工具以更新被安装的共享库列表

D. 经过如上步骤重新编译libs3,还是编译不过

E. 在src/libs3 执行make clean;make编译通过 ,初步解释为libs3在编译过程中不会重新查找依赖包

ceph libs3编译