Q: What are the prerequisites for building OpenClaw from source?
Required: CMake 3.22+, GCC 11+ or Clang 14+, Python 3.10+, Git 2.35+, and 4 GB of free disk space. Optional but recommended: NVIDIA CUDA 12.0+ for GPU simulation, Eigen 3.4 for optimised matrix operations, and the Bullet Physics development headers (libbullet-dev on Ubuntu). Install all Ubuntu prerequisites: sudo apt install build-essential cmake git python3.11 python3.11-dev libeigen3-dev libbullet-dev libssl-dev.
Q: How do I clone and build OpenClaw from source?
Clone the repository: git clone https://github.com/openclaw/openclaw.git && cd openclaw. Create a build directory: mkdir build && cd build. Configure CMake: cmake .. -DCMAKE_BUILD_TYPE=Release -DOPENCLAW_BUILD_TESTS=ON -DOPENCLAW_BUILD_SIMULATOR=ON. Build: cmake --build . --parallel $(nproc). Install system-wide: sudo cmake --install . --prefix /usr/local. Verify: openclaw --version should return the version matching the Git tag you built.
Q: How do I build a custom OpenClaw hardware plugin from source?
Use the plugin template: openclaw plugin new --name my_gripper --type hardware. This generates a CMakeLists.txt, my_gripper_driver.cpp, and my_gripper_driver.h in ./my_gripper/. Implement the IHardwareDriver interface: override initialize(), move_to_position(), get_joint_states(), and emergency_stop(). Build: mkdir build && cmake .. -DOPENCLAW_DIR=/usr/local/share/openclaw/cmake && cmake --build . Install: sudo cmake --install . Verify: openclaw plugin list should show my_gripper.
Q: How do I run OpenClaw unit tests after building from source?
From the build directory, run the full test suite: ctest --output-on-failure. Run specific test groups: ctest -R plugin_api for plugin tests, ctest -R hardware for hardware driver tests, ctest -R simulator for physics simulation tests. Generate a test coverage report (requires lcov): cmake .. -DOPENCLAW_ENABLE_COVERAGE=ON && cmake --build . && ctest && genhtml coverage.info --output-directory coverage_html.
Q: How do I contribute a new hardware driver to OpenClaw?
Fork the openclaw/openclaw repository on GitHub. Create a feature branch: git checkout -b add-myrobot-driver. Implement your driver in src/drivers/myrobot/ following the IHardwareDriver interface. Add tests in test/drivers/myrobot_test.cpp. Run linting: clang-tidy src/drivers/myrobot/*.cpp and clang-format --dry-run src/drivers/myrobot/*.cpp. All tests and linting must pass locally before opening a PR. Submit a pull request with the driver name, supported hardware models, and a link to the hardware API documentation.
Q: How do I debug a build failure when compiling OpenClaw from source?
Run cmake with verbose output: cmake --build . --parallel 1 -- VERBOSE=1 2>&1 | tee build.log. Search build.log for "Error" and "fatal error". Common issues: missing libbullet-dev (install with sudo apt install libbullet-dev); CMake version too old (update with sudo snap install cmake --classic); Python.h not found (install python3.11-dev). Run openclaw doctor after successful build to verify the installation is correctly configured.
Q: What is the OpenClaw contribution workflow and coding standards?
OpenClaw follows the Google C++ Style Guide. All new code must include unit tests with >80% line coverage. Run clang-format -i src/**/*.cpp src/**/*.h to auto-format before committing. Run clang-tidy src/**/*.cpp to check for style violations. Sign commits with your GPG key if contributing to the core framework. The project uses GitHub Actions for CI; all CI checks must pass before maintainers review a PR. For large contributions, open a GitHub Issue first to discuss the design before writing code.