Skip to content

Commit

Permalink
Modify setup.sh and build.sh to work with multiple ubuntu versions.
Browse files Browse the repository at this point in the history
This removes the need for multiple build.sh and setup.sh files.
  • Loading branch information
wouter-heerwegh committed Oct 22, 2024
1 parent 44d6c1a commit c6c418e
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 190 deletions.
4 changes: 4 additions & 0 deletions AirSim/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,13 @@ fi

# variable for build output
build_dir=build_debug
VERSION=$(lsb_release -rs | cut -d. -f1)
if [ "$(uname)" == "Darwin" ]; then
export CC=/usr/local/opt/llvm@8/bin/clang
export CXX=/usr/local/opt/llvm@8/bin/clang++
elif [ "$VERSION" -lt "22" ]; then
export CC="clang-8"
export CXX="clang++-8"
else
export CC="clang-12"
export CXX="clang++-12"
Expand Down
1 change: 1 addition & 0 deletions AirSim/docker_build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ FROM ubuntu:20.04
ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install -y \
sudo \
git \
build-essential \
cmake \
Expand Down
91 changes: 0 additions & 91 deletions AirSim/docker_build/build.sh

This file was deleted.

89 changes: 0 additions & 89 deletions AirSim/docker_build/setup.sh

This file was deleted.

9 changes: 5 additions & 4 deletions AirSim/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,12 @@ 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 "20" ]; then
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 12
sudo apt-get install -y clang-8 clang++-8 libc++-8-dev libc++abi-8-dev
elif [ "$VERSION" -lt "22" ]; then
sudo apt-get install -y clang-8 libc++-8-dev libc++abi-8-dev
else
sudo apt-get install -y clang-12 clang++-12 libc++-12-dev libc++abi-12-dev
fi
sudo apt-get install -y clang-12 clang++-12 libc++-12-dev libc++abi-12-dev

#install additional tools
sudo apt-get install -y build-essential
Expand Down
11 changes: 5 additions & 6 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ This guide outlines the steps for building the project from source on Ubuntu 20.
#### Build AirSim
##### For Ubuntu 20.04

cd /home/YOUR_USER/Formula-Student-Driverless-Simulator/AirSsim
cd /home/$USER/Formula-Student-Driverless-Simulator/AirSim
cp ./docker_build/setup.sh .
cp ./docker_build/build.sh .
./setup.sh && ./build.sh
Expand All @@ -66,16 +66,15 @@ First, install Docker on your Ubuntu system.

Change to the Docker Build Directory: Note that this directory is within the AirSim folder, not the root of the Formula-Student-Driverless-Simulator repository.

cd /home/YOUR_USER/Formula-Student-Driverless-Simulator/AirSim/docker_build
cd /home/$USER/Formula-Student-Driverless-Simulator/AirSim/docker_build

1. Build the Docker Image:

docker build -t formula-simulator .

2. Run the Docker Container: After the build completes, mount your local folder into the container:

docker run --rm -it -v /home/YOUR_USER/Formula-Student-Driverless-Simulator:/home/airsim/Formula-Student-Driverless-Simulator formula-simulator
docker run --rm -it -v $PWD/../..:/home/airsim/Formula-Student-Driverless-Simulator formula-simulator


3. Inside the Container: Copy the modified setup.sh and build.sh scripts:
Expand All @@ -91,11 +90,11 @@ Change to the Docker Build Directory: Note that this directory is within the Air

6. Build the final project, use the following command (this process may take some time):

~/UnrealEngine/Engine/Binaries/ThirdParty/Mono/Linux/bin/mono ~/UnrealEngine/Engine/Binaries/DotNET/UnrealBuildTool.exe Development Linux -Project=/home/YOUR_USER/Formula-Student-Driverless-Simulator/UE4Project/FSOnline.uproject -TargetType=Editor -Progress
~/UnrealEngine/Engine/Binaries/ThirdParty/Mono/Linux/bin/mono ~/UnrealEngine/Engine/Binaries/DotNET/UnrealBuildTool.exe Development Linux -Project=/home/$uSER/Formula-Student-Driverless-Simulator/UE4Project/FSOnline.uproject -TargetType=Editor -Progress

Congratulations! You have successfully built the project from source. You can now open and edit the project by running:

./home/YOUR_USERNAME/Formula-Student-Driverless-Simulator/UE4Project/FSOnline.uproject
./home/$USER/Formula-Student-Driverless-Simulator/UE4Project/FSOnline.uproject

### Building from source using the Unreal Engine Editor for earlier versions of Ubuntu (e.g., Ubuntu 18.04)
Instead of running the simulator from release binaries, you can compile it manually using unreal engine.
Expand Down

0 comments on commit c6c418e

Please sign in to comment.