Cmake: high version on Linux

本文介绍如何在Linux环境下卸载旧版并安装CMake 3.9.1,包括下载、解压软件包及创建软链接等步骤。

1. 卸载已经安装的旧版的CMake[非必需]

apt-get autoremove cmake
  • 1

2. 文件下载解压:

wget https://cmake.org/files/v3.9/cmake-3.9.1-Linux-x86_64.tar.gz
  • 1

解压:

tar zxvf cmake-3.9.1-Linux-x86_64.tar.gz
  • 1

查看解压后目录:

tree -L 2 cmake-3.9.1-Linux-x86_64
cmake-3.9.1-Linux-x86_64
├── bin
│   ├── ccmake
│   ├── cmake
│   ├── cmake-gui
│   ├── cpack
│   └── ctest
├── doc
│   └── cmake
├── man
│   ├── man1
│   └── man7
└── share
    ├── aclocal
    ├── applications
    ├── cmake-3.9
    ├── icons
    └── mime

12 directories, 5 files
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21

bin下面有各种cmake家族的产品程序.

3. 创建软链接

注: 文件路径是可以指定的, 一般选择在/opt 或 /usr 路径下, 这里选择/opt

mv cmake-3.9.1-Linux-x86_64 /opt/cmake-3.9.1
ln -sf /opt/cmake-3.9.1/bin/*  /usr/bin/ 
【四旋翼无人机】具备螺旋桨倾斜机构的全驱动四旋翼无人机:建模与控制研究(Matlab代码、Simulink仿真实现)内容概要:本文围绕具备螺旋桨倾斜机构的全驱动四旋翼无人机展开研究,重点探讨其系统建模与控制策略,结合Matlab代码与Simulink仿真实现。文章详细分析了无人机的动力学模型,特别是引入螺旋桨倾斜机构后带来的全驱动特性,使其在姿态与位置控制上具备更强的机动性与自由度。研究涵盖了非线性系统建模、控制器设计(如PID、MPC、非线性控制等)、仿真验证及动态响应分析,旨在提升无人机在复杂环境下的稳定性和控制精度。同时,文中提供的Matlab/Simulink资源便于读者复现实验并进一步优化控制算法。; 适合人群:具备一定控制理论基础和Matlab/Simulink仿真经验的研究生、科研人员及无人机控制系统开发工程师,尤其适合从事飞行器建模与先进控制算法研究的专业人员。; 使用场景及目标:①用于全驱动四旋翼无人机的动力学建模与仿真平台搭建;②研究先进控制算法(如模型预测控制、非线性控制)在无人机系统中的应用;③支持科研论文复现、课程设计或毕业课题开发,推动无人机高机动控制技术的研究进展。; 阅读建议:建议读者结合文档提供的Matlab代码与Simulink模型,逐步实现建模与控制算法,重点关注坐标系定义、力矩分配逻辑及控制闭环的设计细节,同时可通过修改参数和添加扰动来验证系统的鲁棒性与适应性。
#!/usr/bin/env bash set -x set -e SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" pushd "$SCRIPT_DIR" >/dev/null downloadHighPolySuv=true MIN_CMAKE_VERSION=3.10.0 # On macOS, make sure we have a CMake that will support CMAKE_APPLE_SILICON_PROCESSOR. if [ "$(uname)" == "Darwin" ]; then MIN_CMAKE_VERSION=3.19.2 fi DEBUG="${DEBUG:-false}" function version_less_than_equal_to() { test "$(printf '%s\n' "$@" | sort -V | head -n 1)" = "$1"; } # brew gives error if package is already installed function brew_install() { brew list "$1" &>/dev/null || brew install "$1"; } # Parse command line arguments while [[ $# -gt 0 ]] do key="$1" case $key in --debug) DEBUG=true ;; --no-full-poly-car) downloadHighPolySuv=false shift # past value ;; esac done # llvm tools if [ "$(uname)" == "Darwin" ]; then # osx brew update # Update below line for newer versions #brew install llvm@8 brew install llvm else #linux sudo apt-get update sudo apt-get -y install --no-install-recommends \ lsb-release \ rsync \ software-properties-common \ wget \ libvulkan1 \ vulkan-utils #install clang and build tools VERSION=$(lsb_release -rs | cut -d. -f1) # Since Ubuntu 17 clang is part of the core repository # See https://packages.ubuntu.com/search?keywords=clang-8 if [ "$VERSION" -lt "17" ]; then wget -O - http://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - sudo apt-get update fi sudo apt-get install -y clang-8 clang++-8 libc++-8-dev libc++abi-8-dev fi if ! which cmake; then # CMake not installed cmake_ver=0 else cmake_ver=$(cmake --version 2>&1 | head -n1 | cut -d ' ' -f3 | awk '{print $NF}') fi #give user perms to access USB port - this is not needed if not using PX4 HIL #TODO: figure out how to do below in travis # Install additional tools, CMake if required if [ "$(uname)" == "Darwin" ]; then # osx if [[ -n "${whoami}" ]]; then #this happens when running in travis sudo dseditgroup -o edit -a "$(whoami)" -t user dialout fi brew_install wget brew_install coreutils if version_less_than_equal_to "$cmake_ver" "$MIN_CMAKE_VERSION"; then brew install cmake # should get cmake 3.8 else echo "Already have good version of cmake: $cmake_ver" fi else #linux if [[ -n "${whoami}" ]]; then #this happens when running in travis sudo /usr/sbin/useradd -G dialout "$USER" sudo usermod -a -G dialout "$USER" fi # install additional tools sudo apt-get install -y build-essential unzip if version_less_than_equal_to "$cmake_ver" "$MIN_CMAKE_VERSION"; then # in ubuntu 18 docker CI, avoid building cmake from scratch to save time # ref: https://apt.kitware.com/ if [ "$(lsb_release -rs)" == "18.04" ]; then sudo apt-get -y install \ apt-transport-https \ ca-certificates \ gnupg wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | sudo tee /etc/apt/trusted.gpg.d/kitware.gpg >/dev/null sudo apt-add-repository 'deb https://apt.kitware.com/ubuntu/ bionic main' sudo apt-get -y install --no-install-recommends \ make \ cmake else # For Ubuntu 16.04, or anything else, build CMake 3.10.2 from source if [[ ! -d "cmake_build/bin" ]]; then echo "Downloading cmake..." wget https://cmake.org/files/v3.10/cmake-3.10.2.tar.gz \ -O cmake.tar.gz tar -xzf cmake.tar.gz rm cmake.tar.gz rm -rf ./cmake_build mv ./cmake-3.10.2 ./cmake_build pushd cmake_build ./bootstrap make popd fi fi else echo "Already have good version of cmake: $cmake_ver" fi fi # End USB setup, CMake install # Download rpclib if [ ! -d "external/rpclib/rpclib-2.3.0" ]; then echo "*********************************************************************************************" echo "Downloading rpclib..." echo "*********************************************************************************************" wget https://github.com/rpclib/rpclib/archive/v2.3.0.zip # remove previous versions rm -rf "external/rpclib" mkdir -p "external/rpclib" unzip -q v2.3.0.zip -d external/rpclib rm v2.3.0.zip fi # Download high-polycount SUV model if $downloadHighPolySuv; then if [ ! -d "Unreal/Plugins/AirSim/Content/VehicleAdv" ]; then mkdir -p "Unreal/Plugins/AirSim/Content/VehicleAdv" fi if [ ! -d "Unreal/Plugins/AirSim/Content/VehicleAdv/SUV/v1.2.0" ]; then echo "*********************************************************************************************" echo "Downloading high-poly car assets.... The download is ~37MB and can take some time." echo "To install without this assets, re-run setup.sh with the argument --no-full-poly-car" echo "*********************************************************************************************" if [ -d "suv_download_tmp" ]; then rm -rf "suv_download_tmp" fi mkdir -p "suv_download_tmp" cd suv_download_tmp wget https://github.com/Microsoft/AirSim/releases/download/v1.2.0/car_assets.zip if [ -d "../Unreal/Plugins/AirSim/Content/VehicleAdv/SUV" ]; then rm -rf "../Unreal/Plugins/AirSim/Content/VehicleAdv/SUV" fi unzip -q car_assets.zip -d ../Unreal/Plugins/AirSim/Content/VehicleAdv cd .. rm -rf "suv_download_tmp" fi else echo "### Not downloading high-poly car asset (--no-full-poly-car). The default unreal vehicle will be used." fi echo "Installing Eigen library..." if [ ! -d "AirLib/deps/eigen3" ]; then echo "Downloading Eigen..." wget -O eigen3.zip https://gitlab.com/libeigen/eigen/-/archive/3.3.7/eigen-3.3.7.zip unzip -q eigen3.zip -d temp_eigen mkdir -p AirLib/deps/eigen3 mv temp_eigen/eigen*/Eigen AirLib/deps/eigen3 rm -rf temp_eigen rm eigen3.zip else echo "Eigen is already installed." fi popd >/dev/null set +x echo "" echo "************************************" echo "AirSim setup completed successfully!" echo "************************************"
11-07
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值