-
Notifications
You must be signed in to change notification settings - Fork 2
/
build-rm.sh
executable file
·26 lines (19 loc) · 1.08 KB
/
build-rm.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/bash
set -e
if [ -z "${RM_TOOLCHAIN+x}" ]; then
echo "Set the RM_TOOLCHAIN env var to the toolchain path!"
exit 1
fi
# Set up env vars from the standard rm toolchain
source $RM_TOOLCHAIN/environment-setup-cortexa7hf-neon-remarkable-linux-gnueabi
set -euo pipefail
# This is needed to cross-build with bindgen
export BINDGEN_EXTRA_CLANG_ARGS="\
-I$RM_TOOLCHAIN/sysroots/cortexa7hf-neon-remarkable-linux-gnueabi/usr/include/c++/9.3.0\
-I$RM_TOOLCHAIN/sysroots/cortexa7hf-neon-remarkable-linux-gnueabi/usr/include\
-I$RM_TOOLCHAIN/sysroots/cortexa7hf-neon-remarkable-linux-gnueabi/usr/include/c++/9.3.0/arm-remarkable-linux-gnueabi"
# --sysroot=$RM_TOOLCHAIN/sysroots/cortexa9hf-neon-remarkable-linux-gnueabi"
# Arguments for the tensorflow build in the build.rs file of tflite-rs.
export TFLITE_RS_MAKE_TARGET_TOOLCHAIN_PREFIX="arm-remarkable-linux-gnueabi-"
export TFLITE_RS_MAKE_EXTRA_CFLAGS="-mfpu=neon -mfloat-abi=hard -mcpu=cortex-a9 --sysroot=$RM_TOOLCHAIN/sysroots/cortexa7hf-neon-remarkable-linux-gnueabi"
exec cargo build --release --target armv7-unknown-linux-gnueabihf $@