dragonpilot - 基於 openpilot 的開源駕駛輔助系統
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

148 lines
3.2 KiB

#!/bin/bash
set -e
5 years ago
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
ROOT="$(cd $DIR/../ && pwd)"
SUDO=""
# NOTE: this is used in a docker build, so do not run any scripts here.
# Use sudo if not root
if [[ ! $(id -u) -eq 0 ]]; then
if [[ -z $(which sudo) ]]; then
echo "Please install sudo or run as root"
exit 1
fi
SUDO="sudo"
fi
# Install packages present in all supported versions of Ubuntu
function install_ubuntu_common_requirements() {
$SUDO apt-get update
$SUDO apt-get install -y --no-install-recommends \
5 years ago
autoconf \
build-essential \
ca-certificates \
casync \
clang \
cmake \
make \
cppcheck \
libtool \
gcc-arm-none-eabi \
5 years ago
bzip2 \
liblzma-dev \
libarchive-dev \
libbz2-dev \
capnproto \
libcapnp-dev \
5 years ago
curl \
libcurl4-openssl-dev \
5 years ago
git \
git-lfs \
ffmpeg \
libavformat-dev \
libavcodec-dev \
libavdevice-dev \
libavutil-dev \
libavfilter-dev \
5 years ago
libeigen3-dev \
libffi-dev \
libglew-dev \
libgles2-mesa-dev \
libglfw3-dev \
libglib2.0-0 \
libomp-dev \
libopencv-dev \
5 years ago
libpng16-16 \
5 years ago
libssl-dev \
libsqlite3-dev \
libusb-1.0-0-dev \
libzmq3-dev \
libsystemd-dev \
5 years ago
locales \
opencl-headers \
5 years ago
ocl-icd-libopencl1 \
ocl-icd-opencl-dev \
clinfo \
qml-module-qtquick2 \
qtmultimedia5-dev \
qtlocation5-dev \
qtpositioning5-dev \
qttools5-dev-tools \
libqt5sql5-sqlite \
libqt5svg5-dev \
libqt5charts5-dev \
libqt5x11extras5-dev \
libreadline-dev \
libdw1 \
valgrind
}
# Install Ubuntu 22.04 LTS packages
function install_ubuntu_jammy_requirements() {
install_ubuntu_common_requirements
$SUDO apt-get install -y --no-install-recommends \
qtbase5-dev \
qtchooser \
qt5-qmake \
qtbase5-dev-tools \
python3-dev
}
# Install Ubuntu 20.04 packages
function install_ubuntu_focal_requirements() {
install_ubuntu_common_requirements
$SUDO apt-get install -y --no-install-recommends \
libavresample-dev \
qt5-default \
python-dev
}
# Detect OS using /etc/os-release file
if [ -f "/etc/os-release" ]; then
source /etc/os-release
case "$VERSION_CODENAME" in
"jammy")
install_ubuntu_jammy_requirements
;;
"focal")
install_ubuntu_focal_requirements
;;
*)
echo "$ID $VERSION_ID is unsupported. This setup script is written for Ubuntu 20.04."
read -p "Would you like to attempt installation anyway? " -n 1 -r
echo ""
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
exit 1
fi
if [ "$UBUNTU_CODENAME" = "jammy" ]; then
install_ubuntu_jammy_requirements
else
install_ubuntu_focal_requirements
fi
esac
else
echo "No /etc/os-release in the system"
exit 1
fi
5 years ago
# install python dependencies
$ROOT/update_requirements.sh
source ~/.bashrc
if [ -z "$OPENPILOT_ENV" ]; then
printf "\nsource %s/tools/openpilot_env.sh" "$ROOT" >> ~/.bashrc
source ~/.bashrc
echo "added openpilot_env to bashrc"
fi
echo
mac: fix setup and re-enable CI (#23365) * rework mac_setup.sh * ignore casadi and onnx runtime in pipfile for Darwin * remove rust stuff * build and install casadi * add wget * explicit python3. dont do onnx just yet * resource compiler * replace acados Darwin lib w universal2 libs * relock Pipfile using linux machine * Update update_requirements.sh brackets * Update update_requirements.sh oops * ci: re-enable mac build * attempt to fix ci build: * pip stuff? * move rcc bin path to env script * oops * only mac * k im lazy. does ci like this?? * huh?? * * use curl * avoid casadi rebuilds * add comment to remove protobuf * host detect typo * python version * how did the builds not use swig? * better reinstall check * sometimes mac clang complain abt error limit * ci: build OP in venv * ci: bump to Big Sur * retry? idk why it failed @ acados link * * use macos-latest * move rcc path to scons * add extra paths for odd homebrew installs * acados source change * update macOS README * uh, maybe? * k nvm * ci: ok this is strange. might be scons bug? * fix conflicts: bump * just add cppcheck for pre-commit stuff * agane * cleanup * try that * fix path * no pyenv update on mac * source * fix rpath prefix? * no examples * fix exit * let's get this cached * add virtualenvs to cache * why did we cache that * let's see what's big * more * always ruyn * cache scons cache * better cache key * fix for partial hit * why so long Co-authored-by: Andrew Tec <andrest@trabus.com> Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com> Co-authored-by: Bruce Wayne <batman@openpilot-mac-mini.local>
3 years ago
echo "---- OPENPILOT SETUP DONE ----"
echo "Open a new shell or configure your active shell env by running:"
echo "source ~/.bashrc"