Files
MaaAssistantArknights/docs/en-us/develop/linux-tutorial.md
MistEO 51ab24945b refactor: 依赖大更新 (#13908)
Co-authored-by: status102 <102887808+status102@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-09-08 21:17:47 +08:00

3.2 KiB

order, icon
order icon
2 teenyicons:linux-alt-solid

Linux Compilation Tutorial

This tutorial requires readers to have some Linux environment configuration ability and programming foundation! If you only want to directly install MAA instead of compiling it yourself, please read User Manual - Linux Emulators and Containers.

::: info Note MAA's build method is still under discussion. The content of this tutorial may be outdated. Please refer to the scripts in GitHub workflow file. You can also refer to AUR PKGBUILD, nixpkgs. :::

::: info Mac can use the tools/build_macos_universal.zsh script for compilation. It's recommended to refer to the README.md of the MaaAssistantArknights/MaaMacGui project. :::

Compilation Process

  1. Download compilation dependencies

    • Ubuntu/Debian
    sudo apt install gcc-14 g++-14 cmake zlib1g-dev
    
    • Arch Linux

      sudo pacman -S --needed gcc cmake zlib
      
  2. Build third-party libraries

    You can choose to download pre-built dependency libraries or compile from scratch

    • Download pre-built third-party libraries (recommended)

      Note

      Contains dynamic libraries compiled on relatively new Linux distributions (Ubuntu 22.04). If your system's libstdc++ version is older, you may encounter ABI incompatibility issues.

      python tools/maadeps-download.py
      

    If you find the libraries downloaded above cannot run on your system due to ABI version issues and you don't want to use container solutions, you can also try compiling from scratch

    • Build third-party libraries from scratch (will take considerable time)

      git submodule update --init --recursive
      cd MaaDeps
      python build.py
      
  3. Compile MAA

    CC=gcc-14 CXX=g++-14 cmake -B build \
        -DINSTALL_RESOURCE=ON \
        -DINSTALL_PYTHON=ON
    cmake --build build
    

    To install MAA to target location, note that MAA is recommended to run by specifying LD_LIBRARY_PATH, don't use administrator privileges to install MAA into /usr

    cmake --install build --prefix <target_directory>
    

Integration Documentation

Perhaps not really documentation

Python

You can refer to the implementation of __main__ in Python demo

C++

You can refer to the implementation in CppSample

C Sharp

You can refer to the implementation in MaaWpfGui