Skip to content

Commit 3302010

Browse files
authored
Fix :Linux platform development tool package installation error (#101)
* fix: possibly_missing git and wget dependencies * Add project generated file path switching * fix: Linux platform development tool package installation error
1 parent b1b8d9e commit 3302010

File tree

2 files changed

+52
-22
lines changed

2 files changed

+52
-22
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,13 @@ Follow these steps to set up and run Project AirSim from source:
111111
- Generate Visual Studio Code project files:
112112
- **Linux/macOS**:
113113
```bash
114+
cd ./unreal/Blocks/
115+
chmod u+x ./blocks_genprojfiles_vscode.sh
114116
./blocks_genprojfiles_vscode.sh
115117
```
116118
- **Windows**:
117119
```cmd
120+
cd .\unreal\Blocks\
118121
blocks_genprojfiles_vscode.bat
119122
```
120123

setup_linux_dev_tools.sh

Lines changed: 49 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,40 +6,67 @@
66
set -e
77

88
sudo apt-get update
9+
910
# Install lsb_release to check Ubuntu version
10-
sudo apt-get -y install --no-install-recommends lsb-release git wget
11+
sudo apt-get -y install --no-install-recommends lsb-release git wget gnupg ca-certificates
12+
13+
# Get the current Ubuntu system version
14+
VERSION=$(lsb_release -rs)
15+
# Get the current Ubuntu system codename
16+
CODENAME=$(lsb_release -cs)
17+
18+
echo "Ubuntu version: $VERSION, Ubuntu codename: $CODENAME"
19+
20+
# Define the LLVM version corresponding to different Ubuntu versions.
21+
# Ubuntu 18.04 -> LLVM 11
22+
# Ubuntu 20.04 22.04 24.04 -> LLVM 13
23+
declare -A LLVM_VERSION_MAP=(
24+
["18.04"]="11"
25+
["20.04"]="13"
26+
["22.04"]="13"
27+
["24.04"]="13"
28+
)
29+
30+
# Obtain the LLVM version that should be installed on the current system.
31+
TARGET_LLVM_VERSION=${LLVM_VERSION_MAP[$VERSION]}
1132

12-
if [[ $(lsb_release -rs) == "18.04" ]]; then
33+
# LLVM sources.list file
34+
LLVM_SOURCES_LIST_FILE="/etc/apt/sources.list.d/llvm.list"
35+
# LLVM gpg key file
36+
LLVM_GPG_KEY_FILE="/etc/apt/trusted.gpg.d/llvm.gpg"
37+
38+
# soupport ubuntu 18.04 20.04 22.04 24.04
39+
if [ "$VERSION" == "18.04" ]; then
1340
# Add Kitware's APT repository to get cmake 3.15 or newer on Ubuntu 18.04 following https://apt.kitware.com/
14-
sudo apt-get -y install \
15-
apt-transport-https \
16-
ca-certificates \
17-
gnupg \
18-
software-properties-common \
19-
wget
20-
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
21-
sudo apt-add-repository 'deb https://apt.kitware.com/ubuntu/ bionic main'
22-
23-
# Add LLVM APT repository to get clang-11/libc++-11 on Ubuntu 18.04
24-
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
25-
sudo apt-add-repository 'deb http://apt.llvm.org/bionic llvm-toolchain-bionic-11 main'
26-
fi
41+
# bionic
42+
sudo apt-get -y install \
43+
apt-transport-https \
44+
software-properties-common
2745

28-
if [[ $(lsb_release -rs) == "20.04" ]]; then
29-
sudo apt-get -y install software-properties-common
30-
# Add Ubuntu proposed main and universe repositories to get clang-13/libc++-13 on Ubuntu 20.04
31-
sudo apt-add-repository "deb http://archive.ubuntu.com/ubuntu/ focal-proposed main universe"
46+
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
47+
sudo apt-add-repository -y "deb https://apt.kitware.com/ubuntu/ ${CODENAME} main"
48+
49+
# Add the official Vulkan PPA repository to support the installation of vulkan-tools on Ubuntu 18.04.
50+
sudo add-apt-repository -y ppa:graphics-drivers/ppa
3251
fi
3352

53+
# Add LLVM APT repository to get clang-11/libc++-11 on Ubuntu 18.04
54+
# Add LLVM APT repository to get clang-13/libc++-13 on Ubuntu 20.04 22.04 24.04
55+
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key 2>/dev/null | sudo gpg --dearmor - | sudo tee ${LLVM_GPG_KEY_FILE} >/dev/null
56+
echo "deb [signed-by=${LLVM_GPG_KEY_FILE}] http://apt.llvm.org/${CODENAME}/ llvm-toolchain-${CODENAME}-${TARGET_LLVM_VERSION} main" | sudo tee ${LLVM_SOURCES_LIST_FILE}
57+
58+
# Update package lists
59+
sudo apt-get update
60+
3461
# Install prerequisites
3562
sudo apt-get -y install --no-install-recommends \
3663
build-essential \
3764
rsync \
3865
make \
3966
cmake \
40-
clang-13 \
41-
libc++-13-dev \
42-
libc++abi-13-dev \
67+
clang-${TARGET_LLVM_VERSION} \
68+
libc++-${TARGET_LLVM_VERSION}-dev \
69+
libc++abi-${TARGET_LLVM_VERSION}-dev \
4370
ninja-build \
4471
libvulkan1 \
4572
vulkan-tools

0 commit comments

Comments
 (0)