# Installation (/docs/installation)

Install dependencies and build CHUDCS2 on Arch Linux.

## Requirements [#requirements]

CHUDCS2 targets Linux with a C++20 compiler, CMake 3.10 or newer, an OpenGL 3.3 compatibility profile, and either an X11 server or Wayland with XWayland. The live reader and input modules may require root privileges, depending on local `ptrace_scope` and `/dev/uinput` permissions.

Install the project dependencies on Arch Linux:

```bash
sudo pacman -S base-devel cmake pkgconf glfw-x11 glu glew glm spdlog dbus \
  wayland wayland-protocols libglvnd mesa libx11 libxext libxrandr \
  nlohmann-json
```

`libdecor` is optional. Install it when the compositor uses libdecor-managed title bars and the overlay needs title-bar interaction.

## Build [#build]

From the repository root:

```bash
cmake -B build -S .
make -j"$(nproc)" -C build
```

For build, test and launch shortcuts, see [Build helper](/docs/reference/build-helper).

The main executable is `build/chudcs2`. CMake copies `assets/` and `offsets.json` into the executable directory after linking.

Use a different release CPU target when building for another machine:

```bash
cmake -B build -S . -DCHUDCS2_MARCH=x86-64-v2
make -j"$(nproc)" -C build
```

## Runtime permissions [#runtime-permissions]

Live mode reads the CS2 process with `process_vm_readv`. Input helpers open `/dev/uinput`. Run the application with the permissions needed by the host system:

```bash
sudo ./build/chudcs2
```

The launcher preserves the desktop display variables needed by the original user when it is started through `sudo`. If Wayland layer-shell is unavailable, force the X11/XWayland backend with `--x11`.

## Assets and paths [#assets-and-paths]

Keep the executable next to the copied `assets/` directory and `offsets.json`. The application searches for configuration profiles in `configs/` beside the executable when that directory is writable. It falls back to `$XDG_CONFIG_HOME/chudcs2/configs` or `$HOME/.config/chudcs2/configs` when needed.

If player models or map geometry are missing, check [Game assets and VPK paths](/docs/guides/game-assets).
