arm架构下编译starrocks失败

操作系统:openEuler 20.03 64bit with ARM
手动编译starrocks的第三方依赖aws-sdk-cpp-1.9.179时报错:

[ 62%] Building C object crt/aws-crt-cpp/crt/s2n/CMakeFiles/s2n.dir/utils/s2n_timer.c.o
<command-line>: warning: "_POSIX_C_SOURCE" redefined
<command-line>: note: this is the location of the previous definition
[ 63%] Linking C static library ../../../../lib/libs2n.a
[ 63%] Built target s2n
[ 64%] Building C object crt/aws-crt-cpp/crt/aws-c-io/CMakeFiles/aws-c-io.dir/source/alpn_handler.c.o
[ 64%] Building C object crt/aws-crt-cpp/crt/aws-c-io/CMakeFiles/aws-c-io.dir/source/channel.c.o
[ 64%] Building C object crt/aws-crt-cpp/crt/aws-c-io/CMakeFiles/aws-c-io.dir/source/channel_bootstrap.c.o
[ 64%] Building C object crt/aws-crt-cpp/crt/aws-c-io/CMakeFiles/aws-c-io.dir/source/event_loop.c.o
[ 64%] Building C object crt/aws-crt-cpp/crt/aws-c-io/CMakeFiles/aws-c-io.dir/source/exponential_backoff_retry_strategy.c.o
[ 65%] Building C object crt/aws-crt-cpp/crt/aws-c-io/CMakeFiles/aws-c-io.dir/source/file_utils_shared.c.o
[ 65%] Building C object crt/aws-crt-cpp/crt/aws-c-io/CMakeFiles/aws-c-io.dir/source/host_resolver.c.o
[ 65%] Building C object crt/aws-crt-cpp/crt/aws-c-io/CMakeFiles/aws-c-io.dir/source/io.c.o
[ 65%] Building C object crt/aws-crt-cpp/crt/aws-c-io/CMakeFiles/aws-c-io.dir/source/linux/epoll_event_loop.c.o
[ 65%] Building C object crt/aws-crt-cpp/crt/aws-c-io/CMakeFiles/aws-c-io.dir/source/message_pool.c.o
[ 66%] Building C object crt/aws-crt-cpp/crt/aws-c-io/CMakeFiles/aws-c-io.dir/source/pem_utils.c.o
[ 66%] Building C object crt/aws-crt-cpp/crt/aws-c-io/CMakeFiles/aws-c-io.dir/source/pki_utils.c.o
[ 66%] Building C object crt/aws-crt-cpp/crt/aws-c-io/CMakeFiles/aws-c-io.dir/source/posix/file_utils.c.o
[ 66%] Building C object crt/aws-crt-cpp/crt/aws-c-io/CMakeFiles/aws-c-io.dir/source/posix/host_resolver.c.o
/root/starrocks-2.3.6/thirdparty/src/aws-sdk-cpp-1.9.179/crt/aws-crt-cpp/crt/aws-c-io/source/posix/host_resolver.c: In function ‘aws_default_dns_resolve’:
/root/starrocks-2.3.6/thirdparty/src/aws-sdk-cpp-1.9.179/crt/aws-crt-cpp/crt/aws-c-io/source/posix/host_resolver.c:37:21: error: storage size of ‘hints’ isn’t known
   37 |     struct addrinfo hints;
      |                     ^~~~~
/root/starrocks-2.3.6/thirdparty/src/aws-sdk-cpp-1.9.179/crt/aws-crt-cpp/crt/aws-c-io/source/posix/host_resolver.c:41:22: error: ‘AI_ALL’ undeclared (first use in this function); did you mean ‘AF_ALG’?
   41 |     hints.ai_flags = AI_ALL | AI_V4MAPPED;
      |                      ^~~~~~
      |                      AF_ALG
/root/starrocks-2.3.6/thirdparty/src/aws-sdk-cpp-1.9.179/crt/aws-crt-cpp/crt/aws-c-io/source/posix/host_resolver.c:41:22: note: each undeclared identifier is reported only once for each function it appears in
/root/starrocks-2.3.6/thirdparty/src/aws-sdk-cpp-1.9.179/crt/aws-crt-cpp/crt/aws-c-io/source/posix/host_resolver.c:41:31: error: ‘AI_V4MAPPED’ undeclared (first use in this function)
   41 |     hints.ai_flags = AI_ALL | AI_V4MAPPED;
      |                               ^~~~~~~~~~~
/root/starrocks-2.3.6/thirdparty/src/aws-sdk-cpp-1.9.179/crt/aws-crt-cpp/crt/aws-c-io/source/posix/host_resolver.c:43:20: warning: implicit declaration of function ‘getaddrinfo’ [-Wimplicit-function-declaration]
   43 |     int err_code = getaddrinfo(hostname_cstr, NULL, &hints, &result);
      |                    ^~~~~~~~~~~
