How to Build Dia from Source (Linux)
Dia Diagram Editor is a free, open-source project by the GNOME community. This site is an independent community resource — we are not affiliated with the GNOME Dia project.
Most Linux users should just run sudo apt install dia (see our Linux install guide). Build from source only if you need the absolute latest development code, want to patch something, or your distro doesn’t package Dia. The authoritative instructions live in the BUILDING.md file in GNOME’s Dia repository — always check it first, as dependencies change. What follows is the standard flow.
Prerequisites
You’ll need a compiler toolchain plus Dia’s library dependencies. Install the development packages your distro documents in BUILDING.md — typically this means GTK development files, libxml2, and the Meson/Ninja build tools:
sudo apt install git build-essential meson ninja-build \ libgtk-3-dev libxml2-dev # check BUILDING.md for the current list
Build steps
1. Clone the repository
git clone https://github.com/GNOME/dia.git cd dia
2. Configure with Meson
meson setup builddir
Meson checks for every dependency and reports what’s missing. Fix, re-run.
3. Compile
ninja -C builddir
4. Run without installing (recommended for testing)
./builddir/dia
Or install system-wide with sudo ninja -C builddir install — but running from the build directory keeps your distro’s packaged Dia untouched, which avoids conflicts.
Troubleshooting real build failures
- “Dependency not found”: you skipped a -dev package. The error names it — install and re-run
meson setup. - Python plugin fails to build: this is the most-reported issue (seen on distro forums) — the Python bindings need matching Python dev headers. If you don’t need scripting, you can often disable that component at configure time; check
meson configureoptions. - Old Meson version: distro Meson packages lag;
pip install --user mesongets you a current one. - Stale build directory: after pulling new code, wipe
builddirand re-run setup rather than fighting cached state.
FAQ
Should I build from source or use my package manager?
Package manager, unless you have a specific reason. Distro builds are tested against your libraries; source builds are for developers and the curious.
Which is newer: distro Dia or source Dia?
Source (master branch) is newest by definition. But note most distros already ship 0.97.3 or newer via git snapshots — check dia --version before assuming you need to build.
Can I build on Windows/Mac?
In theory yes, in practice it’s painful — the supported path is Linux. Windows and Mac users should use the prebuilt installers.
Where do I report build problems?
GNOME’s Dia issue tracker (linked from the repository). Include your distro, Meson version, and the full error log.
