73 Star 336 Fork 169

GVPopenEuler / iSulad

 / 详情

iSulad编译失败

Backlog
Bug
Opened this issue  
2021-09-08 10:18

【标题描述】
master代码,根据https://gitee.com/openeuler/iSulad/blob/master/docs/build_guide.md
编译失败。
错误为:

[100%] Built target isula
CMakeFiles/isulad.dir/daemon/entry/connect/metrics/metrics_service.c.o: In function `metrics_get_by_type_cb':
/home/./iSula/iSulad/src/daemon/entry/connect/metrics/metrics_service.c:69: undefined reference to `evhtp_send_reply'
/home/./iSula/iSulad/src/daemon/entry/connect/metrics/metrics_service.c:62: undefined reference to `evhtp_kv_new'
/home/./iSula/iSulad/src/daemon/entry/connect/metrics/metrics_service.c:62: undefined reference to `evhtp_kvs_add_kv'
/home/./iSula/iSulad/src/daemon/entry/connect/metrics/metrics_service.c:64: undefined reference to `evbuffer_add'

我认为src/CMakeLists.txt一处配置不正确。在GRPC_CONNECTOR使能的情况下,要包含EVHTP_LIBRARY,请核对:

if ( GRPC_CONNECTOR )
    target_link_libraries(libisula -Wl,--as-needed -lstdc++)
    target_link_libraries(libisula -Wl,--as-needed ${PROTOBUF_LIBRARY})
    target_link_libraries(libisula -Wl,--no-as-needed ${GRPC_PP_REFLECTION_LIBRARY} ${GRPC_PP_LIBRARY} ${GRPC_LIBRARY} ${GPR_LIBRARY})
else()
    target_link_libraries(libisula ${EVHTP_LIBRARY} ${EVENT_LIBRARY} ${ZLIB_LIBRARY} -ldl libhttpclient)
endif()

【环境信息】
硬件信息:
1) X86_64
2) -
软件信息:
1) Ubuntu 16.04
2) 4.9
3) iSulad
如果有特殊组网,请提供网络拓扑图
【问题复现步骤】

【预期结果】
描述预期结果,可以通过对比新老版本获取
【实际结果】
描述出问题的结果
【附件信息】

Comments (5)

firstadream created缺陷
firstadream set related repository to openEuler/iSulad
firstadream changed description
firstadream changed description
firstadream changed description
Expand operation logs

这块儿应该是iSulad.spec里面少了运行依赖,build文档没有列全,在使能metrics_server或者rest_server的时候需要libevent.so和libevhtp.so两个库的支持。

Hi gaohuatao,
我在 Ubuntu 18.04 下编译也遇到类似错误,检查 /usr/local/lib 下已存在 libevhtp.so。

报错如下

[ 87%] Linking CXX executable isulad

CMakeFiles/isulad.dir/daemon/entry/connect/metrics/metrics_service.c.o: In function `metrics_get_by_type_cb':
/tmp/build_isulad/iSulad/src/daemon/entry/connect/metrics/metrics_service.c:69: undefined reference to `evhtp_send_reply'
/tmp/build_isulad/iSulad/src/daemon/entry/connect/metrics/metrics_service.c:62: undefined reference to `evhtp_kv_new'
/tmp/build_isulad/iSulad/src/daemon/entry/connect/metrics/metrics_service.c:62: undefined reference to `evhtp_kvs_add_kv'
/tmp/build_isulad/iSulad/src/daemon/entry/connect/metrics/metrics_service.c:64: undefined reference to `evbuffer_add'
CMakeFiles/isulad.dir/daemon/entry/connect/metrics/metrics_service.c.o: In function `metrics_server_thrd':
/tmp/build_isulad/iSulad/src/daemon/entry/connect/metrics/metrics_service.c:80: undefined reference to `event_base_new'
/tmp/build_isulad/iSulad/src/daemon/entry/connect/metrics/metrics_service.c:86: undefined reference to `evhtp_new'
/tmp/build_isulad/iSulad/src/daemon/entry/connect/metrics/metrics_service.c:92: undefined reference to `evhtp_set_cb'
/tmp/build_isulad/iSulad/src/daemon/entry/connect/metrics/metrics_service.c:93: undefined reference to `evhtp_use_dynamic_threads'
/tmp/build_isulad/iSulad/src/daemon/entry/connect/metrics/metrics_service.c:97: undefined reference to `evhtp_bind_socket'
/tmp/build_isulad/iSulad/src/daemon/entry/connect/metrics/metrics_service.c:102: undefined reference to `event_base_loop'
/tmp/build_isulad/iSulad/src/daemon/entry/connect/metrics/metrics_service.c:107: undefined reference to `evhtp_free'
/tmp/build_isulad/iSulad/src/daemon/entry/connect/metrics/metrics_service.c:110: undefined reference to `event_base_free'
CMakeFiles/isulad.dir/daemon/entry/connect/metrics/metrics_service.c.o: In function `metrics_service_shutdown':
/tmp/build_isulad/iSulad/src/daemon/entry/connect/metrics/metrics_service.c:150: undefined reference to `evhtp_unbind_socket'
/tmp/build_isulad/iSulad/src/daemon/entry/connect/metrics/metrics_service.c:151: undefined reference to `evhtp_free'
/tmp/build_isulad/iSulad/src/daemon/entry/connect/metrics/metrics_service.c:157: undefined reference to `event_base_loopbreak'
/tmp/build_isulad/iSulad/src/daemon/entry/connect/metrics/metrics_service.c:158: undefined reference to `event_base_free'
collect2: error: ld returned 1 exit status
src/CMakeFiles/isulad.dir/build.make:4199: recipe for target 'src/isulad' failed
make[2]: *** [src/isulad] Error 1
CMakeFiles/Makefile2:105: recipe for target 'src/CMakeFiles/isulad.dir/all' failed
make[1]: *** [src/CMakeFiles/isulad.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 87%] Linking CXX shared library libisula.so
[ 87%] Built target libisula
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2
  1. 修改一下ld load path,加上/usr/local/lib试试;
  2. libevht 的版本对不对;

Sign in to comment

Status
Assignees
Projects
Milestones
Pull Requests
Successfully merging a pull request will close this issue.
Branches
Planed to start   -   Planed to end
-
Top level
Priority
Duration (hours)
Confirm
参与者(5)
7935460 tiamo0 1628583624 5595769 duguhaotian 1605235330
C
1
https://git.oschina.net/openeuler/iSulad.git
git@git.oschina.net:openeuler/iSulad.git
openeuler
iSulad
iSulad

Search