Files
dragonpilot/third_party/acados/build.sh
Kacper Rączy 45a6834a74 macOS: fix build issues & re-enable CI (#28258)
* Uncomment build_mac job

* Add PYCURL_CURL_CONFIG

* Acados universal binary

* Remove x86 macos references from sconscript

* Add missing include in cabana

* Update cereal

* Update workflow

* Remove unnecessary libpaths for darwin

* Add missing path to cached dirs

* Fix path in cache preparation step

* Add poetry caches to CI cache

* Compile acados with lower deployment target for CI

* Update cereal

* Pass -rpath in linker flags as scons doed not support RPATH on macos

* Use scons api instead of os

* @rpath in install name of acados dylibs

* SConstruct cleanup

* fix liblocationd tests by adding lib suffix based on platform

* Update cereal

* Update opendbc

* Update opendbc

* Add acados gitignore to release files

* Update cereal

* Update cereal

* Add scons_cache to build cache

* Add Caskroom to cache

* Fix typo

* Link all packages at once, instead of one by one

* Run cleanup stage using poetry

* Remove casks from cache

* Move scons cache to separate cache step

* Save scons cache only on master

* Remove restore-keys from save-scons-cache step

* Uncomment if conditions for scons save

* Add gcc-arm-embedded cask cache to cache

* Custom handling of gcc-arm-embedded toolchain cache

* Rename dep cache key

* Exclude .fseventsd from cache

* Fix glob pattern

* Remove .feventsd before caching

* Run mac_setup only if dependency cache-hit != true

* Update cereal to master

* Add overwrite flag to brew link

* Remove manual casadi build from mac_setup

* Remove restore-keys from dependency cache

* Remove linux requirement for casadi

* Restore restore-keys to dependency cache
2023-06-21 13:14:20 -07:00

57 lines
1.6 KiB
Bash
Executable File

#!/usr/bin/env bash
set -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"
fi
ACADOS_FLAGS="-DACADOS_WITH_QPOASES=ON -UBLASFEO_TARGET -DBLASFEO_TARGET=$BLAS_TARGET"
if [[ "$OSTYPE" == "darwin"* ]]; then
ACADOS_FLAGS="$ACADOS_FLAGS -DCMAKE_OSX_ARCHITECTURES=arm64;x86_64 -DCMAKE_MACOSX_RPATH=1"
ARCHNAME="Darwin"
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 --all
git checkout 8ea8827fafb1b23b4c7da1c4cf650de1cbd73584
git submodule update --recursive --init
# build
mkdir -p build
cd build
cmake $ACADOS_FLAGS ..
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 $DIR/acados_template
cp -r $DIR/acados_repo/include $DIR
cp -r $DIR/acados_repo/lib $INSTALL_DIR
cp -r $DIR/acados_repo/interfaces/acados_template/acados_template $DIR/
#pip3 install -e $DIR/acados/interfaces/acados_template
# build tera
cd $DIR/acados_repo/interfaces/acados_template/tera_renderer/
if [[ "$OSTYPE" == "darwin"* ]]; then
cargo build --verbose --release --target aarch64-apple-darwin
cargo build --verbose --release --target x86_64-apple-darwin
lipo -create -output target/release/t_renderer target/x86_64-apple-darwin/release/t_renderer target/aarch64-apple-darwin/release/t_renderer
else
cargo build --verbose --release
fi
cp target/release/t_renderer $INSTALL_DIR/