/root/starrocks-2.3.6/thirdparty/src/aws-sdk-cpp-1.9.179/crt/aws-crt-cpp/crt/aws-c-io/source/posix/host_resolver.c:51:50: error: invalid use of undefined type ‘struct addrinfo’
   51 |     for (iter = result; iter != NULL; iter = iter->ai_next) {
      |                                                  ^~
/root/starrocks-2.3.6/thirdparty/src/aws-sdk-cpp-1.9.179/crt/aws-crt-cpp/crt/aws-c-io/source/posix/host_resolver.c:56:17: error: invalid use of undefined type ‘struct addrinfo’
   56 |         if (iter->ai_family == AF_INET6) {
      |                 ^~
/root/starrocks-2.3.6/thirdparty/src/aws-sdk-cpp-1.9.179/crt/aws-crt-cpp/crt/aws-c-io/source/posix/host_resolver.c:58:27: error: invalid use of undefined type ‘struct addrinfo’
   58 |             inet_ntop(iter->ai_family, &((struct sockaddr_in6 *)iter->ai_addr)->sin6_addr, address_buffer, max_len);
      |                           ^~
/root/starrocks-2.3.6/thirdparty/src/aws-sdk-cpp-1.9.179/crt/aws-crt-cpp/crt/aws-c-io/source/posix/host_resolver.c:58:69: error: invalid use of undefined type ‘struct addrinfo’
   58 |             inet_ntop(iter->ai_family, &((struct sockaddr_in6 *)iter->ai_addr)->sin6_addr, address_buffer, max_len);
      |                                                                     ^~
/root/starrocks-2.3.6/thirdparty/src/aws-sdk-cpp-1.9.179/crt/aws-crt-cpp/crt/aws-c-io/source/posix/host_resolver.c:61:27: error: invalid use of undefined type ‘struct addrinfo’
   61 |             inet_ntop(iter->ai_family, &((struct sockaddr_in *)iter->ai_addr)->sin_addr, address_buffer, max_len);
      |                           ^~
/root/starrocks-2.3.6/thirdparty/src/aws-sdk-cpp-1.9.179/crt/aws-crt-cpp/crt/aws-c-io/source/posix/host_resolver.c:61:68: error: invalid use of undefined type ‘struct addrinfo’
   61 |             inet_ntop(iter->ai_family, &((struct sockaddr_in *)iter->ai_addr)->sin_addr, address_buffer, max_len);
      |                                                                    ^~
[ 66%] Building C object crt/aws-crt-cpp/crt/aws-c-io/CMakeFiles/aws-c-io.dir/source/posix/pipe.c.o
/root/starrocks-2.3.6/thirdparty/src/aws-sdk-cpp-1.9.179/crt/aws-crt-cpp/crt/aws-c-io/source/posix/host_resolver.c:94:5: warning: implicit declaration of function ‘freeaddrinfo’ [-Wimplicit-function-declaration]
   94 |     freeaddrinfo(result);
      |     ^~~~~~~~~~~~
/root/starrocks-2.3.6/thirdparty/src/aws-sdk-cpp-1.9.179/crt/aws-crt-cpp/crt/aws-c-io/source/posix/host_resolver.c:104:18: error: ‘EAI_FAIL’ undeclared (first use in this function)
  104 |             case EAI_FAIL:
      |                  ^~~~~~~~
/root/starrocks-2.3.6/thirdparty/src/aws-sdk-cpp-1.9.179/crt/aws-crt-cpp/crt/aws-c-io/source/posix/host_resolver.c:105:18: error: ‘EAI_AGAIN’ undeclared (first use in this function); did you mean ‘TRY_AGAIN’?
  105 |             case EAI_AGAIN:
      |                  ^~~~~~~~~
      |                  TRY_AGAIN
/root/starrocks-2.3.6/thirdparty/src/aws-sdk-cpp-1.9.179/crt/aws-crt-cpp/crt/aws-c-io/source/posix/host_resolver.c:107:18: error: ‘EAI_MEMORY’ undeclared (first use in this function)
  107 |             case EAI_MEMORY:
      |                  ^~~~~~~~~~
/root/starrocks-2.3.6/thirdparty/src/aws-sdk-cpp-1.9.179/crt/aws-crt-cpp/crt/aws-c-io/source/posix/host_resolver.c:109:18: error: ‘EAI_NONAME’ undeclared (first use in this function)
  109 |             case EAI_NONAME:
      |                  ^~~~~~~~~~
/root/starrocks-2.3.6/thirdparty/src/aws-sdk-cpp-1.9.179/crt/aws-crt-cpp/crt/aws-c-io/source/posix/host_resolver.c:110:18: error: ‘EAI_SERVICE’ undeclared (first use in this function)
  110 |             case EAI_SERVICE:
      |                  ^~~~~~~~~~~
/root/starrocks-2.3.6/thirdparty/src/aws-sdk-cpp-1.9.179/crt/aws-crt-cpp/crt/aws-c-io/source/posix/host_resolver.c:37:21: warning: unused variable ‘hints’ [-Wunused-variable]
   37 |     struct addrinfo hints;
      |                     ^~~~~
make[2]: *** [crt/aws-crt-cpp/crt/aws-c-io/CMakeFiles/aws-c-io.dir/build.make:258: crt/aws-crt-cpp/crt/aws-c-io/CMakeFiles/aws-c-io.dir/source/posix/host_resolver.c.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/Makefile2:484: crt/aws-crt-cpp/crt/aws-c-io/CMakeFiles/aws-c-io.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
[root@ecs-2b7a thirdparty]# 

可以使用docker进行编译,可以参考下该贴: (123条消息) 第6.3章:ARM架构下手动编译StarRocks(拓展篇)_流木随风的博客-CSDN博客_starrocks 编译

openeuler的操作系统,在centos环境的容器内编译出来的可执行文件,在openeuler下运行,不会有问题吧?

建议在官方提供的容器环境里编译, 并在容器环境里测试运行. 由于starRocks依赖的三方库较多, 每个Linux发行版本带的gcc/g++以及相关的依赖安装都有差异, 很难做到通用. 我们只能保证在我们支持的环境里编译没有问题.

您遇到的这个编译问题, 看上去像是aws-sdk的源码patch没有正常打上. 可以尝试删除thirdparty/src/aws-sdk-cpp-1.9.179, 再重试看看.

可以参考这个进行编译,推荐使用文章中提到的容器环境:https://www.inlighting.org/archives/setup-perfect-starrocks-dev-env