Framework
RainerKuemmerle/g2o avatar
RainerKuemmerle/g2o

g2o: make debug runs the same command as make all, and the Windows cmake line is missing a space

g2o: A General Framework for Graph Optimization

3,480 stars1,158 forksC++License varies

At a glance

What is it?
A C++ framework for nonlinear least squares over graphs, with solutions for SLAM and bundle adjustment, whose performance claim is dated February 2011 and whose default distro packages quietly pull GPL code into your build. The Python bindings are not in the main branch.
Who is it for?
Use it if you are solving a SLAM or bundle adjustment problem in C++ and want a framework you can extend in a few lines, which is the case it was designed for and still is good at. Three things to check before you build it.
Can I use it commercially?
Not without permission. GitHub finds no licence file in the repository, and without a licence all rights are reserved by default: you may read the code but not reuse it. Check the README, or ask the authors, before using it.
Is it still maintained?
Yes. The repository last received commits 6 days ago.
What is it written in?
Mainly C++, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 15, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • RainerKuemmerle/g2o3,480 ★ · +14
Star history
Repository2026-09-242026-11-15
RainerKuemmerle/g2o3.5k3.5k

14 Stars in the last 52 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

make debug runs exactly what make all runs

The whole build file is four targets, and three of them are the same command:

code
all: build/Makefile
	@ $(MAKE) $(QUIET) -C build

debug: build/Makefile
	@ $(MAKE) $(QUIET) -C build

The debug target passes no build type, no flags and no extra variables to the generator. Whichever way CMake was configured when the build directory was created is what you get, so a developer who reaches for the debug target after a failed assertion gets exactly the same configuration they already had. That matters more here than in most projects because the recommended workflow is a manual out-of-source sequence of making a build directory, changing into it and running the generator, which means the build type is decided once by whoever ran that step. The file also forces bash as the shell, which is worth knowing on a system where the default is not.

The performance claim dates itself to February 2011

One sentence in the readme is the only performance claim in the repository, and it carries its own timestamp:

> g2o offers a performance comparable to implementations of state-of-the-art approaches for the specific problems (02/2011).

So the comparison is fifteen years old and says so in parentheses, which is more honest than most projects manage and also means nobody should cite it as current. The wording is also carefully bounded: comparable to state-of-the-art approaches, for the specific problems, rather than faster than anything. What follows it is the framework's actual claim, which is about extension rather than speed, namely that a new problem can be specified in a few lines of code and the implementation covers several variants of SLAM and bundle adjustment. The paper describing the approach is an ICRA 2011 paper, and the detailed documentation is a PDF in the doc directory with API documentation generated separately.

The Windows build line is missing a space and ends in a stray backtick

The CMake invocation for Windows with the vcpkg toolchain does not parse:

