当前位置:网站首页>Transplant grpc to arm board
Transplant grpc to arm board
2022-07-21 21:34:00 【GZVIMMY】
One . Premise
The platform used in this project
The root file system used in this project is officially provided , use busybox To make the ( Unlike Ubuntu The root file system is so easy to use , What you want, what you need , Can't flash The relatively small )
The key point here is glibc Version of , Because a higher version of cross compilation tool was used to compile grpc library , So I have to remake the root file system ( hole ) , Comrades who stepped on this pit please look ubuntu Root file system scheme
Two . Remake ubuntu Root file system scheme
Make ubuntu The root file system UBI Format , It is recommended to directly use official tools to create images
Reference resources :
(330 Bar message ) AM335X How to run ubuntu System ( One ), Make _szembed The blog of -CSDN Blog
sudo mkfs.ubifs -F -q -r rootfs/ -m 4096 -e 253952 -c 1980 -o ubuntu.img
[ubifs]
mode=ubi
image=ubifs.img
vol_id=0
vol_size=100MiB
vol_type=dynamic
vol_alignment=1
vol_name=rootfs
vol_flags=autoresize
ubinize -o rootfs_ubuntu.img -O 4096 -m 4096 -p 256KiB -s 1024 ubivolume.cfg
ubuntu Ready to , transplant grpc See below for the steps
3、 ... and . Main dish : transplant grpc
1. Reinstall the cross compiler
Download the official , then ln Making soft links
2. Cross compilation grpc
# Write a toolchain file to use for cross-compiling.
cat > /tmp/toolchain.cmake <<'EOT'
SET(CMAKE_SYSTEM_NAME Linux)
SET(CMAKE_SYSTEM_PROCESSOR arm)
set(CMAKE_STAGING_PREFIX /usr/lib/gcc-cross/arm-linux-gnueabihf/11)
set(CMAKE_C_COMPILER arm-linux-gcc)
set(CMAKE_CXX_COMPILER arm-linux-g++)
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
EOT
# Build and install gRPC for ARM.
# This build will use the host architecture copies of protoc and
# grpc_cpp_plugin that we built earlier because we installed them
# to a location in our PATH (/usr/local/bin).
mkdir -p "cmake/build_arm"
pushd "cmake/build_arm"
cmake -DCMAKE_TOOLCHAIN_FILE=/tmp/toolchain.cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr/lib/gcc-cross/arm-linux-gnueabihf/11 \
../..
make "-j${GRPC_CPP_DISTRIBTEST_BUILD_COMPILER_JOBS}" install
popd
# Build helloworld example for ARM.
# As above, it will find and use protoc and grpc_cpp_plugin
# for the host architecture.
mkdir -p "examples/cpp/helloworld/cmake/build_arm"
pushd "examples/cpp/helloworld/cmake/build_arm"
cmake -DCMAKE_TOOLCHAIN_FILE=/tmp/toolchain.cmake \
-DCMAKE_BUILD_TYPE=Release \
-Dabsl_DIR=/tmp/stage/lib/cmake/absl \
-DProtobuf_DIR=/tmp/stage/lib/cmake/protobuf \
-DgRPC_DIR=/tmp/stage/lib/cmake/grpc \
../..
make "-j${GRPC_CPP_DISTRIBTEST_BUILD_COMPILER_JOBS}"
popd
Because the official routine is statically compiled , Run right away
边栏推荐
- [MySQL] detailed summary of MySQL internal and external connections
- PostgreSQL new user login error: fatal: peer authentication failed for user "test“
- New features of flutter2
- (note) Wu Enda deep learning L4 convolutional neural network W1
- [pytorch tutorial] 06- how to use pytorch to build a neural network model and train it
- vi/vim基本命令
- Mqtt (mosquitto) basic configuration
- Amy Tabb robot world hand eye calibration (2. Experimental results)
- 使用 JDBCUtil完成数据库增删改查
- Centos7上的PostgreSQL开启SSL配置
猜你喜欢
Wu Enda deep learning l4w3 target detection
为什么 Activity 都重建了 ViewModel 还存在?—— Jetpack 系列
Qualcomm CAMX debug log control
IMPALA-SHELL导出Kudu上的900多万级别表(下)_完成传输
列表分页接口有哪些方案,你知道吗?
LiveData 还有学习的必要吗?—— Jetpack 系列(2)
在AZURE SQL DB/MI上查询SQL死锁详情
在Azure Synapse Analytics(专用 SQL 池)中对表进行分区
记一次 kotlin 在 MutableList 中使用 remove 引发的问题
[MySQL] detailed summary of natural connection and using connection of MySQL
随机推荐
手机Camera是怎么玩的?
Mqtt (mosquitto) basic configuration
在Azure Synapse Analytics(专用 SQL 池)中对表进行分区
【乐视云学习笔记】关于Letv乐视云点播的视频暂停之后,按home回到桌面后重新onResume回到Activity,视频自动播放的情况
【PyTorch教程】01-如何创建和初始化Pytoch张量 (2022年最新)
How to judge code quality
Take you to customize the gradle plug-in by hand - gradle series (2)
Dart 基础概念和内部原理
Flutter实战-StatefulWidget
MySQL 常见错误处理
Basic concepts and internal principles of dart
Centos7上的PostgreSQL开启SSL配置
Azure Synapse Analytics(Azure SQL DW)中建表语句的注意事项
[MySQL] detailed summary of MySQL internal and external connections
SQL SERVER索引基础详解___概念及原理
[MySQL] classification des requêtes Multi - tables 2: auto - connectées et non - connectées
Sketch map of shutter curves animation curve
Data storage scheme (I) - file storage and SharedPreferences storage
GIS wkb/ewkb structure
【MySQL】多表查询的分类1:等值连接和非等值连接