|
| 1 | +#!/bin/bash |
| 2 | +# Runs as CIBW_BEFORE_ALL inside the manylinux container. |
| 3 | +# Installs C++ dependencies via micromamba and builds all roboplan sub-packages |
| 4 | +# so that the bindings wheel can find them via CMAKE_PREFIX_PATH. |
| 5 | +set -euxo pipefail |
| 6 | + |
| 7 | +PROJECT_DIR="${1:-/project}" |
| 8 | +CONDA_ENV="/opt/cibw_env" |
| 9 | +INSTALL_PREFIX="/opt/roboplan_deps" |
| 10 | + |
| 11 | +# --------------------------------------------------------------------------- |
| 12 | +# 1. Install micromamba (static binary, works in any Linux container) |
| 13 | +# --------------------------------------------------------------------------- |
| 14 | +curl -Ls https://micro.mamba.pm/api/micromamba/linux-64/latest \ |
| 15 | + | tar -xvj -C /usr/local bin/micromamba |
| 16 | + |
| 17 | +# --------------------------------------------------------------------------- |
| 18 | +# 2. Create conda environment with all C++ build + runtime dependencies. |
| 19 | +# - osqp-eigen / libtoppra are NOT listed here; roboplan_oink and |
| 20 | +# roboplan_toppra fall back to FetchContent when they are absent, so |
| 21 | +# cmake will download and build them automatically. |
| 22 | +# --------------------------------------------------------------------------- |
| 23 | +/usr/local/bin/micromamba create \ |
| 24 | + --prefix "$CONDA_ENV" \ |
| 25 | + --channel conda-forge \ |
| 26 | + --yes \ |
| 27 | + "cmake>=3.22" ninja \ |
| 28 | + "gcc>=11,<12" "gxx>=11,<12" \ |
| 29 | + "eigen>=3.4" \ |
| 30 | + "pinocchio>=3.9.0,<4" \ |
| 31 | + "yaml-cpp>=0.8" |
| 32 | + |
| 33 | +CMAKE="$CONDA_ENV/bin/cmake" |
| 34 | +GCC="$CONDA_ENV/bin/gcc" |
| 35 | +GXX="$CONDA_ENV/bin/g++" |
| 36 | + |
| 37 | +# --------------------------------------------------------------------------- |
| 38 | +# 3. Build and install every roboplan sub-package. |
| 39 | +# Order mirrors pixi.toml build_all task. |
| 40 | +# --------------------------------------------------------------------------- |
| 41 | +build_and_install() { |
| 42 | + local NAME="$1" |
| 43 | + "$CMAKE" \ |
| 44 | + -GNinja \ |
| 45 | + -S "$PROJECT_DIR/$NAME" \ |
| 46 | + -B "/tmp/build/$NAME" \ |
| 47 | + -DCMAKE_BUILD_TYPE=Release \ |
| 48 | + -DBUILD_TESTING=OFF \ |
| 49 | + "-DCMAKE_INSTALL_PREFIX=$INSTALL_PREFIX" \ |
| 50 | + "-DCMAKE_PREFIX_PATH=$CONDA_ENV;$INSTALL_PREFIX" \ |
| 51 | + "-DCMAKE_C_COMPILER=$GCC" \ |
| 52 | + "-DCMAKE_CXX_COMPILER=$GXX" |
| 53 | + "$CMAKE" --build "/tmp/build/$NAME" --parallel "$(nproc)" |
| 54 | + "$CMAKE" --install "/tmp/build/$NAME" |
| 55 | +} |
| 56 | + |
| 57 | +build_and_install roboplan_example_models |
| 58 | +build_and_install roboplan |
| 59 | +build_and_install roboplan_simple_ik |
| 60 | +build_and_install roboplan_oink |
| 61 | +build_and_install roboplan_toppra |
| 62 | +build_and_install roboplan_rrt |
0 commit comments