跳到正文
Skillpedia
部署与云(DevOps)15k · #11129

build-carla-ue58

它能做什么

这项技能使用 CMake 构建系统,从源代码为 Unreal Engine 5.8 编译 CARLA 模拟器。适合需要较新 CARLA 版本自定义构建的技术人员。

适用场景

  • ✓当你想从 ue58-dev 源代码分支构建 Unreal Engine 5.8 上的 CARLA 时。
  • ✓当你需要在构建中包含 ROS 2 接口或其他可选功能的时候。
  • ✓当构建失败,你需要这个版本的准确步骤而不是旧的 UE4 说明的时候。

技能链接

https://github.com/carla-simulator/carla/blob/ue58-dev/Skills/ue58/build-carla-ue58/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/carla-simulator/carla/blob/ue58-dev/Skills/ue58/build-carla-ue58/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请帮我从源代码文件夹为 Unreal Engine 5.8 构建 CARLA,并开启 ROS 2 选项。”

每周 5 个新技能,1 分钟读完。

工作原理

智能体会检查你的环境,按你选择的选项配置构建,然后按顺序构建各个目标。选项保存在构建设置中,因此每次重新设置构建时都必须重新指定。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Build CARLA on UE 5.8

Paths. scripts/… and references/… below are relative to the directory holding this SKILL.md. Your working directory is the user's project, not that directory, so prefix them with its absolute path or the command is not found.

This tree has no Makefile and no Util/BuildTools/. Every UE4 recipe — make CarlaUE4, make PythonAPI, make launch, make package, make import — does not exist. The whole build is CMake:

cmake --preset Release                              # configure (once per option change)
cmake --build Build/Release --target <target>       # build

Two consequences that cause most of the confusion:

  • Options live in the CMake cache, not on the build line. -DENABLE_ROS2=ON is passed to --preset, and must be repeated on every re-configure. Forget it and you get a working build that silently has no ROS 2 in it.
  • The engine is a separate, prior build. CARLA_UNREAL_ENGINE_PATH must point at the CarlaUnreal fork on branch ue58-dev-carla (UE 5.8). The ue5-dev branch uses a different engine fork (ue5-dev-carla, UE 5.5) — see the [[build-carla-ue5]] skill for that one.

Instructions

Progress:
- [ ] Step 1: Check prerequisites (bash scripts/check_env.sh), clear every FAIL
- [ ] Step 2: Build the engine, if UnrealEditor is not there yet
- [ ] Step 3: Configure a preset with the options you actually want
- [ ] Step 4: Build the targets, in order
- [ ] Step 5: Verify the artifacts (not the exit codes)

Step 1: Preflight

source scripts/env.sh
bash scripts/check_env.sh

This reads the CMake cache and tells you what the tree was actually configured with — the only honest answer to "was this built with ROS 2?" — plus the engine version, the OFPA large-map patch state, and whether a past sudo poisoned ~/.nuget / ~/.epic.

Step 2: The engine

git clone -b ue58-dev-carla https://github.com/CarlaUnreal/UnrealEngine.git UnrealEngine5_carla
cd UnrealEngine5_carla
./Setup.sh && ./GenerateProjectFiles.sh && make
export CARLA_UNREAL_ENGINE_PATH=$PWD

make takes no -j. Parallel jobs kill each other on the UnrealBuildTool mutex (Failed (ConflictingInstance)); plain make is already parallel. Budget 2–3 h. The clone needs a GitHub account linked to Epic Games, or it 404s.

make can exit 0 with targets dead. Check the binary, never the exit code:

ls -l $CARLA_UNREAL_ENGINE_PATH/Engine/Binaries/Linux/UnrealEditor

Step 3: Configure

source scripts/env.sh

bash scripts/build.sh configure                       # Release, defaults
ROS2=1 bash scripts/build.sh configure                # + ROS 2 native
ROS2=1 MAPS="Town10HD_Opt,Town12,Town13" bash scripts/build.sh configure

or by hand:

cd "$CARLA_UE58_ROOT"
cmake --preset Release -DENABLE_ROS2=ON \
  -DCARLA_MAPS_TO_COOK="/Game/Carla/Maps/Town10HD_Opt+/Game/Carla/Maps/Town12/Town12"

Presets are Release, Development, Debug (plus the Common base). The options worth knowing:

Option Effect
-DENABLE_ROS2=ON native ROS 2; builds carla-ros2-native and links it into the plugin
-DCARLA_MAPS_TO_COOK= restrict the cook. +-separated package paths, not filesystem paths, not ;
-DCARLA_UNREAL_ENGINE_PATH= engine fork path (else the env var)
-DCARLA_UNREAL_RHI=vulkan RHI for the editor/game
-DCARLA_DLSS_SDK_PATH= DLSS SDK; disabled builds without it
-DENABLE_RSS=ON, -DENABLE_PYTORCH=ON both default OFF; the OSM to OpenDRIVE converter is always built
-DCARLA_UNREAL_PACKAGE_BUILD_TYPE=Shipping package configuration
-DCMAKE_DISABLE_FIND_PACKAGE_Qt5=ON -DCMAKE_DISABLE_FIND_PACKAGE_Qt6=ON when system Qt is installed but not linkable with the UE toolchain

bash scripts/build.sh options prints the full list with defaults, read from the tree rather than from this table.

Step 4: Build

bash scripts/build.sh libcarla        # carla-server + carla-client
bash scripts/build.sh pythonapi       # carla-python-api-install (builds + installs the wheel)
bash scripts/build.sh unreal          # carla-unreal        (the game/server target)
bash scripts/build.sh editor          # carla-unreal-editor
bash scripts/build.sh launch          # build + open the editor
bash scripts/build.sh targets         # every available target, from the tree

or directly:

cmake --build Build/Rele
常见问题

这和旧的 UE4 构建一样吗?

不一样。此版本使用 CMake,而不是旧的 make 命令,因此步骤也不同。

是否需要单独构建引擎?

需要。必须先从其自有的 Unreal 代码分支构建引擎。

如果漏掉某个选项会怎样?

构建可能在没有该功能(例如 ROS 2)的情况下完成,而且不会发出警告。

详情

作者的原始描述

Builds CARLA on Unreal Engine 5.8 from the ue58-dev branch using its CMake build system — configure a preset, then build the carla-unreal / carla-unreal-editor / carla-python-api-install / launch targets — with ROS 2, DLSS, RSS and cook-scope options, and the engine-side build of the CarlaUnreal UE 5.8 fork. There is no Makefile and no Util/BuildTools in this tree, so every UE4 `make` recipe is invalid here. Use when the user asks to "build CARLA UE5", "build ue58-dev", "compile CARLA with cmake", "rebuild the Python API", or hits a CMake configure or target failure.

repo: carla-simulator/carla

热度

GitHub 星标
15k
排名
#11129
许可证
MIT
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能