setup_linux.md
May 5, 2026 ยท View on GitHub
Setup on Linux
Note: These instructions were created on Ubuntu and match our Ubuntu CI builds. You may need to modify these instructions if you're using a different distro.
Prerequisites
Anthem is developed with the Flutter framework. You can see instructions for installing Flutter for Linux here.
In addition to Flutter, Anthem needs the following:
- The Clang compiler: Used to compile multiple components within Anthem. Use LLVM/Clang 22 to match CI.
- CMake: Build tool used for multiple components within Anthem.
- Make: Used for assembling Anthem components.
- Apt packages: The following packages are required by either JUCE or Flutter, and can be installed with
aptor a similar package manager:
On Ubuntu, theninja-build llvm-22 clang-22 clang-format-22 clang-tidy-22 libx11-dev libxrandr-dev libxinerama-dev libxcursor-dev libfreetype-dev mesa-common-dev libasound2-dev freeglut3-dev libxcomposite-dev libgtk-3-dev libasound2-dev libwebkit2gtk-4.1-dev libcurl4-openssl-devclang-formatpackage provided by the default distribution repositories may be an older LLVM version. Ifllvm-22,clang-22,clang-format-22, orclang-tidy-22are not available, install LLVM 22 from apt.llvm.org.
Set ANTHEM_LLVM_BIN to the LLVM 22 bin directory if those tools are not exposed as the default clang, clang-format, and clang-tidy on PATH:
export ANTHEM_LLVM_BIN=/usr/lib/llvm-22/bin
Instructions
- Clone this repository.
- Navigate to the local clone folder.
- Run
git submodule initandgit submodule update. - Run
flutter pub getin the repository root. - Run
dart run anthem:cli codegen generateto create or update generated code. - Run
dart run anthem:cli engine build --debug. This will build the engine executable.- Note: You may need to tell CMake which make and compiler tools to use. Anthem is built with
makeandClang. Other tools may work, but are untested. You can tell CMake which tools to use by setting environment variables. Place these in your shell's environment file (e.g.~/.bashrcfor bash,/etc/zsh/zshenvfor zsh, etc.):export CC=/usr/lib/llvm-22/bin/clang export CXX=/usr/lib/llvm-22/bin/clang++ export CMAKE_MAKE_PROGRAM=make
- Note: You may need to tell CMake which make and compiler tools to use. Anthem is built with
- Use the following commands to format and lint engine C++ code:
dart run anthem:cli engine formatdart run anthem:cli engine lint
- (Optional) Open the project in your preferred IDE, such as Visual Studio Code.
- To keep the generated code updated with the source, you have two options:
- Open a new terminal session and run
dart run anthem:cli codegen generate --root-only --watch. This will run Dart-related code generation, and keep the generated files up-to-date as you develop. - Run
dart run anthem:cli codegen generate --root-onlymanually after modifying the model or the IPC messages. This method is a bit more surgical during update, and as a result, C++ build times may be faster when updating generated code with this method.
- Note: you may need to clean and re-run code generation in order to re-generate the files for the IPC messages if they are changed, since they sometimes don't re-generate automatically. There is a note that prints when running the codegen command above which has more info about this.
- Open a new terminal session and run
- Use
flutter runto run Anthem, or start Anthem via your IDE.