mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-08-08 18:05:43 +08:00
This reverts commit eea07462fa.
This commit is contained in:
+14
-3
@@ -2,6 +2,7 @@ import os
|
||||
import subprocess
|
||||
import sys
|
||||
import sysconfig
|
||||
import platform
|
||||
import shlex
|
||||
import numpy as np
|
||||
|
||||
@@ -23,8 +24,19 @@ AddOption('--minimal',
|
||||
default=os.path.exists(File('#.gitattributes').abspath), # minimal by default on release branch (where there's no LFS)
|
||||
help='the minimum build to run openpilot. no tests, tools, etc.')
|
||||
|
||||
# Detect platform (see scripts/platform.sh)
|
||||
arch = subprocess.check_output(["bash", "-c", "source scripts/platform.sh >&2 && echo $OPENPILOT_ARCH"], encoding='utf8', stderr=subprocess.PIPE).rstrip()
|
||||
# Detect platform
|
||||
arch = subprocess.check_output(["uname", "-m"], encoding='utf8').rstrip()
|
||||
if platform.system() == "Darwin":
|
||||
arch = "Darwin"
|
||||
brew_prefix = subprocess.check_output(['brew', '--prefix'], encoding='utf8').strip()
|
||||
elif arch == "aarch64" and os.path.isfile('/TICI'):
|
||||
arch = "larch64"
|
||||
assert arch in [
|
||||
"larch64", # linux tici arm64
|
||||
"aarch64", # linux pc arm64
|
||||
"x86_64", # linux pc x64
|
||||
"Darwin", # macOS arm64 (x86 not supported)
|
||||
]
|
||||
|
||||
env = Environment(
|
||||
ENV={
|
||||
@@ -91,7 +103,6 @@ if arch == "larch64":
|
||||
env.Append(CCFLAGS=arch_flags)
|
||||
env.Append(CXXFLAGS=arch_flags)
|
||||
elif arch == "Darwin":
|
||||
brew_prefix = subprocess.check_output(['brew', '--prefix'], encoding='utf8').strip()
|
||||
env.Append(LIBPATH=[
|
||||
f"{brew_prefix}/lib",
|
||||
f"{brew_prefix}/opt/openssl@3.0/lib",
|
||||
|
||||
@@ -1,51 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Centralized platform and architecture detection for openpilot.
|
||||
# Source this script to get OPENPILOT_ARCH set to one of:
|
||||
# larch64 - linux tici arm64
|
||||
# aarch64 - linux pc arm64
|
||||
# x86_64 - linux pc x64
|
||||
# Darwin - macOS arm64
|
||||
#
|
||||
|
||||
RED='\033[0;31m'
|
||||
GREEN='\033[0;32m'
|
||||
NC='\033[0m'
|
||||
|
||||
OPENPILOT_ARCH=$(uname -m)
|
||||
|
||||
# ── check OS and normalize arch ──────────────────────────────
|
||||
if [ -f /TICI ]; then
|
||||
# TICI runs AGNOS — no OS validation needed
|
||||
OPENPILOT_ARCH="larch64"
|
||||
|
||||
elif [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
if [[ "$OPENPILOT_ARCH" == "x86_64" ]]; then
|
||||
echo -e " ↳ [${RED}✗${NC}] Intel-based Macs are not supported!"
|
||||
echo " openpilot requires an Apple Silicon Mac (M1 or newer)."
|
||||
exit 1
|
||||
fi
|
||||
echo -e " ↳ [${GREEN}✔${NC}] macOS detected."
|
||||
OPENPILOT_ARCH="Darwin"
|
||||
|
||||
elif [[ "$OSTYPE" == "linux-gnu"* ]]; then
|
||||
if [ -f "/etc/os-release" ]; then
|
||||
source /etc/os-release
|
||||
case "$VERSION_CODENAME" in
|
||||
"jammy" | "kinetic" | "noble" | "focal")
|
||||
echo -e " ↳ [${GREEN}✔${NC}] Ubuntu $VERSION_CODENAME detected."
|
||||
;;
|
||||
*)
|
||||
echo -e " ↳ [${RED}✗${NC}] Incompatible Ubuntu version $VERSION_CODENAME detected!"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
else
|
||||
echo -e " ↳ [${RED}✗${NC}] No /etc/os-release on your system. Make sure you're running on Ubuntu, or similar!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
else
|
||||
echo -e " ↳ [${RED}✗${NC}] OS type $OSTYPE not supported!"
|
||||
exit 1
|
||||
fi
|
||||
Vendored
+3
-3
@@ -6,11 +6,10 @@ export ZERO_AR_DATE=1
|
||||
|
||||
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)"
|
||||
|
||||
source "$DIR/../../scripts/platform.sh"
|
||||
ARCHNAME="$OPENPILOT_ARCH"
|
||||
|
||||
ARCHNAME="x86_64"
|
||||
BLAS_TARGET="X64_AUTOMATIC"
|
||||
if [ -f /TICI ]; then
|
||||
ARCHNAME="larch64"
|
||||
BLAS_TARGET="ARMV8A_ARM_CORTEX_A57"
|
||||
fi
|
||||
|
||||
@@ -18,6 +17,7 @@ ACADOS_FLAGS="-DACADOS_WITH_QPOASES=ON -UBLASFEO_TARGET -DBLASFEO_TARGET=$BLAS_T
|
||||
|
||||
if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
ACADOS_FLAGS="$ACADOS_FLAGS -DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_MACOSX_RPATH=1"
|
||||
ARCHNAME="Darwin"
|
||||
fi
|
||||
|
||||
if [ ! -d acados_repo/ ]; then
|
||||
|
||||
Vendored
+8
-2
@@ -6,8 +6,14 @@ export ZERO_AR_DATE=1
|
||||
|
||||
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)"
|
||||
|
||||
source "$DIR/../../scripts/platform.sh"
|
||||
ARCHNAME="$OPENPILOT_ARCH"
|
||||
ARCHNAME=$(uname -m)
|
||||
if [ -f /TICI ]; then
|
||||
ARCHNAME="larch64"
|
||||
fi
|
||||
|
||||
if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
ARCHNAME="Darwin"
|
||||
fi
|
||||
|
||||
cd $DIR
|
||||
if [ ! -d libyuv ]; then
|
||||
|
||||
Vendored
+6
-2
@@ -20,9 +20,9 @@ cd $DIR
|
||||
|
||||
RAYLIB_PLATFORM="PLATFORM_DESKTOP"
|
||||
|
||||
source "$DIR/../../scripts/platform.sh"
|
||||
ARCHNAME="$OPENPILOT_ARCH"
|
||||
ARCHNAME=$(uname -m)
|
||||
if [ -f /TICI ]; then
|
||||
ARCHNAME="larch64"
|
||||
RAYLIB_PLATFORM="PLATFORM_COMMA"
|
||||
elif [[ "$OSTYPE" == "linux"* ]]; then
|
||||
# required dependencies on Linux PC
|
||||
@@ -33,6 +33,10 @@ elif [[ "$OSTYPE" == "linux"* ]]; then
|
||||
libxrandr-dev
|
||||
fi
|
||||
|
||||
if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
ARCHNAME="Darwin"
|
||||
fi
|
||||
|
||||
INSTALL_DIR="$DIR/$ARCHNAME"
|
||||
rm -rf $INSTALL_DIR
|
||||
mkdir -p $INSTALL_DIR
|
||||
|
||||
@@ -23,7 +23,7 @@ echo "installing python packages..."
|
||||
uv sync --frozen --all-extras
|
||||
source .venv/bin/activate
|
||||
|
||||
if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
if [[ "$(uname)" == 'Darwin' ]]; then
|
||||
touch "$ROOT"/.env
|
||||
echo "export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES" >> "$ROOT"/.env
|
||||
fi
|
||||
|
||||
@@ -3,7 +3,6 @@ set -e
|
||||
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
|
||||
ROOT="$(cd $DIR/../ && pwd)"
|
||||
source $ROOT/scripts/platform.sh
|
||||
|
||||
# homebrew update is slow
|
||||
export HOMEBREW_NO_AUTO_UPDATE=1
|
||||
|
||||
+27
-1
@@ -122,7 +122,33 @@ function op_check_git() {
|
||||
|
||||
function op_check_os() {
|
||||
echo "Checking for compatible os version..."
|
||||
source "$OPENPILOT_ROOT/scripts/platform.sh"
|
||||
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
|
||||
|
||||
if [ -f "/etc/os-release" ]; then
|
||||
source /etc/os-release
|
||||
case "$VERSION_CODENAME" in
|
||||
"jammy" | "kinetic" | "noble" | "focal")
|
||||
echo -e " ↳ [${GREEN}✔${NC}] Ubuntu $VERSION_CODENAME detected."
|
||||
;;
|
||||
* )
|
||||
echo -e " ↳ [${RED}✗${NC}] Incompatible Ubuntu version $VERSION_CODENAME detected!"
|
||||
loge "ERROR_INCOMPATIBLE_UBUNTU" "$VERSION_CODENAME"
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
else
|
||||
echo -e " ↳ [${RED}✗${NC}] No /etc/os-release on your system. Make sure you're running on Ubuntu, or similar!"
|
||||
loge "ERROR_UNKNOWN_UBUNTU"
|
||||
return 1
|
||||
fi
|
||||
|
||||
elif [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
echo -e " ↳ [${GREEN}✔${NC}] macOS detected."
|
||||
else
|
||||
echo -e " ↳ [${RED}✗${NC}] OS type $OSTYPE not supported!"
|
||||
loge "ERROR_UNKNOWN_OS" "$OSTYPE"
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
function op_check_python() {
|
||||
|
||||
Reference in New Issue
Block a user