gz-build

Configure and build gz-sim from source using CMake, colcon, or Bazel.

Updated Aug 16, 2026
One-click install
npx skills add https://github.com/three1324/yeonjinautomotive --skill gz-build-three1324
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gz-build
Source: https://github.com/three1324/yeonjinautomotive/tree/main/.claude/skills/gz-build
Command: npx skills add https://github.com/three1324/yeonjinautomotive --skill gz-build-three1324

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Building the Gazebo simulator (gz-sim) from source involves choosing between multiple build front-ends, setting the right CMake flags, and diagnosing dependency failures. This Skill provides the exact commands and troubleshooting guidance for each path. ## Core Features & Use Cases - Direct CMake/Ninja builds: Configure a single gz-sim repository with build-type, testing, profiler, and install-prefix flags. - colcon workspace builds: Build the full Gazebo stack or limit compilation to gz-sim and its dependencies with --packages-up-to. - Bazel alternative: Build and test via Bazel with the pinned MODULE.bazel dependency matrix. - Failure diagnosis: Resolve common errors such as missing gz-cmake, Qt6 linker issues, sdformat mismatches, and stale gz-msgs headers. - Use Case: A robotics developer clones gz-sim on Ubuntu and needs a RelWithDebInfo build with tests enabled, then runs the shapes.sdf smoke test to verify the install. ## Quick Start Ask the assistant to build gz-sim from source in the current repository with tests enabled and then run the shapes.sdf smoke test.

Frequently Asked Questions about gz-build

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build gz-sim from source with CMake?

Run cmake -S . -B build -G Ninja with -DCMAKE_BUILD_TYPE=RelWithDebInfo and -DBUILD_TESTING=ON, then cmake --build build -j$(nproc). All Gazebo dependencies such as gz-cmake, gz-common, and gz-physics must already be installed system-wide.

How to build only gz-sim in a colcon workspace?

Use colcon build --merge-install --packages-up-to gz-sim with your desired cmake-args from the workspace containing the Gazebo sources. Afterwards source install/setup.bash before running gz sim.

Does gz-sim support Bazel builds?

Yes, gz-sim can be built with bazel build //... --config=linux and tested with bazel test //... --config=linux. Dependencies are pinned in MODULE.bazel and exercised by the bazel.yml CI workflow.

Why does find_package(gz-cmake REQUIRED) fail during configuration?

This error means gz-cmake is not installed on the system. Install the gz-cmake package for your Gazebo distribution before configuring gz-sim, since it provides the CMake macros the build requires.

Why do I get Qt6 linker errors when building gz-sim?

Qt6 linker errors indicate missing development packages. Install qt6-base-dev, qt6-declarative-dev, and qt6-5compat-dev, then reconfigure and rebuild gz-sim.

How do I run gz-sim headless in CI after building?

Prefix the command with xvfb-run -s '-screen 0 1280x800x24' to provide a virtual display. A basic smoke test is gz sim -v 4 shapes.sdf, sourcing install/setup.bash first for colcon builds.