mirror of
https://github.com/MoreTore/openpilot.git
synced 2026-08-03 08:41:47 +08:00
d653dd843a
* change acados version to finalized PR https://github.com/acados/acados/pull/791 * acados: update include and x86_64 build * acados: update pyextra * adapt mpc files to updated acados * acados buid: clear acados_template and include dir before updating * update acados again * acados MPC: only generate solver, building is done via scons * update acados to latest acados/master * c3 libs * c2 libs * acados scons files: add acados build script as a dependency * acados scons files: add libacados.so and ocp_nlp_interface.h, build script not in files_common * update acados * adapts long & lat MPC file * update acados reference commit to acados/master Co-authored-by: Comma Device <device@comma.ai>
78 lines
2.1 KiB
Bash
Executable File
78 lines
2.1 KiB
Bash
Executable File
#!/usr/bin/bash -e
|
|
|
|
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)"
|
|
|
|
ARCHNAME="x86_64"
|
|
BLAS_TARGET="X64_AUTOMATIC"
|
|
if [ -f /TICI ]; then
|
|
ARCHNAME="larch64"
|
|
BLAS_TARGET="ARMV8A_ARM_CORTEX_A57"
|
|
elif [ -f /EON ]; then
|
|
ARCHNAME="aarch64"
|
|
BLAS_TARGET="ARMV8A_ARM_CORTEX_A57"
|
|
fi
|
|
|
|
if [ ! -d acados_repo/ ]; then
|
|
git clone https://github.com/acados/acados.git $DIR/acados_repo
|
|
# git clone https://github.com/commaai/acados.git $DIR/acados_repo
|
|
fi
|
|
cd acados_repo
|
|
git fetch
|
|
git checkout 105e06df87f06ea02df4af825867c946b31defdd
|
|
git submodule update --recursive --init
|
|
|
|
# build
|
|
mkdir -p build
|
|
cd build
|
|
cmake -DACADOS_WITH_QPOASES=ON -UBLASFEO_TARGET -DBLASFEO_TARGET=$BLAS_TARGET ..
|
|
make -j20 install
|
|
|
|
INSTALL_DIR="$DIR/$ARCHNAME"
|
|
rm -rf $INSTALL_DIR
|
|
mkdir -p $INSTALL_DIR
|
|
|
|
rm $DIR/acados_repo/lib/*.json
|
|
|
|
rm -rf $DIR/include
|
|
cp -r $DIR/acados_repo/include $DIR
|
|
cp -r $DIR/acados_repo/lib $INSTALL_DIR
|
|
rm -rf $DIR/../../pyextra/acados_template
|
|
cp -r $DIR/acados_repo/interfaces/acados_template/acados_template $DIR/../../pyextra
|
|
#pip3 install -e $DIR/acados/interfaces/acados_template
|
|
|
|
# hack to workaround no rpath on android
|
|
if [ -f /EON ]; then
|
|
pushd $INSTALL_DIR/lib
|
|
for lib in $(ls .); do
|
|
if ! readlink $lib; then
|
|
patchelf --set-soname $PWD/$lib $lib
|
|
|
|
if [ "$lib" = "libacados.so" ]; then
|
|
for nlib in "libhpipm.so" "libblasfeo.so" "libqpOASES_e.so.3.1"; do
|
|
patchelf --replace-needed $nlib $PWD/$nlib $lib
|
|
done
|
|
fi
|
|
|
|
if [ "$lib" = "libhpipm.so" ]; then
|
|
patchelf --replace-needed libblasfeo.so $PWD/libblasfeo.so $lib
|
|
fi
|
|
|
|
# pad extra byte to workaround bionic linker bug
|
|
# https://android.googlesource.com/platform/bionic/+/93ce35434ca5af43a7449e289959543f0a2426fa%5E%21/#F0
|
|
dd if=/dev/zero bs=1 count=1 >> $lib
|
|
fi
|
|
done
|
|
popd
|
|
|
|
cd $DIR
|
|
git checkout $INSTALL_DIR/t_renderer
|
|
fi
|
|
|
|
# build tera
|
|
# build with commaai/termux-packages for NEOS
|
|
if [ ! -f /EON ]; then
|
|
cd $DIR/acados_repo/interfaces/acados_template/tera_renderer/
|
|
cargo build --verbose --release
|
|
cp target/release/t_renderer $INSTALL_DIR/
|
|
fi
|