Implementation:CARLA simulator Carla CMake Build Launch Package
| Knowledge Sources | |
|---|---|
| Domains | Build_System, Development |
| Last Updated | 2026-02-15 00:00 GMT |
Overview
Concrete tool for launching the CARLA Unreal Engine editor or creating a standalone distributable package in the CARLA build pipeline.
Description
This implementation provides two CMake build targets that represent the final stage of the CARLA build-from-source pipeline:
launchtarget: Opens the CARLA project in the Unreal Engine 5 editor for interactive development, map editing, and Play-In-Editor testing. This target compiles the CARLA plugin in Development mode and starts the editor process.
packagetarget: Creates a standalone, distributable CARLA simulator build by invoking Unreal Engine's BuildCookRun automation pipeline. The result is a self-contained directory with the compiled simulator binary, cooked (platform-optimized) content assets, and all runtime dependencies.
Both targets are defined in Unreal/CMakeLists.txt and serve as CMake wrappers around Unreal Engine's native UnrealBuildTool and UnrealAutomationTool.
Usage
Use the launch target during active development for fast iteration. Use the package target when creating builds for deployment, testing on machines without the development environment, or producing release artifacts.
Code Reference
Source Location
- Repository: CARLA
- File:
Unreal/CMakeLists.txt:L573-594(launch target),Unreal/CMakeLists.txt:L375-523(package target)
Signature
# Launch the Unreal Engine editor with the CARLA project
cmake --build Build --target launch
# Create a standalone distributable package
cmake --build Build --target package
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
Build |
Directory path | Yes | The CMake build directory from the configuration step. |
--target launch |
Target name | No | Opens the CARLA project in the Unreal Engine editor (development mode). |
--target package |
Target name | No | Creates a standalone distributable build via the BuildCookRun pipeline. |
| Compiled Unreal Engine 5 | Prerequisite | Yes | The UE5 installation specified during CMake configuration. |
| Content assets | Prerequisite | Yes | The CARLA content repository must be cloned into Unreal/CarlaUnreal/Content/Carla.
|
| CMake configuration | Prerequisite | Yes | The CMake configuration step must have completed successfully. |
Outputs
| Name | Type | Description |
|---|---|---|
| launch target: Unreal Editor process | Running process | The Unreal Engine 5 editor with the CARLA project loaded. Interactive window for development. |
| package target: Distributable directory | Directory tree | A self-contained CARLA simulator build, typically at Unreal/CarlaUnreal/Saved/StagedBuilds/Linux/.
|
| package target: Cooked assets | Binary files | Platform-optimized content assets (compressed textures, compiled shaders, cooked maps). |
| package target: Shipping binary | Executable | Fully optimized simulator binary without editor or development features. |
| Exit code | Integer | 0 on success; non-zero on build, cook, or packaging failure.
|
Usage Examples
Basic Example: Launch Editor
# Navigate to the CARLA repository root
cd CarlaUE5
# Launch the Unreal Engine editor with the CARLA project
cmake --build Build --target launch
Basic Example: Create Package
# Navigate to the CARLA repository root
cd CarlaUE5
# Build a standalone distributable package
cmake --build Build --target package
Running the Packaged Simulator
# After packaging, navigate to the output directory
cd Unreal/CarlaUnreal/Saved/StagedBuilds/Linux/
# Run the simulator with Vulkan rendering
./CarlaUE5.sh -vulkan
# Run in headless mode (no display required, useful for servers)
./CarlaUE5.sh -RenderOffScreen
# Run with a specific map
./CarlaUE5.sh -RenderOffScreen -quality-level=Epic
Packaging with Verbose Output
# Use verbose mode to see the full BuildCookRun pipeline output
cmake --build Build --target package --verbose
Full Build Pipeline Summary
# Complete build-from-source pipeline (after prerequisites and UE5 are ready)
cd CarlaUE5
# 1. Configure
cmake -G Ninja -S . -B Build \
--toolchain=$PWD/CMake/Toolchain.cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCARLA_UNREAL_ENGINE_PATH=$UE5_ROOT
# 2. Build Python API
cmake --build Build --target carla-python-api-install
# 3a. Launch editor (for development)
cmake --build Build --target launch
# 3b. OR create standalone package (for deployment)
cmake --build Build --target package