CARLA is a relatively new simulation environment for self-driving cars. Well, it is open source but it depends on the Unreal Engine. As someone who opposes more and more to use Ubuntu on production systems I’m more and more pissed by software installation guides that assume everybody uses Ubuntu and is okay with installing 10 million external packages that are not maintained/updated afterwards. That is the best way to end up with serious security issues (and rewriting everything for OpenBSD is not feasible ;)). I like to use Fedora because many things are implemented in a proper way when it comes to virtualization, so we see how we can build CARLA for version 29.

Update: Here are my first impressions of CARLA.

I really hope someone rewrites the installation routines. It’s a rather painful experience to install it on something different than Ubuntu and I guess that it may lead to a lot of unnecessary maintenance work for the original developers.

There is nothing wrong with following the official build manual. We simply have to change the first lines of Util/BuildTools/Setup.sh from clang version 6 to 7.

#! /bin/bash

# ==============================================================================
# -- Set up environment --------------------------------------------------------
# ==============================================================================

command -v /usr/bin/clang++-7 >/dev/null 2>&1 || {
  echo >&2 "clang 7.0 is required, but it's not installed.";
  echo >&2 "make sure you build Unreal Engine with clang 7.0 too.";
  exit 1;
}

export CC=/usr/bin/clang-7
export CXX=/usr/bin/clang++-7

source $(dirname "$0")/Environment.sh

mkdir -p ${CARLA_BUILD_FOLDER}
pushd ${CARLA_BUILD_FOLDER} >/dev/null

# ==============================================================================
# -- Get and compile libc++ ----------------------------------------------------
# ==============================================================================

LLVM_BASENAME=llvm-7.0-ex

Since we require the PythonAPI, we have to change clang versions in Util/BuildTools/BuildPythonAPI.sh as well:

#! /bin/bash

source $(dirname "$0")/Environment.sh

export CC=clang-7
export CXX=clang++-7

# ==============================================================================
# -- Parse arguments -----------------------------------------------------------
# ==============================================================================


We have to change gcc to version 8 in setup.py as well:

            # @todo Why would we need this?
            include_dirs += ['/usr/lib/gcc/x86_64-redhat-linux/8/include']
            library_dirs += ['/usr/lib/gcc/x86_64-redhat-linux/8']
            extra_link_args += ['/usr/lib/gcc/x86_64-redhat-linux/8/libstdc++.a']

Further, we have to copy

libboost_numpy37.a
libboost_numpy37.so
libboost_numpy37.so.1.69.0

into PythonAPI/carla/dependencies/lib.

I deactivated the Python-2 API to avoid problems with llvm and gcc.

We can resume following the build guide after we done these changes. CARLA works without any errors compiling it with llvm 7+.

NB! It may take quite some time to compile all textures etc. for the first time. So grabing a coffee is not enough - I recommend a thermosbottle or two full of coffee ;).

BTW: cloning git lfs clone https://bitbucket.org/carla-simulator/carla-content to Unreal/CarlaUE4/Content/Carla requires the download of ~9.1GB of data

If you don’t want to do this, then you should have a look at the CARLA docker image. Pre-compiled binaries for Linux are available as well on their github release page.