code
cmake -DG2O_BUILD_APPS=ON -DG2O_BUILD_EXAMPLES=ON-DVCPKG_TARGET_TRIPLET="%VCPKG_DEFAULT_TRIPLET%" -DCMAKE_TOOLCHAIN_FILE="%VCPKG_ROOT_DIR%\scripts\buildsystems\vcpkg.cmake" ..`

There is no space between ON and the next variable, so the two become one argument, a build flag whose value has been set to the concatenation of the two switches. The line also ends with two dots followed by a backtick, where a backtick has no business being in a shell command at all. Anyone copying this gets a configure step that either errors on an unrecognised variable or quietly does not set the triplet they were trying to set. The next block in the same section, for people not using vcpkg, is correct, which makes the broken one the one more people will copy, since it is on the recommended path.

The Android instructions stop in the middle of a flag

The cross-compilation section for Android is unusable as printed, in three separate ways. Each of its lines ends with a backtick, including the two directory commands, so the sequence is not a copy-pasteable block. The CMake line then breaks off partway through a variable name:

code
mkdir build`
cd build`
cmake -DCMAKE_TOOLCHAIN_FILE=../script/android.toolchain.cmake -DANDROID_NDK=<YOUR_PATH_TO_ANDROID_NDK_r10d+> -DCMAKE_BUILD_TYPE=Release -DAND

What survives is the toolchain file path, the NDK location as a placeholder, a release build type, and half of the next flag. The placeholder itself points at a native development kit revision from 2017. Combined with the earlier statement that Android support is experimental, the practical reading is that Android is a supported target in principle and an untested path in the documentation. The same pattern of stray backticks appears in the Windows block above, which suggests one editing accident rather than three.

Your distribution's SuiteSparse package quietly brings in GPL code

The licensing section is the most consequential part of the readme, and the problem is not in the project. The framework is BSD, one extension is LGPL, and the viewer, an incremental component and one example are GPL3+. Then comes the dependency caveat: some features of the sparse linear solver used by the project are themselves GPL, and the framework will use them if they are present. The readme states that the packages shipped by Ubuntu and Debian do include those features, and that to avoid the GPL you may have to recompile that library without them. So on a default system install, whether your build is permissively licensed depends on a detail of someone else's binary package. Anyone shipping a product that embeds this should resolve that before the licence question, not after.

The Python bindings are a branch, a separate package, and experimental

There are three different Python stories in one short section and none of them is in the main branch. The first is a branch in this repository containing a Python wrapper, and the significant part of that change is not the bindings but the memory management: the branch switches from raw pointers to smart pointers. It is described as experimental, with pull requests welcome. The second is the package on the public index, and that one comes from a different repository entirely, maintained by someone else. The third is what the readme actually ships, which is a C++ library. For anyone arriving from Python, that means the import name in a tutorial is not in this tree, the pip package is not this project, and the branch that would unify them is described as experimental in the same paragraph.

Releases are named after dates with a git suffix

There is no semantic versioning here. The three releases are named 20230223_git, 20230806_git and 20241228_git, a date in year-month-day form, then a connecting character and the word git. Reading the release dates against the names shows why the suffix is there: the release named for the 23rd of February was published on the 26th, so the name records when the work happened and the timestamp records when it was announced. The practical consequence is for anything that pins versions: you are pinning a date string, which sorts correctly but tells a package manager nothing about compatibility, and a project with an 0.x-style public API has expressed no stability commitment in its release names at all. The newest is from December 2024 while the default branch was pushed on 2026-09-28.

The opening paragraph appears twice, nearly word for word

The readme states its purpose twice in consecutive paragraphs. The first introduces the project as a C++ framework for optimising graph-based nonlinear error functions, says it is designed to be easily extensible, that a new problem can be specified in a few lines, and that it covers several variants of SLAM and bundle adjustment. The third paragraph then introduces the same project as a C++ framework for nonlinear least squares problems, says it is designed to be easily extensible, that a new problem can be specified in a few lines, and that it covers several variants of SLAM and bundle adjustment. The second version is the one carrying the performance sentence, so the duplicate is not a no-op: a reader skimming for the claim finds it in the copy that appears to be an elaboration.

Editorial conclusion

Use it if you are solving a SLAM or bundle adjustment problem in C++ and want a framework you can extend in a few lines, which is the case it was designed for and still is good at. Three things to check before you build it. The performance claim in the readme is stamped February 2011, so treat it as a statement about the design rather than a current measurement. The licensing is a patchwork, and the sharpest edge is not in the project at all: if you install SuiteSparse from your distribution, the build may pick up a GPL-licensed factorization and the readme tells you to recompile that library without it if you want to avoid that. And the Python story is three separate things: an experimental branch on this repository, a third-party package on the index, and neither is the main branch.

Frequently asked questions

What does g2o do and what does it need to build?

It is a C++ framework for minimising nonlinear error functions represented as graphs, with solutions for variants of SLAM and bundle adjustment. Building requires a C++17 compiler, CMake and Eigen3, with the continuous integration pipeline running gcc, clang and MSVC. Optional pieces are a logging library, SuiteSparse for sparse factorisation, Qt5 and a Qt OpenGL viewer library.

How do I install g2o on macOS or Windows?

On macOS the Homebrew formula installs the library and its required dependencies so no manual compilation is needed. On Windows the documented path is vcpkg, with two batch scripts in the script directory, one for dependencies and one for the full set, and vcpkg auto-detects the triplet unless you pass one. The project still calls macOS, Android and Windows experimental while giving both platforms first-class instructions.

Where are the g2o Python bindings?

Not in the main branch. The repository points to an experimental branch that contains a Python wrapper and switches the memory management from raw pointers to smart pointers, and separately points to another person's repository for the package published on the public index. Neither is merged into the branch you clone by default.

Is g2o GPL licensed?

The framework is BSD, one extension is under LGPL, and a viewer, an incremental component and an example are under GPL3. The sharper edge is a dependency: some features of the sparse solver it can use are GPL, and the packages shipped by some distributions include them, so the readme says you may need to recompile that library without its GPL features to avoid them.

Official sources

  1. Issues
  2. RainerKuemmerle/g2o on GitHub
  3. README
  4. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/rainerkuemmerle-g2o.svg)](https://hysenlabs.com/projects/rainerkuemmerle-g2o)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/rainerkuemmerle-g2o.svg)](https://hysenlabs.com/projects/rainerkuemmerle-g2o)

Was this useful?