MAC M1 编译 StarRocks

在 doker 上拉取镜像: https://hub.docker.com/r/starrocks/dev-env-centos7/tags


编译三方依赖 s2geometry-0.9.0 失败,报错如下:

/root/starrocks/thirdparty/installed/include/glog/logging.h:702: undefined reference to `google::base::CheckOpMessageBuilder::NewString[abi:cxx11]()'
/usr/bin/ld: ../libs2testing.a(s2testing.cc.o): in function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >* google::MakeCheckOpString<int, util::math::internal_vector::BasicVector<Vector2, double, 2ul>::{unnamed type#1}>(int const&, util::math::internal_vector::BasicVector<Vector2, double, 2ul>::{unnamed type#1} const&, char const*)':
/root/starrocks/thirdparty/installed/include/glog/logging.h:702: undefined reference to `google::base::CheckOpMessageBuilder::NewString[abi:cxx11]()'
/usr/bin/ld: ../libs2testing.a(s2testing.cc.o):/root/starrocks/thirdparty/installed/include/glog/logging.h:702: more undefined references to `google::base::CheckOpMessageBuilder::NewString[abi:cxx11]()' follow
collect2: error: ld returned 1 exit status
make[2]: *** [examples/CMakeFiles/term_index.dir/build.make:103: examples/term_index] Error 1
make[1]: *** [CMakeFiles/Makefile2:184: examples/CMakeFiles/term_index.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
collect2: error: ld returned 1 exit status
make[2]: *** [examples/CMakeFiles/point_index.dir/build.make:103: examples/point_index] Error 1
make[1]: *** [CMakeFiles/Makefile2:157: examples/CMakeFiles/point_index.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

dev-env-centos7 image already has thirdparty pre built and installed in /var/local/thirdparty/ (get the location by environ variable $STARROCKS_THIRDPARTY)

e.g. for s2geometry-0.9.0, you can find the installed library at /var/local/thirdparty/installed/lib/libs2.a

lack aliyun_oss_jars, output dir only have fe

please check your source code branch and version, ensure you are using the right version and the corresponding dev-env. aliyun_oss_jars related jars already renamed to jindosdk (https://github.com/StarRocks/starrocks/pull/15606).

change dev-evn to 2.5.4


repull tag 2.5.4 from github:

build the code cause next error:

[ 99%] Built target Util
Consolidate compiler generated dependencies of target starrocks_be
[ 99%] Building CXX object src/service/CMakeFiles/starrocks_be.dir/starrocks_main.cpp.o
[100%] Linking CXX executable ../../../output/lib/starrocks_be
/usr/bin/ld: ../../../output/tmp/RELEASE/libGutil.a(ascii_ctype.cc.o): unable to initialize decompress status for section .debug_info
/usr/bin/ld: ../../../output/tmp/RELEASE/libGutil.a(ascii_ctype.cc.o): unable to initialize decompress status for section .debug_info
../../../output/tmp/RELEASE/libGutil.a: error adding symbols: File format not recognized
collect2: error: ld returned 1 exit status
make[2]: *** [../output/lib/starrocks_be] Error 1
make[1]: *** [src/service/CMakeFiles/starrocks_be.dir/all] Error 2
make: *** [all] Error 2

please make sure you are doing a clean build. that is, be/build_<buildtype> is removed in case they were not built from this dev-env environment.

you can join our slack channel to get a much quicker response.

rerun the command : ./build.sh --fe --be --clean , get same error

ps: i can’t register the slack account

looks like killed by OOM. how much memory allocated to the container?

8g

please allocate to 14g or 16g and try again. link of starrocks_be consumes huge amount of memory.

thanks a lot, allocate 16g is work. buf fe can’t start with next error, i alreadly try change port to 19010/19020

 /opt/StarRocks-2.5.4/fe/bin  cat ../log/fe.log                                                                                             ok  at 04:59:29 下午
2023-04-06 16:58:41,184 INFO (main|1) [StarRocksFE.start():110] StarRocks FE starting...
2023-04-06 16:58:41,192 INFO (main|1) [FrontendOptions.initAddrUseIp():236] Use IP init local addr, IP: /192.168.255.10
2023-04-06 16:58:41,427 INFO (main|1) [Auth.grantRoleInternal():779] grant operator to 'root'@'%', isReplay = true
2023-04-06 16:58:41,639 ERROR (main|1) [NodeMgr.getCheckedSelfHostPort():587] edit_log_port 9010 is already in use. will exit.
2023-04-06 16:59:13,882 INFO (main|1) [StarRocksFE.start():110] StarRocks FE starting...
2023-04-06 16:59:13,890 INFO (main|1) [FrontendOptions.initAddrUseIp():236] Use IP init local addr, IP: /192.168.255.10
2023-04-06 16:59:14,122 INFO (main|1) [Auth.grantRoleInternal():779] grant operator to 'root'@'%', isReplay = true
2023-04-06 16:59:14,330 ERROR (main|1) [NodeMgr.getCheckedSelfHostPort():587] edit_log_port 19010 is already in use. will exit.
2023-04-06 16:59:30,511 INFO (main|1) [StarRocksFE.start():110] StarRocks FE starting...
2023-04-06 16:59:30,518 INFO (main|1) [FrontendOptions.initAddrUseIp():236] Use IP init local addr, IP: /192.168.255.10
2023-04-06 16:59:30,754 INFO (main|1) [Auth.grantRoleInternal():779] grant operator to 'root'@'%', isReplay = true
2023-04-06 16:59:30,964 ERROR (main|1) [NodeMgr.getCheckedSelfHostPort():587] edit_log_port 19020 is already in use. will exit.

suppose you are starting the fe process in container env under output/fe directory, with bash ./bin/start_fe.sh, right?

you can check the port occupation with netstat -anp -A inet | grep LISTEN, get the process who are using the port.

i have copy the output file to local, and run start_fe.sh , no process use port 9010

if you have multiple network interfaces, fe process may not correctly find the interface you are using, you can edit fe.conf, set priority_networks configure option to the correct one. check if the following doc can help. https://docs.starrocks.io/en-us/latest/quick_start/Deploy#step-2-start-the-fe-node

thanks alot ,i quit the vpn , fe is fine

@lvlouisaslia i try to start be, but get next exception:

mac m1 have no such file : /sys/fs/cgroup /proc/meminfo
and cannot execute starts_be file

the binary built in docker env, can be only running in docker env.