bk-cmdb
bk-cmdb copied to clipboard
蓝鲸cmdb开源版release-v3.13.4 版本编译报错
-
产品:蓝鲸GitHub开源版CMDB
-
版本: 要编译的开源版v3.13.4,要替换的社区版v3.10.21
-
环境信息: centos7.9,mongodb4.2.3
-
问题描述: 根据GitHub开源版的编译指南,下载release代码后,执行make报错。 https://github.com/TencentBlueKing/bk-cmdb/blob/master/docs/overview/upgrade-from-ce.md
-
问题现象关键片段(文字): /root/go/pkg/mod/github.com/!tencent!blue!king/[email protected]/sm4.go:83:38: could not determine kind of name for C.EVP_sm4_ctr
make[1]: *** [cmdb_apiserver] Error 1 make[1]: Leaving directory `/root/tmp1/src/configcenter/src/apiserver' make: *** [default] Error 2
- 问题现象关键信息截图,日志截图:
#GITHASH=v3.13.4 GITTAG=ocr-v3.13.4 VERSION=v3.13.4 make
tongsuo already exists building server... enter directory: /root/tmp1/src/configcenter/src/apiserver make[1]: Entering directory `/root/tmp1/src/configcenter/src/apiserver'
building the target: cmdb_apiserver...
CGO_ENABLED=1 CGO_CFLAGS="-I/root/tmp1/src/configcenter/src/bin/build/v3.13.4/tongsuo/include -Wno-deprecated-declarations" CGO_LDFLAGS="-L/root/tmp1/src/configcenter/src/bin/build/v3.13.4/tongsuo/lib -lssl -lcrypto" go build -ldflags "-X configcenter/src/common/version.CCVersion=v3.13.4 -X configcenter/src/common/version.CCBuildTime=2024-03-15T13:32:21+0800 -X configcenter/src/common/version.CCGitHash=v3.13.4 -X configcenter/src/common/version.CCTag=ocr-v3.13.4 -X configcenter/src/common/version.CCDistro=community -X configcenter/src/common/version.GoVersion=go1.20.10" -o /root/tmp1/src/configcenter/src/bin/build/v3.13.4/cmdb_apiserver/cmdb_apiserver #github.com/TencentBlueKing/crypto-golang-sdk /root/go/pkg/mod/github.com/!tencent!blue!king/[email protected]/sm4.go:83:38: could not determine kind of name for C.EVP_sm4_ctr make[1]: *** [cmdb_apiserver] Error 1 make[1]: Leaving directory `/root/tmp1/src/configcenter/src/apiserver' make: *** [default] Error 2
- 尝试过的操作/已经排查过的情况:如关键的日志片段(请勿粘贴截图)
确认go版本:GOVERSION="go1.20.10";
确认C语言头文件位置:/usr/include/bits/、/usr/include/openssl/
你 tongsuo 的位置在这里吗?CGO_CFLAGS="-I/root/tmp1/src/configcenter/src/bin/build/v3.13.4/tongsuo/include,不在的话可以通过设置TONGSUO_PATH环境变量指定tongsuo 的路径
tongsuo 是什么版本,我用了 8.4.0 报错了
/home/sirui.liao/.g/versions/1.21.9/pkg/tool/linux_amd64/link: running gcc failed: exit status 1
/tmp/go-link-241813502/000024.o:在函数‘_cgo_931c1490a0ed_Cfunc_EVP_sm4_ctr’中:
sm4.cgo2.c:(.text+0x321):对‘EVP_sm4_ctr’未定义的引用
collect2: 错误:ld 返回
编译使用的
./config --prefix=/code/git.liangkui.co/ops/cmdb/bk-cmdb/libs/bk-cmdb/src/bin/build/v3.13.9/tongsuo
make -j
make install
tongsuo 是什么版本,我用了 8.4.0 报错了
/home/sirui.liao/.g/versions/1.21.9/pkg/tool/linux_amd64/link: running gcc failed: exit status 1 /tmp/go-link-241813502/000024.o:在函数‘_cgo_931c1490a0ed_Cfunc_EVP_sm4_ctr’中: sm4.cgo2.c:(.text+0x321):对‘EVP_sm4_ctr’未定义的引用 collect2: 错误:ld 返回
编译使用的
./config --prefix=/code/git.liangkui.co/ops/cmdb/bk-cmdb/libs/bk-cmdb/src/bin/build/v3.13.9/tongsuo make -j make install
抱歉,我看到文档了 8.3.2