From 5b5e9161cf19712222edffc4dc87d8f15e0ccbd1 Mon Sep 17 00:00:00 2001
From: Axel1092 Show command lines to build on Linux
@@ -30,7 +30,7 @@ CARLA forum
```sh
# Make sure to meet the minimum requirements and read the documentation to understand each step.
-# Install dependencies.
+# Install dependencies.
sudo apt-get update &&
sudo apt-get install wget software-properties-common &&
sudo add-apt-repository ppa:ubuntu-toolchain-r/test &&
@@ -39,12 +39,12 @@ sudo apt-add-repository "deb http://apt.llvm.org/$(lsb_release -c --short)/ llvm
sudo apt-get update
# Additional dependencies for Ubuntu 18.04.
-sudo apt-get install build-essential clang-8 lld-8 g++-7 cmake ninja-build libvulkan1 python python-pip python-dev python3-dev python3-pip libpng-dev libtiff5-dev libjpeg-dev tzdata sed curl unzip autoconf libtool rsync libxml2-dev &&
+sudo apt-get install build-essential clang-8 lld-8 g++-7 cmake ninja-build libvulkan1 python python-pip python-dev python3-dev python3-pip libpng-dev libtiff5-dev libjpeg-dev tzdata sed curl unzip autoconf libtool rsync libxml2-dev libxerces-c-dev &&
pip2 install --user setuptools &&
-pip3 install --user setuptools
+pip3 install --user setuptools
-# Additional dependencies for previous Ubuntu versions.
-sudo apt-get install build-essential clang-8 lld-8 g++-7 cmake ninja-build libvulkan1 python python-pip python-dev python3-dev python3-pip libpng16-dev libtiff5-dev libjpeg-dev tzdata sed curl unzip autoconf libtool rsync libxml2-dev &&
+# Additional dependencies for previous Ubuntu versions.
+sudo apt-get install build-essential clang-8 lld-8 g++-7 cmake ninja-build libvulkan1 python python-pip python-dev python3-dev python3-pip libpng16-dev libtiff5-dev libjpeg-dev tzdata sed curl unzip autoconf libtool rsync libxml2-dev libxerces-c-dev &&
pip2 install --user setuptools &&
pip3 install --user setuptools &&
pip2 install --user distro &&
@@ -54,14 +54,14 @@ pip3 install --user distro
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/lib/llvm-8/bin/clang++ 180 &&
sudo update-alternatives --install /usr/bin/clang clang /usr/lib/llvm-8/bin/clang 180
-# Get a GitHub and a UE account, and link both.
-# Install git.
+# Get a GitHub and a UE account, and link both.
+# Install git.
# Download Unreal Engine 4.24.
git clone --depth=1 -b 4.24 https://github.com/EpicGames/UnrealEngine.git ~/UnrealEngine_4.24
cd ~/UnrealEngine_4.24
-# Download and install the UE patch
+# Download and install the UE patch
wget https://carla-releases.s3.eu-west-3.amazonaws.com/Linux/UE_Patch/430667-13636743-patch.txt ~/430667-13636743-patch.txt
patch --strip=4 < ~/430667-13636743-patch.txt
@@ -71,21 +71,21 @@ patch --strip=4 < ~/430667-13636743-patch.txt
# Open the UE Editor to check everything works properly.
cd ~/UnrealEngine_4.24/Engine/Binaries/Linux && ./UE4Editor
-# Clone the CARLA repository.
+# Clone the CARLA repository.
git clone https://github.com/carla-simulator/carla
-# Get the CARLA assets.
+# Get the CARLA assets.
cd ~/carla
./Update.sh
-# Set the environment variable.
+# Set the environment variable.
export UE4_ROOT=~/UnrealEngine_4.24
-# make the CARLA server and the CARLA client.
+# make the CARLA server and the CARLA client.
make launch
-make PythonAPI
+make PythonAPI
-# Press play in the Editor to initialize the server, and run an example script to test CARLA.
+# Press play in the Editor to initialize the server, and run an example script to test CARLA.
cd PythonAPI/examples
python3 spawn_npc.py
```
@@ -96,15 +96,15 @@ python3 spawn_npc.py
### System specifics
-* __Ubuntu 18.04.__ CARLA provides support for previous Ubuntu versions up to 16.04. **However** proper compilers are needed for UE to work properly. The required dependencies for both Ubuntu 18.04 and previous versions are listed below. Make sure to install the ones corresponding to the system.
-* __30GB disk space.__ Installing all the software needed and CARLA itself will require quite a lot of space, especially Unreal Engine. Make sure to have around 30/50GB of free disk space.
-* __An adequate GPU.__ CARLA aims for realistic simulations, so the server needs at least a 4GB GPU. A dedicated GPU is highly recommended for machine learning.
-* __Two TCP ports and good internet connection.__ 2000 and 2001 by default. Be sure neither the firewall nor any other application block these.
+* __Ubuntu 18.04.__ CARLA provides support for previous Ubuntu versions up to 16.04. **However** proper compilers are needed for UE to work properly. The required dependencies for both Ubuntu 18.04 and previous versions are listed below. Make sure to install the ones corresponding to the system.
+* __30GB disk space.__ Installing all the software needed and CARLA itself will require quite a lot of space, especially Unreal Engine. Make sure to have around 30/50GB of free disk space.
+* __An adequate GPU.__ CARLA aims for realistic simulations, so the server needs at least a 4GB GPU. A dedicated GPU is highly recommended for machine learning.
+* __Two TCP ports and good internet connection.__ 2000 and 2001 by default. Be sure neither the firewall nor any other application block these.
### Dependencies
-CARLA needs many dependencies to run. Some of them are built automatically during this process, such as *Boost.Python*. Others are binaries that should be installed before starting the build (*cmake*, *clang*, different versions of *Python* and much more). In order to do so, run the commands below in a terminal window.
+CARLA needs many dependencies to run. Some of them are built automatically during this process, such as *Boost.Python*. Others are binaries that should be installed before starting the build (*cmake*, *clang*, different versions of *Python* and much more). In order to do so, run the commands below in a terminal window.
```sh
sudo apt-get update &&
@@ -116,21 +116,21 @@ sudo apt-get update
```
!!! Important
- The following commands differ depending on the Ubuntu version. While the only change is `libpng16-dev` becoming `libpng-dev`, the full set of commands is here twice to ease the copy.
+ The following commands differ depending on the Ubuntu version. While the only change is `libpng16-dev` becoming `libpng-dev`, the full set of commands is here twice to ease the copy.
__Ubuntu 18.04__.
```sh
-sudo apt-get install build-essential clang-8 lld-8 g++-7 cmake ninja-build libvulkan1 python python-pip python-dev python3-dev python3-pip libpng-dev libtiff5-dev libjpeg-dev tzdata sed curl unzip autoconf libtool rsync libxml2-dev &&
+sudo apt-get install build-essential clang-8 lld-8 g++-7 cmake ninja-build libvulkan1 python python-pip python-dev python3-dev python3-pip libpng-dev libtiff5-dev libjpeg-dev tzdata sed curl unzip autoconf libtool rsync libxml2-dev libxerces-c-dev &&
pip2 install --user setuptools &&
pip3 install --user setuptools &&
pip2 install --user distro &&
pip3 install --user distro
```
-__Previous Ubuntu__ versions.
+__Previous Ubuntu__ versions.
```sh
-sudo apt-get install build-essential clang-8 lld-8 g++-7 cmake ninja-build libvulkan1 python python-pip python-dev python3-dev python3-pip libpng16-dev libtiff5-dev libjpeg-dev tzdata sed curl unzip autoconf libtool rsync libxml2-dev &&
+sudo apt-get install build-essential clang-8 lld-8 g++-7 cmake ninja-build libvulkan1 python python-pip python-dev python3-dev python3-pip libpng16-dev libtiff5-dev libjpeg-dev tzdata sed curl unzip autoconf libtool rsync libxml2-dev libxerces-c-dev &&
pip2 install --user setuptools &&
-pip3 install --user setuptools &&
+pip3 install --user setuptools &&
pip2 install --user distro &&
pip3 install --user distro
```
@@ -145,20 +145,20 @@ sudo update-alternatives --install /usr/bin/clang clang /usr/lib/llvm-8/bin/clan
---
## GitHub
-A [GitHub](https://github.com/) account will be needed, as CARLA content is organized in different repositories in there. Also, [git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) will be used in this build guide when facilitating commands to be run in terminal.
-
-In order to access the Unreal Engine repositories, which are set to private, create an [Unreal Engine](https://www.unrealengine.com/en-US/feed) account and connect it to a GitHub account. To do so, there is a section in Unreal Engine's profile settings under the name of __Connected accounts__. [Here](https://www.unrealengine.com/en-US/blog/updated-authentication-process-for-connecting-epic-github-accounts) is a brief explanation just in case.
+A [GitHub](https://github.com/) account will be needed, as CARLA content is organized in different repositories in there. Also, [git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) will be used in this build guide when facilitating commands to be run in terminal.
+
+In order to access the Unreal Engine repositories, which are set to private, create an [Unreal Engine](https://www.unrealengine.com/en-US/feed) account and connect it to a GitHub account. To do so, there is a section in Unreal Engine's profile settings under the name of __Connected accounts__. [Here](https://www.unrealengine.com/en-US/blog/updated-authentication-process-for-connecting-epic-github-accounts) is a brief explanation just in case.
!!! Warning
- New Unreal Engine accounts need activation. After creating the account, a verification mail will be sent. Check it out, or the UE repository will be shown as non-existent in the following steps.
+ New Unreal Engine accounts need activation. After creating the account, a verification mail will be sent. Check it out, or the UE repository will be shown as non-existent in the following steps.
---
## Unreal Engine
-The current version of CARLA runs on __Unreal Engine 4.24__ only. The path is irrelevant, but for the sake of this tutorial, installation will be done under `~/UnrealEngine_4.24`. If the path chosen differs, remember to change it accordingly when running the commands on terminal.
+The current version of CARLA runs on __Unreal Engine 4.24__ only. The path is irrelevant, but for the sake of this tutorial, installation will be done under `~/UnrealEngine_4.24`. If the path chosen differs, remember to change it accordingly when running the commands on terminal.
!!! Note
- Alternatively, there is this [guide](https://docs.unrealengine.com/en-US/Platforms/Linux/BeginnerLinuxDeveloper/SettingUpAnUnrealWorkflow/index.html) to build UE on Linux. When consulting it, remember that CARLA will need the __4.24 release__, not the latest.
+ Alternatively, there is this [guide](https://docs.unrealengine.com/en-US/Platforms/Linux/BeginnerLinuxDeveloper/SettingUpAnUnrealWorkflow/index.html) to build UE on Linux. When consulting it, remember that CARLA will need the __4.24 release__, not the latest.
Clone the content for Unreal Engine 4.24 in a local computer.
```sh
@@ -169,21 +169,21 @@ Get into said folder. Remember, this is the path where UE4.24 has been cloned.
cd ~/UnrealEngine_4.24
```
-Get a patch for Unreal Engine. The patch fixes some Vulkan visualization issues that may occur when changing the map. Download and install it with the following commands.
+Get a patch for Unreal Engine. The patch fixes some Vulkan visualization issues that may occur when changing the map. Download and install it with the following commands.
```sh
wget https://carla-releases.s3.eu-west-3.amazonaws.com/Linux/UE_Patch/430667-13636743-patch.txt ~/430667-13636743-patch.txt
patch --strip=4 < ~/430667-13636743-patch.txt
```
-Make the build.
+Make the build.
```sh
./Setup.sh && ./GenerateProjectFiles.sh && make
```
!!! Warning
- If UE has already been built, install the patch and make the build again.
+ If UE has already been built, install the patch and make the build again.
-Unreal Engine should be installed in the system. Run `Engine/Binaries/Linux/UE4Editor.sh` to open the Editor and check it out.
+Unreal Engine should be installed in the system. Run `Engine/Binaries/Linux/UE4Editor.sh` to open the Editor and check it out.
```sh
cd ~/UnrealEngine_4.24/Engine/Binaries/Linux && ./UE4Editor
```
@@ -192,15 +192,15 @@ In case something went wrong, it is related with Unreal Engine There is not much
---
## CARLA build
-The system should be ready to start building CARLA. Just for clarity, a brief summary so far.
+The system should be ready to start building CARLA. Just for clarity, a brief summary so far.
-* Minimum technical requirements to run CARLA are suitable.
-* Dependencies have been properly installed.
-* GitHub account is ready.
-* Unreal Engine 4.24 runs smooth.
+* Minimum technical requirements to run CARLA are suitable.
+* Dependencies have been properly installed.
+* GitHub account is ready.
+* Unreal Engine 4.24 runs smooth.
!!! Note
- Downloading aria2 with `sudo apt-get install aria2` will speed up the following commands.
+ Downloading aria2 with `sudo apt-get install aria2` will speed up the following commands.
### Clone repository
@@ -210,31 +210,31 @@ The system should be ready to start building CARLA. Just for clarity, a brief su
CARLA repository