Installing TerraGear

Last updated · how this page is sourced

TerraGear is distributed as source. Installing it means building the toolchain: you finish with fourteen command-line programs, one per stage of a scenery build, rather than a single application.

TerraGear builds on Linux, and in practice that is the only platform anyone has a tested procedure for. Every command below was executed on 23 August 2026 under Debian 12, in this order, and produced working scenery. It takes about a minute of compiling on ten cores. Versions and evidence are on the sources page.

Do not follow the repository README. It describes an autogen.sh and configure build. Neither file exists in the tree; the project moved to CMake and the README was not updated. The full list of places its documentation disagrees with itself is on TerraGear and the alternatives.

Dependencies

From CMakeLists.txt, which is the only authority on this: CMake 3.20 or newer, Boost, CGAL 5.4 or newer with its Core component, zlib 1.2.11 or newer, GDAL 3, TIFF, a threads library, and SimGear.

Debian 12 supplies all of them except SimGear. This is the package list that worked:

apt-get install build-essential cmake ninja-build git pkg-config \
  libboost-dev libcgal-dev libgdal-dev zlib1g-dev libtiff-dev \
  libexpat1-dev libcurl4-openssl-dev libc-ares-dev liblzma-dev

The last four are for SimGear rather than TerraGear. pkg-config and libc-ares-dev are the two that catch people out: without them SimGear’s configure step fails on a message about c-ares that does not obviously point at either package. See Common errors and fixes.

SimGear first

TerraGear links against SimGear, FlightGear’s shared library, and will not configure without it. Build it headless; TerraGear needs none of the rendering half, and skipping it avoids OpenSceneGraph entirely.

git clone --depth 1 -b release/2024.1 https://gitlab.com/flightgear/simgear.git
cmake -S simgear -B sgbuild -G Ninja \
      -DCMAKE_BUILD_TYPE=Release \
      -DSIMGEAR_HEADLESS=ON -DENABLE_TESTS=OFF \
      -DCMAKE_INSTALL_PREFIX=/usr/local
cmake --build sgbuild -j$(nproc)
cmake --install sgbuild

About 11 seconds on ten cores.

Use release/2024.1, not next. SimGear’s next branch cannot be built headless: a canvas test is compiled even with -DENABLE_TESTS=OFF, and it needs headers a headless build does not produce. The pairing that works is SimGear release/2024.1 under TerraGear next.

TerraGear

git clone https://gitlab.com/flightgear/terragear.git
sed -i '6i #include <chrono>' terragear/src/Prep/DemChop/hgtchop.cxx
cmake -S terragear -B tgbuild -G Ninja \
      -DCMAKE_BUILD_TYPE=Release \
      -DCMAKE_INSTALL_PREFIX=/usr/local
cmake --build tgbuild -j$(nproc)
cmake --install tgbuild

About 20 seconds. git clone gives you next, which is the actively developed branch: see Downloads for how the others compare.

That sed line is not optional. A commit in June 2026 removed an #include <chrono> from hgtchop.cxx while leaving four uses of std::chrono behind, and next has not compiled since. Restoring the include is the whole fix. If it has been repaired upstream by the time you read this, the sed is harmless; check whether the line is already there first.

What you end up with

Fourteen executables in /usr/local/bin:

cliff-decode  dtedchop   fillvoids  gdalchop   genapts
hgtchop       ogr-decode poly2ogr   rectify_height
srtmchop      terrafit   test_array testassem  tg-construct

Plus /usr/local/share/TerraGear/default_priorities.txt, which tg-construct reads to decide which material wins where polygons overlap. You will need to pass its path.

The five that matter for a first build are hgtchop and terrafit for elevation, genapts for airports, ogr-decode for land cover, and tg-construct to assemble the result. Note that no GUI is among them: the README is correct that this is a command-line toolchain.

Next: Build your first scenery tile.

Other platforms

Docker

The build above was run inside a debian:bookworm-slim container, which is the least invasive way to get a working toolchain on any host that runs Docker; including macOS and Windows. The container definition and both build scripts are published with the build record.

There are also official prebuilt images, flightgear/terragear:latest and :ws20, which save you the build entirely. Both date from 2019, which puts them well behind the source, so treat them as a demonstration rather than a workshop. See Downloads.

Windows and macOS

Neither has a native build that anyone has published against the current source. The repository’s README.cygwin predates the CMake migration and states a belief rather than a tested procedure.

Docker is the route that works on both, and it is what produced everything on this site: what it needs and what it costs.

Open questions for the TerraGear team. Should scenery/ws2.0 still be the recommended branch, given that next is where the work happens? And should the README‘s build instructions be updated or removed, since following them cannot succeed?