Nebula v3.0三方件在arm环境上的fbthrift编译问题

编译环境:
gcc:9.3.0
ldd version:2.28
arm环境:4.19.36-vhulk1907.1.0.h619.eulerosv2r8.aarch64

请问一下大家,在arm环境中编译nebula-third-party-v3.0的时候,在fbthrift阶段出现以下报错的话,有可能是什么原因导致的呢?有什么办法可以解决?谢谢 :pray: :pray:

source/nebula/third-party/nebula-third-party-3.0/build/build/fbthrift/source/thrift/lib/cpp/transport/TFDTransport.cpp:39:42:warning: 'bool std::uncaught_exception()' is deprecated [-Wdeprecated-declarations]
    39 | if (rv < 0 && !std::uncaught_exception()) {
         |                                                              ^
In file included from source/nebula/third-party/gcc/vesoft/toolset/gcc/9.3.0/include/c++/9.3.0/new:40,
                                source/nebula/third-party/gcc/vesoft/toolset/gcc/9.3.0/include/c++/9.3.0/ext/new_allocator.h:33,
                                source/nebula/third-party/gcc/vesoft/toolset/gcc/9.3.0/include/c++/9.3.0/aarch64-vesoft-linux/bits/c++allocator.h:33,
                                source/nebula/third-party/gcc/vesoft/toolset/gcc/9.3.0/include/c++/9.3.0/bits/allocator.h:46,
                                source/nebula/third-party/gcc/vesoft/toolset/gcc/9.3.0/include/c++/9.3.0/string:41,
                                source/nebula/third-party/nebula-third-party-3.0/build/build/fbthrift/source/thrift/lib/cpp/transport/TFDTransport.h:20,
                                source/nebula/third-party/nebula-third-party-3.0/build/build/fbthrift/source/thrift/lib/cpp/transport/TFDTransport.cpp:17:
source/nebula/third-party/gcc/vesoft/toolset/gcc/9.3.0/include/c++/9.3.0/exception:102:8: note: declared here
    102 | bool uncaught_exception() _GLIBCXX_USE_NOEXCEPT __atrribute__ ((__pre__));
           |         ^~~~~~~~~~~~~~~
In file included from source/nebula/third-party/nebula-third-party-3.0/build/build/fbthrift/source/thrift/lib/cpp2/frozen/Frozen.cpp:17:
source/nebula/third-party/nebula-third-party-3.0/build/build/fbthrift/source/thrift/lib/cpp2/frozen/Frozen.h: In function 'void apache::thrift::frozen::thawField(apache::thrift::frozen::ViewPosition, const apache::thrift::frozen::Field<T>&, apache::thrift::field_ref<T&>)':
source/nebula/third-party/nebula-third-party-3.0/build/build/fbthrift/source/thrift/lib/cpp2/frozen/Frozen.h:1051:5: warning: 'apache::thrift::unset_unsafe' is deprecated: Use `reset` to clear Thrift fields. [-Wdeprecated-declarations]
    1050 | unset_unsafe(ref);
             | ^~~~~~~~~~
In file included from source/nebula/third-party/nebula-third-party-3.0/build/build/fbthrift/source/thrift/lib/cpp2/gen/module_types_h.h:29,
                                source/nebula/third-party/nebula-third-party-3.0/build/build/fbthrift/source/thrift/lib/thrift/gen-cpp2/frozen_types.h:9,
                                source/nebula/third-party/nebula-third-party-3.0/build/build/fbthrift/source/thrift/lib/cpp2/frozen/schema/MemorySchema.h:26,
                                source/nebula/third-party/nebula-third-party-3.0/build/build/fbthrift/source/thrift/lib/cpp2/frozen/Frozen.h:49,
                                source/nebula/third-party/nebula-third-party-3.0/build/build/fbthrift/source/thrift/lib/cpp2/frozen/Frozen.cpp:17:
source/nebula/third-party/nebula-third-party-3.0/build/build/fbthrift/source/thrift/lib/cpp2/FieldRef.h:1017:51: note: declared here
      1017 | constexpr apache::thrift::detail::unset_unsafe_fn unset_unsafe;
               |                                                                               ^~~~~~~~~~
In file included source/nebula/third-party/nebula-third-party-3.0/build/build/fbthrift/source/thrift/lib/cpp2/frozen/FrozenUtil.h:24,
                       source/nebula/third-party/nebula-third-party-3.0/build/build/fbthrift/source/thrift/lib/cpp2/frozen/FrozenUtil.cpp:17:
source/nebula/third-party/nebula-third-party-3.0/build/build/fbthrift/source/thrift/lib/cpp2/frozen/Frozen.h: In function 'void apache::thrift::frozen::thawField(apache::thrift::frozen::ViewPosition, const apache::thrift::frozen::Field<T>&, apache::thrift::field_ref<T&>':
source/nebula/third-party/nebula-third-party-3.0/build/build/fbthrift/source/thrift/lib/cpp2/frozen/Frozen.h:1051:5: warning: 'apache::thrift::unset_unsafe' is deprecated: Use `reset` to clear Thrift fields. [-Wdeprecated-declarations]

不要意思报错日志没有填完整,最终的error报错日志如下:

g++: fatal error: Killed signal terminated program cclplus
compilation terminated
make[5]: *** [thrift/lib/cpp2/CMakeFiles/thriftcpp2.dir/build.make:286: thrift/lib/cpp2/CMakeFiles/thriftcpp2.dir/async/HeaderClientChannel.cop.o] Error 1

你好,请问一下这个glog的编译报错,可以怎么解决呢,我是用的nebula-third-party-3.0.tar,gcc版本是9.3.0

报错日志呢?

和上面的报错日志是一样的报错,也是

请补充使用的分支和commit ID,操作系统版本和gcc/cmake版本,这可能是一个已经修复过的问题

另外你可以核对一下编译log,如果在libunwind之后编译glog遇到这个问题的话,可以在glog的cmake里添加一行: -DCMAKE_EXE_LINKER_FLAGS=-lz 具体可以参考 https://github.com/vesoft-inc/nebula-third-party/blob/master/project/externals/glog.cmake

使用的分支是https://github.com/vesoft-inc/nebula-third-party/tree/v3.0,你说的commitID是指?

那我先试一下在cmake中增加这一行FLAGS,谢谢大佬:pray:

3.0的分支没有合入这个bug fix,你按我上面的方法改就行了。编译的机器上需要安装zlib-devel

谢谢大佬,glog的问题已经顺利解决,可以麻烦大佬再看一个问题吗?

就是在编译到berkeleydb的时候,因为${sys_info}是空的,导致出现了configure:error:cannot guess build type;you must specify one

请问一下这里是可以我直接改为指定的arm-linux,还是说一定要用config_guess返回的结果sys_info呢?

你config.guess返回的结果是什么? 如果type正确的话就用呗

3.0我们在aarch64上也编译过是OK的,另外现在的arm处理器普遍是arm64(aarch64)了,请确认你使用的是arm还是arm64,通常arm指的是arm架构或者32bit的arm指令集(armv7及以前版本)

返回为空了,所以不知道这个type可不可以手动填上。我是用的是arm64,既然config-guess结果为空,那我是不是可以手动写上build-type=arm-linux呢

arm64上config-guess一般返回的格式是aarch64-unknown-linux-gnu、aarch64-linux-gnu
可以手动传入,不过我很在意如果你手动执行config guess脚本也会返回空吗?在我们的arm64上编译是没这个问题的。

我直接将config guess的返回值${sys_info}打印了出来,确实是空的,所以我就手动输入了;如果这个config guess返回为空,会对后续的编译或者功能有影响吗?

返回空会影响编译对目标系统的判断。举个例子比如openssl,如果返回空可能就不知道匹配哪个架构、系统了。最好的结果可能就是匹配到Linux通用版本上,这个target没有用到任何特定架构处理器的优化,性能肯定要差一些的。

这个帖子的内容两个地方分发了,我把另外个地方的帖子合并过来了,另外个帖子关了 cc @特工聋聋龙 @George 。顺便 聋聋龙,下次如果你已经开了个问题贴,就不要在别的地方发相同的问题了(省的多处提问信息不同步)

fbthrift的报错看起来是警告,我之前编译的时候没遇到过这个问题。稍晚一点时候我用centos8测一下,另外也建议你用centos8编译。glibc版本一致就行,有时候国产系统上可能会因为一些其他地方的差异导致编不过。

1 个赞

嗯嗯,最后看出来是内存不够了。那我先试着把当前的路走通,再去试试centos8

还有一个问题想继续请教大佬,就是在最后打包的时候,出现了这个报错

source/nebula/third-party/gcc/vesoft/toolset/gcc/9.3.0/bin/…/libexec/gcc/aarch64-vesoft-linux/9.3.0/ld.bfd: StorageDaemon.cop:(.text+0x58): warning: too many GOT entries for -flic, please recompile with -fPIC
source/nebula/third-party/gcc/vesoft/toolset/gcc/9.3.0/bin/…/libexec/gcc/aarch64-vesoft-linux/9.3.0/ld.bfd: final link failed: symbol needs debug section which does not exist
collect2: error: Id return 1 exist status
[src/daemons/CMakeFiles/nebula-storaged.dir/build.make:632: bin/nebula-storaged] Error 1
[CMakeFiles/Makefile2: 6625: src/daemons/CMakeFiles/nebula-storaged.dir/all] Error 2

请问这个错误是哪里的link不对了呢?是不是按照警告中提示那样,用-fPIC重新编译就没问题了?

你这是在编译nebula本身了,不是third party了。你可以添加-fPIC,不过我想知道你是怎么编译的?请给出cmake、build命令

以下是我编译使用的代码:

export CXXFLAGS=“-fatback-protector-strong -fpie -pie -Wl,-z,relro,-z,now -Wl,-z,noexecstack -s -D_FORTIFY_SOURCE=2 -O2 -ftrapv -fstack-check -std=c++11”
export CFLAGS=“-fatback-protector-strong -fpie -pie -Wl,-z,relro,-z,now -Wl,-z,noexecstack -s -D_FORTIFY_SOURCE=2 -O2 -ftrapv -fstack-check”
export CMAKE_CXX_FLAGS=“-fatback-protector-strong -fpie -pie -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack -s -D_FORTIFY_SOURCE=2 -O2 -ftrapv -fstack-check -std=c++11”
export CMAKE_C_FLAGS=“-fatback-protector-strong -fpie -pie -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack -s -D_FORTIFY_SOURCE=2 -O2 -ftrapv -fstack-check”

CMAKE -DCMAKE_INSTALL_PREFIX=nebula/target -DNEBULA_THIRDPARTY_ROOT=nebula/third-party/vesoft-third-party -DENABLE_BUILD_STORAGE=on -DENABLE_TESTING=off -DCMAKE_BUILD_TYPE=release …
make -j3
make install